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5hZGQobGlzdGVuZXIpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJlbW92ZXMgYSBsaXN0ZW5lciBmcm9tIHRoZSBzZXQgbGlzdGVuaW5nIHRvIHRoaXMgYW5pbWF0aW9uLgorICAgICAqCisgICAgICogQHBhcmFtIGxpc3RlbmVyIHRoZSBsaXN0ZW5lciB0byBiZSByZW1vdmVkIGZyb20gdGhlIGN1cnJlbnQgc2V0IG9mIGxpc3RlbmVycyBmb3IgdGhpcworICAgICAqICAgICAgICAgICAgICAgICBhbmltYXRpb24uCisgICAgICovCisgICAgcHVibGljIHZvaWQgcmVtb3ZlTGlzdGVuZXIoQW5pbWF0YWJsZUxpc3RlbmVyIGxpc3RlbmVyKSB7CisgICAgICAgIGlmIChtTGlzdGVuZXJzID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBtTGlzdGVuZXJzLnJlbW92ZShsaXN0ZW5lcik7CisgICAgICAgIGlmIChtTGlzdGVuZXJzLnNpemUoKSA9PSAwKSB7CisgICAgICAgICAgICBtTGlzdGVuZXJzID0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEdldHMgdGhlIHNldCBvZiB7QGxpbmsgQW5pbWF0YWJsZUxpc3RlbmVyfSBvYmplY3RzIHRoYXQgYXJlIGN1cnJlbnRseQorICAgICAqIGxpc3RlbmluZyBmb3IgZXZlbnRzIG9uIHRoaXMgPGNvZGU+QW5pbWF0YWJsZTwvY29kZT4gb2JqZWN0LgorICAgICAqCisgICAgICogQHJldHVybiBBcnJheUxpc3Q8QW5pbWF0YWJsZUxpc3RlbmVyPiBUaGUgc2V0IG9mIGxpc3RlbmVycy4KKyAgICAgKi8KKyAgICBwdWJsaWMgQXJyYXlMaXN0PEFuaW1hdGFibGVMaXN0ZW5lcj4gZ2V0TGlzdGVuZXJzKCkgeworICAgICAgICByZXR1cm4gbUxpc3RlbmVyczsKKyAgICB9CisKKyAgICAv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W9uKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogPHA+Tm90aWZpZXMgdGhlIGVuZCBvZiB0aGUgYW5pbWF0aW9uLiBUaGlzIGNhbGxiYWNrIGlzIG5vdCBpbnZva2VkCisgICAgICAgICAqIGZvciBhbmltYXRpb25zIHdpdGggcmVwZWF0IGNvdW50IHNldCB0byBJTkZJTklURS48L3A+CisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBhbmltYXRpb24gVGhlIGFuaW1hdGlvbiB3aGljaCByZWFjaGVkIGl0cyBlbmQuCisgICAgICAgICAqLworICAgICAgICB2b2lkIG9uQW5pbWF0aW9uRW5kKEFuaW1hdGFibGUgYW5pbWF0aW9uKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogPHA+Tm90aWZpZXMgdGhlIGNhbmNlbGxhdGlvbiBvZiB0aGUgYW5pbWF0aW9uLiBUaGlzIGNhbGxiYWNrIGlzIG5vdCBpbnZva2VkCisgICAgICAgICAqIGZvciBhbmltYXRpb25zIHdpdGggcmVwZWF0IGNvdW50IHNldCB0byBJTkZJTklURS48L3A+CisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBhbmltYXRpb24gVGhlIGFuaW1hdGlvbiB3aGljaCB3YXMgY2FuY2VsZWQuCisgICAgICAgICAqLworICAgICAgICB2b2lkIG9uQW5pbWF0aW9uQ2FuY2VsKEFuaW1hdGFibGUgYW5pbWF0aW9uKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogPHA+Tm90aWZpZXMgdGhlIHJlcGV0aXRpb24gb2YgdGhlIGFuaW1hdGlvbi48L3A+CisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBhbmltYXRpb24gVGhlIGFuaW1hdGlvbiB3aGljaCB3YXMgcmVwZWF0ZWQuCisgICAgICAgICAqLworICAgICAgICB2b2lkIG9uQW5pbWF0aW9uUmVwZWF0KEFuaW1hdGFibGUgYW5pbWF0aW9uKTsKKyAgICB9Cit9CmRpZmYgLS1naXQgYS9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AgICAgICAgICAgICAgICAgLy8gV2UncmUgZ29pbmcgdG8gY2xlYXIgc1BlbmRpbmdBbmltYXRpb25zLCBidXQgc3RhcnRpbmcgYW5pbWF0aW9uIG1heQorICAgICAgICAgICAgICAgICAgICAvLyBjYXVzZSBtb3JlIHRvIGJlIGFkZGVkIHRvIHRoZSBwZW5kaW5nIGxpc3QgKGZvciBleGFtcGxlLCBpZiBvbmUgYW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgIC8vIHN0YXJ0aW5nIHRyaWdnZXJzIGFub3RoZXIgc3RhcnRpbmcpLiBTbyB3ZSBsb29wIHVudGlsIHNQZW5kaW5nQW5pbWF0aW9ucworICAgICAgICAgICAgICAgICAgICAvLyBpcyBlbXB0eS4KKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHNQZW5kaW5nQW5pbWF0aW9ucy5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBBcnJheUxpc3Q8QW5pbWF0b3I+IHBlbmRpbmdDb3B5ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEFycmF5TGlzdDxBbmltYXRvcj4pIHNQZW5kaW5nQW5pbWF0aW9ucy5jbG9uZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgc1BlbmRpbmdBbmltYXRpb25zLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY291bnQgPSBwZW5kaW5nQ29weS5zaXplKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyArK2kpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBbmltYXRvciBhbmltID0gcGVuZGluZ0NvcHkuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBhbmltYXRpb24gaGFzIGEgc3RhcnREZWxheSwgcGxhY2UgaXQgb24gdGhlIGRlbGF5ZWQgbGlzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmltLm1TdGFydERlbGF5ID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbS5zdGFydEFuaW1hdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNEZWxheWVkQW5pbXMuYWRkKGFuaW0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2ggdG8gcHJvY2VzcyBmaXJzdCBmcmFtZSBvZiBuZXcgYW5pbWF0aW9ucworICAgICAgICAgICAgICAgIGNhc2UgQU5JTUFUSU9OX0ZSQU1FOgorICAgICAgICAgICAgICAgICAgICAvLyBjdXJyZW50VGltZSBob2xkcyB0aGUgY29tbW9uIHRpbWUgZm9yIGFsbCBhbmltYXRpb25zIHByb2Nlc3NlZAorICAgICAgICAgICAgICAgICAgICAvLyBkdXJpbmcgdGhpcyBmcmFtZQorICAgICAgICAgICAgICAgICAgICBsb25nIGN1cnJlbnRUaW1lID0gQW5pbWF0aW9uVXRpbHMuY3VycmVudEFuaW1hdGlvblRpbWVNaWxsaXMoKTsKKworICAgICAgICAgICAgICAgICAgICAvLyBGaXJzdCwgcHJvY2VzcyBhbmltYXRpb25zIGN1cnJlbnRseSBzaXR0aW5nIG9uIHRoZSBkZWxheWVkIHF1ZXVlLCBhZGRpbmcKKyAgICAgICAgICAgICAgICAgICAgLy8gdGhlbSB0byB0aGUgYWN0aXZlIGFuaW1hdGlvbnMgaWYgdGhleSBhcmUgcmVhZHkKKyAgICAgICAgICAgICAgICAgICAgaW50IG51bURlbGF5ZWRBbmltcyA9IHNEZWxheWVkQW5pbXMuc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bURlbGF5ZWRBbmltczsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBBbmltYXRvciBhbmltID0gc0RlbGF5ZWRBbmltcy5nZXQoaSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5pbS5kZWxheWVkQW5pbWF0aW9uRnJhbWUoY3VycmVudFRpbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc1JlYWR5QW5pbXMuYWRkKGFuaW0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGludCBudW1SZWFkeUFuaW1zID0gc1JlYWR5QW5pbXMuc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICBpZiAobnVtUmVhZHlBbmltcyA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtUmVhZHlBbmltczsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQW5pbWF0b3IgYW5pbSA9IHNSZWFkeUFuaW1zLmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltLnN0YXJ0QW5pbWF0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc0RlbGF5ZWRBbmltcy5yZW1vdmUoYW5pbSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzUmVhZHlBbmltcy5jbGVhcigpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gTm93IHByb2Nlc3MgYWxsIGFjdGl2ZSBhbmltYXRpb25zLiBUaGUgcmV0dXJuIHZhbHVlIGZyb20gYW5pbWF0aW9uRnJhbWUoKQorICAgICAgICAgICAgICAgICAgICAvLyB0ZWxscyB0aGUgaGFuZGxlciB3aGV0aGVyIGl0IHNob3VsZCBub3cgYmUgZW5kZWQKKyAgICAgICAgICAgICAgICAgICAgaW50IG51bUFuaW1zID0gc0FuaW1hdGlvbnMuc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bUFuaW1zOyArK2kpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEFuaW1hdG9yIGFuaW0gPSBzQW5pbWF0aW9ucy5nZXQoaSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5pbS5hbmltYXRpb25GcmFtZShjdXJyZW50VGltZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzRW5kaW5nQW5pbXMuYWRkKGFuaW0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChzRW5kaW5nQW5pbXMuc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzRW5kaW5nQW5pbXMuc2l6ZSgpOyArK2kpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzRW5kaW5nQW5pbXMuZ2V0KGkpLmVuZEFuaW1hdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc0VuZGluZ0FuaW1zLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGVyZSBhcmUgc3RpbGwgYWN0aXZlIG9yIGRlbGF5ZWQgYW5pbWF0aW9ucywgY2FsbCB0aGUgaGFuZGxlciBhZ2FpbgorICAgICAgICAgICAgICAgICAgICAvLyBhZnRlciB0aGUgZnJhbWVEZWxheQorICAgICAgICAgICAgICAgICAgICBpZiAoY2FsbEFnYWluICYmICghc0FuaW1hdGlvbnMuaXNFbXB0eSgpIHx8ICFzRGVsYXllZEFuaW1zLmlzRW1wdHkoKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbmRFbXB0eU1lc3NhZ2VEZWxheWVkKEFOSU1BVElPTl9GUkFNRSwgc0ZyYW1lRGVsYXkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhlIGFtb3VudCBvZiB0aW1lLCBpbiBtaWxsaXNlY29uZHMsIHRvIGRlbGF5IHN0YXJ0aW5nIHRoZSBhbmltYXRpb24gYWZ0ZXIKKyAgICAgKiB7QGxpbmsgI3N0YXJ0KCl9IGlzIGNhbGxlZC4KKyAgICAgKgorICAgICAqIEByZXR1cm4gdGhlIG51bWJlciBvZiBtaWxsaXNlY29uZHMgdG8gZGVsYXkgcnVubmluZyB0aGUgYW5pbWF0aW9uCisgICAgICovCisgICAgcHVibGljIGxvbmcgZ2V0U3RhcnREZWxheSgpIHsKKyAgICAgICAgcmV0dXJuIG1TdGFydERlbGF5OworICAgIH0KKworICAgIC8qKgorICAgICAqIFRoZSBhbW91bnQgb2YgdGltZSwgaW4gbWlsbGlzZWNvbmRzLCB0byBkZWxheSBzdGFydGluZyB0aGUgYW5pbWF0aW9uIGFmdGVyCisgICAgICoge0BsaW5rICNzdGFydCgpfSBpcyBjYWxsZWQuCisKKyAgICAgKiBAcGFyYW0gc3RhcnREZWxheSBUaGUgYW1vdW50IG9mIHRoZSBkZWxheSwgaW4gbWlsbGlzZWNvbmRzCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0U3RhcnREZWxheShsb25nIHN0YXJ0RGVsYXkpIHsKKyAgICAgICAgdGhpcy5tU3RhcnREZWxheSA9IHN0YXJ0RGVsYXk7CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhlIGFtb3VudCBvZiB0aW1lLCBpbiBtaWxsaXNlY29uZHMsIGJldHdlZW4gZWFjaCBmcmFtZSBvZiB0aGUgYW5pbWF0aW9uLiBUaGlzIGlzIGEKKyAgICAgKiByZXF1ZXN0ZWQgdGltZSB0aGF0IHRoZSBhbmltYXRpb24gd2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ZT4gZm9yCisgICAgICogdGhlIHByb3BlcnR5IHNwZWNpZmllZCBpbiB0aGUgY29uc3RydWN0b3IuCisgICAgICovCisgICAgcHVibGljIE9iamVjdCBnZXRBbmltYXRlZFZhbHVlKCkgeworICAgICAgICByZXR1cm4gbUFuaW1hdGVkVmFsdWU7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0cyBob3cgbWFueSB0aW1lcyB0aGUgYW5pbWF0aW9uIHNob3VsZCBiZSByZXBlYXRlZC4gSWYgdGhlIHJlcGVhdAorICAgICAqIGNvdW50IGlzIDAsIHRoZSBhbmltYXRpb24gaXMgbmV2ZXIgcmVwZWF0ZWQuIElmIHRoZSByZXBlYXQgY291bnQgaXMKKyAgICAgKiBncmVhdGVyIHRoYW4gMCBvciB7QGxpbmsgI0lORklOSVRFfSwgdGhlIHJlcGVhdCBtb2RlIHdpbGwgYmUgdGFrZW4KKyAgICAgKiBpbnRvIGFjY291bnQuIFRoZSByZXBlYXQgY291bnQgaXMgMCBieSBkZWZhdWx0LgorICAgICAqCisgICAgICogQHBhcmFtIHZhbHVlIHRoZSBudW1iZXIgb2YgdGltZXMgdGhlIGFuaW1hdGlvbiBzaG91bGQgYmUgcmVwZWF0ZWQKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRSZXBlYXRDb3VudChpbnQgdmFsdWUpIHsKKyAgICAgICAgbVJlcGVhdENvdW50ID0gdmFsdWU7CisgICAgfQorICAgIC8qKgorICAgICAqIERlZmluZXMgaG93IG1hbnkgdGltZXMgdGhlIGFuaW1hdGlvbiBzaG91bGQgcmVwZWF0LiBUaGUgZGVmYXVsdCB2YWx1ZQorICAgICAqIGlzIDAuCisgICAgICoKKyAgICAgKiBAcmV0dXJuIHRoZSBudW1iZXIgb2YgdGltZXMgdGhlIGFuaW1hdGlvbiBzaG91bGQgcmVwZWF0LCBvciB7QGxpbmsgI0lORklOSVRFfQorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0UmVwZWF0Q291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N0YXJ0RGVsYXk8L2NvZGU+IGFuZCBzaG91bGQgYmUgc3RhcnRlZC4KKyAgICAgKiBAcmV0dXJuIFRydWUgaWYgdGhlIGFuaW1hdGlvbidzIDxjb2RlPnN0YXJ0RGVsYXk8L2NvZGU+IGhhcyBiZWVuIGV4Y2VlZGVkIGFuZCB0aGUgYW5pbWF0aW9uCisgICAgICogc2hvdWxkIGJlIGFkZGVkIHRvIHRoZSBzZXQgb2YgYWN0aXZlIGFuaW1hdGlvbnMuCisgICAgICovCisgICAgcHJpdmF0ZSBib29sZWFuIGRlbGF5ZWRBbmltYXRpb25GcmFtZShsb25nIGN1cnJlbnRUaW1lKSB7CisgICAgICAgIGlmICghbVN0YXJ0ZWREZWxheSkgeworICAgICAgICAgICAgbVN0YXJ0ZWREZWxheSA9IHRydWU7CisgICAgICAgICAgICBtRGVsYXlTdGFydFRpbWUgPSBjdXJyZW50VGltZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGxvbmcgZGVsdGFUaW1lID0gY3VycmVudFRpbWUgLSBtRGVsYXlTdGFydFRpbWU7CisgICAgICAgICAgICBpZiAoZGVsdGFUaW1lID4gbVN0YXJ0RGVsYXkpIHsKKyAgICAgICAgICAgICAgICAvLyBzdGFydERlbGF5IGVuZGVkIC0gc3RhcnQgdGhlIGFuaW0gYW5kIHJlY29yZCB0aGUKKyAgICAgICAgICAgICAgICAvLyBtU3RhcnRUaW1lIGFwcHJvcHJpYXRlbHkKKyAgICAgICAgICAgICAgICBtU3RhcnRUaW1lID0gY3VycmVudFRpbWUgLSAoZGVsdGFUaW1lIC0gbVN0YXJ0RGVsYXkpOworICAgICAgICAgICAgICAgIG1QbGF5aW5nU3RhdGUgPSBSVU5OSU5HOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGlzIGludGVybmFsIG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ICAgICBpZiAobVBsYXlpbmdTdGF0ZSA9PSBTVE9QUEVEKSB7CisgICAgICAgICAgICBtUGxheWluZ1N0YXRlID0gUlVOTklORzsKKyAgICAgICAgICAgIG1TdGFydFRpbWUgPSBjdXJyZW50VGltZTsKKyAgICAgICAgfQorICAgICAgICBzd2l0Y2ggKG1QbGF5aW5nU3RhdGUpIHsKKyAgICAgICAgY2FzZSBSVU5OSU5HOgorICAgICAgICAgICAgZmxvYXQgZnJhY3Rpb24gPSAoZmxvYXQpKGN1cnJlbnRUaW1lIC0gbVN0YXJ0VGltZSkgLyBtRHVyYXRpb247CisgICAgICAgICAgICBpZiAoZnJhY3Rpb24gPj0gMWYpIHsKKyAgICAgICAgICAgICAgICBpZiAobUN1cnJlbnRJdGVyYXRpb24gPCBtUmVwZWF0Q291bnQgfHwgbVJlcGVhdENvdW50ID09IElORklOSVRFKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRpbWUgdG8gcmVwZWF0CisgICAgICAgICAgICAgICAgICAgIGlmIChtTGlzdGVuZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoQW5pbWF0YWJsZUxpc3RlbmVyIGxpc3RlbmVyIDogbUxpc3RlbmVycykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RlbmVyLm9uQW5pbWF0aW9uUmVwZWF0KHRoaXMpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICsrbUN1cnJlbnRJdGVyYXRpb247CisgICAgICAgICAgICAgICAgICAgIGlmIChtUmVwZWF0TW9kZSA9PSBSRVZFUlNFKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtUGxheWluZ0JhY2t3YXJkcyA9IG1QbGF5aW5nQmFja3dhcmRzID8gZmFsc2UgOiB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IGRvZXNuJ3QgYWNjb3VudCBmb3IgZnJhY3Rpb24gZ29pbmcgV2F5eXl5eSBvdmVyIDEsIGxpa2UgMisKKyAgICAgICAgICAgICAgICAgICAgZnJhY3Rpb24gPSBmcmFjdGlvbiAtIDFmOworICAgICAgICAgICAgICAgICAgICBtU3RhcnRUaW1lICs9IG1EdXJhdGlvbjsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBkb25lID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgZnJhY3Rpb24gPSBNYXRoLm1pbihmcmFjdGlvbiwgMS4wZik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKG1QbGF5aW5nQmFja3dhcmRzKSB7CisgICAgICAgICAgICAgICAgZnJhY3Rpb24gPSAxZiAtIGZyYWN0aW9uOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYW5pbWF0ZVZhbHVlKGZyYWN0aW9uKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIEVOREVEOgorICAgICAgICAgICAgLy8gVGhlIGZpbmFsIHZhbHVlIHNldCBvbiB0aGUgdGFyZ2V0IHZhcmllcywgZGVwZW5kaW5nIG9uIHdoZXRoZXIgdGhlIGFuaW1hdGlvbgorICAgICAgICAgICAgLy8gd2FzIHN1cHBvc2VkIHRvIHJlcGVhdCBhbiBvZGQgbnVtYmVyIG9mIHRpbWVzCisgICAgICAgICAgICBpZiAobVJlcGVhdENvdW50ID4gMCAmJiAobVJlcGVhdENvdW50ICYgMHgwMSkgPT0gMSkgeworICAgICAgICAgICAgICAgIGFuaW1hdGVWYWx1ZSgwZik7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGFuaW1hdGVWYWx1ZSgxZik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBGYWxsIHRocm91Z2ggdG8gc2V0IGRvbmUgZmxhZworICAgICAgICBjYXNlIENBTkNFTEVEOgorICAg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BpdAorICAgICAgICAgICAgICAgIC8vIGJ1dCBiZWZvcmUgd2UndmUgYWRkZWQgYW4gZW50cnkgdG8gaXQKKyAgICAgICAgICAgICAgICBwcm9wZXJ0eU1hcExvY2sud3JpdGVMb2NrKCkubG9jaygpOworICAgICAgICAgICAgICAgIEhhc2hNYXA8U3RyaW5nLCBNZXRob2Q+IHByb3BlcnR5TWFwID0gc1NldHRlclByb3BlcnR5TWFwLmdldChtVGFyZ2V0KTsKKyAgICAgICAgICAgICAgICBpZiAocHJvcGVydHlNYXAgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtU2V0dGVyID0gcHJvcGVydHlNYXAuZ2V0KG1Qcm9wZXJ0eU5hbWUpOworICAgICAgICAgICAgICAgICAgICBpZiAobVNldHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVNldHRlciA9IGdldFByb3BlcnR5RnVuY3Rpb24oInNldCIpOworICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0eU1hcCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5TWFwID0gbmV3IEhhc2hNYXA8U3RyaW5nLCBNZXRob2Q+KCk7CisgICAgICAgICAgICAgICAgICAgIHNTZXR0ZXJQcm9wZXJ0eU1hcC5wdXQobVRhcmdldCwgcHJvcGVydHlNYXApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwcm9wZXJ0eU1hcC5wdXQobVByb3BlcnR5TmFtZSwgbVNldHRlcik7CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIHByb3BlcnR5TWFwTG9jay53cml0ZUxvY2soKS51bmxvY2soKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoZ2V0VmFsdWVGcm9tKCkgPT0gbnVsbCB8fCBnZXRWYWx1ZVRvKCkgPT0gbnVsbCkgeworICAgICAgICAgICAgLy8gTmVlZCB0byBzZXQgdXAgdGhlIGdldHRlciBpZiBub3Qgc2V0IGJ5IHRoZSB1c2VyLCB0aGVuIGNhbGwgaXQKKyAgICAgICAgICAgIC8vIHRvIGdldCB0aGUgaW5pdGlhbCB2YWx1ZXMKKyAgICAgICAgICAgIGlmIChtR2V0dGVyID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eU1hcExvY2sud3JpdGVMb2NrKCkubG9jaygpOworICAgICAgICAgICAgICAgICAgICBIYXNoTWFwPFN0cmluZywgTWV0aG9kPiBwcm9wZXJ0eU1hcCA9IHNHZXR0ZXJQcm9wZXJ0eU1hcC5nZXQobVRhcmdldCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0eU1hcCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtR2V0dGVyID0gcHJvcGVydHlNYXAuZ2V0KG1Qcm9wZXJ0eU5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1HZXR0ZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtR2V0dGVyID0gZ2V0UHJvcGVydHlGdW5jdGlvbigiZ2V0Iik7CisgICAgICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0eU1hcCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eU1hcCA9IG5ldyBIYXNoTWFwPFN0cmluZywgTWV0aG9kPigpOworICAgICAgICAgICAgICAgICAgICAgICAgc0dldHRlclByb3BlcnR5TWFwLnB1dChtVGFyZ2V0LCBwcm9wZXJ0eU1hcCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlNYXAucHV0KG1Qcm9wZXJ0eU5hbWUsIG1HZXR0ZXIpOworICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5TWFwTG9jay53cml0ZUxvY2soKS51bmxvY2soKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGlmIChnZXRWYWx1ZUZyb20oKSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHNldFZhbHVlRnJvbShtR2V0dGVyLmludm9rZShtVGFyZ2V0KSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChnZXRWYWx1ZVRvKCkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBzZXRWYWx1ZVRvKG1HZXR0ZXIuaW52b2tlKG1UYXJnZXQpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKCJQcm9wZXJ0eUFuaW1hdG9yIiwgZS50b1N0cmluZygpKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBY2Nlc3NFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKCJQcm9wZXJ0eUFuaW1hdG9yIiwgZS50b1N0cmluZygpKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEludm9jYXRpb25UYXJnZXRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKCJQcm9wZXJ0eUFuaW1hdG9yIiwgZS50b1N0cmluZygpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworCisgICAgLyoqCisgICAgICogVGhlIHRhcmdldCBvYmplY3Qgd2hvc2UgcHJvcGVydHkgd2lsbCBiZSBhbmltYXRlZCBieS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VlKGZsb2F0IGZyYWN0aW9uKSB7CisgICAgICAgIHN1cGVyLmFuaW1hdGVWYWx1ZShmcmFjdGlvbik7CisgICAgICAgIGlmIChtU2V0dGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbVNldHRlci5pbnZva2UobVRhcmdldCwgZ2V0QW5pbWF0ZWRWYWx1ZSgpKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEludm9jYXRpb25UYXJnZXRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKCJQcm9wZXJ0eUFuaW1hdG9yIiwgZS50b1N0cmluZygpKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBY2Nlc3NFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKCJQcm9wZXJ0eUFuaW1hdG9yIiwgZS50b1N0cmluZygpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgIHJldHVybiAiQW5pbWF0b3I6IHRhcmdldDogIiArIHRoaXMubVRhcmdldCArICJcbiIgKworICAgICAgICAgICAgICAgICIgICAgcHJvcGVydHk6ICIgKyBtUHJvcGVydHlOYW1lICsgIlxuIiArCisgICAgICAgICAgICAgICAgIiAgICBmcm9tOiAiICsgZ2V0VmFsdWVGcm9tKCkgKyAiXG4iICsKKyAgICAgICAgICAgICAgICAiICAgIHRvOiAiICsgZ2V0VmFsdWVUbygpOworICAgIH0KK30KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2FuaW1hdGlvbi9SR0JFdmFsdWF0b3IuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2FuaW1hdGlvbi9SR0JFdmFsdWF0b3IuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5iYWUwYWY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9jfQorICAgICAqCisgICAgICogPHA+Tm90ZSB0aGF0IGNhbmNlbGluZyBhIDxjb2RlPlNlcXVlbmNlcjwvY29kZT4gYWxzbyBjYW5jZWxzIGFsbCBvZiB0aGUgYW5pbWF0aW9ucyB0aGF0IGl0IGlzCisgICAgICogcmVzcG9uc2libGUgZm9yLjwvcD4KKyAgICAgKi8KKyAgICBAU3VwcHJlc3NXYXJuaW5ncygidW5jaGVja2VkIikKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBjYW5jZWwoKSB7CisgICAgICAgIGlmIChtTGlzdGVuZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgIEFycmF5TGlzdDxBbmltYXRhYmxlTGlzdGVuZXI+IHRtcExpc3RlbmVycyA9CisgICAgICAgICAgICAgICAgICAgIChBcnJheUxpc3Q8QW5pbWF0YWJsZUxpc3RlbmVyPikgbUxpc3RlbmVycy5jbG9uZSgpOworICAgICAgICAgICAgZm9yIChBbmltYXRhYmxlTGlzdGVuZXIgbGlzdGVuZXIgOiB0bXBMaXN0ZW5lcnMpIHsKKyAgICAgICAgICAgICAgICBsaXN0ZW5lci5vbkFuaW1hdGlvbkNhbmNlbCh0aGlzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAobVBsYXlpbmdTZXQuc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgZm9yIChBbmltYXRhYmxlIGl0ZW0gOiBtUGxheWluZ1NldCkgeworICAgICAgICAgICAgICAgIGl0ZW0uY2FuY2VsKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtUGxheWluZ1NldC5jbGVhcigpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICoge0Bpbmhlcml0RG9jfQorICAgICAqCisgICAgICogPHA+Tm90ZSB0aGF0IGVuZGluZyBhIDxjb2RlPlNlcXVlbmNlcjwvY29kZT4gYWxzbyBlbmRzIGFsbCBvZiB0aGUgYW5pbWF0aW9ucyB0aG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ICAgICAgICAgICAgZm9yIChEZXBlbmRlbmN5IGRlcGVuZGVuY3kgOiBub2RlLmRlcGVuZGVuY2llcykgeworICAgICAgICAgICAgICAgICAgICBkZXBlbmRlbmN5Lm5vZGUuYW5pbWF0aW9uLmFkZExpc3RlbmVyKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBEZXBlbmRlbmN5TGlzdGVuZXIobm9kZSwgZGVwZW5kZW5jeS5ydWxlKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG5vZGUudG1wRGVwZW5kZW5jaWVzID0gKEFycmF5TGlzdDxEZXBlbmRlbmN5Pikgbm9kZS5kZXBlbmRlbmNpZXMuY2xvbmUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyBOb3cgdGhhdCBhbGwgZGVwZW5kZW5jaWVzIGFyZSBzZXQgdXAsIHN0YXJ0IHRoZSBhbmltYXRpb25zIHRoYXQgc2hvdWxkIGJlIHN0YXJ0ZWQuCisgICAgICAgIGZvciAoTm9kZSBub2RlIDogbm9kZXNUb1N0YXJ0KSB7CisgICAgICAgICAgICBub2RlLmFuaW1hdGlvbi5zdGFydCgpOworICAgICAgICAgICAgbVBsYXlpbmdTZXQuYWRkKG5vZGUuYW5pbWF0aW9uKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUxpc3RlbmVycyAhPSBudWxsKSB7CisgICAgICAgICAgICBBcnJheUxpc3Q8QW5pbWF0YWJsZUxpc3RlbmVyPiB0bXBMaXN0ZW5lcnMgPQorICAgICAgICAgICAgICAgICAgICAoQXJyYXlMaXN0PEFuaW1hdGFibGVMaXN0ZW5lcj4pIG1MaXN0ZW5lcnMuY2xvbmUoKTsKKyAgICAgICAgICAgIGZvciAoQW5pbWF0YWJsZUxpc3RlbmVyIGxpc3RlbmVyIDogdG1wTGlzdGVuZXJzKSB7CisgICAgICAgICAgICAgICAgbGlzdGVuZXIub25BbmltYXRpb25TdGFydCh0aGlzKTsKK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4gdGhpcyByZW1vdmVzCisgICAgICAgICAqIHRoZSBsaXN0ZW5lciBvbiB0aGF0IGFuaW1hdGlvbiwgdG8gYXZvaWQgdHJpZ2dlcmluZyBmdXJ0aGVyIGFuaW1hdGlvbnMgZG93bgorICAgICAgICAgKiB0aGUgbGluZSB3aGVuIHRoZSBhbmltYXRpb24gZW5kcy4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIG9uQW5pbWF0aW9uQ2FuY2VsKEFuaW1hdGFibGUgYW5pbWF0aW9uKSB7CisgICAgICAgICAgICBEZXBlbmRlbmN5IGRlcGVuZGVuY3lUb1JlbW92ZSA9IG51bGw7CisgICAgICAgICAgICBmb3IgKERlcGVuZGVuY3kgZGVwZW5kZW5jeSA6IG1Ob2RlLnRtcERlcGVuZGVuY2llcykgeworICAgICAgICAgICAgICAgIGlmIChkZXBlbmRlbmN5Lm5vZGUuYW5pbWF0aW9uID09IGFuaW1hdGlvbikgeworICAgICAgICAgICAgICAgICAgICAvLyBhbmltYXRpb24gY2FuY2VsZWQgLSByZW1vdmUgdGhlIGRlcGVuZGVuY3kgYW5kIGxpc3RlbmVyCisgICAgICAgICAgICAgICAgICAgIGRlcGVuZGVuY3lUb1JlbW92ZSA9IGRlcGVuZGVuY3k7CisgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5yZW1vdmVMaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgbU5vZGUudG1wRGVwZW5kZW5jaWVzLnJlbW92ZShkZXBlbmRlbmN5VG9SZW1vdmUpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEFuIGVuZCBldmVudCBpcyByZWNlaXZlZCAtIHNlZSBpZiB0aGlzIGlzIGFuIGV2ZW50IHdlIGFyZSBsaXN0ZW5pbmcgZm9yCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBvbkFuaW1hdGlvbkVuZChBbmltYXRhYmxlIGFuaW1hdGlvbikgeworICAgICAgICAgICAgaWYgKG1SdWxlID09IERlcGVuZGVuY3kuQUZURVIpIHsKKyAgICAgICAgICAgICAgICBzdGFydElmUmVhZHkoYW5pbWF0aW9uKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBJZ25vcmUgcmVwZWF0IGV2ZW50cyBmb3Igbm93CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBvbkFuaW1hdGlvblJlcGVhdChBbmltYXRhYmxlIGFuaW1hdGlvbikgeworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEEgc3RhcnQgZXZlbnQgaXMgcmVjZWl2ZWQgLSBzZWUgaWYgdGhpcyBpcyBhbiBldmVudCB3ZSBhcmUgbGlzdGVuaW5nIGZvcgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgb25BbmltYXRpb25TdGFydChBbmltYXRhYmxlIGFuaW1hdGlvbikgeworICAgICAgICAgICAgaWYgKG1SdWxlID09IERlcGVuZGVuY3kuV0lUSCkgeworICAgICAgICAgICAgICAgIHN0YXJ0SWZSZWFkeShhbmltYXRpb24pOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENoZWNrIHdoZXRoZXIgdGhlIGV2ZW50IHJlY2VpdmVkIGlzIG9uZSB0aGF0IHRoZSBub2RlIHdhcyB3YWl0aW5nIGZvci4KKyAgICAgICAgICogSWYgc28sIG1hcmsgaXQgYXMgY29tcGxldGUgYW5kIHNlZSB3aGV0aGVyIGl0J3MgdGltZSB0byBzdGFydAorICAgICAgICAgKiB0aGUgYW5pbWF0aW9uLgorICAgICAgICAgKiBAcGFyYW0gZGVwZW5kZW5jeUFuaW1hdGlvbiB0aGUgYW5pbWF0aW9uIHRoYXQgc2VudCB0aGUgZXZlbnQuCisgICAgICAgICAqLworICAgICAgICBwcml2YXRlIHZvaWQgc3RhcnRJZlJlYWR5KEFuaW1hdGFibGUgZGVwZW5kZW5jeUFuaW1hdGlvbikgeworICAgICAgICAgICAgRGVwZW5kZW5jeSBkZXBlbmRlbmN5VG9SZW1vdmUgPSBudWxsOworICAgICAgICAgICAgZm9yIChEZXBlbmRlbmN5IGRlcGVuZGVuY3kgOiBtTm9kZS50bXBEZXBlbmRlbmNpZXMpIHsKKyAgICAgICAgICAgICAgICBpZiAoZGVwZW5kZW5jeS5ydWxlID09IG1SdWxlICYmCisgICAgICAgICAgICAgICAgICAgICAgICBkZXBlbmRlbmN5Lm5vZGUuYW5pbWF0aW9uID09IGRlcGVuZGVuY3lBbmltYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gcnVsZSBmaXJlZCAtIHJlbW92ZSB0aGUgZGVwZW5kZW5jeSBhbmQgbGlzdGVuZXIgYW5kIGNoZWNrIHRvCisgICAgICAgICAgICAgICAgICAgIC8vIHNlZSB3aGV0aGVyIGl0J3MgdGltZSB0byBzdGFydCB0aGUgYW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgIGRlcGVuZGVuY3lUb1JlbW92ZSA9IGRlcGVuZGVuY3k7CisgICAgICAgICAgICAgICAgICAgIGRlcGVuZGVuY3lBbmltYXRpb24ucmVtb3ZlTGlzdGVuZXIodGhpcyk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Ob2RlLnRtcERlcGVuZGVuY2llcy5yZW1vdmUoZGVwZW5kZW5jeVRvUmVtb3ZlKTsKKyAgICAgICAgICAgIGlmIChtTm9kZS50bXBEZXBlbmRlbmNpZXMuc2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgICAgICAvLyBhbGwgZGVwZW5kZW5jaWVzIHNhdGlzZmllZDogc3RhcnQgdGhlIGFuaW1hdGlvbgorICAgICAgICAgICAgICAgIG1Ob2RlLmFuaW1hdGlvbi5zdGFydCgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIFNlcXVlbmNlckFuaW1hdGFibGVMaXN0ZW5lciBpbXBsZW1lbnRzIEFuaW1hdGFibGVMaXN0ZW5lciB7CisKKyAgICAgICAgcHJpdmF0ZSBTZXF1ZW5jZXIgbVNlcXVlbmNlcjsKKworICAgICAgICBTZXF1ZW5jZXJBbmltYXRhYmxlTGlzdGVuZXIoU2VxdWVuY2VyIHNlcXVlbmNlcikgeworICAgICAgICAgICAgbVNlcXVlbmNlciA9IHNlcXVlbmNlcjsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIG9uQW5pbWF0aW9uQ2FuY2VsKEFuaW1hdGFibGUgYW5pbWF0aW9uKSB7CisgICAgICAgICAgICBpZiAobVBsYXlpbmdTZXQuc2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgICAgICBpZiAobUxpc3RlbmVycyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGZvciAoQW5pbWF0YWJsZUxpc3RlbmVyIGxpc3RlbmVyIDogbUxpc3RlbmVycykgeworICAgICAgICAgICAgICAgICAgICAgICAgbGlzdGVuZXIub25BbmltYXRpb25DYW5jZWwobVNlcXVlbmNlcik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBAU3VwcHJlc3NXYXJuaW5ncygidW5jaGVja2VkIikKKyAgICAgICAgcHVibGljIHZvaWQgb25BbmltYXRpb25FbmQoQW5pbWF0YWJsZSBhbmltYXRpb24pIHsKKyAgICAgICAgICAgIGFuaW1hdGlvbi5yZW1vdmVMaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgICAgIG1QbGF5aW5nU2V0LnJlbW92ZShhbmltYXRpb24pOworICAgICAgICAgICAgaWYgKG1QbGF5aW5nU2V0LnNpemUoKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgLy8gSWYgdGhpcyB3YXMgdGhlIGxhc3QgY2hpbGQgYW5pbWF0aW9uIHRvIGVuZCwgdGhlbiBub3RpZnkgbGlzdGVuZXJzIHRoYXQgdGhpcworICAgICAgICAgICAgICAgIC8vIHNlcXVlbmNlIGVuZGVkCisgICAgICAgICAgICAgICAgaWYgKG1MaXN0ZW5lcnMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBBcnJheUxpc3Q8QW5pbWF0YWJsZUxpc3RlbmVyPiB0bXBMaXN0ZW5lcnMgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIChBcnJheUxpc3Q8QW5pbWF0YWJsZUxpc3RlbmVyPikgbUxpc3RlbmVycy5jbG9uZSgpOworICAgICAgICAgICAgICAgICAgICBmb3IgKEFuaW1hdGFibGVMaXN0ZW5lciBsaXN0ZW5lciA6IHRtcExpc3RlbmVycykgeworICAgICAgICAgICAgICAgICAgICAgICAgbGlzdGVuZXIub25BbmltYXRpb25FbmQobVNlcXVlbmNlcik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBOb3RoaW5nIHRvIGRvCisgICAgICAgIHB1YmxpYyB2b2lkIG9uQW5pbWF0aW9uUmVwZWF0KEFuaW1hdGFibGUgYW5pbWF0aW9uKSB7CisgICAgICAgIH0KKworICAgICAgICAvLyBOb3RoaW5nIHRvIGRvCisgICAgICAgIHB1YmxpYyB2b2lkIG9uQW5pbWF0aW9uU3RhcnQoQW5pbWF0YWJsZSBhbmltYXRpb24pIHsKKyAgICAgICAgfQorCisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBtZXRob2Qgc29ydHMgdGhlIGN1cnJlbnQgc2V0IG9mIG5vZGVzLCBpZiBuZWVkZWQuIFRoZSBzb3J0IGlzIGEgc2ltcGxlCisgICAgICogRGVwZW5kZW5jeUdyYXBoIHNvcnQsIHdoaWNoIGdvZXMgbGlrZSB0aGlzOgorICAgICAqIC0gQWxsIG5vZGVzIHdpdGhvdXQgZGVwZW5kZW5jaWVzIGJlY29tZSAncm9vdHMnCisgICAgICogLSB3aGlsZSByb290cyBsaXN0IGlzIG5vdCBudWxsCisgICAgICogLSAgIGZvciBlYWNoIHJvb3QgcgorICAgICAqIC0gICAgIGFkZCByIHRvIHNvcnRlZCBsaXN0CisgICAgICogLSAgICAgcmVtb3ZlIHIgYXMgYSBkZXBlbmRlbmN5IGZyb20gYW55IG90aGVyIG5vZGUKKyAgICAgKiAtICAgYW55IG5vZGVzIHdpdGggbm8gZGVwZW5kZW5jaWVzIGFyZSBhZGRlZCB0byB0aGUgcm9vdHMgbGlzdAorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBzb3J0Tm9kZXMoKSB7CisgICAgICAgIGlmIChtTmVlZHNTb3J0KSB7CisgICAgICAgICAgICBtU29ydGVkTm9kZXMuY2xlYXIoKTsKKyAgICAgICAgICAgIEFycmF5TGlzdDxOb2RlPiByb290cyA9IG5ldyBBcnJheUxpc3Q8Tm9kZT4oKTsKKyAgICAgICAgICAgIGZvciAoTm9kZSBub2RlIDogbU5vZGVzKSB7CisgICAgICAgICAgICAgICAgaWYgKG5vZGUuZGVwZW5kZW5jaWVzID09IG51bGwgfHwgbm9kZS5kZXBlbmRlbmNpZXMuc2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcm9vdHMuYWRkKG5vZGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEFycmF5TGlzdDxOb2RlPiB0bXBSb290cyA9IG5ldyBBcnJheUxpc3Q8Tm9kZT4oKTsKKyAgICAgICAgICAgIHdoaWxlIChyb290cy5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICAgICAgZm9yIChOb2RlIHJvb3QgOiByb290cykgeworICAgICAgICAgICAgICAgICAgICBtU29ydGVkTm9kZXMuYWRkKHJvb3QpOworICAgICAgICAgICAgICAgICAgICBpZiAocm9vdC5ub2RlRGVwZW5kZW50cyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKE5vZGUgbm9kZSA6IHJvb3Qubm9kZURlcGVuZGVudHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLm5vZGVEZXBlbmRlbmNpZXMucmVtb3ZlKHJvb3QpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChub2RlLm5vZGVEZXBlbmRlbmNpZXMuc2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wUm9vdHMuYWRkKG5vZGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByb290cy5hZGRBbGwodG1wUm9vdHMpOworICAgICAgICAgICAgICAgIHRtcFJvb3RzLmNsZWFyKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtTmVlZHNTb3J0ID0gZmFsc2U7CisgICAgICAgICAgICBpZiAobVNvcnRlZE5vZGVzLnNpemUoKSAhPSBtTm9kZXMuc2l6ZSgpKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiQ2lyY3VsYXIgZGVwZW5kZW5jaWVzIGNhbm5vdCBleGlzdCIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBpbiBTZXF1ZW5jZXIiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vIERvZXNuJ3QgbmVlZCBzb3J0aW5nLCBidXQgc3RpbGwgbmVlZCB0byBhZGQgaW4gdGhlIG5vZGVEZXBlbmRlbmNpZXMgbGlzdAorICAgICAgICAgICAgLy8gYmVjYXVzZSB0aGVzZSBnZXQgcmVtb3ZlZCBhcyB0aGUgZXZlbnQgbGlzdGVuZXJzIGZpcmUgYW5kIHRoZSBkZXBlbmRlbmNpZXMKKyAgICAgICAgICAgIC8vIGFyZSBzYXRpc2ZpZWQKKyAgICAgICAgICAgIGZvciAoTm9kZSBub2RlIDogbU5vZGVzKSB7CisgICAgICAgICAgICAgICAgaWYgKG5vZGUuZGVwZW5kZW5jaWVzICE9IG51bGwgJiYgbm9kZS5kZXBlbmRlbmNpZXMuc2l6ZSgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICBmb3IgKERlcGVuZGVuY3kgZGVwZW5kZW5jeSA6IG5vZGUuZGVwZW5kZW5jaWVzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobm9kZS5ub2RlRGVwZW5kZW5jaWVzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLm5vZGVEZXBlbmRlbmNpZXMgPSBuZXcgQXJyYXlMaXN0PE5vZGU+KCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW5vZGUubm9kZURlcGVuZGVuY2llcy5jb250YWlucyhkZXBlbmRlbmN5Lm5vZGUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5ub2RlRGVwZW5kZW5jaWVzLmFkZChkZXBlbmRlbmN5Lm5vZGUpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogRGVwZW5kZW5jeSBob2xkcyBpbmZvcm1hdGlvbiBhYm91dCB0aGUgbm9kZSB0aGF0IHNvbWUgb3RoZXIgbm9kZSBpcworICAgICAqIGRlcGVuZGVudCB1cG9uIGFuZCB0aGUgbmF0dXJlIG9mIHRoYXQgZGVwZW5kZW5jeS4KKyAgICAgKgorICAgICAq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IChkZXBlbmRlbmNpZXMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGRlcGVuZGVuY2llcyA9IG5ldyBBcnJheUxpc3Q8RGVwZW5kZW5jeT4oKTsKKyAgICAgICAgICAgICAgICBub2RlRGVwZW5kZW5jaWVzID0gbmV3IEFycmF5TGlzdDxOb2RlPigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZGVwZW5kZW5jaWVzLmFkZChkZXBlbmRlbmN5KTsKKyAgICAgICAgICAgIGlmICghbm9kZURlcGVuZGVuY2llcy5jb250YWlucyhkZXBlbmRlbmN5Lm5vZGUpKSB7CisgICAgICAgICAgICAgICAgbm9kZURlcGVuZGVuY2llcy5hZGQoZGVwZW5kZW5jeS5ub2RlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIE5vZGUgZGVwZW5kZW5jeU5vZGUgPSBkZXBlbmRlbmN5Lm5vZGU7CisgICAgICAgICAgICBpZiAoZGVwZW5kZW5jeU5vZGUubm9kZURlcGVuZGVudHMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGRlcGVuZGVuY3lOb2RlLm5vZGVEZXBlbmRlbnRzID0gbmV3IEFycmF5TGlzdDxOb2RlPigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZGVwZW5kZW5jeU5vZGUubm9kZURlcGVuZGVudHMuYWRkKHRoaXMpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhlIDxjb2RlPkJ1aWxkZXI8L2NvZGU+IG9iamVjdCBpcyBhIHV0aWxpdHkgY2xhc3MgdG8gZmFjaWxpdGF0ZSBhZGRpbmcgYW5pbWF0aW9ucyB0byBhCisgICAgICogPGNvZGU+U2VxdWVuY2VyPC9jb2RlPiBhbG9uZyB3aXRoIHRoZSByZWxhdGlvbnNoaXBzIGJldHdlZW4gdGhlIHZhcmlvdXMgYW5pbWF0aW9ucy4gVGhlCisgICAgICogaW50ZW50aW9uIG9mIHRoZSA8Y29kZT5CdWlsZGVyP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gICAgICoge0BsaW5rIFNlcXVlbmNlciNwbGF5KEFuaW1hdGFibGUpfSBtZXRob2Qgc3RhcnRzLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgd2l0aChBbmltYXRhYmxlIGFuaW0pIHsKKyAgICAgICAgICAgIE5vZGUgbm9kZSA9IG1Ob2RlTWFwLmdldChhbmltKTsKKyAgICAgICAgICAgIGlmIChub2RlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBub2RlID0gbmV3IE5vZGUoYW5pbSk7CisgICAgICAgICAgICAgICAgbU5vZGVNYXAucHV0KGFuaW0sIG5vZGUpOworICAgICAgICAgICAgICAgIG1Ob2Rlcy5hZGQobm9kZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBEZXBlbmRlbmN5IGRlcGVuZGVuY3kgPSBuZXcgRGVwZW5kZW5jeShtQ3VycmVudE5vZGUsIERlcGVuZGVuY3kuV0lUSCk7CisgICAgICAgICAgICBub2RlLmFkZERlcGVuZGVuY3koZGVwZW5kZW5jeSk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogU2V0cyB1cCB0aGUgZ2l2ZW4gYW5pbWF0aW9uIHRvIHBsYXkgd2hlbiB0aGUgYW5pbWF0aW9uIHN1cHBsaWVkIGluIHRoZQorICAgICAgICAgKiB7QGxpbmsgU2VxdWVuY2VyI3BsYXkoQW5pbWF0YWJsZSl9IGNhbGwgdGhhdCBjcmVhdGVkIHRoaXMgPGNvZGU+QnVpbGRlcjwvY29kZT4gb2JqZWN0CisgICAgICAgICAqIGVuZHMuCisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBhbmltIFRoZSBhbmltYXRpb24gdGhhdCB3aWxsIHBsYXkgd2hlbiB0aGUgYW5pbWF0aW9uIHN1cHBsaWVkIHRvIHRoZQorICAgICAgICAgKiB7QGxpbmsgU2VxdWVuY2VyI3BsYXkoQW5pbWF0YWJsZSl9IG1ldGhvZCBlbmRzLgorICAgICAgICAg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gICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIGFmdGVyKEFuaW1hdGFibGUgYW5pbSkgeworICAgICAgICAgICAgTm9kZSBub2RlID0gbU5vZGVNYXAuZ2V0KGFuaW0pOworICAgICAgICAgICAgaWYgKG5vZGUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG5vZGUgPSBuZXcgTm9kZShhbmltKTsKKyAgICAgICAgICAgICAgICBtTm9kZU1hcC5wdXQoYW5pbSwgbm9kZSk7CisgICAgICAgICAgICAgICAgbU5vZGVzLmFkZChub2RlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIERlcGVuZGVuY3kgZGVwZW5kZW5jeSA9IG5ldyBEZXBlbmRlbmN5KG5vZGUsIERlcGVuZGVuY3kuQUZURVIpOworICAgICAgICAgICAgbUN1cnJlbnROb2RlLmFkZERlcGVuZGVuY3koZGVwZW5kZW5jeSk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogU2V0cyB1cCB0aGUgYW5pbWF0aW9uIHN1cHBsaWVkIGluIHRoZQorICAgICAgICAgKiB7QGxpbmsgU2VxdWVuY2VyI3BsYXkoQW5pbWF0YWJsZSl9IGNhbGwgdGhhdCBjcmVhdGVkIHRoaXMgPGNvZGU+QnVpbGRlcjwvY29kZT4gb2JqZWN0CisgICAgICAgICAqIHRvIHBsYXkgd2hlbiB0aGUgZ2l2ZW4gYW1vdW50IG9mIHRpbWUgZWxhcHNlcy4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIGRlbGF5IFRoZSBudW1iZXIgb2YgbWlsbGlzZWNvbmRzIHRoYXQgc2hvdWxkIGVsYXBzZSBiZWZvcmUgdGhlCisgICAgICAgICAqIGFuaW1hdGlvbiBzdGFydHMuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBhZnRlcihsb25nIGRlbGF5KSB7CisgICAgICAgICAgICAvLyBzZXR1cCBkdW1teSBBbmltYXRvciBqdXN0IHRvIHJ1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zcGxheU9wdGlvbnMoaW50LCBpbnQpfS4KKyAgICAgKiAKKyAgICAgKiBAcGFyYW0gb3B0aW9ucyBBIGNvbWJpbmF0aW9uIG9mIHRoZSBiaXRzIGRlZmluZWQgYnkgdGhlIERJU1BMQVlfIGNvbnN0YW50cworICAgICAqICAgICAgICAgICAgICAgIGRlZmluZWQgaW4gQWN0aW9uQmFyLgorICAgICAqLworICAgIHB1YmxpYyBhYnN0cmFjdCB2b2lkIHNldERpc3BsYXlPcHRpb25zKGludCBvcHRpb25zKTsKKyAgICAKKyAgICAvKioKKyAgICAgKiBTZXQgc2VsZWN0ZWQgZGlzcGxheSBvcHRpb25zLiBPbmx5IHRoZSBvcHRpb25zIHNwZWNpZmllZCBieSBtYXNrIHdpbGwgYmUgY2hhbmdlZC4KKyAgICAgKiBUbyBjaGFuZ2UgYWxsIGRpc3BsYXkgb3B0aW9uIGJpdHMgYXQgb25jZSwgc2VlIHtAbGluayAjc2V0RGlzcGxheU9wdGlvbnMoaW50KX0uCisgICAgICogCisgICAgICogPHA+RXhhbXBsZTogc2V0RGlzcGxheU9wdGlvbnMoMCwgRElTUExBWV9ISURFX0hPTUUpIHdpbGwgZGlzYWJsZSB0aGUKKyAgICAgKiB7QGxpbmsgI0RJU1BMQVlfSElERV9IT01FfSBvcHRpb24uCisgICAgICogc2V0RGlzcGxheU9wdGlvbnMoRElTUExBWV9ISURFX0hPTUUsIERJU1BMQVlfSElERV9IT01FIHwgRElTUExBWV9VU0VfTE9HTykKKyAgICAgKiB3aWxsIGVuYWJsZSB7QGxpbmsgI0RJU1BMQVlfSElERV9IT01FfSBhbmQgZGlzYWJsZSB7QGxpbmsgI0RJU1BMQVlfVVNFX0xPR099LgorICAgICAqIAorICAgICAqIEBwYXJhbSBvcHRpb25zIEEgY29tYmluYXRpb24gb2YgdGhlIGJpdHMgZGVmaW5lZCBieSB0aGUgRElTUExBWV8gY29uc3RhbnRzCisgICAgICogICAgICAgICAgICAgICAgZGVmaW5lZCBpbiBBY3Rpb25CYXIuCisgICAgICogQHBhcmFtIG1hc2sgQSBiaXQgbWFzayBkZWNsYXJpbmcgd2hpY2ggZGlzcGxheSBvcHRpb25zIHNob3VsZCBiZSBjaGFuZ2VkLgorICAgICAqLworICAgIHB1YmxpYyBhYnN0cmFjdCB2b2lkIHNldERpc3BsYXlPcHRpb25zKGludCBvcHRpb25zLCBpbnQgbWFzayk7CisgICAgCisgICAgLyoqCisgICAgICogU2V0IHRoZSBBY3Rpb25CYXIncyBiYWNrZ3JvdW5kLgorICAgICAqIAorICAgICAqIEBwYXJhbSBkIEJhY2tncm91bmQgZHJhd2FibGUKKyAgICAgKi8KKyAgICBwdWJsaWMgYWJzdHJhY3Qgdm9pZCBzZXRCYWNrZ3JvdW5kRHJhd2FibGUoRHJhd2FibGUgZCk7CisgICAgCisgICAgLyoqCisgICAgICogQHJldHVybiBUaGUgY3VycmVudCBjdXN0b20gbmF2aWdhdGlvbiB2aWV3LgorICAgICAqLworICAgIHB1YmxpYyBhYnN0cmFjdCBWaWV3IGdldEN1c3RvbU5hdmlnYXRpb25WaWV3KCk7CisgICAgCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgY3VycmVudCBBY3Rpb25CYXIgdGl0bGUgaW4gc3RhbmRhcmQgbW9kZS4KKyAgICAgKiBSZXR1cm5zIG51bGwgaWYge0BsaW5rICNnZXROYXZpZ2F0aW9uTW9kZSgpfSB3b3VsZCBub3QgcmV0dXJuCisgICAgICoge0BsaW5rICNOQVZJR0FUSU9OX01PREVfU1RBTkRBUkR9LiAKKyAgICAgKgorICAgICAqIEByZXR1cm4gVGhlIGN1cnJlbnQgQWN0aW9uQmFyIHRpdGxlIG9yIG51bGwuCisgICAgICovCisgICAgcHVibGljIGFic3RyYWN0IENoYXJTZXF1ZW5jZSBnZXRUaXRsZSgpOworICAgIAorICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIGN1cnJlbnQgQWN0aW9uQmFyIHN1YnRpdGxlIGluIHN0YW5kYXJkIG1vZGUuCisgICAgICogUmV0dXJucyBudWxsIGlmIHtAbGluayAjZ2V0TmF2aWdhdGlvbk1vZGUoKX0gd291bGQgbm90IHJldHVybgorICAgICAqIHtAbGluayAjTkFWSUdBVElPTl9NT0RFX1NUQU5EQVJEfS4gCisgICAgICoKKyAgICAgKiBAcmV0dXJuIFRoZSBjdXJyZW50IEFjdGlvbkJhciBzdWJ0aXRsZSBvciBudWxsLgorICAgICAqLworICAgIHB1YmxpYyBhYnN0cmFjdCBDaGFyU2VxdWVuY2UgZ2V0U3VidGl0bGUoKTsKKyAgICAKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBjdXJyZW50IG5hdmlnYXRpb24gbW9kZS4gVGhlIHJlc3VsdCB3aWxsIGJlIG9uZSBvZjoKKyAgICAgKiA8dWw+CisgICAgICogPGxpPntAbGluayAjTkFWSUdBVElPTl9NT0RFX1NUQU5EQVJEfTwvbGk+CisgICAgICogPGxpPntAbGluayAjTkFWSUdBVElPTl9NT0RFX0RST1BET1dOX0xJU1R9PC9saT4KKyAgICAgKiA8bGk+e0BsaW5rICNOQVZJR0FUSU9OX01PREVfVEFCU308L2xpPgorICAgICAqIDxsaT57QGxpbmsgI05BVklHQVRJT05fTU9ERV9DVVNUT019PC9saT4KKyAgICAgKiA8L3VsPgorICAgICAqCisgICAgICogQHJldHVybiBUaGUgY3VycmVudCBuYXZpZ2F0aW9uIG1vZGUuCisgICAgICogCisgICAgICogQHNlZSAjc2V0U3RhbmRhcmROYXZpZ2F0aW9uTW9kZShDaGFyU2VxdWVuY2UpCisgICAgICogQHNlZSAjc2V0U3RhbmRhcmROYXZpZ2F0aW9uTW9kZShDaGFyU2VxdWVuY2UsIENoYXJTZXF1ZW5jZSkKKyAgICAgKiBAc2VlICNzZXREcm9wZG93bk5hdmlnYXRpb25Nb2RlKFNwaW5uZXJBZGFwdGVyKQorICAgICAqIEBzZWUgI3NldEN1c3RvbU5hdmlnYXRpb25Nb2RlKFZpZXcpCisgICAg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xlIHN0cmluZyB0byBzZXQKKyAgICAgICAgICogCisgICAgICAgICAqIEBzZWUgI3NldEN1c3RvbVZpZXcoVmlldykKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBhYnN0cmFjdCB2b2lkIHNldFRpdGxlKENoYXJTZXF1ZW5jZSB0aXRsZSk7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogU2V0IHRoZSBzdWJ0aXRsZSBvZiB0aGUgY29udGV4dCBtb2RlLiBUaGlzIG1ldGhvZCB3aWxsIGhhdmUgbm8gdmlzaWJsZSBlZmZlY3QgaWYKKyAgICAgICAgICogYSBjdXN0b20gdmlldyBoYXMgYmVlbiBzZXQuCisgICAgICAgICAqIAorICAgICAgICAgKiBAcGFyYW0gc3VidGl0bGUgU3VidGl0bGUgc3RyaW5nIHRvIHNldAorICAgICAgICAgKiAKKyAgICAgICAgICogQHNlZSAjc2V0Q3VzdG9tVmlldyhWaWV3KQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGFic3RyYWN0IHZvaWQgc2V0U3VidGl0bGUoQ2hhclNlcXVlbmNlIHN1YnRpdGxlKTsKKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBTZXQgYSBjdXN0b20gdmlldyBmb3IgdGhpcyBjb250ZXh0IG1vZGUuIFRoZSBjdXN0b20gdmlldyB3aWxsIHRha2UgdGhlIHBsYWNlIG9mCisgICAgICAgICAqIHRoZSB0aXRsZSBhbmQgc3VidGl0bGUuIFVzZWZ1bCBmb3IgdGhpbmdzIGxpa2Ugc2VhcmNoIGJveGVzLgorICAgICAgICAgKiAgCisgICAgICAgICAqIEBwYXJhbSB2aWV3IEN1c3RvbSB2aWV3IHRvIHVzZSBpbiBwbGFjZSBvZiB0aGUgdGl0bGUvc3VidGl0bGUuCisgICAgICAgICAqIAorICAgICAgICAgKiBAc2VlICNzZXRUaXRsZShDaGFyU2VxdWVuY2UpCisgICAgICAgICAqIEBzZWUgI3NldFN1YnRpdGxlKENoYXJTZXF1ZW5jZSkKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBhYnN0cmFjdCB2b2lkIHNldEN1c3RvbVZpZXcoVmlldyB2aWV3KTsKKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBJbnZhbGlkYXRlIHRoZSBjb250ZXh0IG1vZGUgYW5kIHJlZnJlc2ggbWVudSBjb250ZW50LiBUaGUgY29udGV4dCBtb2RlJ3MKKyAgICAgICAgICoge0BsaW5rIENvbnRleHRNb2RlQ2FsbGJhY2t9IHdpbGwgaGF2ZSBpdHMKKyAgICAgICAgICoge0BsaW5rIENvbnRleHRNb2RlQ2FsbGJhY2sjb25QcmVwYXJlQ29udGV4dE1vZGUoQ29udGV4dE1vZGUsIE1lbnUpfSBtZXRob2QgY2FsbGVkLgorICAgICAgICAgKiBJZiBpdCByZXR1cm5zIHRydWUgdGhlIG1lbnUgd2lsbCBiZSBzY2FubmVkIGZvciB1cGRhdGVkIGNvbnRlbnQgYW5kIGFueSByZWxldmFudCBjaGFuZ2VzCisgICAgICAgICAqIHdpbGwgYmUgcmVmbGVjdGVkIHRvIHRoZSB1c2VyLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGFic3RyYWN0IHZvaWQgaW52YWxpZGF0ZSgpOworICAgICAgICAKKyAgICAgICAgLyoqCisgICAgICAgICAqIEZpbmlzaCBhbmQgY2xvc2UgdGhpcyBjb250ZXh0IG1vZGUuIFRoZSBjb250ZXh0IG1vZGUncyB7QGxpbmsgQ29udGV4dE1vZGVDYWxsYmFja30gd2lsbAorICAgICAgICAgKiBoYXZlIGl0cyB7QGxpbmsgQ29udGV4dE1vZGVDYWxsYmFjayNvbkRlc3Ryb3lDb250ZXh0TW9kZShDb250ZXh0TW9kZSl9IG1ldGhvZCBjYWxsZWQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgYWJzdHJhY3Qgdm9pZCBmaW5pc2goKTsKKworICAgICAgICAvKioKKyAgICAgICAgICogUmV0dXJucyB0aGUgbWVudSBvZiBhY3Rpb25zIHRoYXQgdGhpcyBjb250ZXh0IG1vZGUgcHJlc2VudHMuCisgICAgICAgICAqIEByZXR1cm4gVGhlIGNvbnRleHQgbW9kZSdzIG1lbnUuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgYWJzdHJhY3QgTWVudSBnZXRNZW51KCk7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIENhbGxiYWNrIGludGVyZmFjZSBmb3IgQWN0aW9uQmFyIGNvbnRleHQgbW9kZXMuIFN1cHBsaWVkIHRvCisgICAgICoge0BsaW5rIEFjdGlvbkJhciNzdGFydENvbnRleHRNb2RlKENvbnRleHRNb2RlQ2FsbGJhY2spfSwgYSBDb250ZXh0TW9kZUNhbGxiYWNrCisgICAgICogY29uZmlndXJlcyBhbmQgaGFuZGxlcyBldmVudHMgcmFpc2VkIGJ5IGEgdXNlcidzIGludGVyYWN0aW9uIHdpdGggYSBjb250ZXh0IG1vZGUuCisgICAgICogCisgICAgICogPHA+QSBjb250ZXh0IG1vZGUncyBsaWZlY3ljbGUgaXMgYXMgZm9sbG93czoKKyAgICAgKiA8dWw+CisgICAgICogPGxpPntAbGluayBDb250ZXh0TW9kZUNhbGxiYWNrI29uQ3JlYXRlQ29udGV4dE1vZGUoQ29udGV4dE1vZGUsIE1lbnUpfSBvbmNlIG9uIGluaXRpYWwKKyAgICAgKiBjcmVhdGlvbjwvbGk+CisgICAgICogPGxpPntAbGluayBDb250ZXh0TW9kZUNhbGxiYWNrI29uUHJlcGFyZUNvbnRleHRNb2RlKENvbnRleHRNb2RlLCBNZW51KX0gYWZ0ZXIgY3JlYXRpb24KKyAgICAgKiBhbmQgYW55IHRpbWUgdGhlIHtAbGluayBDb250ZXh0TW9kZX0gaXMgaW52YWxpZGF0ZWQ8L2xpPgorICAgICAqIDxsaT57QGxpbmsgQ29udGV4dE1vZGVDYWxsYmFjayNvbkNvbnRleHRJdGVtQ2xpY2tlZChDb250ZXh0TW9kZSwg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1vZGUncyBhY3Rpb24gbWVudSB3aGVuZXZlciBpdCBpcyBpbnZhbGlkYXRlZC4KKyAgICAgICAgICogCisgICAgICAgICAqIEBwYXJhbSBtb2RlIENvbnRleHRNb2RlIGJlaW5nIHByZXBhcmVkCisgICAgICAgICAqIEBwYXJhbSBtZW51IE1lbnUgdXNlZCB0byBwb3B1bGF0ZSBjb250ZXh0dWFsIGFjdGlvbiBidXR0b25zCisgICAgICAgICAqIEByZXR1cm4gdHJ1ZSBpZiB0aGUgbWVudSBvciBjb250ZXh0IG1vZGUgd2FzIHVwZGF0ZWQsIGZhbHNlIG90aGVyd2lzZS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBib29sZWFuIG9uUHJlcGFyZUNvbnRleHRNb2RlKENvbnRleHRNb2RlIG1vZGUsIE1lbnUgbWVudSk7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogQ2FsbGVkIHRvIHJlcG9ydCBhIHVzZXIgY2xpY2sgb24gYSBjb250ZXh0dWFsIGFjdGlvbiBidXR0b24uCisgICAgICAgICAqIAorICAgICAgICAgKiBAcGFyYW0gbW9kZSBUaGUgY3VycmVudCBDb250ZXh0TW9kZQorICAgICAgICAgKiBAcGFyYW0gaXRlbSBUaGUgaXRlbSB0aGF0IHdhcyBjbGlja2VkCisgICAgICAgICAqIEByZXR1cm4gdHJ1ZSBpZiB0aGlzIGNhbGxiYWNrIGhhbmRsZWQgdGhlIGV2ZW50LCBmYWxzZSBpZiB0aGUgc3RhbmRhcmQgTWVudUl0ZW0KKyAgICAgICAgICogICAgICAgICAgaW52b2NhdGlvbiBzaG91bGQgY29udGludWUuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgYm9vbGVhbiBvbkNvbnRleHRJdGVtQ2xpY2tlZChDb250ZXh0TW9kZSBtb2RlLCBNZW51SXRlbSBpdGVtKTsKKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBDYWxsZWQgd2hlbiBhIGNvbnRleHQg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gICogQHNlZSBDdXJzb3IjcmVxdWVyeQotICAgICAqIEBoaWRlCi0gICAgICovCi0gICAgQERlcHJlY2F0ZWQKLSAgICBwdWJsaWMgdm9pZCBtYW5hZ2VkQ29tbWl0VXBkYXRlcyhDdXJzb3IgYykgewotICAgICAgICBzeW5jaHJvbml6ZWQgKG1NYW5hZ2VkQ3Vyc29ycykgewotICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtTWFuYWdlZEN1cnNvcnMuc2l6ZSgpOwotICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgewotICAgICAgICAgICAgICAgIE1hbmFnZWRDdXJzb3IgbWMgPSBtTWFuYWdlZEN1cnNvcnMuZ2V0KGkpOwotICAgICAgICAgICAgICAgIGlmIChtYy5tQ3Vyc29yID09IGMpIHsKLSAgICAgICAgICAgICAgICAgICAgYy5jb21taXRVcGRhdGVzKCk7Ci0gICAgICAgICAgICAgICAgICAgIG1jLm1VcGRhdGVkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKAotICAgICAgICAgICAgICAgICJDdXJzb3IgIiArIGMgKyAiIGlzIG5vdCBjdXJyZW50bHkgbWFuYWdlZCIpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqCiAgICAgICogVGhpcyBtZXRob2QgYWxsb3dzIHRoZSBhY3Rpdml0eSB0byB0YWtlIGNhcmUgb2YgbWFuYWdpbmcgdGhlIGdpdmVuCiAgICAgICoge0BsaW5rIEN1cnNvcn0ncyBsaWZlY3ljbGUgZm9yIHlvdSBiYXNlZCBvbiB0aGUgYWN0aXZpdHkncyBsaWZlY3ljbGUuCiAgICAgICogVGhhdCBpcywgd2hlbiB0aGUgYWN0aXZpdHkgaXMgc3RvcHBlZCBpdCB3aWxsIGF1dG9tYXRpY2FsbHkgY2F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FRoZSBmcmFnbWVudCBpZiBmb3VuZCBvciBudWxsIG90aGVyd2lzZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgRnJhZ21lbnQgZmluZEZyYWdtZW50QnlUYWcoU3RyaW5nIHRhZykgeworICAgICAgICByZXR1cm4gbUZyYWdtZW50cy5maW5kRnJhZ21lbnRCeVRhZyh0YWcpOworICAgIH0KKyAgICAKICAgICAvKioKICAgICAgKiBTZXQgdGhlIGFjdGl2aXR5IGNvbnRlbnQgZnJvbSBhIGxheW91dCByZXNvdXJjZS4gIFRoZSByZXNvdXJjZSB3aWxsIGJlCiAgICAgICogaW5mbGF0ZWQsIGFkZGluZyBhbGwgdG9wLWxldmVsIHZpZXdzIHRvIHRoZSBhY3Rpdml0eS4KQEAgLTE2NDQsNiArMTcxMSw3IEBACiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc2V0Q29udGVudFZpZXcoaW50IGxheW91dFJlc0lEKSB7CiAgICAgICAgIGdldFdpbmRvdygpLnNldENvbnRlbnRWaWV3KGxheW91dFJlc0lEKTsKKyAgICAgICAgaW5pdEFjdGlvbkJhcigpOwogICAgIH0KIAogICAgIC8qKgpAQCAtMTY1NSw2ICsxNzIzLDcgQEAKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBzZXRDb250ZW50VmlldyhWaWV3IHZpZXcpIHsKICAgICAgICAgZ2V0V2luZG93KCkuc2V0Q29udGVudFZpZXcodmlldyk7CisgICAgICAgIGluaXRBY3Rpb25CYXIoKTsKICAgICB9CiAKICAgICAvKioKQEAgLTE2NjcsNiArMTczNiw3IEBACiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc2V0Q29udGVudFZpZXcoVmlldyB2aWV3LCBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zIHBhcmFtcykgewogICAgICAgICBnZXRXaW5kb3coKS5zZXRDb250ZW50Vmlldyh2aWV3LCBwYXJhbXMpOworICAgICAgICBpbml0QWN0aW9uQmFyKCk7CiAgICAgfQogCiAgICAgL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ZVBhbmVsTWVudShpbnQgZmVhdHVyZUlkLCBNZW51IG1lbnUpIHsKICAgICAgICAgaWYgKGZlYXR1cmVJZCA9PSBXaW5kb3cuRkVBVFVSRV9PUFRJT05TX1BBTkVMKSB7Ci0gICAgICAgICAgICByZXR1cm4gb25DcmVhdGVPcHRpb25zTWVudShtZW51KTsKKyAgICAgICAgICAgIGJvb2xlYW4gc2hvdyA9IG9uQ3JlYXRlT3B0aW9uc01lbnUobWVudSk7CisgICAgICAgICAgICBzaG93IHw9IG1GcmFnbWVudHMuZGlzcGF0Y2hDcmVhdGVPcHRpb25zTWVudShtZW51LCBnZXRNZW51SW5mbGF0ZXIoKSk7CisgICAgICAgICAgICByZXR1cm4gc2hvdzsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgfQpAQCAtMjE2MSw2ICsyMjU0LDcgQEAKICAgICBwdWJsaWMgYm9vbGVhbiBvblByZXBhcmVQYW5lbChpbnQgZmVhdHVyZUlkLCBWaWV3IHZpZXcsIE1lbnUgbWVudSkgewogICAgICAgICBpZiAoZmVhdHVyZUlkID09IFdpbmRvdy5GRUFUVVJFX09QVElPTlNfUEFORUwgJiYgbWVudSAhPSBudWxsKSB7CiAgICAgICAgICAgICBib29sZWFuIGdvZm9yaXQgPSBvblByZXBhcmVPcHRpb25zTWVudShtZW51KTsKKyAgICAgICAgICAgIGdvZm9yaXQgfD0gbUZyYWdtZW50cy5kaXNwYXRjaFByZXBhcmVPcHRpb25zTWVudShtZW51KTsKICAgICAgICAgICAgIHJldHVybiBnb2Zvcml0ICYmIG1lbnUuaGFzVmlzaWJsZUl0ZW1zKCk7CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHRydWU7CkBAIC0yMTkxLDExICsyMjg1LDE3IEBACiAgICAgICAgICAgICAgICAgLy8gZG9lc24ndCBjYWxsIHRocm91Z2ggdG8gc3VwZXJjbGFzcydzIGltcGxtZWVudGF0aW9uIG9mIGVhY2gKICAgICAgICAgICAgICAgICAvLyBvZiB0aGVzZSBtZXRob2RzIGJlbG93CiAgICAgICAgICAgICAgICAgRXZlbnRMb2cud3JpdGVFdmVudCg1MDAwMCwgMCwgaXRlbS5nZXRUaXRsZUNvbmRlbnNlZCgpKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gb25PcHRpb25zSXRlbVNlbGVjdGVkKGl0ZW0pOworICAgICAgICAgICAgICAgIGlmIChvbk9wdGlvbnNJdGVtU2VsZWN0ZWQoaXRlbSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBtRnJhZ21lbnRzLmRpc3BhdGNoT3B0aW9uc0l0ZW1TZWxlY3RlZChpdGVtKTsKICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgIGNhc2UgV2luZG93LkZFQVRVUkVfQ09OVEVYVF9NRU5VOgogICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoNTAwMDAsIDEsIGl0ZW0uZ2V0VGl0bGVDb25kZW5zZWQoKSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG9uQ29udGV4dEl0ZW1TZWxlY3RlZChpdGVtKTsKKyAgICAgICAgICAgICAgICBpZiAob25Db250ZXh0SXRlbVNlbGVjdGVkKGl0ZW0pKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gbUZyYWdtZW50cy5kaXNwYXRjaENvbnRleHRJdGVtU2VsZWN0ZWQoaXRlbSk7CiAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKQEAgLTIyMTQsNiArMjMxNCw3IEBACiAgICAgcHVibGljIHZvaWQgb25QYW5lbENsb3NlZChpbnQgZmVhdHVyZUlkLCBNZW51IG1lbnUpIHsKICAgICAgICAgc3dpdGNoIChmZWF0dXJlSWQpIHsKICAgICAgICAgICAgIGNhc2UgV2luZG93LkZFQVRVUkVfT1BUSU9OU19QQU5FTDoKKyAgICAgICAgICAgICAgICBtRnJhZ21lbnRzLmRpc3BhdGNoT3B0aW9uc01lbnVDbG9zZWQobWVudSk7CiAgICAgICAgICAgICAgICAgb25PcHRpb25zTWVudUNsb3NlZChtZW51KTsKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAKQEAgLTIyMjQsNiArMjMyNSwxNSBAQAogICAgIH0KIAogICAgIC8qKgorICAgICAqIERlY2xhcmUgdGhhdCB0aGUgb3B0aW9ucyBtZW51IGhhcyBjaGFuZ2VkLCBzbyBzaG91bGQgYmUgcmVjcmVhdGVkLgorICAgICAqIFRoZSB7QGxpbmsgI29uQ3JlYXRlT3B0aW9uc01lbnUoTWVudSl9IG1ldGhvZCB3aWxsIGJlIGNhbGxlZCB0aGUgbmV4dAorICAgICAqIHRpbWUgaXQgbmVlZHMgdG8gYmUgZGlzcGxheWVkLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGludmFsaWRhdGVPcHRpb25zTWVudSgpIHsKKyAgICAgICAgbVdpbmRvdy5pbnZhbGlkYXRlUGFuZWxNZW51KFdpbmRvdy5GRUFUVVJFX09QVElPTlNfUEFORUwpOworICAgIH0KKyAgICAKKyAgICAvKioKICAgICAgKiBJbml0aWFsaXplIHRoZSBjb250ZW50cyBvZiB0aGUgQWN0aXZpdHkncyBzdGFuZGFyZCBvcHRpb25zIG1lbnUuICBZb3UKICAgICAgKiBzaG91bGQgcGxhY2UgeW91ciBtZW51IGl0ZW1zIGluIHRvIDx2YXI+bWVudTwvdmFyPi4KICAgICAgKiAKQEAgLTMwNjUsNiArMzE3NSwzNiBAQAogICAgIH0KIAogICAgIC8qKgorICAgICAqIFRoaXMgaXMgY2FsbGVkIHdoZW4gYSBGcmFnbWVudCBpbiB0aGlzIGFjdGl2aXR5IGNhbGxzIGl0cyAKKyAgICAgK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bmcgYSBuZXcgb25lLgorICAgICAgICAgICAgRnJhZ21lbnQgZnJhZ21lbnQgPSBtRnJhZ21lbnRzLmZpbmRGcmFnbWVudEJ5SWQoaWQpOworICAgICAgICAgICAgaWYgKEZyYWdtZW50TWFuYWdlci5ERUJVRykgTG9nLnYoVEFHLCAib25DcmVhdGVWaWV3OiBpZD0weCIKKyAgICAgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGlkKSArICIgZm5hbWU9IiArIGZuYW1lCisgICAgICAgICAgICAgICAgICAgICsgIiBleGlzdGluZz0iICsgZnJhZ21lbnQpOworICAgICAgICAgICAgaWYgKGZyYWdtZW50ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmcmFnbWVudCA9IEZyYWdtZW50Lmluc3RhbnRpYXRlKHRoaXMsIGZuYW1lKTsKKyAgICAgICAgICAgICAgICBmcmFnbWVudC5tRnJvbUxheW91dCA9IHRydWU7CisgICAgICAgICAgICAgICAgZnJhZ21lbnQubUZyYWdtZW50SWQgPSBpZDsKKyAgICAgICAgICAgICAgICBmcmFnbWVudC5tVGFnID0gdGFnOworICAgICAgICAgICAgICAgIGZyYWdtZW50Lm1JbW1lZGlhdGVBY3Rpdml0eSA9IHRoaXM7CisgICAgICAgICAgICAgICAgbUZyYWdtZW50cy5hZGRGcmFnbWVudChmcmFnbWVudCwgdHJ1ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBJZiB0aGlzIGZyYWdtZW50IGlzIG5ld2x5IGluc3RhbnRpYXRlZCAoZWl0aGVyIHJpZ2h0IG5vdywgb3IKKyAgICAgICAgICAgIC8vIGZyb20gbGFzdCBzYXZlZCBzdGF0ZSksIHRoZW4gZ2l2ZSBpdCB0aGUgYXR0cmlidXRlcyB0bworICAgICAgICAgICAgLy8gaW5pdGlhbGl6ZSBpdHNlbGYuCisgICAgICAgICAgICBpZiAoIWZyYWdtZW50Lm1SZXRhaW5pbmcpIHsKKyAgICAgICAgICAgICAgICBmcmFnbWVudC5vbkluZmxhdGUodGhpcywgYXR0cnMsIGZyYWdtZW50Lm1TYXZlZEZyYWdtZW50U3RhdGUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGZyYWdtZW50Lm1WaWV3ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZm5hbWUKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkaWQgbm90IGNyZWF0ZSBhIHZpZXcuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmcmFnbWVudC5tVmlldy5zZXRJZChpZCk7CisgICAgICAgICAgICBpZiAoZnJhZ21lbnQubVZpZXcuZ2V0VGFnKCkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZyYWdtZW50Lm1WaWV3LnNldFRhZyh0YWcpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGZyYWdtZW50Lm1WaWV3OworICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgSW5mbGF0ZUV4Y2VwdGlvbiBpZSA9IG5ldyBJbmZsYXRlRXhjZXB0aW9uKGF0dHJzLmdldFBvc2l0aW9uRGVzY3JpcHRpb24oKQorICAgICAgICAgICAgICAgICAgICArICI6IEVycm9yIGluZmxhdGluZyBmcmFnbWVudCAiICsgZm5hbWUpOworICAgICAgICAgICAgaWUuaW5pdENhdXNlKGUpOworICAgICAgICAgICAgdGhyb3cgaWU7CisgICAgICAgIH0KICAgICB9CiAKICAgICAvKioKQEAgLTM3NjcsMjMgKzM5NzMsMjUgQEAKIAogICAgIGZpbmFsIHZvaWQgYXR0YWNoKENvbnRleHQgY29udGV4dCwgQWN0aXZpdHlUaHJlYWQgYVRocmVhZCwgSW5zdHJ1bWVudGF0aW9uIGluc3RyLCBJQmluZGVyIHRva2VuLAogICAgICAgICAgICAgQXBwbGljYXRpb24gYXB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luc3RhbmNlcyA9IGxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzOwogCiAgICAgICAgIG1XaW5kb3cuc2V0V2luZG93TWFuYWdlcihudWxsLCBtVG9rZW4sIG1Db21wb25lbnQuZmxhdHRlblRvU3RyaW5nKCkpOwogICAgICAgICBpZiAobVBhcmVudCAhPSBudWxsKSB7CkBAIC0zODE1LDE0ICs0MDIyLDIwIEBACiAgICAgICAgIHJldHVybiBtUGFyZW50ICE9IG51bGwgPyBtUGFyZW50LmdldEFjdGl2aXR5VG9rZW4oKSA6IG1Ub2tlbjsKICAgICB9CiAKKyAgICBmaW5hbCB2b2lkIHBlcmZvcm1DcmVhdGUoQnVuZGxlIGljaWNsZSkgeworICAgICAgICBvbkNyZWF0ZShpY2ljbGUpOworICAgIH0KKyAgICAKICAgICBmaW5hbCB2b2lkIHBlcmZvcm1TdGFydCgpIHsKICAgICAgICAgbUNhbGxlZCA9IGZhbHNlOworICAgICAgICBtRnJhZ21lbnRzLmV4ZWNQZW5kaW5nQWN0aW9ucygpOwogICAgICAgICBtSW5zdHJ1bWVudGF0aW9uLmNhbGxBY3Rpdml0eU9uU3RhcnQodGhpcyk7CiAgICAgICAgIGlmICghbUNhbGxlZCkgewogICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKAogICAgICAgICAgICAgICAgICJBY3Rpdml0eSAiICsgbUNvbXBvbmVudC50b1Nob3J0U3RyaW5nKCkgKwogICAgICAgICAgICAgICAgICIgZGlkIG5vdCBjYWxsIHRocm91Z2ggdG8gc3VwZXIub25TdGFydCgpIik7CiAgICAgICAgIH0KKyAgICAgICAgbUZyYWdtZW50cy5kaXNwYXRjaFN0YXJ0KCk7CiAgICAgfQogICAgIAogICAgIGZpbmFsIHZvaWQgcGVyZm9ybVJlc3RhcnQoKSB7CkBAIC0zODU0LDcgKzQwNjcsOSBAQAogICAgIGZpbmFsIHZvaWQgcGVyZm9ybVJlc3VtZSgpI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NDExMiw4IEBACiAgICAgICAgICAgICAgICAgbVdpbmRvdy5jbG9zZUFsbFBhbmVscygpOwogICAgICAgICAgICAgfQogCisgICAgICAgICAgICBtRnJhZ21lbnRzLmRpc3BhdGNoU3RvcCgpOworICAgICAgICAgICAgCiAgICAgICAgICAgICBtQ2FsbGVkID0gZmFsc2U7CiAgICAgICAgICAgICBtSW5zdHJ1bWVudGF0aW9uLmNhbGxBY3Rpdml0eU9uU3RvcCh0aGlzKTsKICAgICAgICAgICAgIGlmICghbUNhbGxlZCkgewpAQCAtMzkxNiw2ICs0MTM4LDExIEBACiAgICAgICAgIG1SZXN1bWVkID0gZmFsc2U7CiAgICAgfQogCisgICAgZmluYWwgdm9pZCBwZXJmb3JtRGVzdHJveSgpIHsKKyAgICAgICAgbUZyYWdtZW50cy5kaXNwYXRjaERlc3Ryb3koKTsKKyAgICAgICAgb25EZXN0cm95KCk7CisgICAgfQorICAgIAogICAgIGZpbmFsIGJvb2xlYW4gaXNSZXN1bWVkKCkgewogICAgICAgICByZXR1cm4gbVJlc3VtZWQ7CiAgICAgfQpAQCAtMzkyNyw2ICs0MTU0LDExIEBACiAgICAgICAgICAgICArICIsIHJlc0NvZGU9IiArIHJlc3VsdENvZGUgKyAiLCBkYXRhPSIgKyBkYXRhKTsKICAgICAgICAgaWYgKHdobyA9PSBudWxsKSB7CiAgICAgICAgICAgICBvbkFjdGl2aXR5UmVzdWx0KHJlcXVlc3RDb2RlLCByZXN1bHRDb2RlLCBkYXRhKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIEZyYWdtZW50IGZyYWcgPSBtRnJhZ21lbnRzLmZpbmRGcmFnbWVudEJ5V2hvKHdobyk7CisgICAgICAgICAgICBpZiAoZnJhZyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZnJhZy5vbkFjdGl2aXR5UmVzdWx0KHJlcXVlc3RDb2RlLCByZXN1bHRDb2RlLCBkYXRhKTsKKyAgICAgICAgICAgIH0KICAgICAgIC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XRzLmdldChpKTsKICAgICAgICAgICAgICAgICAgICAgcHJpbnRSb3cocHcsIERCX0lORk9fRk9STUFULCBkYlN0YXRzLnBhZ2VTaXplLCBkYlN0YXRzLmRiU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYlN0YXRzLmxvb2thc2lkZSwgZGJTdGF0cy5kYk5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRiU3RhdHMubG9va2FzaWRlLCBkYlN0YXRzLmNhY2hlLCBkYlN0YXRzLmRiTmFtZSk7CiAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCcsJyk7CiAgICAgICAgICAgICAgICAgfQogCkBAIC04MTEsMTEgKzgxMSwxMiBAQAogICAgICAgICAgICAgaW50IE4gPSBzdGF0cy5kYlN0YXRzLnNpemUoKTsKICAgICAgICAgICAgIGlmIChOID4gMCkgewogICAgICAgICAgICAgICAgIHB3LnByaW50bG4oIiBEQVRBQkFTRVMiKTsKLSAgICAgICAgICAgICAgICBwcmludFJvdyhwdywgIiAgJThzICU4cyAlMTBzICAlcyIsICJQYWdlc2l6ZSIsICJEYnNpemUiLCAiTG9va2FzaWRlIiwgIkRibmFtZSIpOworICAgICAgICAgICAgICAgIHByaW50Um93KHB3LCAiICAlNHMgJTZzICU4cyAlMTRzICAlcyIsICJwZ3N6IiwgImRic3oiLCAibGthc2lkZSIsICJjYWNoZSIsCisgICAgICAgICAgICAgICAgICAgICJEYm5hbWUiKTsKICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47IGkrKykgewogICAgICAgICAgICAgICAgICAgICBEYlN0YXRzIGRiU3RhdHMgPSBzdGF0cy5kYlN0YXRzLmdldChpKTsKICAgICAgICAgICAgICAgICAgICAgcHJpbnRSb3cocHcsIERCX0lORk9fRk9STUFULCBkYlN0YXRzLnBhZ2VTaXplLCBkYlN0YXRzLmRiU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYlN0YXRzLmxvb2thc2lkZSwgZGJTdGF0cy5kYk5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRiU3RhdHMubG9va2FzaWRlLCBkYlN0YXRzLmNhY2hlLCBkYlN0YXRzLmRiTmFtZSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCkBAIC0xMDQxLDggKzEwNDIsMjcgQEAKIAogICAgICAgICB2b2lkIG1heWJlU25hcHNob3QoKSB7CiAgICAgICAgICAgICBpZiAobUJvdW5kQXBwbGljYXRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIFNhbXBsaW5nUHJvZmlsZXJJbnRlZ3JhdGlvbi53cml0ZVNuYXBzaG90KAotICAgICAgICAgICAgICAgICAgICAgICAgbUJvdW5kQXBwbGljYXRpb24ucHJvY2Vzc05hbWUpOworICAgICAgICAgICAgICAgIC8vIGNvbnZlcnQgdGhlICpwcml2YXRlKiBBY3Rpdml0eVRocmVhZC5QYWNrYWdlSW5mbyB0byAqcHVibGljKiBrbm93bgorICAgICAgICAgICAgICAgIC8vIGFuZHJvaWQuY29udGVudC5wbS5QYWNrYWdlSW5mbworICAgICAgICAgICAgICAgIFN0cmluZyBwYWNrYWdlTmFtZSA9IG1Cb3VuZEFwcGxpY2F0aW9uLmluZm8ubVBhY2thZ2VOYW1lOworICAgICAgICAgICAgICAgIGFuZHJvaWQuY29udGVudC5wbS5QYWNrYWdlSW5mbyBwYWNrYWdlSW5mbyA9IG51bGw7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgQ29udGV4dCBjb250ZXh0ID0gZ2V0U3lzdGVtQ29udGV4dCgpOworICAgICAgICAgICAgICAgICAgICBpZihjb250ZXh0ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImNhbm5vdCBnZXQgYSB2YWxpZCBjb250ZXh0Iik7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgUGFja2FnZU1hbmFnZXIgcG0gPSBjb250ZXh0LmdldFBhY2thZ2VNYW5hZ2VyKCk7CisgICAgICAgICAgICAgICAgICAgIGlmKHBtID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImNhbm5vdCBnZXQgYSB2YWxpZCBQYWNrYWdlTWFuYWdlciIpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHBhY2thZ2VJbmZvID0gcG0uZ2V0UGFja2FnZUluZm8oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2FnZU5hbWUsIFBhY2thZ2VNYW5hZ2VyLkdFVF9BQ1RJVklUSUVTKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChOYW1lTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJjYW5ub3QgZ2V0IHBhY2thZ2UgaW5mbyBmb3IgIiArIHBhY2thZ2VOYW1lLCBlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgU2FtcGxpbmdQcm9maWxlckludGVncmF0aW9uLndyaXRlU25hcHNob3QobUJvdW5kQXBwbGljYXRpb24ucHJvY2Vzc05hbWUsIHBhY2thZ2VJbmZvKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KQEAgLTE0MzMsNyArMTQ1Myw3IEBACiAKICAgICBwdWJsaWMgZmluYWwgQWN0aXZpdHkgc3RhcnRBY3Rpdml0eU5vdyhBY3Rpdml0eSBwYXJlbnQsIFN0cmluZyBpZCwKICAgICAgICAgSW50ZW50IGludGVudCwgQWN0aXZpdHlJbmZvIGFjdGl2aXR5SW5mbywgSUJpbmRlciB0b2tlbiwgQnVuZGxlIHN0YXRlLAotICAgICAgICBPYmplY3QgbGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZSkgeworICAgICAgICBBY3Rpdml0eS5Ob25Db25maWd1cmF0aW9uSW5zdGFuY2VzIGxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzKSB7CiAgICAgICAgIEFjdGl2aXR5Q2xpZW50UmVjb3JkIHIgPSBuZXcgQWN0aXZpdHlDbGllbnRSZWNvcmQoKTsKICAgICAgICAgICAgIHIudG9rZW4gPSB0b2tlbjsKICAgICAgICAgICAgIHIuaWRlbnQgPSAwOwpAQCAtMTQ0Miw3ICsxNDYyLDcgQEAKICAgICAgICAgICAgIHIucGFyZW50ID0gcGFyZW50OwogICAgICAgICAgICAgci5lbWJlZGRlZElEID0gaWQ7CiAgICAgICAgICAgICByLmFjdGl2aXR5SW5mbyA9IGFjdGl2aXR5SW5mbzsKLSAgICAgICAgICAgIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZSA9IGxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2U7CisgICAgICAgICAgICByLmxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzID0gbGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZXM7CiAgICAgICAgIGlmIChsb2NhbExPR1YpIHsKICAgICAgICAgICAgIENvbXBvbmVudE5hbWUgY29tcG5hbWUgPSBpbnRlbnQuZ2V0Q29tcG9uZW50KCk7CiAgICAgICAgICAgICBTdHJpbmcgbmFtZTsKQEAgLTE1NjQsMTQgKzE1ODQsMTIgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICsgci5hY3Rpdml0eUluZm8ubmFtZSArICIgd2l0aCBjb25maWcgIiArIGNvbmZpZyk7CiAgICAgICAgICAgICAgICAgYWN0aXZpdHkuYXR0YWNoKGFwcENvbnRleHQsIHRoaXMsIGdldEluc3RydW1lbnRhdGlvbigpLCByLnRva2VuLAogICAgICAgICAgICAgICAgICAgICAgICAgci5pZGVudCwgYXBwLCByLmludGVudCwgci5hY3Rpdml0eUluZm8sIHRpdGxlLCByLnBhcmVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHIuZW1iZWRkZWRJRCwgci5sYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgci5sYXN0Tm9uQ29uZmlndXJhdGlvbkNoaWxkSW5zdGFuY2VzLCBjb25maWcpOworICAgICAgICAgICAgICAgICAgICAgICAgci5lbWJlZGRlZElELCByLmxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzLCBjb25maWcpOwogCiAgICAgICAgICAgICAgICAgaWYgKGN1c3RvbUludGVudCAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIGFjdGl2aXR5Lm1JbnRlbnQgPSBjdXN0b21JbnRlbnQ7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZSA9IG51bGw7Ci0gICAgICAgICAgICAgICAgci5sYXN0Tm9uQ29uZmlndXJhdGlvbkNoaWxkSW5zdGFuY2VzID0gbnVsbDsKKyAgICAgICAgICAgICAgICByLmxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzID0gbnVsbDsKICAgICAgICAgICAgICAgICBhY3Rpdml0eS5tU3RhcnRlZEFjdGl2aXR5ID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgaW50IHRoZW1lID0gci5hY3Rpdml0eUluZm8uZ2V0VGhlbWVSZXNvdXJjZSgpOwogICAgICAgICAgICAgICAgIGlmICh0aGVtZSAhPSAwKSB7CkBAIC0yNTI5LDYgKzI1NDcsOSBAQAogICAgICAgICAgICAgaWYgKGZpbmlzaGluZykgewogICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkubUZpbmlzaGVkID0gdHJ1ZTsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChnZXROb25Db25maWdJbnN0YW5jZSkgeworICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkubUNoYW5naW5nQ29uZmlndXJhdGlvbnMgPSB0cnVlOworICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKCFyLnBhdXNlZCkgewogICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkubUNhbGxlZCA9IGZhbHNlOwpAQCAtMjU2OSw4ICsyNTkwLDggQEAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChnZXROb25Db25maWdJbnN0YW5jZSkgewogICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gci5hY3Rpdml0eS5vblJldGFpbk5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZSgpOworICAgICAgICAgICAgICAgICAgICByLmxhc3ROb25Db25maWd1cmF0aW9uSW5zdGFuY2VzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSByLmFjdGl2aXR5LnJldGFpbk5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZXMoKTsKICAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICBpZiAoIW1JbnN0cnVtZW50YXRpb24ub25FeGNlcHRpb24oci5hY3Rpdml0eSwgZSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKApAQCAtMjU3OSwyMiArMjYwMCwxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICI6ICIgKyBlLnRvU3RyaW5nKCksIGUpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIHIubGFzdE5vbkNvbmZpZ3VyYXRpb25DaGlsZEluc3RhbmNlcwotICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gci5hY3Rpdml0eS5vblJldGFpbk5vbkNvbmZpZ3VyYXRpb25DaGlsZEluc3RhbmNlcygpOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghbUluc3RydW1lbnRhdGlvbi5vbkV4Y2VwdGlvbihyLmFjdGl2aXR5LCBlKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJVbmFibGUgdG8gcmV0YWluIGNoaWxkIGFjdGl2aXRpZXMgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHNhZmVUb0NvbXBvbmVudFNob3J0U3RyaW5nKHIuaW50ZW50KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICI6ICIgKyBlLnRvU3RyaW5nKCksIGUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCiAgICAgICAgICAgICB9CiAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkubUNhbGxlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIHIuYWN0aXZpdHkub25EZXN0cm95KCk7CisgICAgICAgICAgICAgICAgbUluc3RydW1lbnRhdGlvbi5jYWxsQWN0aXZpdHlPbkRlc3Ryb3koci5hY3Rpdml0eSk7CiAgICAgICAgICAgICAgICAgaWYgKCFyLmFjdGl2aXR5Lm1DYWxsZWQpIHsKICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKAogICAgICAgICAgICAgICAgICAgICAgICAgIkFjdGl2aXR5ICIgKyBzYWZlVG9Db21wb25lbnRTaG9ydFN0cmluZyhyLmludGVudCkgKwpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvYXBwL0JhY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5lbnRlckFuaW07CisgICAgICAgICAgICBtT3BzW3BvcysrXSA9IG9wLmV4aXRBbmltOworICAgICAgICAgICAgaWYgKG9wLnJlbW92ZWQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZpbmFsIGludCBOID0gb3AucmVtb3ZlZC5zaXplKCk7CisgICAgICAgICAgICAgICAgbU9wc1twb3MrK10gPSBOOworICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgbU9wc1twb3MrK10gPSBvcC5yZW1vdmVkLmdldChpKS5tSW5kZXg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtT3BzW3BvcysrXSA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBvcCA9IG9wLm5leHQ7CisgICAgICAgIH0KKyAgICAgICAgbVRyYW5zaXRpb24gPSBic2UubVRyYW5zaXRpb247CisgICAgICAgIG1UcmFuc2l0aW9uU3R5bGUgPSBic2UubVRyYW5zaXRpb25TdHlsZTsKKyAgICAgICAgbU5hbWUgPSBic2UubU5hbWU7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBCYWNrU3RhY2tTdGF0ZShQYXJjZWwgaW4pIHsKKyAgICAgICAgbU9wcyA9IGluLmNyZWF0ZUludEFycmF5KCk7CisgICAgICAgIG1UcmFuc2l0aW9uID0gaW4ucmVhZEludCgpOworICAgICAgICBtVHJhbnNpdGlvblN0eWxlID0gaW4ucmVhZEludCgpOworICAgICAgICBtTmFtZSA9IGluLnJlYWRTdHJpbmcoKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIEJhY2tTdGFja0VudHJ5IGluc3RhbnRpYXRlKEZyYWdtZW50TWFuYWdlciBmbSkgeworICAgICAgICBCYWNrU3RhY2tFbnRyeSBic2UgPSBuZXcgQmFja1N0YWNrRW50cnkoZm0pOworICAgICAgICBpbnQgcG9zID0gMDsKKyAgICAgICAgd2hpbGUgKHBvcyA8IG1PcHMubGVuZ3RoKSB7CisgICAgICAgICAgICBCYWNrU3RhY2tFbnRyeS5PcCBvcCA9IG5ldyBCYWNrU3RhY2tFbnRyeS5PcCgpOworICAgICAgICAgICAgb3AuY21kID0gbU9wc1twb3MrK107CisgICAgICAgICAgICBGcmFnbWVudCBmID0gZm0ubUFjdGl2ZS5nZXQobU9wc1twb3MrK10pOworICAgICAgICAgICAgZi5tQmFja1N0YWNrTmVzdGluZysrOworICAgICAgICAgICAgb3AuZnJhZ21lbnQgPSBmOworICAgICAgICAgICAgb3AuZW50ZXJBbmltID0gbU9wc1twb3MrK107CisgICAgICAgICAgICBvcC5leGl0QW5pbSA9IG1PcHNbcG9zKytdOworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtT3BzW3BvcysrXTsKKyAgICAgICAgICAgIGlmIChOID4gMCkgeworICAgICAgICAgICAgICAgIG9wLnJlbW92ZWQgPSBuZXcgQXJyYXlMaXN0PEZyYWdtZW50PihOKTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIG9wLnJlbW92ZWQuYWRkKGZtLm1BY3RpdmUuZ2V0KG1PcHNbcG9zKytdKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnNlLmFkZE9wKG9wKTsKKyAgICAgICAgfQorICAgICAgICBic2UubVRyYW5zaXRpb24gPSBtVHJhbnNpdGlvbjsKKyAgICAgICAgYnNlLm1UcmFuc2l0aW9uU3R5bGUgPSBtVHJhbnNpdGlvblN0eWxlOworICAgICAgICBic2UubU5hbWUgPSBtTmFtZTsKKyAgICAgICAgcmV0dXJuIGJzZTsKKyAgICB9CisgICAgCisgICAgcHVibGljIGludCBkZXNjcmliZUNvbnRlbnRzKCkgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB3cml0ZVRvUGFyY2VsKFBhc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RhdGljIGZpbmFsIGludCBPUF9BREQgPSAxOworICAgIHN0YXRpYyBmaW5hbCBpbnQgT1BfUkVQTEFDRSA9IDI7CisgICAgc3RhdGljIGZpbmFsIGludCBPUF9SRU1PVkUgPSAzOworICAgIHN0YXRpYyBmaW5hbCBpbnQgT1BfSElERSA9IDQ7CisgICAgc3RhdGljIGZpbmFsIGludCBPUF9TSE9XID0gNTsKKyAgICAKKyAgICBzdGF0aWMgZmluYWwgY2xhc3MgT3AgeworICAgICAgICBPcCBuZXh0OworICAgICAgICBPcCBwcmV2OworICAgICAgICBpbnQgY21kOworICAgICAgICBGcmFnbWVudCBmcmFnbWVudDsKKyAgICAgICAgaW50IGVudGVyQW5pbTsKKyAgICAgICAgaW50IGV4aXRBbmltOworICAgICAgICBBcnJheUxpc3Q8RnJhZ21lbnQ+IHJlbW92ZWQ7CisgICAgfQorICAgIAorICAgIE9wIG1IZWFkOworICAgIE9wIG1UYWlsOworICAgIGludCBtTnVtT3A7CisgICAgaW50IG1FbnRlckFuaW07CisgICAgaW50IG1FeGl0QW5pbTsKKyAgICBpbnQgbVRyYW5zaXRpb247CisgICAgaW50IG1UcmFuc2l0aW9uU3R5bGU7CisgICAgYm9vbGVhbiBtQWRkVG9CYWNrU3RhY2s7CisgICAgU3RyaW5nIG1OYW1lOworICAgIGJvb2xlYW4gbUNvbW1pdHRlZDsKKyAgICAKKyAgICBwdWJsaWMgQmFja1N0YWNrRW50cnkoRnJhZ21lbnRNYW5hZ2VyIG1hbmFnZXIpIHsKKyAgICAgICAgbU1hbmFnZXIgPSBtYW5hZ2VyOworICAgIH0KKyAgICAKKyAgICB2b2lkIGFkZE9wKE9wIG9wKSB7CisgICAgICAgIGlmIChtSGVhZCA9PSBudWxsKSB7CisgICAgICAgICAgICBtSGVhZCA9IG1UYWlsID0gb3A7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBvcC5wcmV2ID0gbVRhaWw7CisgICAgICAgICAgICBtVGFpbC5uZXh0ID0gb3A7CisgICAgICAgICAgICBtVGFpbCA9IG9wOworICAgICAgICB9CisgICAgICAgIG9wLmVudGVyQW5pbSA9IG1FbnRlckFuaW07CisgICAgICAgIG9wLmV4aXRBbmltID0gbUV4aXRBbmltOworICAgICAgICBtTnVtT3ArKzsKKyAgICB9CisgICAgICAgIAorICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIGFkZChGcmFnbWVudCBmcmFnbWVudCwgU3RyaW5nIHRhZykgeworICAgICAgICBkb0FkZE9wKDAsIGZyYWdtZW50LCB0YWcsIE9QX0FERCk7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIGFkZChpbnQgY29udGFpbmVyVmlld0lkLCBGcmFnbWVudCBmcmFnbWVudCkgeworICAgICAgICBkb0FkZE9wKGNvbnRhaW5lclZpZXdJZCwgZnJhZ21lbnQsIG51bGwsIE9QX0FERCk7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIGFkZChpbnQgY29udGFpbmVyVmlld0lkLCBGcmFnbWVudCBmcmFnbWVudCwgU3RyaW5nIHRhZykgeworICAgICAgICBkb0FkZE9wKGNvbnRhaW5lclZpZXdJZCwgZnJhZ21lbnQsIHRhZywgT1BfQUREKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGRvQWRkT3AoaW50IGNvbnRhaW5lclZpZXdJZCwgRnJhZ21lbnQgZnJhZ21lbnQsIFN0cmluZyB0YWcsIGludCBvcGNtZCkgeworICAgICAgICBpZiAoZnJhZ21lbnQubUltbWVkaWF0ZUFjdGl2aXR5ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkZyYWdtZW50IGFscmVhZHkgYWRkZWQ6ICIgKyBmcmFnbWVudCk7CisgICAgICAgIH0KKyAgICAgICAgZnJhZ21lbnQubUltbWVkaWF0ZUFjdGl2aXR5ID0gbU1hbmFnZXIubUFjdGl2aXR5OworICAgICAgICAKKyAgICAgICAgaWYgKHRhZyAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAoZnJhZ21lbnQubVRhZyAhPSBudWxsICYmICF0YWcuZXF1YWxzKGZyYWdtZW50Lm1UYWcpKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiQ2FuJ3QgY2hhbmdlIHRhZyBvZiBmcmFnbWVudCAiCisgICAgICAgICAgICAgICAgICAgICAgICArIGZyYWdtZW50ICsgIjogd2FzICIgKyBmcmFnbWVudC5tVGFnCisgICAgICAgICAgICAgICAgICAgICAgICArICIgbm93ICIgKyB0YWcpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZnJhZ21lbnQubVRhZyA9IHRhZzsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKGNvbnRhaW5lclZpZXdJZCAhPSAwKSB7CisgICAgICAgICAgICBpZiAoZnJhZ21lbnQubUZyYWdtZW50SWQgIT0gMCAmJiBmcmFnbWVudC5tRnJhZ21lbnRJZCAhPSBjb250YWluZXJWaWV3SWQpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJDYW4ndCBjaGFuZ2UgY29udGFpbmVyIElEIG9mIGZyYWdtZW50ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgZnJhZ21lbnQgKyAiOiB3YXMgIiArIGZyYWdtZW50Lm1GcmFnbWVudElkCisgICAgICAgICAgICAgICAgICAgICAgICArICIgbm93ICIgKyBjb250YWluZXJWaWV3SWQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZnJhZ21lbnQubUNvbnRhaW5lcklkID0gZnJhZ21lbnQubUZyYWdtZW50SWQgPSBjb250YWluZXJWaWV3SWQ7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIE9wIG9wID0gbmV3IE9wKCk7CisgICAgICAgIG9wLmNtZCA9IG9wY21kOworICAgICAgICBvcC5mcmFnbWVudCA9IGZyYWdtZW50OworICAgICAgICBhZGRPcChvcCk7CisgICAgfQorCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gcmVwbGFjZShpbnQgY29udGFpbmVyVmlld0lkLCBGcmFnbWVudCBmcmFnbWVudCkgeworICAgICAgICByZXR1cm4gcmVwbGFjZShjb250YWluZXJWaWV3SWQsIGZyYWdtZW50LCBudWxsKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gcmVwbGFjZShpbnQgY29udGFpbmVyVmlld0lkLCBGcmFnbWVudCBmcmFnbWVudCwgU3RyaW5nIHRhZykgeworICAgICAgICBpZiAoY29udGFpbmVyVmlld0lkID09IDApIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIk11c3QgdXNlIG5vbi16ZXJvIGNvbnRhaW5lclZpZXdJZCIpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBkb0FkZE9wKGNvbnRhaW5lclZpZXdJZCwgZnJhZ21lbnQsIHRhZywgT1BfUkVQTEFDRSk7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgRnJhZ21lbnRUcmFuc2FjdGlvbiByZW1vdmUoRnJhZ21lbnQgZnJhZ21lbnQpIHsKKyAgICAgICAgaWYgKGZyYWdtZW50Lm1JbW1lZGlhdGVBY3Rpdml0eSA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJGcmFnbWVudCBub3QgYWRkZWQ6ICIgKyBmcmFnbWVudCk7CisgICAgICAgIH0KKyAgICAgICAgZnJhZ21lbnQubUltbWVkaWF0ZUFjdGl2aXR5ID0gbnVsbDsKKyAgICAgICAgCisgICAgICAgIE9wIG9wID0gbmV3IE9wKCk7CisgICAgICAgIG9wLmNtZCA9IE9QX1JFTU9WRTsKKyAgICAgICAgb3AuZnJhZ21lbnQgPSBmcmFnbWVudDsKKyAgICAgICAgYWRkT3Aob3ApOworICAgICAgICAKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gaGlkZShGcmFnbWVudCBmcmFnbWVudCkgeworICAgICAgICBpZiAoZnJhZ21lbnQubUltbWVkaWF0ZUFjdGl2aXR5ID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkZyYWdtZW50IG5vdCBhZGRlZDogIiArIGZyYWdtZW50KTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgT3Agb3AgPSBuZXcgT3AoKTsKKyAgICAgICAgb3AuY21kID0gT1BfSElERTsKKyAgICAgICAgb3AuZnJhZ21lbnQgPSBmcmFnbWVudDsKKyAgICAgICAgYWRkT3Aob3ApOworICAgICAgICAKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIHNob3coRnJhZ21lbnQgZnJhZ21lbnQpIHsKKyAgICAgICAgaWYgKGZyYWdtZW50Lm1JbW1lZGlhdGVBY3Rpdml0eSA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJGcmFnbWVudCBub3QgYWRkZWQ6ICIgKyBmcmFnbWVudCk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIE9wIG9wID0gbmV3IE9wKCk7CisgICAgICAgIG9wLmNtZCA9IE9QX1NIT1c7CisgICAgICAgIG9wLmZyYWdtZW50ID0gZnJhZ21lbnQ7CisgICAgICAgIGFkZE9wKG9wKTsKKyAgICAgICAgCisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgRnJhZ21lbnRUcmFuc2FjdGlvbiBzZXRDdXN0b21BbmltYXRpb25zKGludCBlbnRlciwgaW50IGV4aXQpIHsKKyAgICAgICAgbUVudGVyQW5pbSA9IGVudGVyOworICAgICAgICBtRXhpdEFuaW0gPSBleGl0OworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisgICAgCisgICAgcHVibGljIEZyYWdtZW50VHJhbnNhY3Rpb24gc2V0VHJhbnNpdGlvbihpbnQgdHJhbnNpdGlvbikgeworICAgICAgICBtVHJhbnNpdGlvbiA9IHRyYW5zaXRpb247CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgRnJhZ21lbnRUcmFuc2FjdGlvbiBzZXRUcmFuc2l0aW9uU3R5bGUoaW50IHN0eWxlUmVzKSB7CisgICAgICAgIG1UcmFuc2l0aW9uU3R5bGUgPSBzdHlsZVJlczsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBGcmFnbWVudFRyYW5zYWN0aW9uIGFkZFRvQmFja1N0YWNrKFN0cmluZyBuYW1lKSB7CisgICAgICAgIG1BZGRUb0JhY2tTdGFjayA9IHRydWU7CisgICAgICAgIG1OYW1lID0gbmFtZTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgY29tbWl0KCkgeworICAgICAgICBpZiAobUNvbW1pdHRlZCkgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiY29tbWl0IGFscmVhZHkgY2FsbGVkIik7CisgICAgICAgIGlmIChGcmFnbWVudE1hbmFnZXIuREVCVUcpIExvZy52KFRBRywgIkNvbW1pdDogIiArIHRoaXMpOworICAgICAgICBtQ29tbWl0dGVkID0gdHJ1ZTsKKyAgICAgICAgbU1hbmFnZXIuZW5xdWV1ZUFjdGlvbih0aGlzKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICBpZiAoRnJhZ21lbnRNYW5hZ2VyLkRFQlVHKSBMb2cudihUQUcsICJSdW46ICIgKyB0aGlzKTsKKyAgICAgICAgCisgICAgICAgIE9wIG9wID0gbUhlYWQ7CisgICAgICAgIHdoaWxlIChvcCAhPSBudWxsKSB7CisgICAgICAgICAgICBzd2l0Y2ggKG9wLmNtZCkgeworICAgICAgICAgICAgICAgIGNhc2UgT1BfQUREOiB7CisgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBvcC5mcmFnbWVudDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQmFja1N0YWNrTmVzdGluZysrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGYubU5leHRBbmltID0gb3AuZW50ZXJBbmltOworICAgICAgICAgICAgICAgICAgICBtTWFuYWdlci5hZGRGcmFnbWVudChmLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgfSBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIE9QX1JFUExBQ0U6IHsKKyAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG9wLmZyYWdtZW50OworICAgICAgICAgICAgICAgICAgICBpZiAobU1hbmFnZXIubUFkZGVkICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxtTWFuYWdlci5tQWRkZWQuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBvbGQgPSBtTWFuYWdlci5tQWRkZWQuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGcmFnbWVudE1hbmFnZXIuREVCVUcpIExvZy52KFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJPUF9SRVBMQUNFOiBhZGRpbmc9IiArIGYgKyAiIG9sZD0iICsgb2xkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob2xkLm1Db250YWluZXJJZCA9PSBmLm1Db250YWluZXJJZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3AucmVtb3ZlZCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcC5yZW1vdmVkID0gbmV3IEFycmF5TGlzdDxGcmFnbWVudD4oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcC5yZW1vdmVkLmFkZChvbGQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUFkZFRvQmFja1N0YWNrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbGQubUJhY2tTdGFja05lc3RpbmcrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbGQubU5leHRBbmltID0gb3AuZXhpdEFuaW07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1NYW5hZ2VyLnJlbW92ZUZyYWdtZW50KG9sZCwgbVRyYW5zaXRpb24sIG1UcmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAobUFkZFRvQmFja1N0YWNrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1CYWNrU3RhY2tOZXN0aW5nKys7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZi5tTmV4dEFuaW0gPSBvcC5lbnRlckFuaW07CisgICAgICAgICAgICAgICAgICAgIG1NYW5hZ2VyLmFkZEZyYWdtZW50KGYsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICB9IGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgT1BfUkVNT1ZFOiB7CisgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBvcC5mcmFnbWVudDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQmFja1N0YWNrTmVzdGluZysrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGYubU5leHRBbmltID0gb3AuZXhpdEFuaW07CisgICAgICAgICAgICAgICAgICAgIG1NYW5hZ2VyLnJlbW92ZUZyYWdtZW50KGYsIG1UcmFuc2l0aW9uLCBtVHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICB9IGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgT1BfSElERTogeworICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gb3AuZnJhZ21lbnQ7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQWRkVG9CYWNrU3RhY2spIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUJhY2tTdGFja05lc3RpbmcrKzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBmLm1OZXh0QW5pbSA9IG9wLmV4aXRBbmltOworICAgICAgICAgICAgICAgICAgICBtTWFuYWdlci5oaWRlRnJhZ21lbnQoZiwgbVRyYW5zaXRpb24sIG1UcmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBPUF9TSE9XOiB7CisgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBvcC5mcmFnbWVudDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQmFja1N0YWNrTmVzdGluZysrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGYubU5leHRBbmltID0gb3AuZW50ZXJBbmltOworICAgICAgICAgICAgICAgICAgICBtTWFuYWdlci5zaG93RnJhZ21lbnQoZiwgbVRyYW5zaXRpb24sIG1UcmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgIH0gYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDogeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmtub3duIGNtZDogIiArIG9wLmNtZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBvcCA9IG9wLm5leHQ7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIG1NYW5hZ2VyLm1vdmVUb1N0YXRlKG1NYW5hZ2VyLm1DdXJTdGF0ZSwgbVRyYW5zaXRpb24sCisgICAgICAgICAgICAgICAgbVRyYW5zaXRpb25TdHlsZSwgdHJ1ZSk7CisgICAgICAgIGlmIChtTWFuYWdlci5tTmVlZE1lbnVJbnZhbGlkYXRlICYmIG1NYW5hZ2VyLm1BY3Rpdml0eSAhPSBudWxsKSB7CisgICAgICAgICAgICBtTWFuYWdlci5tQWN0aXZpdHkuaW52YWxpZGF0ZU9wdGlvbnNNZW51KCk7CisgICAgICAgICAgICBtTWFuYWdlci5tTmVlZE1lbnVJbnZhbGlkYXRlID0gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtQWRkVG9CYWNrU3RhY2spIHsKKyAgICAgICAgICAgIG1NYW5hZ2VyLmFkZEJhY2tTdGFja1N0YXRlKHRoaXMpOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHBvcEZyb21CYWNrU3RhY2soKSB7CisgICAgICAgIGlmIChGcmFnbWVudE1hbmFnZXIuREVCVUcpIExvZy52KFRBRywgInBvcEZyb21CYWNrU3RhY2s6ICIgKyB0aGlzKTsKKyAgICAgICAgCisgICAgICAgIE9wIG9wID0gbVRhaWw7CisgICAgICAgIHdoaWxlIChvcCAhPSBudWxsKSB7CisgICAgICAgICAgICBzd2l0Y2ggKG9wLmNtZCkgeworICAgICAgICAgICAgICAgIGNhc2UgT1BfQUREOiB7CisgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBvcC5mcmFnbWVudDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQmFja1N0YWNrTmVzdGluZy0tOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1NYW5hZ2VyLnJlbW92ZUZyYWdtZW50KGYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnRNYW5hZ2VyLnJldmVyc2VUcmFuc2l0KG1UcmFuc2l0aW9uKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICB9IGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgT1BfUkVQTEFDRTogeworICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gb3AuZnJhZ21lbnQ7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQWRkVG9CYWNrU3RhY2spIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUJhY2tTdGFja05lc3RpbmctLTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtTWFuYWdlci5yZW1vdmVGcmFnbWVudChmLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50TWFuYWdlci5yZXZlcnNlVHJhbnNpdChtVHJhbnNpdGlvbiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRyYW5zaXRpb25TdHlsZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChvcC5yZW1vdmVkICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxvcC5yZW1vdmVkLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhZ21lbnQgb2xkID0gb3AucmVtb3ZlZC5nZXQoaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbGQubUJhY2tTdGFja05lc3RpbmctLTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1hbmFnZXIuYWRkRnJhZ21lbnQob2xkLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgT1BfUkVNT1ZFOiB7CisgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBvcC5mcmFnbWVudDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1BZGRUb0JhY2tTdGFjaykgeworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQmFja1N0YWNrTmVzdGluZy0tOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG1NYW5hZ2VyLmFkZEZyYWdtZW50KGYsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICB9IGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgT1BfSElERTogeworICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gb3AuZnJhZ21lbnQ7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQWRkVG9CYWNrU3RhY2spIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUJhY2tTdGFja05lc3RpbmctLTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtTWFuYWdlci5zaG93RnJhZ21lbnQoZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudE1hbmFnZXIucmV2ZXJzZVRyYW5zaXQobVRyYW5zaXRpb24pLCBtVHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICB9IGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgT1BfU0hPVzogeworICAgICAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gb3AuZnJhZ21lbnQ7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQWRkVG9CYWNrU3RhY2spIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUJhY2tTdGFja05lc3RpbmctLTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtTWFuYWdlci5oaWRlRnJhZ21lbnQoZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFnbWVudE1hbmFnZXIucmV2ZXJzZVRyYW5zaXQobVRyYW5zaXRpb24pLCBtVHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICB9IGJyZWFrOworICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVW5rbm93biBjbWQ6ICIgKyBvcC5jbWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgb3AgPSBvcC5wcmV2OworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBtTWFuYWdlci5tb3ZlVG9TdGF0ZShtTWFuYWdlci5tQ3VyU3RhdGUsCisgICAgICAgICAgICAgICAgRnJhZ21lbnRNYW5hZ2VyLnJldmVyc2VUcmFuc2l0KG1UcmFuc2l0aW9uKSwgbVRyYW5zaXRpb25Td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lYWQuZ2V0SW5zdHJ1bWVudGF0aW9uKCkuZXhlY1N0YXJ0QWN0aXZpdHkoCi0gICAgICAgICAgICBnZXRPdXRlckNvbnRleHQoKSwgbU1haW5UaHJlYWQuZ2V0QXBwbGljYXRpb25UaHJlYWQoKSwgbnVsbCwgbnVsbCwgaW50ZW50LCAtMSk7CisgICAgICAgICAgICBnZXRPdXRlckNvbnRleHQoKSwgbU1haW5UaHJlYWQuZ2V0QXBwbGljYXRpb25UaHJlYWQoKSwgbnVsbCwKKyAgICAgICAgICAgIChBY3Rpdml0eSludWxsLCBpbnRlbnQsIC0xKTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKQEAgLTI3MzcsNiArMjc0OCwxMyBAQAogICAgICAgICAgICAgICAgIHJldHVybiB2ICE9IG51bGwgPyB2IDogZGVmVmFsdWU7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyBTZXQ8U3RyaW5nPiBnZXRTdHJpbmdTZXQoU3RyaW5nIGtleSwgU2V0PFN0cmluZz4gZGVmVmFsdWVzKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgICAgICBTZXQ8U3RyaW5nPiB2ID0gKFNldDxTdHJpbmc+KSBtTWFwLmdldChrZXkpOworICAgICAgICAgICAgICAgIHJldHVybiB2ICE9IG51bGwgPyB2IDogZGVmVmFsdWVzOworICAgICAgICAgICAgfQorICAgICAgICB9CiAKICAgICAgICAgcHVibGljIGludCBnZXRJbnQoU3RyaW5nIGtleSwgaW50IGRlZlZhbHVlKSB7CiAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKQEAgLTI3NzksNiArMjc5NywxMiBAQAogICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpczsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBwdWJsaWMgRWRpdG9yIHB1dFN0cmluZ1NldCh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AgICBtRnJvbUxheW91dCA9IGZyYWcubUZyb21MYXlvdXQ7CisgICAgICAgIG1GcmFnbWVudElkID0gZnJhZy5tRnJhZ21lbnRJZDsKKyAgICAgICAgbUNvbnRhaW5lcklkID0gZnJhZy5tQ29udGFpbmVySWQ7CisgICAgICAgIG1UYWcgPSBmcmFnLm1UYWc7CisgICAgICAgIG1SZXRhaW5JbnN0YW5jZSA9IGZyYWcubVJldGFpbkluc3RhbmNlOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgRnJhZ21lbnRTdGF0ZShQYXJjZWwgaW4pIHsKKyAgICAgICAgbUNsYXNzTmFtZSA9IGluLnJlYWRTdHJpbmcoKTsKKyAgICAgICAgbUluZGV4ID0gaW4ucmVhZEludCgpOworICAgICAgICBtRnJvbUxheW91dCA9IGluLnJlYWRJbnQoKSAhPSAwOworICAgICAgICBtRnJhZ21lbnRJZCA9IGluLnJlYWRJbnQoKTsKKyAgICAgICAgbUNvbnRhaW5lcklkID0gaW4ucmVhZEludCgpOworICAgICAgICBtVGFnID0gaW4ucmVhZFN0cmluZygpOworICAgICAgICBtUmV0YWluSW5zdGFuY2UgPSBpbi5yZWFkSW50KCkgIT0gMDsKKyAgICAgICAgbVNhdmVkRnJhZ21lbnRTdGF0ZSA9IGluLnJlYWRCdW5kbGUoKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIEZyYWdtZW50IGluc3RhbnRpYXRlKEFjdGl2aXR5IGFjdGl2aXR5KSB7CisgICAgICAgIGlmIChtSW5zdGFuY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIG1JbnN0YW5jZTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1JbnN0YW5jZSA9IEZyYWdtZW50Lmluc3RhbnRpYXRlKGFjdGl2aXR5LCBtQ2xhc3NOYW1lKTsKKyAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJVbmFibGUgdG8gcmVzdG9yZSBmcmFnbWVudCAiICsgbUNsYXNzTmFtZSwgZSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtU2F2ZWRGcmFnbWVudFN0YXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1TYXZlZEZyYWdtZW50U3RhdGUuc2V0Q2xhc3NMb2FkZXIoYWN0aXZpdHkuZ2V0Q2xhc3NMb2FkZXIoKSk7CisgICAgICAgICAgICBtSW5zdGFuY2UubVNhdmVkRnJhZ21lbnRTdGF0ZSA9IG1TYXZlZEZyYWdtZW50U3RhdGU7CisgICAgICAgICAgICBtSW5zdGFuY2UubVNhdmVkVmlld1N0YXRlCisgICAgICAgICAgICAgICAgICAgID0gbVNhdmVkRnJhZ21lbnRTdGF0ZS5nZXRTcGFyc2VQYXJjZWxhYmxlQXJyYXkoVklFV19TVEFURV9UQUcpOworICAgICAgICB9CisgICAgICAgIG1JbnN0YW5jZS5zZXRJbmRleChtSW5kZXgpOworICAgICAgICBtSW5zdGFuY2UubUZyb21MYXlvdXQgPSBtRnJvbUxheW91dDsKKyAgICAgICAgbUluc3RhbmNlLm1GcmFnbWVudElkID0gbUZyYWdtZW50SWQ7CisgICAgICAgIG1JbnN0YW5jZS5tQ29udGFpbmVySWQgPSBtQ29udGFpbmVySWQ7CisgICAgICAgIG1JbnN0YW5jZS5tVGFnID0gbVRhZzsKKyAgICAgICAgbUluc3RhbmNlLm1SZXRhaW5JbnN0YW5jZSA9IG1SZXRhaW5JbnN0YW5jZTsKKyAgICAgICAgCisgICAgICAgIHJldHVybiBtSW5zdGFuY2U7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBpbnQgZGVzY3JpYmVDb250ZW50cygpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IGZsYWdzKSB7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WFwLnB1dChmbmFtZSwgY2xhenopOworICAgICAgICB9CisgICAgICAgIHJldHVybiAoRnJhZ21lbnQpY2xhenoubmV3SW5zdGFuY2UoKTsKKyAgICB9CisgICAgCisgICAgdm9pZCByZXN0b3JlVmlld1N0YXRlKCkgeworICAgICAgICBpZiAobVNhdmVkVmlld1N0YXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1WaWV3LnJlc3RvcmVIaWVyYXJjaHlTdGF0ZShtU2F2ZWRWaWV3U3RhdGUpOworICAgICAgICAgICAgbVNhdmVkVmlld1N0YXRlID0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICB2b2lkIHNldEluZGV4KGludCBpbmRleCkgeworICAgICAgICBtSW5kZXggPSBpbmRleDsKKyAgICAgICAgbVdobyA9ICJhbmRyb2lkOmZyYWdtZW50OiIgKyBtSW5kZXg7CisgICB9CisgICAgCisgICAgdm9pZCBjbGVhckluZGV4KCkgeworICAgICAgICBtSW5kZXggPSAtMTsKKyAgICAgICAgbVdobyA9IG51bGw7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIFN1YmNsYXNzZXMgY2FuIG5vdCBvdmVycmlkZSBlcXVhbHMoKS4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUgZmluYWwgcHVibGljIGJvb2xlYW4gZXF1YWxzKE9iamVjdCBvKSB7CisgICAgICAgIHJldHVybiBzdXBlci5lcXVhbHMobyk7CisgICAgfQorCisgICAgLyoqCisgICAgICogU3ViY2xhc3NlcyBjYW4gbm90IG92ZXJyaWRlIGhhc2hDb2RlKCkuCisgICAgICovCisgICAgQE92ZXJyaWRlIGZpbmFsIHB1YmxpYyBpbnQgaGFzaENvZGUoKSB7CisgICAgICAgIHJldHVybiBzdXBlci5oYXNoQ29kZSgpOworICAgIH0KKyAgICAKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICBTdHJpbmdCdWlsZGVyIHNiID0gbmV3IFN0cmluZ0J1aWxkZXIoMTI4KTsKKyAgICAgICAgc2IuYXBwZW5kKCJGcmFnbWVudHsiKTsKKyAgICAgICAgc2IuYXBwZW5kKEludGVnZXIudG9IZXhTdHJpbmcoU3lzdGVtLmlkZW50aXR5SGFzaENvZGUodGhpcykpKTsKKyAgICAgICAgaWYgKG1JbmRleCA+PSAwKSB7CisgICAgICAgICAgICBzYi5hcHBlbmQoIiAjIik7CisgICAgICAgICAgICBzYi5hcHBlbmQobUluZGV4KTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUZyYWdtZW50SWQgIT0gMCkgeworICAgICAgICAgICAgc2IuYXBwZW5kKCIgaWQ9MHgiKTsKKyAgICAgICAgICAgIHNiLmFwcGVuZChJbnRlZ2VyLnRvSGV4U3RyaW5nKG1GcmFnbWVudElkKSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1UYWcgIT0gbnVsbCkgeworICAgICAgICAgICAgc2IuYXBwZW5kKCIgIik7CisgICAgICAgICAgICBzYi5hcHBlbmQobVRhZyk7CisgICAgICAgIH0KKyAgICAgICAgc2IuYXBwZW5kKCd9Jyk7CisgICAgICAgIHJldHVybiBzYi50b1N0cmluZygpOworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBSZXR1cm4gdGhlIGlkZW50aWZpZXIgdGhpcyBmcmFnbWVudCBpcyBrbm93biBieS4gIFRoaXMgaXMgZWl0aGVyCisgICAgICogdGhlIGFuZHJvaWQ6aWQgdmFsdWUgc3VwcGxpZWQgaW4gYSBsYXlvdXQgb3IgdGhlIGNvbnRhaW5lciB2aWV3IElECisgICAgICogc3VwcGxpZWQgd2hlbiBhZGRpbmcgdGhlIGZyYWdtZW50LgorICAgICAqLworICAgIGZpbmFsIHB1YmxpYyBpbnQgZ2V0SWQoKSB7CisgICAgICAgIHJldHVybiBtRnJhZ21lbnRJZDsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogR2V0IHRoZSB0YWcgbmFtZSBv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ldGFpbkluc3RhbmNlKGJvb2xlYW4gcmV0YWluKSB7CisgICAgICAgIG1SZXRhaW5JbnN0YW5jZSA9IHJldGFpbjsKKyAgICB9CisgICAgCisgICAgZmluYWwgcHVibGljIGJvb2xlYW4gZ2V0UmV0YWluSW5zdGFuY2UoKSB7CisgICAgICAgIHJldHVybiBtUmV0YWluSW5zdGFuY2U7CisgICAgfQorICAgIAorICAgIC8qKgorICAgICAqIFJlcG9ydCB0aGF0IHRoaXMgZnJhZ21lbnQgd291bGQgbGlrZSB0byBwYXJ0aWNpcGF0ZSBpbiBwb3B1bGF0aW5nCisgICAgICogdGhlIG9wdGlvbnMgbWVudSBieSByZWNlaXZpbmcgYSBjYWxsIHRvIHtAbGluayAjb25DcmVhdGVPcHRpb25zTWVudX0KKyAgICAgKiBhbmQgcmVsYXRlZCBtZXRob2RzLgorICAgICAqIAorICAgICAqIEBwYXJhbSBoYXNNZW51IElmIHRydWUsIHRoZSBmcmFnbWVudCBoYXMgbWVudSBpdGVtcyB0byBjb250cmlidXRlLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEhhc09wdGlvbnNNZW51KGJvb2xlYW4gaGFzTWVudSkgeworICAgICAgICBpZiAobUhhc01lbnUgIT0gaGFzTWVudSkgeworICAgICAgICAgICAgbUhhc01lbnUgPSBoYXNNZW51OworICAgICAgICAgICAgaWYgKGlzQWRkZWQoKSAmJiAhaXNIaWRkZW4oKSkgeworICAgICAgICAgICAgICAgIG1BY3Rpdml0eS5pbnZhbGlkYXRlT3B0aW9uc01lbnUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBDYWxsIHtAbGluayBBY3Rpdml0eSNzdGFydEFjdGl2aXR5KEludGVudCl9IG9uIHRoZSBmcmFnbWVudCdzCisgICAgICogY29udGFpbmluZyBBY3Rpdml0eS4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzdGFydEFjdGl2aXR5KElud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bWVudS4KKyAgICAgKiAKKyAgICAgKiBAc2VlICN1bnJlZ2lzdGVyRm9yQ29udGV4dE1lbnUoVmlldykKKyAgICAgKiBAcGFyYW0gdmlldyBUaGUgdmlldyB0aGF0IHNob3VsZCBzaG93IGEgY29udGV4dCBtZW51LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHJlZ2lzdGVyRm9yQ29udGV4dE1lbnUoVmlldyB2aWV3KSB7CisgICAgICAgIHZpZXcuc2V0T25DcmVhdGVDb250ZXh0TWVudUxpc3RlbmVyKHRoaXMpOworICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBQcmV2ZW50cyBhIGNvbnRleHQgbWVudSB0byBiZSBzaG93biBmb3IgdGhlIGdpdmVuIHZpZXcuIFRoaXMgbWV0aG9kIHdpbGwKKyAgICAgKiByZW1vdmUgdGhlIHtAbGluayBPbkNyZWF0ZUNvbnRleHRNZW51TGlzdGVuZXJ9IG9uIHRoZSB2aWV3LgorICAgICAqIAorICAgICAqIEBzZWUgI3JlZ2lzdGVyRm9yQ29udGV4dE1lbnUoVmlldykKKyAgICAgKiBAcGFyYW0gdmlldyBUaGUgdmlldyB0aGF0IHNob3VsZCBzdG9wIHNob3dpbmcgYSBjb250ZXh0IG1lbnUuCisgICAgICovCisgICAgcHVibGljIHZvaWQgdW5yZWdpc3RlckZvckNvbnRleHRNZW51KFZpZXcgdmlldykgeworICAgICAgICB2aWV3LnNldE9uQ3JlYXRlQ29udGV4dE1lbnVMaXN0ZW5lcihudWxsKTsKKyAgICB9CisgICAgCisgICAgLyoqCisgICAgICogVGhpcyBob29rIGlzIGNhbGxlZCB3aGVuZXZlciBhbiBpdGVtIGluIGEgY29udGV4dCBtZW51IGlzIHNlbGVjdGVkLiBUaGUKKyAgICAgKiBkZWZhdWx0IGltcGxlbWVudGF0aW9uIHNpbXBseSByZXR1cm5zIGZhbHNlIHRvIGhhdmUgdGhlIG5vcm1hbCBwcm9jZXNzaW5nCisgICAgICogaGFwcGVuIChj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SKTsKKyAgICAgICAgbUFkZGVkID0gaW4uY3JlYXRlSW50QXJyYXkoKTsKKyAgICAgICAgbUJhY2tTdGFjayA9IGluLmNyZWF0ZVR5cGVkQXJyYXkoQmFja1N0YWNrU3RhdGUuQ1JFQVRPUik7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBpbnQgZGVzY3JpYmVDb250ZW50cygpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IGZsYWdzKSB7CisgICAgICAgIGRlc3Qud3JpdGVUeXBlZEFycmF5KG1BY3RpdmUsIGZsYWdzKTsKKyAgICAgICAgZGVzdC53cml0ZUludEFycmF5KG1BZGRlZCk7CisgICAgICAgIGRlc3Qud3JpdGVUeXBlZEFycmF5KG1CYWNrU3RhY2ssIGZsYWdzKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBQYXJjZWxhYmxlLkNyZWF0b3I8RnJhZ21lbnRNYW5hZ2VyU3RhdGU+IENSRUFUT1IKKyAgICAgICAgICAgID0gbmV3IFBhcmNlbGFibGUuQ3JlYXRvcjxGcmFnbWVudE1hbmFnZXJTdGF0ZT4oKSB7CisgICAgICAgIHB1YmxpYyBGcmFnbWVudE1hbmFnZXJTdGF0ZSBjcmVhdGVGcm9tUGFyY2VsKFBhcmNlbCBpbikgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBGcmFnbWVudE1hbmFnZXJTdGF0ZShpbik7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyBGcmFnbWVudE1hbmFnZXJTdGF0ZVtdIG5ld0FycmF5KGludCBzaXplKSB7CisgICAgICAgICAgICByZXR1cm4gbmV3IEZyYWdtZW50TWFuYWdlclN0YXRlW3NpemVdOworICAgICAgICB9CisgICAgfTsKK30KKworLyoqCisgKiBAaGlkZQorICogQ29udGFpbmVyIGZvciBmcmFnbWVudH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ICAgIAorICAgIEFuaW1hdGlvbiBsb2FkQW5pbWF0aW9uKEZyYWdtZW50IGZyYWdtZW50LCBpbnQgdHJhbnNpdCwgYm9vbGVhbiBlbnRlciwKKyAgICAgICAgICAgIGludCB0cmFuc2l0aW9uU3R5bGUpIHsKKyAgICAgICAgQW5pbWF0aW9uIGFuaW1PYmogPSBmcmFnbWVudC5vbkNyZWF0ZUFuaW1hdGlvbih0cmFuc2l0aW9uU3R5bGUsIGVudGVyLAorICAgICAgICAgICAgICAgIGZyYWdtZW50Lm1OZXh0QW5pbSk7CisgICAgICAgIGlmIChhbmltT2JqICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBhbmltT2JqOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAoZnJhZ21lbnQubU5leHRBbmltICE9IDApIHsKKyAgICAgICAgICAgIEFuaW1hdGlvbiBhbmltID0gQW5pbWF0aW9uVXRpbHMubG9hZEFuaW1hdGlvbihtQWN0aXZpdHksIGZyYWdtZW50Lm1OZXh0QW5pbSk7CisgICAgICAgICAgICBpZiAoYW5pbSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGFuaW07CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmICh0cmFuc2l0ID09IDApIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpbnQgc3R5bGVJbmRleCA9IHRyYW5zaXRUb1N0eWxlSW5kZXgodHJhbnNpdCwgZW50ZXIpOworICAgICAgICBpZiAoc3R5bGVJbmRleCA8IDApIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAodHJhbnNpdGlvblN0eWxlID09IDAgJiYgbUFjdGl2aXR5LmdldFdpbmRvdygpICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyYW5zaXRpb25TdHlsZSA9IG1BY3Rpdml0eS5nZXRXaW5kb3coKS5nZXRBdHRyaWJ1dGVzKCkud2luZG93QW5pbWF0aW9uczsKKyAgICAgICAgfQorICAgICAgICBpZiAodHJhbnNpdGlvblN0eWxlID09IDApIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBUeXBlZEFycmF5IGF0dHJzID0gbUFjdGl2aXR5Lm9idGFpblN0eWxlZEF0dHJpYnV0ZXModHJhbnNpdGlvblN0eWxlLAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbik7CisgICAgICAgIGludCBhbmltID0gYXR0cnMuZ2V0UmVzb3VyY2VJZChzdHlsZUluZGV4LCAwKTsKKyAgICAgICAgYXR0cnMucmVjeWNsZSgpOworICAgICAgICAKKyAgICAgICAgaWYgKGFuaW0gPT0gMCkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHJldHVybiBBbmltYXRpb25VdGlscy5sb2FkQW5pbWF0aW9uKG1BY3Rpdml0eSwgYW5pbSk7CisgICAgfQorICAgIAorICAgIHZvaWQgbW92ZVRvU3RhdGUoRnJhZ21lbnQgZiwgaW50IG5ld1N0YXRlLCBpbnQgdHJhbnNpdCwgaW50IHRyYW5zaXRpb25TdHlsZSkgeworICAgICAgICAvLyBGcmFnbWVudHMgdGhhdCBhcmUgbm90IGN1cnJlbnRseSBhZGRlZCB3aWxsIHNpdCBpbiB0aGUgb25DcmVhdGUoKSBzdGF0ZS4KKyAgICAgICAgaWYgKCFmLm1BZGRlZCAmJiBuZXdTdGF0ZSA+IEZyYWdtZW50LkNSRUFURUQpIHsKKyAgICAgICAgICAgIG5ld1N0YXRlID0gRnJhZ21lbnQuQ1JFQVRFRDsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKGYubVN0YXRlIDwgbmV3U3RhdGUpIHsKKyAgICAgICAgICAgIHN3aXRjaCAoZi5tU3RhdGUpIHsKKyAgICAgICAgICAgICAgICBjYXNlIEZyYWdtZW50LklOSVRJQUxJWklORzoKKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJtb3ZldG8gQ1JFQVRFRDogIiArIGYpOworICAgICAgICAgICAgICAgICAgICBmLm1BY3Rpdml0eSA9IG1BY3Rpdml0eTsKKyAgICAgICAgICAgICAgICAgICAgZi5tQ2FsbGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGYub25BdHRhY2gobUFjdGl2aXR5KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1DYWxsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTdXBlck5vdENhbGxlZEV4Y2VwdGlvbigiRnJhZ21lbnQgIiArIGYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRpZCBub3QgY2FsbCB0aHJvdWdoIHRvIHN1cGVyLm9uQXR0YWNoKCkiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1SZXRhaW5pbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgZi5vbkNyZWF0ZShmLm1TYXZlZEZyYWdtZW50U3RhdGUpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1DYWxsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU3VwZXJOb3RDYWxsZWRFeGNlcHRpb24oIkZyYWdtZW50ICIgKyBmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZGlkIG5vdCBjYWxsIHRocm91Z2ggdG8gc3VwZXIub25DcmVhdGUoKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGYubVJldGFpbmluZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBpZiAoZi5tRnJvbUxheW91dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gRm9yIGZyYWdtZW50cyB0aGF0IGFyZSBwYXJ0IG9mIHRoZSBjb250ZW50IHZpZXcKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxheW91dCwgd2UgbmVlZCB0byBpbnN0YW50aWF0ZSB0aGUgdmlldyBpbW1lZGlhdGVseQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5kIHRoZSBpbmZsYXRlciB3aWxsIHRha2UgY2FyZSBvZiBhZGRpbmcgaXQuCisgICAgICAgICAgICAgICAgICAgICAgICBmLm1WaWV3ID0gZi5vbkNyZWF0ZVZpZXcobUFjdGl2aXR5LmdldExheW91dEluZmxhdGVyKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIGYubVNhdmVkRnJhZ21lbnRTdGF0ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5tVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZi5tVmlldy5zZXRTYXZlRnJvbVBhcmVudEVuYWJsZWQoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYucmVzdG9yZVZpZXdTdGF0ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLm1IaWRkZW4pIGYubVZpZXcuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOyAKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNhc2UgRnJhZ21lbnQuQ1JFQVRFRDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1N0YXRlID4gRnJhZ21lbnQuQ1JFQVRFRCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJtb3ZldG8gQ09OVEVOVDogIiArIGYpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1Gcm9tTGF5b3V0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlld0dyb3VwIGNvbnRhaW5lciA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYubUNvbnRhaW5lcklkICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbmVyID0gKFZpZXdHcm91cCltQWN0aXZpdHkuZmluZFZpZXdCeUlkKGYubUNvbnRhaW5lcklkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRhaW5lciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJOZXcgdmlldyBmb3VuZCBmb3IgaWQgMHgiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgSW50ZWdlci50b0hleFN0cmluZyhmLm1Db250YWluZXJJZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGZvciBmcmFnbWVudCAiICsgZik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZi5tQ29udGFpbmVyID0gY29udGFpbmVyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYubVZpZXcgPSBmLm9uQ3JlYXRlVmlldyhtQWN0aXZpdHkuZ2V0TGF5b3V0SW5mbGF0ZXIoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lciwgZi5tU2F2ZWRGcmFnbWVudFN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5tVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYubVZpZXcuc2V0U2F2ZUZyb21QYXJlbnRFbmFibGVkKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRhaW5lciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBbmltYXRpb24gYW5pbSA9IGxvYWRBbmltYXRpb24oZiwgdHJhbnNpdCwgdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmltICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmLm1WaWV3LnNldEFuaW1hdGlvbihhbmltKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lci5hZGRWaWV3KGYubVZpZXcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZi5yZXN0b3JlVmlld1N0YXRlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYubUhpZGRlbikgZi5tVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgZi5tQ2FsbGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm9uUmVhZHkoZi5tU2F2ZWRGcmFnbWVudFN0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRpZCBub3QgY2FsbCB0aHJvdWdoIHRvIHN1cGVyLm9uUmVhZHkoKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZi5tU2F2ZWRGcmFnbWVudFN0YXRlID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNhc2UgRnJhZ21lbnQuQ09OVEVOVDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1N0YXRlID4gRnJhZ21lbnQuQ09OVEVOVCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJtb3ZldG8gU1RBUlRFRDogIiArIGYpOworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQ2FsbGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm9uU3RhcnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRpZCBub3QgY2FsbCB0aHJvdWdoIHRvIHN1cGVyLm9uU3RhcnQoKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2FzZSBGcmFnbWVudC5TVEFSVEVEOgorICAgICAgICAgICAgICAgICAgICBpZiAobmV3U3RhdGUgPiBGcmFnbWVudC5TVEFSVEVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIm1vdmV0byBSRVNVTUVEOiAiICsgZik7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1DYWxsZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYub25SZXN1bWUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRpZCBub3QgY2FsbCB0aHJvdWdoIHRvIHN1cGVyLm9uUmVzdW1lKCkiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKGYubVN0YXRlID4gbmV3U3RhdGUpIHsKKyAgICAgICAgICAgIHN3aXRjaCAoZi5tU3RhdGUpIHsKKyAgICAgICAgICAgICAgICBjYXNlIEZyYWdtZW50LlJFU1VNRUQ6CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdTdGF0ZSA8IEZyYWdtZW50LlJFU1VNRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAibW92ZWZyb20gUkVTVU1FRDogIiArIGYpOworICAgICAgICAgICAgICAgICAgICAgICAgZi5tQ2FsbGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm9uUGF1c2UoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRpZCBub3QgY2FsbCB0aHJvdWdoIHRvIHN1cGVyLm9uUGF1c2UoKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2FzZSBGcmFnbWVudC5TVEFSVEVEOgorICAgICAgICAgICAgICAgICAgICBpZiAobmV3U3RhdGUgPCBGcmFnbWVudC5TVEFSVEVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy52KFRBRywgIm1vdmVmcm9tIFNUQVJURUQ6ICIgKyBmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgZi5vblN0b3AoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRpZCBub3QgY2FsbCB0aHJvdWdoIHRvIHN1cGVyLm9uU3RvcCgpIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjYXNlIEZyYWdtZW50LkNPTlRFTlQ6CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdTdGF0ZSA8IEZyYWdtZW50LkNPTlRFTlQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAibW92ZWZyb20gQ09OVEVOVDogIiArIGYpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYubVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYub25EZXN0cm95VmlldygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZi5tQ2FsbGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTdXBlck5vdENhbGxlZEV4Y2VwdGlvbigiRnJhZ21lbnQgIiArIGYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZGlkIG5vdCBjYWxsIHRocm91Z2ggdG8gc3VwZXIub25EZXN0cm95ZWRWaWV3KCkiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTmVlZCB0byBzYXZlIHRoZSBjdXJyZW50IHZpZXcgc3RhdGUgaWYgbm90CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG9uZSBhbHJlYWR5LgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbUFjdGl2aXR5LmlzRmluaXNoaW5nKCkgJiYgZi5tU2F2ZWRGcmFnbWVudFN0YXRlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZyYWdtZW50Vmlld1N0YXRlKGYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5tQ29udGFpbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1DdXJTdGF0ZSA+IEZyYWdtZW50LklOSVRJQUxJWklORykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQW5pbWF0aW9uIGFuaW0gPSBsb2FkQW5pbWF0aW9uKGYsIHRyYW5zaXQsIGZhbHNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuaW0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYubVZpZXcuc2V0QW5pbWF0aW9uKGFuaW0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYubUNvbnRhaW5lci5yZW1vdmVWaWV3KGYubVZpZXcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGYubUNvbnRhaW5lciA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1WaWV3ID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGNhc2UgRnJhZ21lbnQuQ1JFQVRFRDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1N0YXRlIDwgRnJhZ21lbnQuQ1JFQVRFRCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJtb3ZlZnJvbSBDUkVBVEVEOiAiICsgZik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWYubVJldGFpbmluZykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYubUNhbGxlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYub25EZXN0cm95KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmLm1DYWxsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFN1cGVyTm90Q2FsbGVkRXhjZXB0aW9uKCJGcmFnbWVudCAiICsgZgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkaWQgbm90IGNhbGwgdGhyb3VnaCB0byBzdXBlci5vbkRlc3Ryb3koKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgZi5tQ2FsbGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBmLm9uRGV0YWNoKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWYubUNhbGxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBTdXBlck5vdENhbGxlZEV4Y2VwdGlvbigiRnJhZ21lbnQgIiArIGYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkaWQgbm90IGNhbGwgdGhyb3VnaCB0byBzdXBlci5vbkRldGFjaCgpIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBmLm1BY3Rpdml0eSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgZi5tU3RhdGUgPSBuZXdTdGF0ZTsKKyAgICB9CisgICAgCisgICAgdm9pZCBtb3ZlVG9TdGF0ZShpbnQgbmV3U3RhdGUsIGJvb2xlYW4gYWx3YXlzKSB7CisgICAgICAgIG1vdmVUb1N0YXRlKG5ld1N0YXRlLCAwLCAwLCBhbHdheXMpOworICAgIH0KKyAgICAKKyAgICB2b2lkIG1vdmVUb1N0YXRlKGludCBuZXdTdGF0ZSwgaW50IHRyYW5zaXQsIGludCB0cmFuc2l0U3R5bGUsIGJvb2xlYW4gYWx3YXlzKSB7CisgICAgICAgIGlmIChtQWN0aXZpdHkgPT0gbnVsbCAmJiBuZXdTdGF0ZSAhPSBGcmFnbWVudC5JTklUSUFMSVpJTkcpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIk5vIGFjdGl2aXR5Iik7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmICghYWx3YXlzICYmIG1DdXJTdGF0ZSA9PSBuZXdTdGF0ZSkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBtQ3VyU3RhdGUgPSBuZXdTdGF0ZTsKKyAgICAgICAgaWYgKG1BY3RpdmUgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPG1BY3RpdmUuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gbUFjdGl2ZS5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtb3ZlVG9TdGF0ZShmLCBuZXdTdGF0ZSwgdHJhbnNpdCwgdHJhbnNpdFN0eWxlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgdm9pZCBtYWtlQWN0aXZlKEZyYWdtZW50IGYpIHsKKyAgICAgICAgaWYgKGYubUluZGV4ID49IDApIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKG1BdmFpbEluZGljZXMgPT0gbnVsbCB8fCBtQXZhaWxJbmRpY2VzLnNpemUoKSA8PSAwKSB7CisgICAgICAgICAgICBpZiAobUFjdGl2ZSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUFjdGl2ZSA9IG5ldyBBcnJheUxpc3Q8RnJhZ21lbnQ+KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmLnNldEluZGV4KG1BY3RpdmUuc2l6ZSgpKTsKKyAgICAgICAgICAgIG1BY3RpdmUuYWRkKGYpOworICAgICAgICAgICAgCisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmLnNldEluZGV4KG1BdmFpbEluZGljZXMucmVtb3ZlKG1BdmFpbEluZGljZXMuc2l6ZSgpLTEpKTsKKyAgICAgICAgICAgIG1BY3RpdmUuc2V0KGYubUluZGV4LCBmKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICB2b2lkIG1ha2VJbmFjdGl2ZShGcmFnbWVudCBmKSB7CisgICAgICAgIGlmIChmLm1JbmRleCA8IDApIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgbUFjdGl2ZS5zZXQoZi5tSW5kZXgsIG51bGwpOworICAgICAgICBpZiAobUF2YWlsSW5kaWNlcyA9PSBudWxsKSB7CisgICAgICAgICAgICBtQXZhaWxJbmRpY2VzID0gbmV3IEFycmF5TGlzdDxJbnRlZ2VyPigpOworICAgICAgICB9CisgICAgICAgIG1BdmFpbEluZGljZXMuYWRkKGYubUluZGV4KTsKKyAgICAgICAgZi5jbGVhckluZGV4KCk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGFkZEZyYWdtZW50KEZyYWdtZW50IGZyYWdtZW50LCBib29sZWFuIG1vdmVUb1N0YXRlTm93KSB7CisgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiYWRkOiAiICsgZnJhZ21lbnQpOworICAgICAgICBpZiAobUFkZGVkID09IG51bGwpIHsKKyAgICAgICAgICAgIG1BZGRlZCA9IG5ldyBBcnJheUxpc3Q8RnJhZ21lbnQ+KCk7CisgICAgICAgIH0KKyAgICAgICAgbUFkZGVkLmFkZChmcmFnbWVudCk7CisgICAgICAgIG1ha2VBY3RpdmUoZnJhZ21lbnQpOworICAgICAgICBmcmFnbWVudC5tQWRkZWQgPSB0cnVlOworICAgICAgICBpZiAoZnJhZ21lbnQubUhhc01lbnUpIHsKKyAgICAgICAgICAgIG1OZWVkTWVudUludmFsaWRhdGUgPSB0cnVlOworICAgICAgICB9CisgICAgICAgIGlmIChtb3ZlVG9TdGF0ZU5vdykgeworICAgICAgICAgICAgbW92ZVRvU3RhdGUoZnJhZ21lbnQsIG1DdXJTdGF0ZSwgMCwgMCk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgcmVtb3ZlRnJhZ21lbnQoRnJhZ21lbnQgZnJhZ21lbnQsIGludCB0cmFuc2l0aW9uLCBpbnQgdHJhbnNpdGlvblN0eWxlKSB7CisgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAicmVtb3ZlOiAiICsgZnJhZ21lbnQpOworICAgICAgICBtQWRkZWQucmVtb3ZlKGZyYWdtZW50KTsKKyAgICAgICAgZmluYWwgYm9vbGVhbiBpbmFjdGl2ZSA9IGZyYWdtZW50Lm1CYWNrU3RhY2tOZXN0aW5nIDw9IDA7CisgICAgICAgIGlmIChpbmFjdGl2ZSkgeworICAgICAgICAgICAgbWFrZUluYWN0aXZlKGZyYWdtZW50KTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZnJhZ21lbnQubUhhc01lbnUpIHsKKyAgICAgICAgICAgIG1OZWVkTWVudUludmFsaWRhdGUgPSB0cnVlOworICAgICAgICB9CisgICAgICAgIGZyYWdtZW50Lm1BZGRlZCA9IGZhbHNlOworICAgICAgICBtb3ZlVG9TdGF0ZShmcmFnbWVudCwgaW5hY3RpdmUgPyBGcmFnbWVudC5JTklUSUFMSVpJTkcgOiBGcmFnbWVudC5DUkVBVEVELAorICAgICAgICAgICAgICAgIHRyYW5zaXRpb24sIHRyYW5zaXRpb25TdHlsZSk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIGhpZGVGcmFnbWVudChGcmFnbWVudCBmcmFnbWVudCwgaW50IHRyYW5zaXRpb24sIGludCB0cmFuc2l0aW9uU3R5bGUpIHsKKyAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJoaWRlOiAiICsgZnJhZ21lbnQpOworICAgICAgICBpZiAoIWZyYWdtZW50Lm1IaWRkZW4pIHsKKyAgICAgICAgICAgIGZyYWdtZW50Lm1IaWRkZW4gPSB0cnVlOworICAgICAgICAgICAgaWYgKGZyYWdtZW50Lm1WaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBBbmltYXRpb24gYW5pbSA9IGxvYWRBbmltYXRpb24oZnJhZ21lbnQsIHRyYW5zaXRpb24sIGZhbHNlLAorICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblN0eWxlKTsKKyAgICAgICAgICAgICAgICBpZiAoYW5pbSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGZyYWdtZW50Lm1WaWV3LnNldEFuaW1hdGlvbihhbmltKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZnJhZ21lbnQubVZpZXcuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGZyYWdtZW50Lm1BZGRlZCAmJiBmcmFnbWVudC5tSGFzTWVudSkgeworICAgICAgICAgICAgICAgIG1OZWVkTWVudUludmFsaWRhdGUgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZnJhZ21lbnQub25IaWRkZW5DaGFuZ2VkKHRydWUpOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyB2b2lkIHNob3dGcmFnbWVudChGcmFnbWVudCBmcmFnbWVudCwgaW50IHRyYW5zaXRpb24sIGludCB0cmFuc2l0aW9uU3R5bGUpIHsKKyAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJzaG93OiAiICsgZnJhZ21lbnQpOworICAgICAgICBpZiAoZnJhZ21lbnQubUhpZGRlbikgeworICAgICAgICAgICAgZnJhZ21lbnQubUhpZGRlbiA9IGZhbHNlOworICAgICAgICAgICAgaWYgKGZyYWdtZW50Lm1WaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBBbmltYXRpb24gYW5pbSA9IGxvYWRBbmltYXRpb24oZnJhZ21lbnQsIHRyYW5zaXRpb24sIHRydWUsCisgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uU3R5bGUpOworICAgICAgICAgICAgICAgIGlmIChhbmltICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgZnJhZ21lbnQubVZpZXcuc2V0QW5pbWF0aW9uKGFuaW0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmcmFnbWVudC5tVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZnJhZ21lbnQubUFkZGVkICYmIGZyYWdtZW50Lm1IYXNNZW51KSB7CisgICAgICAgICAgICAgICAgbU5lZWRNZW51SW52YWxpZGF0ZSA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmcmFnbWVudC5vbkhpZGRlbkNoYW5nZWQoZmFsc2UpOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIHB1YmxpYyBGcmFnbWVudCBmaW5kRnJhZ21lbnRCeUlkKGludCBpZCkgeworICAgICAgICBpZiAobUFjdGl2ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAvLyBGaXJzdCBsb29rIHRocm91Z2ggYWRkZWQgZnJhZ21lbnRzLgorICAgICAgICAgICAgZm9yIChpbnQgaT1tQWRkZWQuc2l6ZSgpLTE7IGk+PTA7IGktLSkgeworICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBtQWRkZWQuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwgJiYgZi5tRnJhZ21lbnRJZCA9PSBpZCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBOb3cgZm9yIGFueSBrbm93biBmcmFnbWVudC4KKyAgICAgICAgICAgIGZvciAoaW50IGk9bUFjdGl2ZS5zaXplKCktMTsgaT49MDsgaS0tKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BY3RpdmUuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwgJiYgZi5tRnJhZ21lbnRJZCA9PSBpZCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBGcmFnbWVudCBmaW5kRnJhZ21lbnRCeVRhZyhTdHJpbmcgdGFnKSB7CisgICAgICAgIGlmIChtQWN0aXZlICE9IG51bGwgJiYgdGFnICE9IG51bGwpIHsKKyAgICAgICAgICAgIC8vIEZpcnN0IGxvb2sgdGhyb3VnaCBhZGRlZCBmcmFnbWVudHMuCisgICAgICAgICAgICBmb3IgKGludCBpPW1BZGRlZC5zaXplKCktMTsgaT49MDsgaS0tKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BZGRlZC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCAmJiB0YWcuZXF1YWxzKGYubVRhZykpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGY7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gTm93IGZvciBhbnkga25vd24gZnJhZ21lbnQuCisgICAgICAgICAgICBmb3IgKGludCBpPW1BY3RpdmUuc2l6ZSgpLTE7IGk+PTA7IGktLSkgeworICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBtQWN0aXZlLmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAoZiAhPSBudWxsICYmIHRhZy5lcXVhbHMoZi5tVGFnKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBGcmFnbWVudCBmaW5kRnJhZ21lbnRCeVdobyhTdHJpbmcgd2hvKSB7CisgICAgICAgIGlmIChtQWN0aXZlICE9IG51bGwgJiYgd2hvICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9bUFjdGl2ZS5zaXplKCktMTsgaT49MDsgaS0tKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BY3RpdmUuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwgJiYgd2hvLmVxdWFscyhmLm1XaG8pKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgZW5xdWV1ZUFjdGlvbihSdW5uYWJsZSBhY3Rpb24pIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpZiAobVBlbmRpbmdBY3Rpb25zID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtUGVuZGluZ0FjdGlvbnMgPSBuZXcgQXJyYXlMaXN0PFJ1bm5hYmxlPigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVBlbmRpbmdBY3Rpb25zLmFkZChhY3Rpb24pOworICAgICAgICAgICAgaWYgKG1QZW5kaW5nQWN0aW9ucy5zaXplKCkgPT0gMSkgeworICAgICAgICAgICAgICAgIG1BY3Rpdml0eS5tSGFuZGxlci5yZW1vdmVDYWxsYmFja3MobUV4ZWNDb21taXQpOworICAgICAgICAgICAgICAgIG1BY3Rpdml0eS5tSGFuZGxlci5wb3N0KG1FeGVjQ29tbWl0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBPbmx5IGNhbGwgZnJvbSBtYWluIHRocmVhZCEKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBleGVjUGVuZGluZ0FjdGlvbnMoKSB7CisgICAgICAgIGlmIChtRXhlY3V0aW5nQWN0aW9ucykgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiUmVjdXJzaXZlIGVudHJ5IHRvIGV4ZWNQZW5kaW5nQWN0aW9ucyIpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICB3aGlsZSAodHJ1ZSkgeworICAgICAgICAgICAgaW50IG51bUFjdGlvbnM7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgICAgIGlmIChtUGVuZGluZ0FjdGlvbnMgPT0gbnVsbCB8fCBtUGVuZGluZ0FjdGlvbnMuc2l6ZSgpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBudW1BY3Rpb25zID0gbVBlbmRpbmdBY3Rpb25zLnNpemUoKTsKKyAgICAgICAgICAgICAgICBpZiAobVRtcEFjdGlvbnMgPT0gbnVsbCB8fCBtVG1wQWN0aW9ucy5sZW5ndGggPCBudW1BY3Rpb25zKSB7CisgICAgICAgICAgICAgICAgICAgIG1UbXBBY3Rpb25zID0gbmV3IFJ1bm5hYmxlW251bUFjdGlvbnNdOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtUGVuZGluZ0FjdGlvbnMudG9BcnJheShtVG1wQWN0aW9ucyk7CisgICAgICAgICAgICAgICAgbVBlbmRpbmdBY3Rpb25zLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgbUFjdGl2aXR5Lm1IYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtRXhlY0NvbW1pdCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1FeGVjdXRpbmdBY3Rpb25zID0gdHJ1ZTsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxudW1BY3Rpb25zOyBpKyspIHsKKyAgICAgICAgICAgICAgICBtVG1wQWN0aW9uc1tpXS5ydW4oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1FeGVjdXRpbmdBY3Rpb25zID0gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgYWRkQmFja1N0YWNrU3RhdGUoQmFja1N0YWNrRW50cnkgc3RhdGUpIHsKKyAgICAgICAgaWYgKG1CYWNrU3RhY2sgPT0gbnVsbCkgeworICAgICAgICAgICAgbUJhY2tTdGFjayA9IG5ldyBBcnJheUxpc3Q8QmFja1N0YWNrRW50cnk+KCk7CisgICAgICAgIH0KKyAgICAgICAgbUJhY2tTdGFjay5hZGQoc3RhdGUpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgYm9vbGVhbiBwb3BCYWNrU3RhY2tTdGF0ZShIYW5kbGVyIGhhbmRsZXIsIFN0cmluZyBuYW1lKSB7CisgICAgICAgIGlmIChtQmFja1N0YWNrID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBpZiAobmFtZSA9PSBudWxsKSB7CisgICAgICAgICAgICBpbnQgbGFzdCA9IG1CYWNrU3RhY2suc2l6ZSgpLTE7CisgICAgICAgICAgICBpZiAobGFzdCA8IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmaW5hbCBCYWNrU3RhY2tFbnRyeSBic3MgPSBtQmFja1N0YWNrLnJlbW92ZShsYXN0KTsKKyAgICAgICAgICAgIGVucXVldWVBY3Rpb24obmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJQb3BwaW5nIGJhY2sgc3RhY2sgc3RhdGU6ICIgKyBic3MpOworICAgICAgICAgICAgICAgICAgICBic3MucG9wRnJvbUJhY2tTdGFjaygpOworICAgICAgICAgICAgICAgICAgICBtb3ZlVG9TdGF0ZShtQ3VyU3RhdGUsIHJldmVyc2VUcmFuc2l0KGJzcy5nZXRUcmFuc2l0aW9uKCkpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJzcy5nZXRUcmFuc2l0aW9uU3R5bGUoKSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbnQgaW5kZXggPSBtQmFja1N0YWNrLnNpemUoKS0xOworICAgICAgICAgICAgd2hpbGUgKGluZGV4ID49IDApIHsKKyAgICAgICAgICAgICAgICBCYWNrU3RhY2tFbnRyeSBic3MgPSBtQmFja1N0YWNrLmdldChpbmRleCk7CisgICAgICAgICAgICAgICAgaWYgKG5hbWUuZXF1YWxzKGJzcy5nZXROYW1lKCkpKSB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChpbmRleCA8IDAgfHwgaW5kZXggPT0gbUJhY2tTdGFjay5zaXplKCktMSkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZpbmFsIEFycmF5TGlzdDxCYWNrU3RhY2tFbnRyeT4gc3RhdGVzCisgICAgICAgICAgICAgICAgICAgID0gbmV3IEFycmF5TGlzdDxCYWNrU3RhY2tFbnRyeT4oKTsKKyAgICAgICAgICAgIGZvciAoaW50IGk9bUJhY2tTdGFjay5zaXplKCktMTsgaT5pbmRleDsgaS0tKSB7CisgICAgICAgICAgICAgICAgc3RhdGVzLmFkZChtQmFja1N0YWNrLnJlbW92ZShpKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbnF1ZXVlQWN0aW9uKG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxzdGF0ZXMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLnYoVEFHLCAiUG9wcGluZyBiYWNrIHN0YWNrIHN0YXRlOiAiICsgc3RhdGVzLmdldChpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZXMuZ2V0KGkpLnBvcEZyb21CYWNrU3RhY2soKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBtb3ZlVG9TdGF0ZShtQ3VyU3RhdGUsIHRydWUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKyAgICAKKyAgICBBcnJheUxpc3Q8RnJhZ21lbnQ+IHJldGFpbk5vbkNvbmZpZygpIHsKKyAgICAgICAgQXJyYXlMaXN0PEZyYWdtZW50PiBmcmFnbWVudHMgPSBudWxsOworICAgICAgICBpZiAobUFjdGl2ZSAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8bUFjdGl2ZS5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBtQWN0aXZlLmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAoZiAhPSBudWxsICYmIGYubVJldGFpbkluc3RhbmNlKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChmcmFnbWVudHMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZnJhZ21lbnRzID0gbmV3IEFycmF5TGlzdDxGcmFnbWVudD4oKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBmcmFnbWVudHMuYWRkKGYpOworICAgICAgICAgICAgICAgICAgICBmLm1SZXRhaW5pbmcgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZnJhZ21lbnRzOworICAgIH0KKyAgICAKKyAgICB2b2lkIHNhdmVGcmFnbWVudFZpZXdTdGF0ZShGcmFnbWVudCBmKSB7CisgICAgICAgIGlmIChmLm1WaWV3ID09IG51bGwpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBpZiAobVN0YXRlQXJyYXkgPT0gbnVsbCkgeworICAgICAgICAgICAgbVN0YXRlQXJyYXkgPSBuZXcgU3BhcnNlQXJyYXk8UGFyY2VsYWJsZT4oKTsKKyAgICAgICAgfQorICAgICAgICBmLm1WaWV3LnNhdmVIaWVyYXJjaHlTdGF0ZShtU3RhdGVBcnJheSk7CisgICAgICAgIGlmIChtU3RhdGVBcnJheS5zaXplKCkgPiAwKSB7CisgICAgICAgICAgICBmLm1TYXZlZFZpZXdTdGF0ZSA9IG1TdGF0ZUFycmF5OworICAgICAgICAgICAgbVN0YXRlQXJyYXkgPSBudWxsOworICAgICAgICB9CisgICAgfQorICAgIAorICAgIFBhcmNlbGFibGUgc2F2ZUFsbFN0YXRlKCkgeworICAgICAgICBpZiAobUFjdGl2ZSA9PSBudWxsIHx8IG1BY3RpdmUuc2l6ZSgpIDw9IDApIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyBGaXJzdCBjb2xsZWN0IGFsbCBhY3RpdmUgZnJhZ21lbnRzLgorICAgICAgICBpbnQgTiA9IG1BY3RpdmUuc2l6ZSgpOworICAgICAgICBGcmFnbWVudFN0YXRlW10gYWN0aXZlID0gbmV3IEZyYWdtZW50U3RhdGVbTl07CisgICAgICAgIGJvb2xlYW4gaGF2ZUZyYWdtZW50cyA9IGZhbHNlOworICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICBGcmFnbWVudCBmID0gbUFjdGl2ZS5nZXQoaSk7CisgICAgICAgICAgICBpZiAoZiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaGF2ZUZyYWdtZW50cyA9IHRydWU7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgRnJhZ21lbnRTdGF0ZSBmcyA9IG5ldyBGcmFnbWVudFN0YXRlKGYpOworICAgICAgICAgICAgICAgIGFjdGl2ZVtpXSA9IGZzOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmIChtU3RhdGVCdW5kbGUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtU3RhdGVCdW5kbGUgPSBuZXcgQnVuZGxlKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGYub25TYXZlSW5zdGFuY2VTdGF0ZShtU3RhdGVCdW5kbGUpOworICAgICAgICAgICAgICAgIGlmICghbVN0YXRlQnVuZGxlLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgICAgICAgICBmcy5tU2F2ZWRGcmFnbWVudFN0YXRlID0gbVN0YXRlQnVuZGxlOworICAgICAgICAgICAgICAgICAgICBtU3RhdGVCdW5kbGUgPSBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZiAoZi5tVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHNhdmVGcmFnbWVudFZpZXdTdGF0ZShmKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGYubVNhdmVkVmlld1N0YXRlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmcy5tU2F2ZWRGcmFnbWVudFN0YXRlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcy5tU2F2ZWRGcmFnbWVudFN0YXRlID0gbmV3IEJ1bmRsZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZnMubVNhdmVkRnJhZ21lbnRTdGF0ZS5wdXRTcGFyc2VQYXJjZWxhYmxlQXJyYXkoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50U3RhdGUuVklFV19TVEFURV9UQUcsIGYubVNhdmVkVmlld1N0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKCFoYXZlRnJhZ21lbnRzKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaW50W10gYWRkZWQgPSBudWxsOworICAgICAgICBCYWNrU3RhY2tTdGF0ZVtdIGJhY2tTdGFjayA9IG51bGw7CisgICAgICAgIAorICAgICAgICAvLyBCdWlsZCBsaXN0IG9mIGN1cnJlbnRseSBhZGRlZCBmcmFnbWVudHMuCisgICAgICAgIE4gPSBtQWRkZWQuc2l6ZSgpOworICAgICAgICBpZiAoTiA+IDApIHsKKyAgICAgICAgICAgIGFkZGVkID0gbmV3IGludFtOXTsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKKyAgICAgICAgICAgICAgICBhZGRlZFtpXSA9IG1BZGRlZC5nZXQoaSkubUluZGV4OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICAvLyBOb3cgc2F2ZSBiYWNrIHN0YWNrLgorICAgICAgICBpZiAobUJhY2tTdGFjayAhPSBudWxsKSB7CisgICAgICAgICAgICBOID0gbUJhY2tTdGFjay5zaXplKCk7CisgICAgICAgICAgICBpZiAoTiA+IDApIHsKKyAgICAgICAgICAgICAgICBiYWNrU3RhY2sgPSBuZXcgQmFja1N0YWNrU3RhdGVbTl07CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICA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uQ29uZmlnICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxub25Db25maWcuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBGcmFnbWVudCBmID0gbm9uQ29uZmlnLmdldChpKTsKKyAgICAgICAgICAgICAgICBGcmFnbWVudFN0YXRlIGZzID0gZm1zLm1BY3RpdmVbZi5tSW5kZXhdOworICAgICAgICAgICAgICAgIGZzLm1JbnN0YW5jZSA9IGY7CisgICAgICAgICAgICAgICAgZi5tU2F2ZWRWaWV3U3RhdGUgPSBudWxsOworICAgICAgICAgICAgICAgIGYubUJhY2tTdGFja05lc3RpbmcgPSAwOworICAgICAgICAgICAgICAgIGYubUFkZGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgaWYgKGZzLm1TYXZlZEZyYWdtZW50U3RhdGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmLm1TYXZlZFZpZXdTdGF0ZSA9IGZzLm1TYXZlZEZyYWdtZW50U3RhdGUuZ2V0U3BhcnNlUGFyY2VsYWJsZUFycmF5KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYWdtZW50U3RhdGUuVklFV19TVEFURV9UQUcpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgLy8gQnVpbGQgdGhlIGZ1bGwgbGlzdCBvZiBhY3RpdmUgZnJhZ21lbnRzLCBpbnN0YW50aWF0aW5nIHRoZW0gZnJvbQorICAgICAgICAvLyB0aGVpciBzYXZlZCBzdGF0ZS4KKyAgICAgICAgbUFjdGl2ZSA9IG5ldyBBcnJheUxpc3Q8RnJhZ21lbnQ+KGZtcy5tQWN0aXZlLmxlbmd0aCk7CisgICAgICAgIGlmIChtQXZhaWxJbmRpY2VzICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1BdmFpbEluZGljZXMuY2xlYXIoKTsKKyAgICAgICAgfQorICAgICAgICBmb3IgKGludCBpPTA7IGk8Zm1zLm1BY3RpdmUubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgIEZyYWdtZW50U3RhdGUgZnMgPSBmbXMubUFjdGl2ZVtpXTsKKyAgICAgICAgICAgIGlmIChmcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUFjdGl2ZS5hZGQoZnMuaW5zdGFudGlhdGUobUFjdGl2aXR5KSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1BY3RpdmUuYWRkKG51bGwpOworICAgICAgICAgICAgICAgIGlmIChtQXZhaWxJbmRpY2VzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUF2YWlsSW5kaWNlcyA9IG5ldyBBcnJheUxpc3Q8SW50ZWdlcj4oKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbUF2YWlsSW5kaWNlcy5hZGQoaSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8vIEJ1aWxkIHRoZSBsaXN0IG9mIGN1cnJlbnRseSBhZGRlZCBmcmFnbWVudHMuCisgICAgICAgIGlmIChmbXMubUFkZGVkICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1BZGRlZCA9IG5ldyBBcnJheUxpc3Q8RnJhZ21lbnQ+KGZtcy5tQWRkZWQubGVuZ3RoKTsKKyAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxmbXMubUFkZGVkLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BY3RpdmUuZ2V0KGZtcy5tQWRkZWRbaV0pOworICAgICAgICAgICAgICAgIGlmIChmID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTm8gaW5zdGFudGlhdGVkIGZyYWdtZW50IGZvciBpbmRleCAjIiArIGZtcy5tQWRkZWRbaV0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmLm1BZGRlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgZi5tSW1tZWRpYXRlQWN0aXZpdHkgPSBtQWN0aXZpdHk7CisgICAgICAgICAgICAgICAgbUFkZGVkLmFkZChmKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1BZGRlZCA9IG51bGw7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8vIEJ1aWxkIHRoZSBiYWNrIHN0YWNrLgorICAgICAgICBpZiAoZm1zLm1CYWNrU3RhY2sgIT0gbnVsbCkgeworICAgICAgICAgICAgbUJhY2tTdGFjayA9IG5ldyBBcnJheUxpc3Q8QmFja1N0YWNrRW50cnk+KGZtcy5tQmFja1N0YWNrLmxlbmd0aCk7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8Zm1zLm1CYWNrU3RhY2subGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICBCYWNrU3RhY2tFbnRyeSBic2UgPSBmbXMubUJhY2tTdGFja1tpXS5pbnN0YW50aWF0ZSh0aGlzKTsKKyAgICAgICAgICAgICAgICBtQmFja1N0YWNrLmFkZChic2UpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbUJhY2tTdGFjayA9IG51bGw7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgYXR0YWNoQWN0aXZpdHkoQWN0aXZpdHkgYWN0aXZpdHkpIHsKKyAgICAgICAgaWYgKG1BY3Rpdml0eSAhPSBudWxsKSB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCk7CisgICAgICAgIG1BY3Rpdml0eSA9IGFjdGl2aXR5OworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBkaXNwYXRjaENyZWF0ZSgpIHsKKyAgICA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aWRkZW4gJiYgZi5tSGFzTWVudSkgeworICAgICAgICAgICAgICAgICAgICBzaG93ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgZi5vbkNyZWF0ZU9wdGlvbnNNZW51KG1lbnUsIGluZmxhdGVyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHNob3c7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBib29sZWFuIGRpc3BhdGNoUHJlcGFyZU9wdGlvbnNNZW51KE1lbnUgbWVudSkgeworICAgICAgICBib29sZWFuIHNob3cgPSBmYWxzZTsKKyAgICAgICAgaWYgKG1BY3RpdmUgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPG1BZGRlZC5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBtQWRkZWQuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwgJiYgIWYubUhpZGRlbiAmJiBmLm1IYXNNZW51KSB7CisgICAgICAgICAgICAgICAgICAgIHNob3cgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBmLm9uUHJlcGFyZU9wdGlvbnNNZW51KG1lbnUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gc2hvdzsKKyAgICB9CisgICAgCisgICAgcHVibGljIGJvb2xlYW4gZGlzcGF0Y2hPcHRpb25zSXRlbVNlbGVjdGVkKE1lbnVJdGVtIGl0ZW0pIHsKKyAgICAgICAgaWYgKG1BY3RpdmUgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPG1BZGRlZC5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgIEZyYWdtZW50IGYgPSBtQWRkZWQuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChmICE9IG51bGwgJiYgIWYubUhpZGRlbiAmJiBmLm1IYXNNZW51KSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChmLm9uT3B0aW9uc0l0ZW1TZWxlY3RlZChpdGVtKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgYm9vbGVhbiBkaXNwYXRjaENvbnRleHRJdGVtU2VsZWN0ZWQoTWVudUl0ZW0gaXRlbSkgeworICAgICAgICBpZiAobUFjdGl2ZSAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8bUFkZGVkLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BZGRlZC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCAmJiAhZi5tSGlkZGVuKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChmLm9uQ29udGV4dEl0ZW1TZWxlY3RlZChpdGVtKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBkaXNwYXRjaE9wdGlvbnNNZW51Q2xvc2VkKE1lbnUgbWVudSkgeworICAgICAgICBpZiAobUFjdGl2ZSAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8bUFkZGVkLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgRnJhZ21lbnQgZiA9IG1BZGRlZC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGYgIT0gbnVsbCAmJiAhZi5tSGlkZGVuICYmIGYubUhhc01lbnUpIHsKKyAgICAgICAgICAgICAgICAgICAgZi5vbk9wdGlvbnNNZW51Q2xvc2VkKG1lbnUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwdWJsaWMgc3RhdGljIGludCByZXZlcnNlVHJhbnNpdChpbnQgdHJhbnNpdCkgeworICAgICAgICBpbnQgcmV2ID0gMDsKKyAgICAgICAgc3dpdGNoICh0cmFuc2l0KSB7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9FTlRFUjoKKyAgICAgICAgICAgICAgICByZXYgPSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfRVhJVDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX0VYSVQ6CisgICAgICAgICAgICAgICAgcmV2ID0gRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX0VOVEVSOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfU0hPVzoKKyAgICAgICAgICAgICAgICByZXYgPSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfSElERTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX0hJREU6CisgICAgICAgICAgICAgICAgcmV2ID0gRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1NIT1c7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9BQ1RJVklUWV9PUEVOOgorICAgICAgICAgICAgICAgIHJldiA9IEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9BQ1RJVklUWV9DTE9TRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX0FDVElWSVRZX0NMT1NFOgorICAgICAgICAgICAgICAgIHJldiA9IEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9BQ1RJVklUWV9PUEVOOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfVEFTS19PUEVOOgorICAgICAgICAgICAgICAgIHJldiA9IEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9UQVNLX0NMT1NFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfVEFTS19DTE9TRToKKyAgICAgICAgICAgICAgICByZXYgPSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfVEFTS19PUEVOOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfVEFTS19UT19GUk9OVDoKKyAgICAgICAgICAgICAgICByZXYgPSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfVEFTS19UT19CQUNLOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfVEFTS19UT19CQUNLOgorICAgICAgICAgICAgICAgIHJldiA9IEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9UQVNLX1RPX0ZST05UOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfV0FMTFBBUEVSX09QRU46CisgICAgICAgICAgICAgICAgcmV2ID0gRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1dBTExQQVBFUl9DTE9TRTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1dBTExQQVBFUl9DTE9TRToKKyAgICAgICAgICAgICAgICByZXYgPSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfV0FMTFBBUEVSX09QRU47CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9XQUxMUEFQRVJfSU5UUkFfT1BFTjoKKyAgICAgICAgICAgICAgICByZXYgPSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfV0FMTFBBUEVSX0lOVFJBX0NMT1NFOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfV0FMTFBBUEVSX0lOVFJBX0NMT1NFOgorICAgICAgICAgICAgICAgIHJldiA9IEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9XQUxMUEFQRVJfSU5UUkFfT1BFTjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmV2OworICAgICAgICAKKyAgICB9CisgICAgCisgICAgcHVibGljIHN0YXRpYyBpbnQgdHJhbnNpdFRvU3R5bGVJbmRleChpbnQgdHJhbnNpdCwgYm9vbGVhbiBlbnRlcikgeworICAgICAgICBpbnQgYW5pbUF0dHIgPSAtMTsKKyAgICAgICAgc3dpdGNoICh0cmFuc2l0KSB7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9FTlRFUjoKKyAgICAgICAgICAgICAgICBhbmltQXR0ciA9IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl93aW5kb3dFbnRlckFuaW1hdGlvbjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX0VYSVQ6CisgICAgICAgICAgICAgICAgYW5pbUF0dHIgPSBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fd2luZG93RXhpdEFuaW1hdGlvbjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1NIT1c6CisgICAgICAgICAgICAgICAgYW5pbUF0dHIgPSBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fd2luZG93U2hvd0FuaW1hdGlvbjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX0hJREU6CisgICAgICAgICAgICAgICAgYW5pbUF0dHIgPSBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fd2luZG93SGlkZUFuaW1hdGlvbjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX0FDVElWSVRZX09QRU46CisgICAgICAgICAgICAgICAgYW5pbUF0dHIgPSBlbnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgPyBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fYWN0aXZpdHlPcGVuRW50ZXJBbmltYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIDogY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX2FjdGl2aXR5T3BlbkV4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9BQ1RJVklUWV9DTE9TRToKKyAgICAgICAgICAgICAgICBhbmltQXR0ciA9IGVudGVyCisgICAgICAgICAgICAgICAgICAgICAgICA/IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl9hY3Rpdml0eUNsb3NlRW50ZXJBbmltYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIDogY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX2FjdGl2aXR5Q2xvc2VFeGl0QW5pbWF0aW9uOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfVEFTS19PUEVOOgorICAgICAgICAgICAgICAgIGFuaW1BdHRyID0gZW50ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgID8gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3Rhc2tPcGVuRW50ZXJBbmltYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIDogY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3Rhc2tPcGVuRXhpdEFuaW1hdGlvbjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1RBU0tfQ0xPU0U6CisgICAgICAgICAgICAgICAgYW5pbUF0dHIgPSBlbnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgPyBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fdGFza0Nsb3NlRW50ZXJBbmltYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIDogY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3Rhc2tDbG9zZUV4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9UQVNLX1RPX0ZST05UOgorICAgICAgICAgICAgICAgIGFuaW1BdHRyID0gZW50ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgID8gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3Rhc2tUb0Zyb250RW50ZXJBbmltYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIDogY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3Rhc2tUb0Zyb250RXhpdEFuaW1hdGlvbjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1RBU0tfVE9fQkFDSzoKKyAgICAgICAgICAgICAgICBhbmltQXR0ciA9IGVudGVyCisgICAgICAgICAgICAgICAgICAgICAgICA/IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl90YXNrVG9CYWNrRW50ZXJBbmltYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIDogY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuV2luZG93QW5pbWF0aW9uX3Rhc2tUb0JhY2tFeGl0QW5pbWF0aW9uOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFnbWVudFRyYW5zYWN0aW9uLlRSQU5TSVRfV0FMTFBBUEVSX09QRU46CisgICAgICAgICAgICAgICAgYW5pbUF0dHIgPSBlbnRlcgorICAgICAgICAgICAgICAgICAgICAgICAgPyBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5XaW5kb3dBbmltYXRpb25fd2FsbHBhcGVyT3BlbkVudGVyQW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl93YWxscGFwZXJPcGVuRXhpdEFuaW1hdGlvbjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRnJhZ21lbnRUcmFuc2FjdGlvbi5UUkFOU0lUX1dBTExQQVBFUl9DTE9TRToKKyAgICAgICAgICAgICAgICBhbmltQXR0ciA9IGVudGVyCisgICAgICAgICAgICAgICAgICAgICAgICA/IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl93YWxscGFwZXJDbG9zZUVudGVyQW5pbWF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICA6IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl93YWxscGFwZXJDbG9zZUV4aXRBbmltYXRpb247CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYWdtZW50VHJhbnNhY3Rpb24uVFJBTlNJVF9XQUxMUEFQRVJfSU5UUkFfT1BFTjoKKyAgICAgICAgICAgICAgICBhbmltQXR0ciA9IGVudGVyCisgICAgICAgICAgICAgICAgICAgICAgICA/IGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLldpbmRvd0FuaW1hdGlvbl93YWxscGFwZXJJbnRyYU9wZW5FbnRlckFuaW1hdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgOiBjb20uYW5kcm9pZC5pbnRlcm5h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JldHVybiBhY3Rpdml0eTsKICAgICB9CiAKQEAgLTEwNTgsMjEgKzEwNjAsMjMgQEAKICAgICB9CiAgICAgCiAgICAgcHVibGljIHZvaWQgY2FsbEFjdGl2aXR5T25EZXN0cm95KEFjdGl2aXR5IGFjdGl2aXR5KSB7Ci0gICAgICBpZiAobVdhaXRpbmdBY3Rpdml0aWVzICE9IG51bGwpIHsKLSAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1TeW5jKSB7Ci0gICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbVdhaXRpbmdBY3Rpdml0aWVzLnNpemUoKTsKLSAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgewotICAgICAgICAgICAgICAgICAgZmluYWwgQWN0aXZpdHlXYWl0ZXIgYXcgPSBtV2FpdGluZ0FjdGl2aXRpZXMuZ2V0KGkpOwotICAgICAgICAgICAgICAgICAgZmluYWwgSW50ZW50IGludGVudCA9IGF3LmludGVudDsKLSAgICAgICAgICAgICAgICAgIGlmIChpbnRlbnQuZmlsdGVyRXF1YWxzKGFjdGl2aXR5LmdldEludGVudCgpKSkgewotICAgICAgICAgICAgICAgICAgICAgIGF3LmFjdGl2aXR5ID0gYWN0aXZpdHk7Ci0gICAgICAgICAgICAgICAgICAgICAgbU1lc3NhZ2VRdWV1ZS5hZGRJZGxlSGFuZGxlcihuZXcgQWN0aXZpdHlHb2luZyhhdykpOwotICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICB9Ci0gICAgICAgICAgfQotICAgICAgfQorICAgICAgLy8gVE9ETzogdGhlIGZvbGxvd2luZyBibG9jayBjYXVzZXMgaW50ZXJtaXR0ZW50IGhhbmdzIHdoZW4gdXNpbmcgc3RhcnRBY3Rpdml0eQorICAgICAgLy8gdGVtcG9yYXJpbHkgY29tbWVudCBvdXQgdW50aWwgcm9vdCBjYXVzZSBpcyBmaXhlZCAoYnVnIDI2MzA2ODMpCisvLyAgICAgIGlmIChtV2FpdGluZ0FjdGl2aXRpZXMgIT0gbnVsbCkgeworLy8gICAgICAgICAgc3luY2hyb25pemVkIChtU3luYykgeworLy8gICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbVdhaXRpbmdBY3Rpdml0aWVzLnNpemUoKTsKKy8vICAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisvLyAgICAgICAgICAgICAgICAgIGZpbmFsIEFjdGl2aXR5V2FpdGVyIGF3ID0gbVdhaXRpbmdBY3Rpdml0aWVzLmdldChpKTsKKy8vICAgICAgICAgICAgICAgICAgZmluYWwgSW50ZW50IGludGVudCA9IGF3LmludGVudDsKKy8vICAgICAgICAgICAgICAgICAgaWYgKGludGVudC5maWx0ZXJFcXVhbHMoYWN0aXZpdHkuZ2V0SW50ZW50KCkpKSB7CisvLyAgICAgICAgICAgICAgICAgICAgICBhdy5hY3Rpdml0eSA9IGFjdGl2aXR5OworLy8gICAgICAgICAgICAgICAgICAgICAgbU1lc3NhZ2VRdWV1ZS5hZGRJZGxlSGFuZGxlcihuZXcgQWN0aXZpdHlHb2luZyhhdykpOworLy8gICAgICAgICAgICAgICAgICB9CisvLyAgICAgICAgICAgICAgfQorLy8gICAgICAgICAgfQorLy8gICAgICB9CiAgICAgICAKLSAgICAgIGFjdGl2aXR5Lm9uRGVzdHJveSgpOworICAgICAgYWN0aXZpdHkucGVyZm9ybURlc3Ryb3koKTsKICAgICAgIAogICAgICAgaWYgKG1BY3Rpdml0eU1vbml0b3JzICE9IG51bGwpIHsKICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1TeW5jKSB7CkBAIC0xMzMxLDcgKzEzMzUsNyBAQAogICAgICAqICAgICAgICAgICAgICAgICAgICAgIGlzIGJlaW5nIHN0YXJ0ZWQuCiAgICAgICogQHBhcmFtIHRva2VuIEludGVybmFsIHRva2VuIGlkZW50aWZ5aW5nIHRvIHRoZSBzeXN0ZW0gd2hvIGlzIHN0YXJ0aW5nIAogICAgICAqICAgICAgICAgICAgICB0a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m9tQ2hpbGQKKyAgICAgKiAKKyAgICAgKiB7QGhpZGV9CisgICAgICovCisgICAgcHVibGljIEFjdGl2aXR5UmVzdWx0IGV4ZWNTdGFydEFjdGl2aXR5KAorICAgICAgICBDb250ZXh0IHdobywgSUJpbmRlciBjb250ZXh0VGhyZWFkLCBJQmluZGVyIHRva2VuLCBGcmFnbWVudCB0YXJnZXQsCisgICAgICAgIEludGVudCBpbnRlbnQsIGludCByZXF1ZXN0Q29kZSkgeworICAgICAgICBJQXBwbGljYXRpb25UaHJlYWQgd2hvVGhyZWFkID0gKElBcHBsaWNhdGlvblRocmVhZCkgY29udGV4dFRocmVhZDsKKyAgICAgICAgaWYgKG1BY3Rpdml0eU1vbml0b3JzICE9IG51bGwpIHsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZCAobVN5bmMpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BY3Rpdml0eU1vbml0b3JzLnNpemUoKTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIEFjdGl2aXR5TW9uaXRvciBhbSA9IG1BY3Rpdml0eU1vbml0b3JzLmdldChpKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFtLm1hdGNoKHdobywgbnVsbCwgaW50ZW50KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgYW0ubUhpdHMrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbS5pc0Jsb2NraW5nKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVxdWVzdENvZGUgPj0gMCA/IGFtLmdldFJlc3VsdCgpIDogbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAg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orICAgICAqIGRhdGEgYXNzb2NpYXRlZCB3aXRoIHRoZSBzZWxlY3RlZCBpdGVtLgorICAgICAqCisgICAgICogQHBhcmFtIGwgVGhlIExpc3RWaWV3IHdoZXJlIHRoZSBjbGljayBoYXBwZW5lZAorICAgICAqIEBwYXJhbSB2IFRoZSB2aWV3IHRoYXQgd2FzIGNsaWNrZWQgd2l0aGluIHRoZSBMaXN0VmlldworICAgICAqIEBwYXJhbSBwb3NpdGlvbiBUaGUgcG9zaXRpb24gb2YgdGhlIHZpZXcgaW4gdGhlIGxpc3QKKyAgICAgKiBAcGFyYW0gaWQgVGhlIHJvdyBpZCBvZiB0aGUgaXRlbSB0aGF0IHdhcyBjbGlja2VkCisgICAgICovCisgICAgcHVibGljIHZvaWQgb25MaXN0SXRlbUNsaWNrKExpc3RWaWV3IGwsIFZpZXcgdiwgaW50IHBvc2l0aW9uLCBsb25nIGlkKSB7CisgICAgfQorCisgICAgLyoqCisgICAgICogUHJvdmlkZSB0aGUgY3Vyc29yIGZvciB0aGUgbGlzdCB2aWV3LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldExpc3RBZGFwdGVyKExpc3RBZGFwdGVyIGFkYXB0ZXIpIHsKKyAgICAgICAgbUFkYXB0ZXIgPSBhZGFwdGVyOworICAgICAgICBpZiAobUxpc3QgIT0gbnVsbCkgeworICAgICAgICAgICAgbUxpc3Quc2V0QWRhcHRlcihhZGFwdGVyKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCB0aGUgY3VycmVudGx5IHNlbGVjdGVkIGxpc3QgaXRlbSB0byB0aGUgc3BlY2lmaWVkCisgICAgICogcG9zaXRpb24gd2l0aCB0aGUgYWRhcHRlcidzIGRhdGEKKyAgICAgKgorICAgICAqIEBwYXJhbSBwb3NpdGlvbgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFNlbGVjdGlvbihpbnQgcG9zaXRpb24pIHsKKyAgICAgICAgZW5zdXJlTGlzdCgpOworICAgICAgICBtTGlzdC5zZXRTZWxlY3Rpb24ocG9zaXRpb24pOworICAgIH0KKworICAgIC8qKgorICAgICAqIEdldCB0aGUgcG9zaXRpb24gb2YgdGhlIGN1cnJlbnRseSBzZWxlY3RlZCBsaXN0IGl0ZW0uCisgICAgICovCisgICAgcHVibGljIGludCBnZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpIHsKKyAgICAgICAgZW5zdXJlTGlzdCgpOworICAgICAgICByZXR1cm4gbUxpc3QuZ2V0U2VsZWN0ZWRJdGVtUG9zaXRpb24oKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHZXQgdGhlIGN1cnNvciByb3cgSUQgb2YgdGhlIGN1cnJlbnRseSBzZWxlY3RlZCBsaXN0IGl0ZW0uCisgICAgICovCisgICAgcHVibGljIGxvbmcgZ2V0U2VsZWN0ZWRJdGVtSWQoKSB7CisgICAgICAgIGVuc3VyZUxpc3QoKTsKKyAgICAgICAgcmV0dXJuIG1MaXN0LmdldFNlbGVjdGVkSXRlbUlkKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogR2V0IHRoZSBhY3Rpdml0eSdzIGxpc3QgdmlldyB3aWRnZXQuCisgICAgICovCisgICAgcHVibGljIExpc3RWaWV3IGdldExpc3RWaWV3KCkgeworICAgICAgICBlbnN1cmVMaXN0KCk7CisgICAgICAgIHJldHVybiBtTGlzdDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGUgZGVmYXVsdCBjb250ZW50IGZvciBhIExpc3RGcmFnbWVudCBoYXMgYSBUZXh0VmlldyB0aGF0IGNhbgorICAgICAqIGJlIHNob3duIHdoZW4gdGhlIGxpc3QgaXMgZW1wdHkuICBJZiB5b3Ugd291bGQgbGlrZSB0byBoYXZlIGl0CisgICAgICogc2hvd24sIGNhbGwgdGhpcyBtZXRob2QgdG8gc3VwcGx5IHRoZSB0ZXh0IGl0IHNob3VsZCB1c2UuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2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BwdWJsaWMgdm9pZCBzZXRMaXN0U2hvd24oYm9vbGVhbiBzaG93biwgYm9vbGVhbiBhbmltYXRlKSB7CisgICAgICAgIGVuc3VyZUxpc3QoKTsKKyAgICAgICAgaWYgKG1Qcm9ncmVzc0NvbnRhaW5lciA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJDYW4ndCBiZSB1c2VkIHdpdGggYSBjdXN0b20gY29udGVudCB2aWV3Iik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1MaXN0U2hvd24gPT0gc2hvd24pIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBtTGlzdFNob3duID0gc2hvd247CisgICAgICAgIGlmIChzaG93bikgeworICAgICAgICAgICAgaWYgKGFuaW1hdGUpIHsKKyAgICAgICAgICAgICAgICBtUHJvZ3Jlc3NDb250YWluZXIuc3RhcnRBbmltYXRpb24oQW5pbWF0aW9uVXRpbHMubG9hZEFuaW1hdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgIGdldEFjdGl2aXR5KCksIGFuZHJvaWQuUi5hbmltLmZhZGVfb3V0KSk7CisgICAgICAgICAgICAgICAgbUxpc3RDb250YWluZXIuc3RhcnRBbmltYXRpb24oQW5pbWF0aW9uVXRpbHMubG9hZEFuaW1hdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgIGdldEFjdGl2aXR5KCksIGFuZHJvaWQuUi5hbmltLmZhZGVfaW4pKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Qcm9ncmVzc0NvbnRhaW5lci5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICBtTGlzdENvbnRhaW5lci5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAoYW5pbWF0ZSkgeworICAgICAgICAgICAgICAgIG1Qcm9ncmVzc0NvbnRhaW5lci5zdGFydEFuaW1hdGlvbihBbmltYXRpb25VdGlscy5sb2FkQW5pbWF0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgZ2V0QWN0aXZpdHkoKSwgYW5kcm9pZC5SLmFuaW0uZmFkZV9pbikpOworICAgICAgICAgICAgICAgIG1MaXN0Q29udGFpbmVyLnN0YXJ0QW5pbWF0aW9uKEFuaW1hdGlvblV0aWxzLmxvYWRBbmltYXRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICBnZXRBY3Rpdml0eSgpLCBhbmRyb2lkLlIuYW5pbS5mYWRlX291dCkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVByb2dyZXNzQ29udGFpbmVyLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgIG1MaXN0Q29udGFpbmVyLnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBHZXQgdGhlIExpc3RBZGFwdGVyIGFzc29jaWF0ZWQgd2l0aCB0aGlzIGFjdGl2aXR5J3MgTGlzdFZpZXcuCisgICAgICovCisgICAgcHVibGljIExpc3RBZGFwdGVyIGdldExpc3RBZGFwdGVyKCkgeworICAgICAgICByZXR1cm4gbUFkYXB0ZXI7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGVuc3VyZUxpc3QoKSB7CisgICAgICAgIGlmIChtTGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgVmlldyByb290ID0gZ2V0VmlldygpOworICAgICAgICBpZiAocm9vdCA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJDb250ZW50IHZpZXcgbm90IHlldCBjcmVhdGVkIik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHJvb3QgaW5zdGFuY2VvZiBMaXN0VmlldykgeworICAgICAgICAgICAgbUxpc3QgPSAoTGlzdFZpZXcpcm9vdDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1TdGFuZGFyZEVtcHR5VmlldyA9IChUZXh0Vmlldylyb290LmZpbmRWaWV3QnlJZCgKKyAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5pbnRlcm5hbEVtcHR5KTsKKyAgICAgICAgICAgIGlmIChtU3RhbmRhcmRFbXB0eVZpZXcgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1FbXB0eVZpZXcgPSByb290LmZpbmRWaWV3QnlJZChhbmRyb2lkLlIuaWQuZW1wdHkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVByb2dyZXNzQ29udGFpbmVyID0gcm9vdC5maW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5wcm9ncmVzc0NvbnRhaW5lcik7CisgICAgICAgICAgICBtTGlzdENvbnRhaW5lciA9IHJvb3QuZmluZFZpZXdCeUlkKGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQubGlzdENvbnRhaW5lcik7CisgICAgICAgICAgICBWaWV3IHJhd0xpc3RWaWV3ID0gcm9vdC5maW5kVmlld0J5SWQoYW5kcm9pZC5SLmlkLmxpc3QpOworICAgICAgICAgICAgaWYgKCEocmF3TGlzdFZpZXcgaW5zdGFuY2VvZiBMaXN0VmlldykpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICJDb250ZW50IGhhcyB2aWV3IHdpdGggaWQgYXR0cmlidXRlICdhbmRyb2lkLlIuaWQubGlzdCcgIgorICAgICAgICAgICAgICAgICAgICAgICAgKyAidGhhdCBpcyBub3QgYSBMaXN0VmlldyBjbGFzcyIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUxpc3QgPSAoTGlzdFZpZXcpcmF3TGlzdFZpZXc7CisgICAgICAgICAgICBpZiAobUxpc3QgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgIllvdXIgY29udGVudCBtdXN0IGhhdmUgYSBMaXN0VmlldyB3aG9zZSBpZCBhdHRyaWJ1dGUgaXMgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAiJ2FuZHJvaWQuUi5pZC5saXN0JyIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKG1FbXB0eVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1MaXN0LnNldEVtcHR5VmlldyhtRW1wdHlWaWV3KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBtTGlzdFNob3duID0gdHJ1ZTsKKyAgICAgICAgbUxpc3Quc2V0T25JdGVtQ2xpY2tMaXN0ZW5lcihtT25DbGlja0xpc3RlbmVyKTsKKyAgICAgICAgaWYgKG1BZGFwdGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIHNldExpc3RBZGFwdGVyKG1BZGFwdGVyKTsKKyAgICAgICAgfQorICAgICAgICBtSGFuZGxlci5wb3N0KG1SZXF1ZXN0Rm9jdXMpOworICAgIH0KK30KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9Mb2FkZXJNYW5hZ2luZ0ZyYWdtZW50LmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9hcHAvTG9hZGVyTWFuYWdpbmdGcmFnbWVudC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjVkNDE3YTAKLS0tIC9kZXYvbnVsbAorKysgYi9jb3JlL2phdmEvYW5kcm9pZC9hcHAvTG9hZGVyTWFuYWdpbmdGcmFnbWVudC5qYXZhCkBAIC0wLDAgKzEsMjA0IEBACisvKgorICogQ29weXJpZ2h0IChDKSAyMDEw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ICBtSW5hY3RpdmVMb2FkZXJzLnJlbW92ZShpZCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvbkNyZWF0ZShCdW5kbGUgc2F2ZWRTdGF0ZSkgeworICAgICAgICBzdXBlci5vbkNyZWF0ZShzYXZlZFN0YXRlKTsKKworICAgICAgICBpZiAobUxvYWRlcnMgPT0gbnVsbCkgeworICAgICAgICAgICAgLy8gTG9vayBmb3IgYSBwYXNzZWQgYWxvbmcgbG9hZGVyIGFuZCBjcmVhdGUgYSBuZXcgb25lIGlmIGl0J3Mgbm90IHRoZXJlCisvLyBUT0RPOiB1bmNvbW1lbnQgb25jZSBnZXRMYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlIG1ldGhvZCBpcyBhdmFpbGFibGUKKy8vICAgICAgICAgICAgbUxvYWRlcnMgPSAoSGFzaE1hcDxJbnRlZ2VyLCBMb2FkZXJJbmZvPikgZ2V0TGFzdE5vbkNvbmZpZ3VyYXRpb25JbnN0YW5jZSgpOworICAgICAgICAgICAgaWYgKG1Mb2FkZXJzID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtTG9hZGVycyA9IG5ldyBIYXNoTWFwPEludGVnZXIsIExvYWRlckluZm88RD4+KCk7CisgICAgICAgICAgICAgICAgb25Jbml0aWFsaXplTG9hZGVycygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChtSW5hY3RpdmVMb2FkZXJzID09IG51bGwpIHsKKyAgICAgICAgICAgIG1JbmFjdGl2ZUxvYWRlcnMgPSBuZXcgSGFzaE1hcDxJbnRlZ2VyLCBMb2FkZXJJbmZvPEQ+PigpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25TdGFydCgpIHsKKyAgICAgICAgc3VwZXIub25TdGFydCgpOworCisgICAgICAgIC8vIENhbGwgb3V0IHRvIHN1YiBjbGFzc2Vz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gICAgICBMb2FkZXI8RD4gbG9hZGVyID0gaW5mby5sb2FkZXI7CisgICAgICAgICAgICBpZiAobG9hZGVyID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gTGV0IHRoZSBsb2FkZXIga25vdyB3ZSdyZSBkb25lIHdpdGggaXQKKyAgICAgICAgICAgIGxvYWRlci51bnJlZ2lzdGVyTGlzdGVuZXIodGhpcyk7CisKKyAgICAgICAgICAgIC8vIFRoZSBsb2FkZXIgaXNuJ3QgZ2V0dGluZyBwYXNzZWQgYWxvbmcgdG8gdGhlIG5leHQgaW5zdGFuY2Ugc28gYXNrIGl0IHRvIHN0b3AgbG9hZGluZworICAgICAgICAgICAgaWYgKCFnZXRBY3Rpdml0eSgpLmlzQ2hhbmdpbmdDb25maWd1cmF0aW9ucygpKSB7CisgICAgICAgICAgICAgICAgbG9hZGVyLnN0b3BMb2FkaW5nKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBtU3RhcnRlZCA9IGZhbHNlOworICAgIH0KKworICAgIC8qKiBUTyBETzogVGhpcyBuZWVkcyB0byBiZSB0dXJuZWQgaW50byBhIHJldGFpbmVkIGZyYWdtZW50LgorICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBPYmplY3Qgb25SZXRhaW5Ob25Db25maWd1cmF0aW9uSW5zdGFuY2UoKSB7CisgICAgICAgIC8vIFBhc3MgdGhlIGxvYWRlciBhbG9uZyB0byB0aGUgbmV4dCBndXkKKyAgICAgICAgT2JqZWN0IHJlc3VsdCA9IG1Mb2FkZXJzOworICAgICAgICBtTG9hZGVycyA9IG51bGw7CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorICAgICoqLworCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25EZXN0cm95KCkgeworICAgICAgICBzdXBlci5vbkRlc3Ryb3koKTsKKworICAgICAgICBpZiAobUxvYWRlcnMgIT0gbnVsbCkgeworICAgICAgICAgICAgZm9yIChIYXNoTWFwLkVudHJ5PEludGVnZXIsIExvYWRlckluZm88RD4+IGVudHJ5IDogbUxvYWRlcnMuZW50cnlTZXQoKSkgeworICAgICAgICAgICAgICAgIExvYWRlckluZm88RD4gaW5mbyA9IGVudHJ5LmdldFZhbHVlKCk7CisgICAgICAgICAgICAgICAgTG9hZGVyPEQ+IGxvYWRlciA9IGluZm8ubG9hZGVyOworICAgICAgICAgICAgICAgIGlmIChsb2FkZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbG9hZGVyLmRlc3Ryb3koKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFN0b3BzIGFuZCByZW1vdmVzIHRoZSBsb2FkZXIgd2l0aCB0aGUgZ2l2ZW4gSUQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc3RvcExvYWRpbmcoaW50IGlkKSB7CisgICAgICAgIGlmIChtTG9hZGVycyAhPSBudWxsKSB7CisgICAgICAgICAgICBMb2FkZXJJbmZvPEQ+IGluZm8gPSBtTG9hZGVycy5yZW1vdmUoaWQpOworICAgICAgICAgICAgaWYgKGluZm8gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIExvYWRlcjxEPiBsb2FkZXIgPSBpbmZvLmxvYWRlcjsKKyAgICAgICAgICAgICAgICBpZiAobG9hZGVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbG9hZGVyLnVucmVnaXN0ZXJMaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgICAgICAgICAgICAgbG9hZGVyLmRlc3Ryb3koKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIHRoZSBMb2FkZXIgd2l0aCB0aGUgZ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G1QYXJlbnQuZ2V0TGFzdE5vbkNvbmZpZ3VyYXRpb25DaGlsZEluc3RhbmNlcygpOworICAgICAgICAgICAgT2JqZWN0IGluc3RhbmNlT2JqID0gbnVsbDsKICAgICAgICAgICAgIGlmIChsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgaW5zdGFuY2UgPSBsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcy5nZXQoci5pZCk7CisgICAgICAgICAgICAgICAgaW5zdGFuY2VPYmogPSBsYXN0Tm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcy5nZXQoci5pZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBBY3Rpdml0eS5Ob25Db25maWd1cmF0aW9uSW5zdGFuY2VzIGluc3RhbmNlID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChpbnN0YW5jZU9iaiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaW5zdGFuY2UgPSBuZXcgQWN0aXZpdHkuTm9uQ29uZmlndXJhdGlvbkluc3RhbmNlcygpOworICAgICAgICAgICAgICAgIGluc3RhbmNlLmFjdGl2aXR5ID0gaW5zdGFuY2VPYmo7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICAKICAgICAgICAgICAgIC8vIFdlIG5lZWQgdG8gaGF2ZSBhbHdheXMgY3JlYXRlZCB0aGUgYWN0aXZpdHkuCkBAIC0zNDYsNyArMzQ5LDcgQEAKICAgICB9CiAKICAgICBwcml2YXRlIFdpbmRvdyBwZXJmb3JtRGVzdHJveShMb2NhbEFjdGl2aXR5UmVjb3JkIHIsIGJvb2xlYW4gZmluaXNoKSB7Ci0gICAgICAgIFdpbmRvdyB3aW4gPSBudWxsOworICAgICAgICBXaW5kb3cgd2luOwogICAgICAgICB3aW4gPSByLndpbmRvdzsKICAgICAgICAgaWYgKHIuY3VyU3RhdGUgPT0gUkVTVU1FRCAmJiAhZmluaXNoKSB7CiAgICAgICAgICAgICBwZXJmb3JtUGF1c2UociwgZmluaXNoKTsKQEAgLTM4MCw3ICszODMsOCBAQAogICAgICAgICBpZiAociAhPSBudWxsKSB7CiAgICAgICAgICAgICB3aW4gPSBwZXJmb3JtRGVzdHJveShyLCBmaW5pc2gpOwogICAgICAgICAgICAgaWYgKGZpbmlzaCkgewotICAgICAgICAgICAgICAgIG1BY3Rpdml0aWVzLnJlbW92ZShyKTsKKyAgICAgICAgICAgICAgICBtQWN0aXZpdGllcy5yZW1vdmUoaWQpOworICAgICAgICAgICAgICAgIG1BY3Rpdml0eUFycmF5LnJlbW92ZShyKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICByZXR1cm4gd2luOwpAQCAtNDQxLDEwICs0NDUsOCBAQAogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIGRpc3BhdGNoQ3JlYXRlKEJ1bmRsZSBzdGF0ZSkgewogICAgICAgICBpZiAoc3RhdGUgIT0gbnVsbCkgewotICAgICAgICAgICAgZmluYWwgSXRlcmF0b3I8U3RyaW5nPiBpID0gc3RhdGUua2V5U2V0KCkuaXRlcmF0b3IoKTsKLSAgICAgICAgICAgIHdoaWxlIChpLmhhc05leHQoKSkgeworICAgICAgICAgICAgZm9yIChTdHJpbmcgaWQgOiBzdGF0ZS5rZXlTZXQoKSkgewogICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBpZCA9IGkubmV4dCgpOwogICAgICAgICAgICAgICAgICAgICBmaW5hbCBCdW5kbGUgYXN0YXRlID0gc3RhdGUuZ2V0QnVuZGxlKGlkKTsKICAgICAgICAgICAgICAgICAgICAgTG9jYWxBY3Rpdml0eVJlY29yZCByID0gbUFjdGl2aXRpZXMuZ2V0KGlkKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKHIgIT0gbnVsbCkgewpAQCAtNDU3LDkgKzQ1OSw3IEBACiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgICAvLyBSZWNvdmVyIGZyb20gLWFsbC0gYXBwIGVycm9ycy4KLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAiRXhjZXB0aW9uIHRocm93biB3aGVuIHJlc3RvcmluZyBMb2NhbEFjdGl2aXR5TWFuYWdlciBzdGF0ZSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIGUpOworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFeGNlcHRpb24gdGhyb3duIHdoZW4gcmVzdG9yaW5nIExvY2FsQWN0aXZpdHlNYW5hZ2VyIHN0YXRlIiwgZSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9hcHAvYWRtaW4vRGV2aWNlUG9saWN5TWFuYWdlci5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvYXBwL2FkbWluL0RldmljZVBvbGljeU1hbmFnZXIuamF2YQppbmRleCAyOTZkNzBhNC4uMzA2NmY1YyAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvYXBwL2FkbWluL0RldmljZVBvbGljeU1hbmFnZXIuamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC9hcHAvYWRtaW4vRGV2aWNlUG9saWN5TWFuYWdlci5qYXZhCkBAIC00Niw3ICs0Niw3IEBACiAKICAgICBwcml2YXRlIGZpbmFsIENvbnRleHQgbUNvbnRleHQ7CiAgICAgcHJpdmF0ZSBmaW5hbCBJRGV2aWNlUG9saWN5TWFuYWdlciBtU2VydmljZTsKLSAgICAKKwogICAgIHByaXZhdGUgZmluYWwgSGFuZGxlciBtSGFuZGxlcjsKIAogICAgIHByaXZhdGUgRGV2aWNlUG9saWN5TWFuYWdlcihDb250ZXh0IGNvbnR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pY2VBZG1pbkluZm8jVVNFU19QT0xJQ1lfTElNSVRfUEFTU1dPUkR9IHRvIGJlIGFibGUgdG8gY2FsbAorICAgICAqIHRoaXMgbWV0aG9kOyBpZiBpdCBoYXMgbm90LCBhIHNlY3VyaXR5IGV4Y2VwdGlvbiB3aWxsIGJlIHRocm93bi4KKyAgICAgKgorICAgICAqIEBwYXJhbSBhZG1pbiBXaGljaCB7QGxpbmsgRGV2aWNlQWRtaW5SZWNlaXZlcn0gdGhpcyByZXF1ZXN0IGlzIGFzc29jaWF0ZWQKKyAgICAgKiAgICAgICAgICAgIHdpdGguCisgICAgICogQHBhcmFtIGxlbmd0aCBUaGUgbmV3IGRlc2lyZWQgbWluaW11bSBudW1iZXIgb2YgdXBwZXIgY2FzZSBsZXR0ZXJzCisgICAgICogICAgICAgICAgICByZXF1aXJlZCBpbiB0aGUgcGFzc3dvcmQuIEEgdmFsdWUgb2YgMCBtZWFucyB0aGVyZSBpcyBubworICAgICAqICAgICAgICAgICAgcmVzdHJpY3Rpb24uCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0UGFzc3dvcmRNaW5pbXVtVXBwZXJDYXNlKENvbXBvbmVudE5hbWUgYWRtaW4sIGludCBsZW5ndGgpIHsKKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbVNlcnZpY2Uuc2V0UGFzc3dvcmRNaW5pbXVtVXBwZXJDYXNlKGFkbWluLCBsZW5ndGgpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJGYWlsZWQgdGFsa2luZyB3aXRoIGRldmljZSBwb2xpY3kgc2VydmljZSIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0cmlldmUgdGhlIGN1cnJlbnQgbnVtYmVyIG9mIHVwcGVyIGNhc2UgbGV0dGVycyByZXF1aXJlZCBpbiB0aGUKKyAgICAgKiBwYXNzd29yZCBmb3IgYWxsIGFkbWlucyBvciBhIHBhcnRpY3VsYXIgb25lLiBUaGlzIGlzIHRoZSBzYW1lIHZhbHVlIGFzCisgICAgICogc2V0IGJ5IHsjbGluayB7QGxpbmsgI3NldFBhc3N3b3JkTWluaW11bVVwcGVyQ2FzZShDb21wb25lbnROYW1lLCBpbnQpfQorICAgICAqIGFuZCBvbmx5IGFwcGxpZXMgd2hlbiB0aGUgcGFzc3dvcmQgcXVhbGl0eSBpcworICAgICAqIHtAbGluayAjUEFTU1dPUkRfUVVBTElUWV9DT01QTEVYfS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBhZG1pbiBUaGUgbmFtZSBvZiB0aGUgYWRtaW4gY29tcG9uZW50IHRvIGNoZWNrLCBvciBudWxsIHRvCisgICAgICogICAgICAgICAgICBhZ2dyZWdhdGUgYWxsIGFkbWlucy4KKyAgICAgKiBAcmV0dXJuIFRoZSBtaW5pbXVtIG51bWJlciBvZiB1cHBlciBjYXNlIGxldHRlcnMgcmVxdWlyZWQgaW4gdGhlCisgICAgICogICAgICAgICBwYXNzd29yZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkTWluaW11bVVwcGVyQ2FzZShDb21wb25lbnROYW1lIGFkbWluKSB7CisgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRQYXNzd29yZE1pbmltdW1VcHBlckNhc2UoYWRtaW4pOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJGYWlsZWQgdGFsa2luZyB3aXRoIGRldmljZSBwb2xpY3kgc2VydmljZSIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgI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lIHJlcXVlc3RlZAorICAgICAqIHtAbGluayBEZXZpY2VBZG1pbkluZm8jVVNFU19QT0xJQ1lfTElNSVRfUEFTU1dPUkR9IHRvIGJlIGFibGUgdG8gY2FsbAorICAgICAqIHRoaXMgbWV0aG9kOyBpZiBpdCBoYXMgbm90LCBhIHNlY3VyaXR5IGV4Y2VwdGlvbiB3aWxsIGJlIHRocm93bi4KKyAgICAgKgorICAgICAqIEBwYXJhbSBhZG1pbiBXaGljaCB7QGxpbmsgRGV2aWNlQWRtaW5SZWNlaXZlcn0gdGhpcyByZXF1ZXN0IGlzIGFzc29jaWF0ZWQKKyAgICAgKiAgICAgICAgICAgIHdpdGguCisgICAgICogQHBhcmFtIGxlbmd0aCBUaGUgbmV3IGRlc2lyZWQgbWluaW11bSBudW1iZXIgb2YgbG93ZXIgY2FzZSBsZXR0ZXJzCisgICAgICogICAgICAgICAgICByZXF1aXJlZCBpbiB0aGUgcGFzc3dvcmQuIEEgdmFsdWUgb2YgMCBtZWFucyB0aGVyZSBpcyBubworICAgICAqICAgICAgICAgICAgcmVzdHJpY3Rpb24uCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0UGFzc3dvcmRNaW5pbXVtTG93ZXJDYXNlKENvbXBvbmVudE5hbWUgYWRtaW4sIGludCBsZW5ndGgpIHsKKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbVNlcnZpY2Uuc2V0UGFzc3dvcmRNaW5pbXVtTG93ZXJDYXNlKGFkbWluLCBsZW5ndGgpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJGYWlsZWQgdGFsa2luZyB3aXRoIGRldmljZSBwb2xpY3kgc2VydmljZSIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0cmlldmUgdGhlIGN1cnJlbnQgbnVtYmVyIG9mIGxvd2VyIGNhc2UgbGV0dGVycyByZXF1aXJlZCBpbiB0aGUKKyAgICAgKiBwYXNzd29yZCBmb3IgYWxsIGFkbWlucyBvciBhIHBhcnRpY3VsYXIgb25lLiBUaGlzIGlzIHRoZSBzYW1lIHZhbHVlIGFzCisgICAgICogc2V0IGJ5IHsjbGluayB7QGxpbmsgI3NldFBhc3N3b3JkTWluaW11bUxvd2VyQ2FzZShDb21wb25lbnROYW1lLCBpbnQpfQorICAgICAqIGFuZCBvbmx5IGFwcGxpZXMgd2hlbiB0aGUgcGFzc3dvcmQgcXVhbGl0eSBpcworICAgICAqIHtAbGluayAjUEFTU1dPUkRfUVVBTElUWV9DT01QTEVYfS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBhZG1pbiBUaGUgbmFtZSBvZiB0aGUgYWRtaW4gY29tcG9uZW50IHRvIGNoZWNrLCBvciBudWxsIHRvCisgICAgICogICAgICAgICAgICBhZ2dyZWdhdGUgYWxsIGFkbWlucy4KKyAgICAgKiBAcmV0dXJuIFRoZSBtaW5pbXVtIG51bWJlciBvZiBsb3dlciBjYXNlIGxldHRlcnMgcmVxdWlyZWQgaW4gdGhlCisgICAgICogICAgICAgICBwYXNzd29yZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkTWluaW11bUxvd2VyQ2FzZShDb21wb25lbnROYW1lIGFkbWluKSB7CisgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRQYXNzd29yZE1pbmltdW1Mb3dlckNhc2UoYWRtaW4pOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJGYWlsZWQgdGFsa2luZyB3aXRoIGRldmljZSBwb2xpY3kgc2VydmljZSIsIGUp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ZXN0ZWQKKyAgICAgKiB7QGxpbmsgRGV2aWNlQWRtaW5JbmZvI1VTRVNfUE9MSUNZX0xJTUlUX1BBU1NXT1JEfSB0byBiZSBhYmxlIHRvIGNhbGwKKyAgICAgKiB0aGlzIG1ldGhvZDsgaWYgaXQgaGFzIG5vdCwgYSBzZWN1cml0eSBleGNlcHRpb24gd2lsbCBiZSB0aHJvd24uCisgICAgICoKKyAgICAgKiBAcGFyYW0gYWRtaW4gV2hpY2gge0BsaW5rIERldmljZUFkbWluUmVjZWl2ZXJ9IHRoaXMgcmVxdWVzdCBpcyBhc3NvY2lhdGVkCisgICAgICogICAgICAgICAgICB3aXRoLgorICAgICAqIEBwYXJhbSBsZW5ndGggVGhlIG5ldyBkZXNpcmVkIG1pbmltdW0gbnVtYmVyIG9mIGxldHRlcnMgcmVxdWlyZWQgaW4gdGhlCisgICAgICogICAgICAgICAgICBwYXNzd29yZC4gQSB2YWx1ZSBvZiAwIG1lYW5zIHRoZXJlIGlzIG5vIHJlc3RyaWN0aW9uLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFBhc3N3b3JkTWluaW11bUxldHRlcnMoQ29tcG9uZW50TmFtZSBhZG1pbiwgaW50IGxlbmd0aCkgeworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBtU2VydmljZS5zZXRQYXNzd29yZE1pbmltdW1MZXR0ZXJzKGFkbWluLCBsZW5ndGgpOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJGYWlsZWQgdGFsa2luZyB3aXRoIGRldmljZSBwb2xpY3kgc2VydmljZSIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0cmlldmUgdGhlIGN1cnJlbnQgbnVtYmVyIG9mIGxldHRlcnMgcmVxdW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d29yZAorICAgICAqIGZvciBhbGwgYWRtaW5zIG9yIGEgcGFydGljdWxhciBvbmUuIFRoaXMgaXMgdGhlIHNhbWUgdmFsdWUgYXMKKyAgICAgKiBzZXQgYnkgeyNsaW5rIHtAbGluayAjc2V0UGFzc3dvcmRNaW5pbXVtTnVtZXJpYyhDb21wb25lbnROYW1lLCBpbnQpfQorICAgICAqIGFuZCBvbmx5IGFwcGxpZXMgd2hlbiB0aGUgcGFzc3dvcmQgcXVhbGl0eSBpcworICAgICAqIHtAbGluayAjUEFTU1dPUkRfUVVBTElUWV9DT01QTEVYfS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBhZG1pbiBUaGUgbmFtZSBvZiB0aGUgYWRtaW4gY29tcG9uZW50IHRvIGNoZWNrLCBvciBudWxsIHRvCisgICAgICogICAgICAgICAgICBhZ2dyZWdhdGUgYWxsIGFkbWlucy4KKyAgICAgKiBAcmV0dXJuIFRoZSBtaW5pbXVtIG51bWJlciBvZiBudW1lcmljYWwgZGlnaXRzIHJlcXVpcmVkIGluIHRoZSBwYXNzd29yZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkTWluaW11bU51bWVyaWMoQ29tcG9uZW50TmFtZSBhZG1pbikgeworICAgICAgICBpZiAobVNlcnZpY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0UGFzc3dvcmRNaW5pbXVtTnVtZXJpYyhhZG1pbik7CisgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkZhaWxlZCB0YWxraW5nIHdpdGggZGV2aWNlIHBvbGljeSBzZXJ2aWNlIiwgZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2FsbGVkIGJ5IGFuIG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ucyBvciBhIHBhcnRpY3VsYXIgb25lLiBUaGlzIGlzIHRoZSBzYW1lIHZhbHVlIGFzCisgICAgICogc2V0IGJ5IHsjbGluayB7QGxpbmsgI3NldFBhc3N3b3JkTWluaW11bVN5bWJvbHMoQ29tcG9uZW50TmFtZSwgaW50KX0KKyAgICAgKiBhbmQgb25seSBhcHBsaWVzIHdoZW4gdGhlIHBhc3N3b3JkIHF1YWxpdHkgaXMKKyAgICAgKiB7QGxpbmsgI1BBU1NXT1JEX1FVQUxJVFlfQ09NUExFWH0uCisgICAgICoKKyAgICAgKiBAcGFyYW0gYWRtaW4gVGhlIG5hbWUgb2YgdGhlIGFkbWluIGNvbXBvbmVudCB0byBjaGVjaywgb3IgbnVsbCB0bworICAgICAqICAgICAgICAgICAgYWdncmVnYXRlIGFsbCBhZG1pbnMuCisgICAgICogQHJldHVybiBUaGUgbWluaW11bSBudW1iZXIgb2Ygc3ltYm9scyByZXF1aXJlZCBpbiB0aGUgcGFzc3dvcmQuCisgICAgICovCisgICAgcHVibGljIGludCBnZXRQYXNzd29yZE1pbmltdW1TeW1ib2xzKENvbXBvbmVudE5hbWUgYWRtaW4pIHsKKyAgICAgICAgaWYgKG1TZXJ2aWNlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldFBhc3N3b3JkTWluaW11bVN5bWJvbHMoYWRtaW4pOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJGYWlsZWQgdGFsa2luZyB3aXRoIGRldmljZSBwb2xpY3kgc2VydmljZSIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIC8qKgorICAgICAqIENhbGxlZCBieSBhbiBhcHBsaWNhdGlvbiB0aGF0IGlzIGFkbWluaXN0ZXJpbmcgdGhlIGRld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Bmb3IgYWxsIGFkbWlucyBvciBhIHBhcnRpY3VsYXIgb25lLiBUaGlzIGlzIHRoZSBzYW1lIHZhbHVlIGFzCisgICAgICogc2V0IGJ5IHsjbGluayB7QGxpbmsgI3NldFBhc3N3b3JkTWluaW11bU5vbkxldHRlcihDb21wb25lbnROYW1lLCBpbnQpfQorICAgICAqIGFuZCBvbmx5IGFwcGxpZXMgd2hlbiB0aGUgcGFzc3dvcmQgcXVhbGl0eSBpcworICAgICAqIHtAbGluayAjUEFTU1dPUkRfUVVBTElUWV9DT01QTEVYfS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBhZG1pbiBUaGUgbmFtZSBvZiB0aGUgYWRtaW4gY29tcG9uZW50IHRvIGNoZWNrLCBvciBudWxsIHRvCisgICAgICogICAgICAgICAgICBhZ2dyZWdhdGUgYWxsIGFkbWlucy4KKyAgICAgKiBAcmV0dXJuIFRoZSBtaW5pbXVtIG51bWJlciBvZiBsZXR0ZXJzIHJlcXVpcmVkIGluIHRoZSBwYXNzd29yZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkTWluaW11bU5vbkxldHRlcihDb21wb25lbnROYW1lIGFkbWluKSB7CisgICAgICAgIGlmIChtU2VydmljZSAhPSBudWxsKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHJldHVybiBtU2VydmljZS5nZXRQYXNzd29yZE1pbmltdW1Ob25MZXR0ZXIoYWRtaW4pOworICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJGYWlsZWQgdGFsa2luZyB3aXRoIGRldmljZSBwb2xpY3kgc2VydmljZSIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAvKioKKyAgICogQ2FsbGVkIGJ5IGFuIGFwcGxpY2F0aW9uIHRoYXQgaXMgYWRtaW5pc3Rlc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GN1cnJlbnRseSBtdXN0IGJlIDAuCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgd2lwZURhdGEoaW50IGZsYWdzKSB7CkBAIC01MzAsNyArOTEzLDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIEBoaWRlCiAgICAgICovCkBAIC01NDMsNyArOTI2LDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIEBoaWRlCiAgICAgICovCkBAIC01NTYsMTAgKzkzOSwxMCBAQAogICAgICAgICAgICAgTG9nLncoVEFHLCAiVW5hYmxlIHRvIHJldHJpZXZlIGRldmljZSBwb2xpY3kgIiArIGNuLCBlKTsKICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIFJlc29sdmVJbmZvIHJpID0gbmV3IFJlc29sdmVJbmZvKCk7CiAgICAgICAgIHJpLmFjdGl2aXR5SW5mbyA9IGFpOwotICAgICAgICAKKwogICAgICAgICB0cnkgewogICAgICAgICAgICAgcmV0dXJuIG5ldyBEZXZpY2VBZG1pbkluZm8obUNvbnRleHQsIHJpKTsKICAgICAgICAgfSBjYXRjaCAoWG1sUHVsbFBhcnNlckV4Y2VwdGlvbiBlKSB7CkBAIC01NzAsNyArOTUzLDcgQEAKICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogQGhpZGUKICAgICAgKi8KQEAgLTU4NywxNiArOTcwLDE4IEBACiAgICAgLyoqCiAgICAgICogQGhpZGUKICAgICAgKi8KLSAgICBwdWJsaWMgdm9pZCBzZXRBY3RpdmVQYXNzd29yZFN0YXRlKGludCBxdWFsaXR5LCBpbnQgbGVuZ3RoKSB7CisgICAgcHVibGljIHZvaWQgc2V0QWN0aXZlUGFzc3dvcmRTdGF0ZShpbnQgcXVh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5kcm9pZC9hcHAvYWRtaW4vSURldmljZVBvbGljeU1hbmFnZXIuYWlkbAorKysgYi9jb3JlL2phdmEvYW5kcm9pZC9hcHAvYWRtaW4vSURldmljZVBvbGljeU1hbmFnZXIuYWlkbApAQCAtMjcsMTAgKzI3LDMxIEBACiBpbnRlcmZhY2UgSURldmljZVBvbGljeU1hbmFnZXIgewogICAgIHZvaWQgc2V0UGFzc3dvcmRRdWFsaXR5KGluIENvbXBvbmVudE5hbWUgd2hvLCBpbnQgcXVhbGl0eSk7CiAgICAgaW50IGdldFBhc3N3b3JkUXVhbGl0eShpbiBDb21wb25lbnROYW1lIHdobyk7Ci0gICAgCisKICAgICB2b2lkIHNldFBhc3N3b3JkTWluaW11bUxlbmd0aChpbiBDb21wb25lbnROYW1lIHdobywgaW50IGxlbmd0aCk7CiAgICAgaW50IGdldFBhc3N3b3JkTWluaW11bUxlbmd0aChpbiBDb21wb25lbnROYW1lIHdobyk7CisKKyAgICB2b2lkIHNldFBhc3N3b3JkTWluaW11bVVwcGVyQ2FzZShpbiBDb21wb25lbnROYW1lIHdobywgaW50IGxlbmd0aCk7CisgICAgaW50IGdldFBhc3N3b3JkTWluaW11bVVwcGVyQ2FzZShpbiBDb21wb25lbnROYW1lIHdobyk7CisKKyAgICB2b2lkIHNldFBhc3N3b3JkTWluaW11bUxvd2VyQ2FzZShpbiBDb21wb25lbnROYW1lIHdobywgaW50IGxlbmd0aCk7CisgICAgaW50IGdldFBhc3N3b3JkTWluaW11bUxvd2VyQ2FzZShpbiBDb21wb25lbnROYW1lIHdobyk7CisKKyAgICB2b2lkIHNldFBhc3N3b3JkTWluaW11bUxldHRlcnMoaW4gQ29tcG9uZW50TmFtZSB3aG8sIGludCBsZW5ndGgpOworICAgIGludCBnZXRQYXNzd29yZE1pbmltdW1MZXR0ZXJzKGluIENvbXBvbmVudE5hbWUgd2hvKTsKKworICAgIHZvaWQgc2V0UGFzc3dvcmRNaW5pbXVtTnVtZXJpYyhpbiBDb21wb25lb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4gYXR0cmlidXRlIGluCisgICAgICogdGhlIDxjb2RlPiZsdDtyZWNlaXZlciZndDs8L2NvZGU+IGVsZW1lbnQgaW4gdGhlIEFuZHJvaWRNYW5pZmVzdC54bWwgZmlsZS4KKyAgICAgKiAKKyAgICAgKiBAaGlkZSBQZW5kaW5nIEFQSSBhcHByb3ZhbAorICAgICAqLworCXB1YmxpYyBpbnQgcHJldmlld0ltYWdlOwogCiAgICAgcHVibGljIEFwcFdpZGdldFByb3ZpZGVySW5mbygpIHsKICAgICB9CkBAIC0xMzAsNiArMTQxLDcgQEAKICAgICAgICAgfQogICAgICAgICB0aGlzLmxhYmVsID0gaW4ucmVhZFN0cmluZygpOwogICAgICAgICB0aGlzLmljb24gPSBpbi5yZWFkSW50KCk7CisgICAgICAgIHRoaXMucHJldmlld0ltYWdlID0gaW4ucmVhZEludCgpOwogICAgIH0KIAogCkBAIC0xNTIsNiArMTY0LDcgQEAKICAgICAgICAgfQogICAgICAgICBvdXQud3JpdGVTdHJpbmcodGhpcy5sYWJlbCk7CiAgICAgICAgIG91dC53cml0ZUludCh0aGlzLmljb24pOworICAgICAgICBvdXQud3JpdGVJbnQodGhpcy5wcmV2aWV3SW1hZ2UpOwogICAgIH0KIAogICAgIHB1YmxpYyBpbnQgZGVzY3JpYmVDb250ZW50cygpIHsKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2JsdWV0b290aC9CbHVldG9vdGhDbGFzcy5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvYmx1ZXRvb3RoL0JsdWV0b290aENsYXNzLmphdmEKaW5kZXggYzdmZWE5ZS4uMGM5YmFiMiAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvYmx1ZXRvb3RoL0JsdWV0b290aENsYXNzLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvYmx1ZXRvb3RoL0JsdWV0b290aENsYXNzLmphdmEKQEAgLTI1OSw2ICsyNTksOCBAQAogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFBST0ZJTEVfQTJEUCA9IDE7CiAgICAgLyoqIEBoaWRlICovCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgUFJPRklMRV9PUFAgPSAyOworICAgIC8qKiBAaGlkZSAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFBST0ZJTEVfSElEID0gMzsKIAogICAgIC8qKgogICAgICAqIENoZWNrIGNsYXNzIGJpdHMgZm9yIHBvc3NpYmxlIGJsdWV0b290aCBwcm9maWxlIHN1cHBvcnQuCkBAIC0zMjQsNiArMzI2LDggQEAKICAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAocHJvZmlsZSA9PSBQUk9GSUxFX0hJRCkgeworICAgICAgICAgICAgcmV0dXJuIChnZXREZXZpY2VDbGFzcygpICYgRGV2aWNlLk1ham9yLlBFUklQSEVSQUwpID09IERldmljZS5NYWpvci5QRVJJUEhFUkFMOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9ibHVldG9vdGgvQmx1ZXRvb3RoSW5wdXREZXZpY2UuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2JsdWV0b290aC9CbHVldG9vdGhJbnB1dERldmljZS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjE3OTM4MzgKLS0tIC9kZXYvbnVsbAorKysgYi9jb3JlL2phdmEvYW5kcm9pZC9ibHVldG9vdGgvQmx1ZXRvb3RoSW5wdXREZXZpY2UuamF2YQpAQCAtMCwwICsxLDI0MSBAQAorLyoKKyAqIENvcHlyaWdodCAoQykgMjAxMCBUaGUgQW5kcm9pZCBPcGVuIFNvdXJjZSBQ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AgIG1TZXJ2aWNlID0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKiBJbml0aWF0ZSBhIGNvbm5lY3Rpb24gdG8gYW4gSW5wdXQgZGV2aWNlLgorICAgICAqCisgICAgICogIFRoaXMgZnVuY3Rpb24gcmV0dXJucyBmYWxzZSBvbiBlcnJvciBhbmQgdHJ1ZSBpZiB0aGUgY29ubmVjdGlvbgorICAgICAqICBhdHRlbXB0IGlzIGJlaW5nIG1hZGUuCisgICAgICoKKyAgICAgKiAgTGlzdGVuIGZvciBJTlBVVF9ERVZJQ0VfU1RBVEVfQ0hBTkdFRF9BQ1RJT04gdG8gZmluZCBvdXQgd2hlbiB0aGUKKyAgICAgKiAgY29ubmVjdGlvbiBpcyBjb21wbGV0ZWQuCisgICAgICogIEBwYXJhbSBkZXZpY2UgUmVtb3RlIEJUIGRldmljZS4KKyAgICAgKiAgQHJldHVybiBmYWxzZSBvbiBpbW1lZGlhdGUgZXJyb3IsIHRydWUgb3RoZXJ3aXNlCisgICAgICogIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gY29ubmVjdElucHV0RGV2aWNlKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJjb25uZWN0SW5wdXREZXZpY2UoIiArIGRldmljZSArICIpIik7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuY29ubmVjdElucHV0RGV2aWNlKGRldmljZSk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICIiLCBlKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKiBJbml0aWF0ZSBkaXNjb25uZWN0IGZyb20gYW4gSW5wdXQgRGV2aWNlLgorICAgICAqICBUaGlzIGZ1bmN0aW9uIHJldHVybiBmYWxzZSBvbiBlcnJvciBhbmQgdHJ1ZSBpZiB0aGUgZGlzY29ubmVjdGlvbgorICAgICAqICBhdHRlbXB0IGlzIGJlaW5nIG1hZGUuCisgICAgICoKKyAgICAgKiAgTGlzdGVuIGZvciBJTlBVVF9ERVZJQ0VfU1RBVEVfQ0hBTkdFRF9BQ1RJT04gdG8gZmluZCBvdXQgd2hlbgorICAgICAqICBkaXNjb25uZWN0IGlzIGNvbXBsZXRlZC4KKyAgICAgKgorICAgICAqICBAcGFyYW0gZGV2aWNlIFJlbW90ZSBCVCBkZXZpY2UuCisgICAgICogIEByZXR1cm4gZmFsc2Ugb24gaW1tZWRpYXRlIGVycm9yLCB0cnVlIG90aGVyd2lzZQorICAgICAqICBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIGRpc2Nvbm5lY3RJbnB1dERldmljZShCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiZGlzY29ubmVjdElucHV0RGV2aWNlKCIgKyBkZXZpY2UgKyAiKSIpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmRpc2Nvbm5lY3RJbnB1dERldmljZShkZXZpY2UpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiIiwgZSk7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiogQ2hlY2sgaWYgYSBzcGVjaWZpZWQgSW5wdXREZXZpY2UgaXMgY29ubmVjdGVkLgorICAgICAqCisgICAgICogIEBwYXJhbSBkZXZpY2UgUmVtb3RlIEJUIGRldmljZS4KKyAgICAgKiAgQHJldHVybiBUcnVlIGlmIGNvbm5lY3RlZCAsIGZhbHNlIG90aGVyd2lzZSBhbmQgb24gZXJyb3IuCisgICAgICogIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gaXNJbnB1dERldmljZUNvbm5lY3RlZChCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIGlmIChEQkcpIGxvZygiaXNJbnB1dERldmljZUNvbm5lY3RlZCgiICsgZGV2aWNlICsgIikiKTsKKyAgICAgICAgaW50IHN0YXRlID0gZ2V0SW5wdXREZXZpY2VTdGF0ZShkZXZpY2UpOworICAgICAgICBpZiAoc3RhdGUgPT0gU1RBVEVfQ09OTkVDVEVEKSByZXR1cm4gdHJ1ZTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKiBDaGVjayBpZiBhbnkgSW5wdXQgRGV2aWNlIGlzIGNvbm5lY3RlZC4KKyAgICAgKgorICAgICAqIEByZXR1cm4gYSB1bm1vZGlmaWFibGUgc2V0IG9mIGNvbm5lY3RlZCBJbnB1dCBEZXZpY2VzLCBvciBudWxsIG9uIGVycm9yLgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIFNldDxCbHVldG9vdGhEZXZpY2U+IGdldENvbm5lY3RlZElucHV0RGV2aWNlcygpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJnZXRDb25uZWN0ZWRJbnB1dERldmljZXMoKSIpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIENvbGxlY3Rpb25zLnVubW9kaWZpYWJsZVNldCgKKyAgICAgICAgICAgICAgICAgICAgbmV3IEhhc2hTZXQ8Qmx1ZXRvb3RoRGV2aWNlPigKKyAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QobVNlcnZpY2UuZ2V0Q29ubmVjdGVkSW5wdXREZXZpY2VzKCkpKSk7CisgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShUQUcsICIiLCBlKTsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqIEdldCB0aGUgc3RhdGUgb2YgYW4gSW5wdXQgRGV2aWNlLgorICAgICAqCisgICAgICogIEBwYXJhbSBkZXZpY2UgUmVtb3RlIEJUIGRldmljZS4KKyAgICAgKiAgQHJldHVybiBUaGUgY3VycmVudCBzdGF0ZSBvZiB0aGUgSW5wdXQgRGV2aWNlCisgICAgICogIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGludCBnZXRJbnB1dERldmljZVN0YXRlKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgaWYgKERCRykgbG9nKCJnZXRJbnB1dERldmljZVN0YXRlKCIgKyBkZXZpY2UgKyAiKSIpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgcmV0dXJuIG1TZXJ2aWNlLmdldElucHV0RGV2aWNlU3RhdGUoZGV2aWNlKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIiIsIGUpOworICAgICAgICAgICAgcmV0dXJuIFNUQVRFX0RJU0NPTk5FQ1RFRDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCBwcmlvcml0eSBvZiBhbiBpbnB1dCBkZXZpY2UuCisgICAgICoKKyAgICAgKiBQcmlvcml0eSBpcyBhIG5vbi1uZWdhdGl2ZSBpbnRlZ2VyLiBQcmlvcml0eSBjYW4gdGFrZSB0aGUgZm9sbG93aW5nCisgICAgICogdmFsdWVzOgorICAgICAqIHtAbGluayBQUklPUklUWV9PTn0sIHtAbGluayBQUklPUklUWV9PRkZ9LCB7QGxpbmsgUFJJT1JJVFlfQVVUT19DT05ORUNUfQorICAgICAqCisgICAgICogQHBhcmFtIGRldmljZSBQYWlyZWQgZGV2aWNlLgorICAgICAqIEBwYXJhbSBwcmlvcml0eSBJbnRlZ2VyIHByaW9yaXR5CisgICAgICogQHJldHVybiB0cnVlIGlmIHByaW9yaXR5IGlzIHNldCwgZmFsc2Ugb24gZXJyb3IKKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBzZXRJbnB1dERldmljZVByaW9yaXR5KEJsdWV0b290aERldmljZSBkZXZpY2UsIGludCBwcmlvcml0eSkgeworICAgICAgICBpZiAoREJHKSBsb2coInNldElucHV0RGV2aWNlUHJpb3JpdHkoIiArIGRldmljZSArICIsICIgKyBwcmlvcml0eSArICIpIik7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2Uuc2V0SW5wdXREZXZpY2VQcmlvcml0eShkZXZpY2UsIHByaW9yaXR5KTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIExvZy5lKFRBRywgIiIsIGUpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogR2V0IHRoZSBwcmlvcml0eSBhc3NvY2lhdGVkIHdpdGggYW4gSW5wdXQgRGV2aWNlLgorICAgICAqCisgICAgICogQHBhcmFtIGRldmljZSBJbnB1dCBEZXZpY2UKKyAgICAgKiBAcmV0dXJuIG5vbi1uZWdhdGl2ZSBwcmlvcml0eSwgb3IgbmVnYXRpdmUgZXJyb3IgY29kZSBvbiBlcnJvci4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldElucHV0RGV2aWNlUHJpb3JpdHkoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBpZiAoREJHKSBsb2coImdldElucHV0RGV2aWNlUHJpb3JpdHkoIiArIGRldmljZSArICIpIik7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXR1cm4gbVNlcnZpY2UuZ2V0SW5wdXREZXZpY2VQcmlvcml0eShkZXZpY2UpOworICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmUoVEFHLCAiIiwgZSk7CisgICAgICAgICAgICByZXR1cm4gUFJJT1JJVFlfT0ZGOworICAg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ZCwgRD4geworCisgICAgICAgIHByaXZhdGUgRCByZXN1bHQ7CisKKyAgICAgICAgLyogUnVucyBvbiBhIHdvcmtlciB0aHJlYWQgKi8KKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCBEIGRvSW5CYWNrZ3JvdW5kKFZvaWQuLi4gcGFyYW1zKSB7CisgICAgICAgICAgICByZXN1bHQgPSBBc3luY1Rhc2tMb2FkZXIudGhpcy5sb2FkSW5CYWNrZ3JvdW5kKCk7CisgICAgICAgICAgICByZXR1cm4gcmVzdWx0OworICAgICAgICB9CisKKyAgICAgICAgLyogUnVucyBvbiB0aGUgVUkgdGhyZWFkICovCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvblBvc3RFeGVjdXRlKEQgZGF0YSkgeworICAgICAgICAgICAgQXN5bmNUYXNrTG9hZGVyLnRoaXMuZGlzcGF0Y2hPbkxvYWRDb21wbGV0ZShkYXRhKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvbkNhbmNlbGxlZCgpIHsKKyAgICAgICAgICAgIEFzeW5jVGFza0xvYWRlci50aGlzLm9uQ2FuY2VsbGVkKHJlc3VsdCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBMb2FkVGFzayBtVGFzazsKKworICAgIHB1YmxpYyBBc3luY1Rhc2tMb2FkZXIoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIHN1cGVyKGNvbnRleHQpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEZvcmNlIGFuIGFzeW5jaHJvbm91cyBsb2FkLiBVbmxpa2Uge0BsaW5rICNzdGFydExvYWRpbmcoKX0gdGhpcyB3aWxsIGlnbm9yZSBhIHByZXZpb3VzbHkKKyAgICAgKiBsb2FkZWQgZGF0YSBzZXQgYW5kIGxvYWQgYSBuZXcgb25lLgorICAgICAqLworICAgIEBPdmVycmlkZQorICAgI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U9ic2VydmVyKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gY3Vyc29yOworICAgIH0KKworICAgIC8qIFJ1bnMgb24gdGhlIFVJIHRocmVhZCAqLworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRlbGl2ZXJSZXN1bHQoQ3Vyc29yIGN1cnNvcikgeworICAgICAgICBpZiAobVN0b3BwZWQpIHsKKyAgICAgICAgICAgIC8vIEFuIGFzeW5jIHF1ZXJ5IGNhbWUgaW4gd2hpbGUgdGhlIGxvYWRlciBpcyBzdG9wcGVkCisgICAgICAgICAgICBjdXJzb3IuY2xvc2UoKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBtQ3Vyc29yID0gY3Vyc29yOworICAgICAgICBzdXBlci5kZWxpdmVyUmVzdWx0KGN1cnNvcik7CisgICAgfQorCisgICAgcHVibGljIEN1cnNvckxvYWRlcihDb250ZXh0IGNvbnRleHQsIFVyaSB1cmksIFN0cmluZ1tdIHByb2plY3Rpb24sIFN0cmluZyBzZWxlY3Rpb24sCisgICAgICAgICAgICBTdHJpbmdbXSBzZWxlY3Rpb25BcmdzLCBTdHJpbmcgc29ydE9yZGVyKSB7CisgICAgICAgIHN1cGVyKGNvbnRleHQpOworICAgICAgICBtT2JzZXJ2ZXIgPSBuZXcgRm9yY2VMb2FkQ29udGVudE9ic2VydmVyKCk7CisgICAgICAgIG1VcmkgPSB1cmk7CisgICAgICAgIG1Qcm9qZWN0aW9uID0gcHJvamVjdGlvbjsKKyAgICAgICAgbVNlbGVjdGlvbiA9IHNlbGVjdGlvbjsKKyAgICAgICAgbVNlbGVjdGlvbkFyZ3MgPSBzZWxlY3Rpb25BcmdzOworICAgICAgICBtU29ydE9yZGVyID0gc29ydE9yZGVyOworICAgIH0KKworICAgIC8qKgorICAgICAqIFN0YXJ0cyBhbiBhc3luY2hyb25vdXMgbG9hZCBvZiB0aGUgY29udGFjdHMgbGlzdCBkYXRhLiBXaGVuIHRoZSByZXN1bHQgaXMgcmVhZHkgdGhlIGNhbGxiYWNrcworICAgICAqIHdpbGwgYmUgY2FsbGVkIG9uIHRoZSBVSSB0aHJlYWQuIElmIGEgcHJldmlvdXMgbG9hZCBoYXMgYmVlbiBjb21wbGV0ZWQgYW5kIGlzIHN0aWxsIHZhbGlkCisgICAgICogdGhlIHJlc3VsdCBtYXkgYmUgcGFzc2VkIHRvIHRoZSBjYWxsYmFja3MgaW1tZWRpYXRlbHkuCisgICAgICoKKyAgICAgKiBNdXN0IGJlIGNhbGxlZCBmcm9tIHRoZSBVSSB0aHJlYWQKKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzdGFydExvYWRpbmcoKSB7CisgICAgICAgIG1TdG9wcGVkID0gZmFsc2U7CisKKyAgICAgICAgaWYgKG1DdXJzb3IgIT0gbnVsbCkgeworICAgICAgICAgICAgZGVsaXZlclJlc3VsdChtQ3Vyc29yKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGZvcmNlTG9hZCgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogTXVzdCBiZSBjYWxsZWQgZnJvbSB0aGUgVUkgdGhyZWFkCisgICAgICovCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc3RvcExvYWRpbmcoKSB7CisgICAgICAgIGlmIChtQ3Vyc29yICE9IG51bGwgJiYgIW1DdXJzb3IuaXNDbG9zZWQoKSkgeworICAgICAgICAgICAgbUN1cnNvci5jbG9zZSgpOworICAgICAgICAgICAgbUN1cnNvciA9IG51bGw7CisgICAgICAgIH0KKworICAgICAgICAvLyBBdHRlbXB0IHRvIGNhbmNlbCB0aGUgY3VycmVudCBsb2FkIHRhc2sgaWYgcG9zc2libGUuCisgICAgICAgIGNhbmNlbExvYWQoKTsKKworICAgICAgICAvLyBNYWtlIHN1cmUgdGhhdCBhbnkgb3V0c3RhbmRpbmcgbG9hZHMgY2xlYW4gdGhlbXNlbHZlcyB1cCBwcm9wZXJseQorICAgICAgICBtU3RvcHBlZCA9IHRydWU7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb25DYW5jZWxsZWQoQ3Vyc29yIGN1cnNvcikgeworICAgICAgICBpZiAoY3Vyc29yICE9IG51bGwgJiYgIWN1cnNvci5pc0Nsb3NlZCgpKSB7CisgICAgICAgICAgICBjdXJzb3IuY2xvc2UoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRlc3Ryb3koKSB7CisgICAgICAgIC8vIEVuc3VyZSB0aGUgbG9hZGVyIGlzIHN0b3BwZWQKKyAgICAgICAgc3RvcExvYWRpbmcoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgVXJpIGdldFVyaSgpIHsKKyAgICAgICAgcmV0dXJuIG1Vcmk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0VXJpKFVyaSB1cmkpIHsKKyAgICAgICAgbVVyaSA9IHVyaTsKKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nW10gZ2V0UHJvamVjdGlvbigpIHsKKyAgICAgICAgcmV0dXJuIG1Qcm9qZWN0aW9uOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFByb2plY3Rpb24oU3RyaW5nW10gcHJvamVjdGlvbikgeworICAgICAgICBtUHJvamVjdGlvbiA9IHByb2plY3Rpb247CisgICAgfQorCisgICAgcHVibGljIFN0cmluZyBnZXRTZWxlY3Rpb24oKSB7CisgICAgICAgIHJldHVybiBtU2VsZWN0aW9uOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFNlbGVjdGlvbihTdHJpbmcgc2VsZWN0aW9uKSB7CisgICAgICAgIG1TZWxlY3Rpb24gPSBzZWxlY3Rpb247CisgICAgfQorCisgICAgcHVibGljIFN0cmluZ1tdIGdldFNlbGVjdGlvbkFyZ3MoKSB7CisgICAgICAgIHJldHVybiBt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Q29udGV4dDsKKworICAgIHB1YmxpYyBmaW5hbCBjbGFzcyBGb3JjZUxvYWRDb250ZW50T2JzZXJ2ZXIgZXh0ZW5kcyBDb250ZW50T2JzZXJ2ZXIgeworICAgICAgICBwdWJsaWMgRm9yY2VMb2FkQ29udGVudE9ic2VydmVyKCkgeworICAgICAgICAgICAgc3VwZXIobmV3IEhhbmRsZXIoKSk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gZGVsaXZlclNlbGZOb3RpZmljYXRpb25zKCkgeworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25DaGFuZ2UoYm9vbGVhbiBzZWxmQ2hhbmdlKSB7CisgICAgICAgICAgICBmb3JjZUxvYWQoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnRlcmZhY2UgT25Mb2FkQ29tcGxldGVMaXN0ZW5lcjxEPiB7CisgICAgICAgIC8qKgorICAgICAgICAgKiBDYWxsZWQgb24gdGhlIHRocmVhZCB0aGF0IGNyZWF0ZWQgdGhlIExvYWRlciB3aGVuIHRoZSBsb2FkIGlzIGNvbXBsZXRlLgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gbG9hZGVyIHRoZSBsb2FkZXIgdGhhdCBjb21wbGV0ZWQgdGhlIGxvYWQKKyAgICAgICAgICogQHBhcmFtIGRhdGEgdGhlIHJlc3VsdCBvZiB0aGUgbG9hZAorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgb25Mb2FkQ29tcGxldGUoTG9hZGVyPEQ+IGxvYWRlciwgRCBkYXRhKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTdG9yZXMgYXdheSB0aGUgYXBwbGljYXRpb24gY29udGV4dCBhc3NvY2lhdGVkIHdpdGggY29udGV4dC4gU2luY2UgTG9hZG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ayhTdHJpbmcgYWNjb3VudFR5cGUsIFN0cmluZyBhdXRob3JpdHkpIHsKKyAgICAgICAgICAgIGZpbmFsIFBhaXI8U3RyaW5nLCBTdHJpbmc+IHdha2VMb2NrS2V5ID0gUGFpci5jcmVhdGUoYWNjb3VudFR5cGUsIGF1dGhvcml0eSk7CisgICAgICAgICAgICBQb3dlck1hbmFnZXIuV2FrZUxvY2sgd2FrZUxvY2sgPSBtV2FrZUxvY2tzLmdldCh3YWtlTG9ja0tleSk7CisgICAgICAgICAgICBpZiAod2FrZUxvY2sgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBuYW1lID0gU1lOQ19XQUtFX0xPQ0tfUFJFRklYICsgIl8iICsgYXV0aG9yaXR5ICsgIl8iICsgYWNjb3VudFR5cGU7CisgICAgICAgICAgICAgICAgd2FrZUxvY2sgPSBtUG93ZXJNYW5hZ2VyLm5ld1dha2VMb2NrKFBvd2VyTWFuYWdlci5QQVJUSUFMX1dBS0VfTE9DSywgbmFtZSk7CisgICAgICAgICAgICAgICAgd2FrZUxvY2suc2V0UmVmZXJlbmNlQ291bnRlZChmYWxzZSk7CisgICAgICAgICAgICAgICAgbVdha2VMb2Nrcy5wdXQod2FrZUxvY2tLZXksIHdha2VMb2NrKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiB3YWtlTG9jazsKKyAgICAgICAgfQorCiAgICAgICAgIHByaXZhdGUgdm9pZCB3YWl0VW50aWxSZWFkeVRvUnVuKCkgewogICAgICAgICAgICAgQ291bnREb3duTGF0Y2ggbGF0Y2ggPSBtUmVhZHlUb1J1bkxhdGNoOwogICAgICAgICAgICAgaWYgKGxhdGNoICE9IG51bGwpIHsKQEAgLTE0NzcsOCArMTQ5NCw5IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIGlzU3luY0luUHJvZ3Jlc3MgPSBtQWN0aXZlU3luY0NvbnRleHQgIT0gbnVsbDsKLSAgICAgICAgICAgICAgICBpZiAoIWlzU3luY0luUHJvZ3Jlc3MpIHsKKyAgICAgICAgICAgICAgICBpZiAoIWlzU3luY0luUHJvZ3Jlc3MgJiYgbVN5bmNXYWtlTG9jayAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIG1TeW5jV2FrZUxvY2sucmVsZWFzZSgpOworICAgICAgICAgICAgICAgICAgICBtU3luY1dha2VMb2NrID0gbnVsbDsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgbWFuYWdlU3luY05vdGlmaWNhdGlvbigpOwogICAgICAgICAgICAgICAgIG1hbmFnZUVycm9yTm90aWZpY2F0aW9uKCk7CkBAIC0xNzA0LDcgKzE3MjIsMjYgQEAKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIG1TeW5jV2FrZUxvY2suYWNxdWlyZSgpOworICAgICAgICAgICAgLy8gRmluZCB0aGUgd2FrZWxvY2sgZm9yIHRoaXMgYWNjb3VudCBhbmQgYXV0aG9yaXR5IGFuZCBzdG9yZSBpdCBpbiBtU3luY1dha2VMb2NrLgorICAgICAgICAgICAgLy8gQmUgc3VyZSB0byByZWxlYXNlIHRoZSBwcmV2aW91cyB3YWtlbG9jayBzbyB0aGF0IHdlIGRvbid0IGVuZCB1cCB3aXRoIGl0IGJlaW5nCisgICAgICAgICAgICAvLyBoZWxkIHVudGlsIGl0IGlzIHVzZWQgYWdhaW4uCisgICAgICAgICAgICAvLyBUaGVyZSBhcmUgYSBjb3VwbGUgdHJpY2t5IHRoaW5ncyBhYm91dCB0aGlzIGNvZGU6CisgICAgICAgICAgICAvLyAtIG1ha2Ugc3VyZSB0aGF0IHdlIGFjcXVpcmUgdGhlIG5ldyB3YWtlbG9jayBiZWZvcmUgcmVsZWFzaW5nIHRoZSBvbGQgb25lLAorICAgICAgICAgICAgLy8gICBvdGhlcndpc2UgdGhlIGRldmljZSBtaWdodCBnbyB0byBzbGVlcCBhcyBzb29uIGFzIHdlIHJlbGVhc2UgaXQuCisgICAgICAgICAgICAvLyAtIHNpbmNlIHdlIHVzZSBub24tcmVmZXJlbmNlIGNvdW50ZWQgd2FrZWxvY2tzIHdlIGhhdmUgdG8gYmUgc3VyZSBub3QgdG8gZG8KKyAgICAgICAgICAgIC8vICAgdGhlIHJlbGVhc2UgaWYgdGhlIHdha2Vsb2NrIGRpZG4ndCBjaGFuZ2UuIE90aGV3aXNlIHdlIHdvdWxkIGRvIGFuCisgICAgICAgICAgICAvLyAgIGFjcXVpcmUgZm9sbG93ZWQgYnkgYSByZWxlYXNlIG9uIHRoZSBzYW1lIGxvY2ssIHJlc3VsdGluZyBpbiBubyBsb2NrCisgICAgICAgICAgICAvLyAgIGJlaW5nIGhlbGQuCisgICAgICAgICAgICBQb3dlck1hbmFnZXIuV2FrZUxvY2sgb2xkV2FrZUxvY2sgPSBtU3luY1dha2VMb2NrOworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBtU3luY1dha2VMb2NrID0gZ2V0U3luY1dha2VMb2NrKG9wLmFjY291bnQudHlwZSwgb3AuYXV0aG9yaXR5KTsKKyAgICAgICAgICAgICAgICBtU3luY1dha2VMb2NrLmFjcXVpcmUoKTsKKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgaWYgKG9sZFdha2VMb2NrICE9IG51bGwgJiYgb2xkV2FrZUxvY2sgIT0gbVN5bmNXYWtlTG9jaykgeworICAgICAgICAgICAgICAgICAgICBvbGRXYWtlTG9jay5yZWxlYXNlKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAvLyBubyBuZWVkIHRvIHNjaGVkdWxlIGFuIGFsYXJtLCBhcyB0aGF0IHdpbGwgYmUgZG9uZSBieSBvdXIgY2FsbGVyLgogCiAgICAgICAgICAgICAvLyB0aGUgbmV4dCBzdGV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eVBhcmFtZXRlcigidXJsIik7CisgICAgICAgIGlmICh1cmwgIT0gbnVsbCkgeworICAgICAgICAgICAgcGFyc2VyID0gZ2V0VXJpWG1sUHVsbFBhcnNlcih1cmwpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZmluYWwgU3RyaW5nIHJlc291cmNlID0gdXJpLmdldFF1ZXJ5UGFyYW1ldGVyKCJyZXNvdXJjZSIpOworICAgICAgICAgICAgaWYgKHJlc291cmNlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBVcmkgcmVzb3VyY2VVcmkgPSBVcmkucGFyc2UoQ29udGVudFJlc29sdmVyLlNDSEVNRV9BTkRST0lEX1JFU09VUkNFICsgIjovLyIgKworICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q29udGV4dCgpLmdldFBhY2thZ2VOYW1lKCkgKyAiLyIgKyByZXNvdXJjZSk7CisgICAgICAgICAgICAgICAgcGFyc2VyID0gZ2V0UmVzb3VyY2VYbWxQdWxsUGFyc2VyKHJlc291cmNlVXJpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChwYXJzZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgWE1MQ3Vyc29yIHhtbEN1cnNvciA9IG5ldyBYTUxDdXJzb3Ioc2VsZWN0aW9uLCBwcm9qZWN0aW9uKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgeG1sQ3Vyc29yLnBhcnNlV2l0aChwYXJzZXIpOworICAgICAgICAgICAgICAgIHJldHVybiB4bWxDdXJzb3I7CisgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIkkvTyBlcnJvciB3aGlsZSBwYXJzaW5nIFhNTCAiICsgdXJpLCBlKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFhtbFB1bGxQYXJzZXJFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJFcnJvciB3aGlsZSBwYXJzaW5nIFhNTCAiICsgdXJpLCBlKTsKKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgaWYgKG1IdHRwQ2xpZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUh0dHBDbGllbnQuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDcmVhdGVzIGFuIFhtbFB1bGxQYXJzZXIgZm9yIHRoZSBwcm92aWRlZCBVUkwuIENhbiBiZSBvdmVybG9hZGVkIHRvIHByb3ZpZGUgeW91ciBvd24gcGFyc2VyLgorICAgICAqIEBwYXJhbSB1cmwgVGhlIFVSTCBvZiB0aGUgWE1MIGRvY3VtZW50IHRoYXQgaXMgdG8gYmUgcGFyc2VkLgorICAgICAqIEByZXR1cm4gQW4gWG1sUHVsbFBhcnNlciBvbiB0aGlzIGRvY3VtZW50LgorICAgICAqLworICAgIHByb3RlY3RlZCBYbWxQdWxsUGFyc2VyIGdldFVyaVhtbFB1bGxQYXJzZXIoU3RyaW5nIHVybCkgeworICAgICAgICBYbWxQdWxsUGFyc2VyIHBhcnNlciA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBYbWxQdWxsUGFyc2VyRmFjdG9yeSBmYWN0b3J5ID0gWG1sUHVsbFBhcnNlckZhY3RvcnkubmV3SW5zdGFuY2UoKTsKKyAgICAgICAgICAgIGZhY3Rvcnkuc2V0TmFtZXNwYWNlQXdhcmUodHJ1ZSk7CisgICAgICAgICAgICBwYXJzZXIgPSBmYWN0b3J5Lm5ld1B1bGxQYXJzZXIoKTsKKyAgICAgICAgfSBjYXRjaCAoWG1sUHVsbFBhcnNlckV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiVW5hYmxlIHRvIGNyZWF0ZSBYbWxQdWxsUGFyc2VyIiwgZSk7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIElucHV0U3RyZWFtIGlucHV0U3RyZWFtID0gbnVsbDsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGZpbmFsIEh0dHBHZXQgZ2V0ID0gbmV3IEh0dHBHZXQodXJsKTsKKyAgICAgICAgICAgIG1IdHRwQ2xpZW50ID0gQW5kcm9pZEh0dHBDbGllbnQubmV3SW5zdGFuY2UoIkFuZHJvaWQiKTsKKyAgICAgICAgICAgIEh0dHBSZXNwb25zZSByZXNwb25zZSA9IG1IdHRwQ2xpZW50LmV4ZWN1dGUoZ2V0KTsKKyAgICAgICAgICAgIGlmIChyZXNwb25zZS5nZXRTdGF0dXNMaW5lKCkuZ2V0U3RhdHVzQ29kZSgpID09IEh0dHBTdGF0dXMuU0NfT0spIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBIdHRwRW50aXR5IGVudGl0eSA9IHJlc3BvbnNlLmdldEVudGl0eSgpOworICAgICAgICAgICAgICAgIGlmIChlbnRpdHkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBpbnB1dFN0cmVhbSA9IGVudGl0eS5nZXRDb250ZW50KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cudyhMT0dfVEFHLCAiRXJyb3Igd2hpbGUgcmV0cmlldmluZyBYTUwgZmlsZSAiICsgdXJsLCBlKTsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHBhcnNlci5zZXRJbnB1dChpbnB1dFN0cmVhbSwgbnVsbCk7CisgICAgICAgIH0gY2F0Y2ggKFhtbFB1bGxQYXJzZXJFeGNlcHRpb24gZSkgewor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hdHRlcm4ocHJvamVjdGlvbnMpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBQYXR0ZXJuIGNyZWF0ZVBhdHRlcm4oU3RyaW5nIGlucHV0KSB7CisgICAgICAgICAgICBTdHJpbmcgcGF0dGVybiA9IGlucHV0LnJlcGxhY2VBbGwoIi8vIiwgIi8oLiovfCkiKS5yZXBsYWNlQWxsKCJeLyIsICJeLyIpICsgIiQiOworICAgICAgICAgICAgcmV0dXJuIFBhdHRlcm4uY29tcGlsZShwYXR0ZXJuKTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCBjcmVhdGVQcm9qZWN0aW9uUGF0dGVybihTdHJpbmdbXSBwcm9qZWN0aW9ucykgeworICAgICAgICAgICAgbVByb2plY3Rpb25QYXR0ZXJucyA9IG5ldyBQYXR0ZXJuW21OdW1iZXJPZlByb2plY3Rpb25zXTsKKyAgICAgICAgICAgIG1BdHRyaWJ1dGVOYW1lcyA9IG5ldyBTdHJpbmdbbU51bWJlck9mUHJvamVjdGlvbnNdOworICAgICAgICAgICAgbUFjdGl2ZVRleHREZXB0aE1hc2sgPSBuZXcgQml0U2V0W21OdW1iZXJPZlByb2plY3Rpb25zXTsKKyAgICAgICAgICAgIC8vIEFkZCBhIGNvbHVtbiB0byBzdG9yZSBfSUQKKyAgICAgICAgICAgIG1DdXJyZW50VmFsdWVzID0gbmV3IFN0cmluZ1ttTnVtYmVyT2ZQcm9qZWN0aW9ucyArIDFdOworCisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8bU51bWJlck9mUHJvamVjdGlvbnM7IGkrKykgeworICAgICAgICAgICAgICAgIG1BY3RpdmVUZXh0RGVwdGhNYXNrW2ldID0gbmV3IEJpdFNldCgpOworICAgICAgICAgICAgICAgIFN0cmluZyBwcm9qZWN0aW9uID0gcHJvamVjdGlvbnNbaSArIDFdOyAvLyArMSB0byBza2lwIHRoZSBfSUQgY29sdW1uCisgICAgICAgICAgICAgICAgaW50IGF0SW5kZXggPSBwcm9qZWN0aW9uLmxhc3RJbmRleE9mKCdAJywgcHJvamVjdGlvbi5sZW5ndGgoKSk7CisgICAgICAgICAgICAgICAgaWYgKGF0SW5kZXggPj0gMCkgeworICAgICAgICAgICAgICAgICAgICBtQXR0cmlidXRlTmFtZXNbaV0gPSBwcm9qZWN0aW9uLnN1YnN0cmluZyhhdEluZGV4KzEpOworICAgICAgICAgICAgICAgICAgICBwcm9qZWN0aW9uID0gcHJvamVjdGlvbi5zdWJzdHJpbmcoMCwgYXRJbmRleCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnV0ZU5hbWVzW2ldID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBDb25mb3JtcyB0byBYUGF0aCBzdGFuZGFyZDogcmVmZXJlbmNlIHRvIGxvY2FsIGNvbnRleHQgc3RhcnRzIHdpdGggYSAuCisgICAgICAgICAgICAgICAgaWYgKHByb2plY3Rpb24uY2hhckF0KDApID09ICcuJykgeworICAgICAgICAgICAgICAgICAgICBwcm9qZWN0aW9uID0gcHJvamVjdGlvbi5zdWJzdHJpbmcoMSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1Qcm9qZWN0aW9uUGF0dGVybnNbaV0gPSBjcmVhdGVQYXR0ZXJuKHByb2plY3Rpb24pOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgcGFyc2VXaXRoKFhtbFB1bGxQYXJzZXIgcGFyc2VyKSB0aHJvd3MgSU9FeGNlcHRpb24sIFhtbFB1bGxQYXJzZXJFeGNlcHRpb24geworICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBwYXRoID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgICAgIFN0YWNrPEludGVnZXI+IHBhdGhMZW5ndGhTdGFjayA9IG5ldyBTdGFjazxJbnRlZ2Vy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XRoLmFwcGVuZCgnLycpOworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcHJlZml4ID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGdldFByZWZpeCBpcyBub3Qgc3VwcG9ydGVkIGJ5IGxvY2FsIFhtbCByZXNvdXJjZSBwYXJzZXIKKyAgICAgICAgICAgICAgICAgICAgICAgIHByZWZpeCA9IHBhcnNlci5nZXRQcmVmaXgoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUnVudGltZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwcmVmaXggPSBudWxsOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChwcmVmaXggIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcGF0aC5hcHBlbmQocHJlZml4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhdGguYXBwZW5kKCc6Jyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcGF0aC5hcHBlbmQocGFyc2VyLmdldE5hbWUoKSk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnROb2RlRGVwdGggPj0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudE5vZGVEZXB0aCsrOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQSBub2RlIG1hdGNoaW5nIHNlbGVjdGlvbiBpcyBmb3VuZDogaW5pdGlhbGl6ZSBjaGlsZCBwYXJzaW5nIG1vZGUKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtU2VsZWN0aW9uUGF0dGVybi5tYXRjaGVyKHBhdGgudG9TdHJpbmcoKSkubWF0Y2hlcygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudE5vZGVEZXB0aCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudE5vZGVQYXRoU3RhcnRJbmRleCA9IHBhdGgubGVuZ3RoKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRWYWx1ZXNbMF0gPSBJbnRlZ2VyLnRvU3RyaW5nKGdldENvdW50KCkpOyAvLyBfSUQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1OdW1iZXJPZlByb2plY3Rpb25zOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVzZXQgdmFsdWVzIHRvIGRlZmF1bHQgKGVtcHR5IHN0cmluZykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRWYWx1ZXNbaSArIDFdID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVUZXh0RGVwdGhNYXNrW2ldLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyB0ZXN0IGhhcyB0byBiZSBzZXBhcmF0ZWQgZnJvbSB0aGUgcHJldmlvdXMgb25lIGFzIGN1cnJlbnROb2RlRGVwdGggY2FuCisgICAgICAgICAgICAgICAgICAgIC8vIGJlIG1vZGlmaWVkIGFib3ZlICh3aGVuIGEgbm9kZSBtYXRjaGluZyBzZWxlY3Rpb24gaXMgZm91bmQpLgorICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudE5vZGVEZXB0aCA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbG9jYWxOb2RlUGF0aCA9IHBhdGguc3Vic3RyaW5nKGN1cnJlbnROb2RlUGF0aFN0YXJ0SW5kZXgpOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtTnVtYmVyT2ZQcm9qZWN0aW9uczsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Qcm9qZWN0aW9uUGF0dGVybnNbaV0ubWF0Y2hlcihsb2NhbE5vZGVQYXRoKS5tYXRjaGVzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGF0dHJpYnV0ZSA9IG1BdHRyaWJ1dGVOYW1lc1tpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF0dHJpYnV0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFZhbHVlc1tpICsgMV0gPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCBhdHRyaWJ1dGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVRleHREZXB0aE1hc2tbaV0uc2V0KGN1cnJlbnROb2RlRGVwdGgsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2ZW50VHlwZSA9PSBYbWxQdWxsUGFyc2VyLkVORF9UQUcpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gUG9wIGxhc3Qgbm9kZSBmcm9tIHBhdGgKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IGxlbmd0aCA9IHBhdGhMZW5ndGhTdGFjay5wb3AoKTsKKyAgICAgICAgICAgICAgICAgICAgcGF0aC5zZXRMZW5ndGgobGVuZ3RoKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudE5vZGVEZXB0aCA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudE5vZGVEZXB0aCA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTGVhdmluZyBhIHNlbGVjdGlvbiBtYXRjaGluZyBub2RlOiBhZGQgYSBuZXcgcm93IHdpdGggcmVzdWx0cworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZFJvdyhtQ3VycmVudFZhbHVlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbU51bWJlck9mUHJvamVjdGlvbnM7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQWN0aXZlVGV4dERlcHRoTWFza1tpXS5zZXQoY3VycmVudE5vZGVEZXB0aCwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnROb2RlRGVwdGgtLTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoZXZlbnRUeXBlID09IFhtbFB1bGxQYXJzZXIuVEVYVCkgJiYgKCFwYXJzZXIuaXNXaGl0ZXNwYWNlKCkpKSB7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbU51bWJlck9mUHJvamVjdGlvbnM7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChjdXJyZW50Tm9kZURlcHRoID49IDApICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1BY3RpdmVUZXh0RGVwdGhNYXNrW2ldLmdldChjdXJyZW50Tm9kZURlcHRoKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFZhbHVlc1tpICsgMV0gKz0gcGFyc2VyLmdldFRleHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGV2ZW50VHlwZSA9IHBhcnNlci5uZXh0KCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L3BtL0FwcGxpY2F0aW9uSW5mby5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvY29udGVudC9wbS9BcHBsaWNhdGlvbkluZm8uamF2YQppbmRleCA3OTAxYjE1NS4uMzVmMjJkYyAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvY29udGVudC9wbS9BcHBsaWNhdGlvbkluZm8uamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC9jb250ZW50L3BtL0FwcGxpY2F0aW9uSW5mby5qYXZhCkBAIC0yODQsNiArMjg0LDEyIEBACiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRkxBR19IRUFWWV9XRUlHSFQgPSAxPDwyMDsKICAgICAKICAgICAvKioKKyAgICAgKiBWYWx1ZSBmb3Ige0BsaW5rICNmbGFnc306IHRydWUgd2hlbiB0aGUgYXBwbGljYXRpb24ncyByZW5kZXJpbmcgc2hvdWxkCisgICAgICogYmUgaGFyZHdhcmUgYWNjZWxlcmF0ZWQuCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRkxBR19IQVJEV0FSRV9BQ0NFTEVSQVRFRCA9IDE8PDIxOworICAgIAorICAgIC8qKgogICAgICAqIFZhbHVlIGZvciB7QGxpbmsgI2ZsYWdzfTogdGhpcyBpcyB0cnVlIGlmIHRoZSBhcHBsaWNhdGlvbiBoYXMgc2V0CiAgICAgICogaXRzIGFuZHJva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G93LmdldEJsb2IobVBvcywgY29sdW1uSW5kZXgpOwogICAgIH0KIAogICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBTdHJpbmcgZ2V0U3RyaW5nKGludCBjb2x1bW5JbmRleCkKLSAgICB7CisgICAgcHVibGljIFN0cmluZyBnZXRTdHJpbmcoaW50IGNvbHVtbkluZGV4KSB7CiAgICAgICAgIGNoZWNrUG9zaXRpb24oKTsKLQotICAgICAgICBzeW5jaHJvbml6ZWQobVVwZGF0ZWRSb3dzKSB7Ci0gICAgICAgICAgICBpZiAoaXNGaWVsZFVwZGF0ZWQoY29sdW1uSW5kZXgpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIChTdHJpbmcpZ2V0VXBkYXRlZEZpZWxkKGNvbHVtbkluZGV4KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCiAgICAgICAgIHJldHVybiBtV2luZG93LmdldFN0cmluZyhtUG9zLCBjb2x1bW5JbmRleCk7CiAgICAgfQotICAgIAorCiAgICAgQE92ZXJyaWRlCi0gICAgcHVibGljIHZvaWQgY29weVN0cmluZ1RvQnVmZmVyKGludCBjb2x1bW5JbmRleCwgQ2hhckFycmF5QnVmZmVyIGJ1ZmZlcikKLSAgICB7CisgICAgcHVibGljIHZvaWQgY29weVN0cmluZ1RvQnVmZmVyKGludCBjb2x1bW5JbmRleCwgQ2hhckFycmF5QnVmZmVyIGJ1ZmZlcikgewogICAgICAgICBjaGVja1Bvc2l0aW9uKCk7Ci0gICAgICAgIAotICAgICAgICBzeW5jaHJvbml6ZWQobVVwZGF0ZWRSb3dzKSB7Ci0gICAgICAgICAgICBpZiAoaXNGaWVsZFVwZGF0ZWQoY29sdW1uSW5kZXgpKSB7Ci0gICAgICAgICAgICAgICAgc3VwZXIuY29weVN0cmluZ1RvQnVmZmVyKGNvbHVtbkluZGV4LCBidWZmZXIpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIAogICAgICAgICBtV2luZG93LmNvcHlTd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AgICByZXR1cm4gbVdpbmRvdy5nZXRJbnQobVBvcywgY29sdW1uSW5kZXgpOwogICAgIH0KIAogICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBsb25nIGdldExvbmcoaW50IGNvbHVtbkluZGV4KQotICAgIHsKKyAgICBwdWJsaWMgbG9uZyBnZXRMb25nKGludCBjb2x1bW5JbmRleCkgewogICAgICAgICBjaGVja1Bvc2l0aW9uKCk7Ci0KLSAgICAgICAgc3luY2hyb25pemVkKG1VcGRhdGVkUm93cykgewotICAgICAgICAgICAgaWYgKGlzRmllbGRVcGRhdGVkKGNvbHVtbkluZGV4KSkgewotICAgICAgICAgICAgICAgIE51bWJlciB2YWx1ZSA9IChOdW1iZXIpZ2V0VXBkYXRlZEZpZWxkKGNvbHVtbkluZGV4KTsKLSAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWUubG9uZ1ZhbHVlKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQogICAgICAgICByZXR1cm4gbVdpbmRvdy5nZXRMb25nKG1Qb3MsIGNvbHVtbkluZGV4KTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKLSAgICBwdWJsaWMgZmxvYXQgZ2V0RmxvYXQoaW50IGNvbHVtbkluZGV4KQotICAgIHsKKyAgICBwdWJsaWMgZmxvYXQgZ2V0RmxvYXQoaW50IGNvbHVtbkluZGV4KSB7CiAgICAgICAgIGNoZWNrUG9zaXRpb24oKTsKLQotICAgICAgICBzeW5jaHJvbml6ZWQobVVwZGF0ZWRSb3dzKSB7Ci0gICAgICAgICAgICBpZiAoaXNGaWVsZFVwZGF0ZWQoY29sdW1uSW5kZXgpKSB7Ci0gICAgICAgICAgICAgICAgTnVtYmVyIHZhbHVlID0gKE51bWJlcilnZXRVcGRhdGVkRmllbGQoY29sdW1uSW5kZXgpOwotICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZS5mbG9hdFZhbHVlKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQogICAgICAgICByZXR1cm4gbVdpbmRvdy5nZXRGbG9hdChtUG9zLCBjb2x1bW5JbmRleCk7CiAgICAgfQogCiAgICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGRvdWJsZSBnZXREb3VibGUoaW50IGNvbHVtbkluZGV4KQotICAgIHsKKyAgICBwdWJsaWMgZG91YmxlIGdldERvdWJsZShpbnQgY29sdW1uSW5kZXgpIHsKICAgICAgICAgY2hlY2tQb3NpdGlvbigpOwotCi0gICAgICAgIHN5bmNocm9uaXplZChtVXBkYXRlZFJvd3MpIHsKLSAgICAgICAgICAgIGlmIChpc0ZpZWxkVXBkYXRlZChjb2x1bW5JbmRleCkpIHsKLSAgICAgICAgICAgICAgICBOdW1iZXIgdmFsdWUgPSAoTnVtYmVyKWdldFVwZGF0ZWRGaWVsZChjb2x1bW5JbmRleCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlLmRvdWJsZVZhbHVlKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQogICAgICAgICByZXR1cm4gbVdpbmRvdy5nZXREb3VibGUobVBvcywgY29sdW1uSW5kZXgpOwogICAgIH0KIAogICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBib29sZWFuIGlzTnVsbChpbnQgY29sdW1uSW5kZXgpCi0gICAgeworICAgIHB1YmxpYyBib29sZWFuIGlzTnVsbChpbnQgY29sdW1uSW5kZXgpIHsKICAgICAgICAgY2hlY2tQb3NpdGlvbigpOwotCi0gICAgICAgIHN5bmNocm9uaXplZChtVXBkYXRlZFJvd3MpIHsKLSAgICAgICAgICAgIGlmIChpc0ZpZWxkVXBkYXRlZChjb2x1bW5JbmRleCkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZ2V0VXBkYXRlZEZpZWxkKGNvbHVtbkluZGV4KSA9PSBudWxsOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIG1XaW5kb3cuaXNOdWxsKG1Qb3MsIGNvbHV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gICAgICAgIE9iamVjdCBvYmplY3QgPSBnZXRVcGRhdGVkRmllbGQoY29sdW1uSW5kZXgpOwotICAgICAgICAgICAgICAgIHJldHVybiBvYmplY3QgPT0gbnVsbCB8fCBvYmplY3QgaW5zdGFuY2VvZiBTdHJpbmc7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gbVdpbmRvdy5pc1N0cmluZyhtUG9zLCBjb2x1bW5JbmRleCk7CisgICAgLyoqCisgICAgICogQGRlcHJlY2F0ZWQgVXNlIHtAbGluayAjZ2V0VHlwZX0KKyAgICAgKi8KKyAgICBARGVwcmVjYXRlZAorICAgIHB1YmxpYyBib29sZWFuIGlzU3RyaW5nKGludCBjb2x1bW5JbmRleCkgeworICAgICAgICByZXR1cm4gZ2V0VHlwZShjb2x1bW5JbmRleCkgPT0gQ3Vyc29yLkZJRUxEX1RZUEVfU1RSSU5HOwogICAgIH0KIAotICAgIHB1YmxpYyBib29sZWFuIGlzTG9uZyhpbnQgY29sdW1uSW5kZXgpCi0gICAgewotICAgICAgICBjaGVja1Bvc2l0aW9uKCk7Ci0KLSAgICAgICAgc3luY2hyb25pemVkKG1VcGRhdGVkUm93cykgewotICAgICAgICAgICAgaWYgKGlzRmllbGRVcGRhdGVkKGNvbHVtbkluZGV4KSkgewotICAgICAgICAgICAgICAgIE9iamVjdCBvYmplY3QgPSBnZXRVcGRhdGVkRmllbGQoY29sdW1uSW5kZXgpOwotICAgICAgICAgICAgICAgIHJldHVybiBvYmplY3QgIT0gbnVsbCAmJiAob2JqZWN0IGluc3RhbmNlb2YgSW50ZWdlciB8fCBvYmplY3QgaW5zdGFuY2VvZiBMb25nKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBtV2luZG93LmlzTG9uZyhtUG9zLCBjb2x1bW5JbmRleCk7CisgICAgLyoqCisgICAgICogQGRlcHJlY2F0ZWQgVXNlIHtAbGluayAjZ2V0VHlwZX0KKyAgICAgKi8KKyAgICBARGVwcmVjYXRlZAorICAgIHB1YmxpYyBib29sZWFuIGlzTG9uZyhpbnQgY29sdW1uSW5kZXgpIHsKKyAgICAgICAgcmV0dXJuIGdldFR5cGUoY29sdW1uSW5kZXgpID09IEN1cnNvci5GSUVMRF9UWVBFX0lOVEVHRVI7CiAgICAgfQogCi0gICAgcHVibGljIGJvb2xlYW4gaXNGbG9hdChpbnQgY29sdW1uSW5kZXgpCi0gICAgewotICAgICAgICBjaGVja1Bvc2l0aW9uKCk7Ci0KLSAgICAgICAgc3luY2hyb25pemVkKG1VcGRhdGVkUm93cykgewotICAgICAgICAgICAgaWYgKGlzRmllbGRVcGRhdGVkKGNvbHVtbkluZGV4KSkgewotICAgICAgICAgICAgICAgIE9iamVjdCBvYmplY3QgPSBnZXRVcGRhdGVkRmllbGQoY29sdW1uSW5kZXgpOwotICAgICAgICAgICAgICAgIHJldHVybiBvYmplY3QgIT0gbnVsbCAmJiAob2JqZWN0IGluc3RhbmNlb2YgRmxvYXQgfHwgb2JqZWN0IGluc3RhbmNlb2YgRG91YmxlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBtV2luZG93LmlzRmxvYXQobVBvcywgY29sdW1uSW5kZXgpOworICAgIC8qKgorICAgICAqIEBkZXByZWNhdGVkIFVzZSB7QGxpbmsgI2dldFR5cGV9CisgICAgICovCisgICAgQERlcHJlY2F0ZWQKKyAgICBwdWJsaWMgYm9vbGVhbiBpc0Zsb2F0KGludCBjb2x1bW5JbmRleCkgeworICAgICAgICByZXR1cm4gZ2V0VHlwZShjb2x1bW5JbmRleCkgPT0gQ3Vyc29yLkZJRUxEX1RZUEVfRkxPQVQ7CiAgICAgfQogCiAgICAgQE92ZXJyaWRlCi0gICAgcHJvdGVjdGVkIHZvaWQgY2hlY2tQb3NpdGlvbigpCi0gICAgeworICAgIHB1YmxpYyBpbnQgZ2V0VHlwZShpbnQgY29sdW1uSW5kZXgpIHsKKyAg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2lkLm9zLlBhcmNlbDsKLWltcG9ydCBhbmRyb2lkLm9zLkJ1bmRsZTsKLQotaW1wb3J0IGphdmEudXRpbC5IYXNoTWFwOwotaW1wb3J0IGphdmEudXRpbC5NYXA7CitpbXBvcnQgYW5kcm9pZC5vcy5SZW1vdGVFeGNlcHRpb247CiAKIC8qKgogICogTmF0aXZlIGltcGxlbWVudGF0aW9uIG9mIHRoZSBidWxrIGN1cnNvci4gVGhpcyBpcyBvbmx5IGZvciB1c2UgaW4gaW1wbGVtZW50aW5nCkBAIC0xMjAsMjYgKzExNyw2IEBACiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIGNhc2UgVVBEQVRFX1JPV1NfVFJBTlNBQ1RJT046IHsKLSAgICAgICAgICAgICAgICAgICAgZGF0YS5lbmZvcmNlSW50ZXJmYWNlKElCdWxrQ3Vyc29yLmRlc2NyaXB0b3IpOwotICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIC0gd2hhdCBDbGFzc0xvYWRlciBzaG91bGQgYmUgcGFzc2VkIHRvIHJlYWRIYXNoTWFwPwotICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIC0gc3dpdGNoIHRvIEJ1bmRsZQotICAgICAgICAgICAgICAgICAgICBIYXNoTWFwPExvbmcsIE1hcDxTdHJpbmcsIE9iamVjdD4+IHZhbHVlcyA9IGRhdGEucmVhZEhhc2hNYXAobnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gcmVzdWx0ID0gdXBkYXRlUm93cyh2YWx1ZXMpOwotICAgICAgICAgICAgICAgICAgICByZXBseS53cml0ZU5vRXhjZXB0aW9uKCk7Ci0gICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlSW50KChyZXN1bHQgPT0gdHJ1ZSA/IDEgOiAwKSk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGNhc2UgREVMRVRFX1JPV19UUkFOU0FDVElPTjogewotICAgICAgICAgICAgICAgICAgICBkYXRhLmVuZm9yY2VJbnRlcmZhY2UoSUJ1bGtDdXJzb3IuZGVzY3JpcHRvcik7Ci0gICAgICAgICAgICAgICAgICAgIGludCBwb3NpdGlvbiA9IGRhdGEucmVhZEludCgpOwotICAgICAgICAgICAgICAgICAgICBib29sZWFuIHJlc3VsdCA9IGRlbGV0ZVJvdyhwb3NpdGlvbik7Ci0gICAgICAgICAgICAgICAgICAgIHJlcGx5LndyaXRlTm9FeGNlcHRpb24oKTsKLSAgICAgICAgICAgICAgICAgICAgcmVwbHkud3JpdGVJbnQoKHJlc3VsdCA9PSB0cnVlID8gMSA6IDApKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgfQotCiAgICAgICAgICAgICAgICAgY2FzZSBPTl9NT1ZFX1RSQU5TQUNUSU9OOiB7CiAgICAgICAgICAgICAgICAgICAgIGRhdGEuZW5mb3JjZUludGVyZmFjZShJQnVsa0N1cnNvci5kZXNjcmlwdG9yKTsKICAgICAgICAgICAgICAgICAgICAgaW50IHBvc2l0aW9uID0gZGF0YS5yZWFkSW50KCk7CkBAIC0zNDMsNDggKzMyMCw2IEBACiAgICAgICAgIHJldHVybiBjb3VudDsKICAgICB9CiAKLSAgICBwdWJsaWMgYm9vbGVhbiB1cGRhdGVSb3dzKE1hcCB2YWx1ZXMpIHRocm93cyBSZW1vdGVFeGNlcHRpb24KLSAgICB7Ci0gICAgICAgIFBhcmNlbCBkYXRhID0gUGFyY2VsLm9idGFpbigpOwotICAgICAgICBQYXJjZWwgcmVwbHkgPSBQYXJjZWwub2J0YWluKCk7Ci0KLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElCdWxrQ3Vyc29yLmRlc2NyaXB0b3IpOwotCi0gICAgICAgIGRhdGEud3JpdGVNYXAodmFsdWVzKTsK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dGVkCi0gICAgICovCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIGJvb2xlYW4gZGVsZXRlUm93KCkgewotICAgICAgICB0cnkgewotICAgICAgICAgICAgYm9vbGVhbiByZXN1bHQgPSBtQnVsa0N1cnNvci5kZWxldGVSb3cobVBvcyk7Ci0gICAgICAgICAgICBpZiAocmVzdWx0ICE9IGZhbHNlKSB7Ci0gICAgICAgICAgICAgICAgLy8gVGhlIHdpbmRvdyBjb250YWlucyB0aGUgb2xkIHZhbHVlLCBkaXNjYXJkIGl0Ci0gICAgICAgICAgICAgICAgbVdpbmRvdyA9IG51bGw7Ci0gICAgCi0gICAgICAgICAgICAgICAgLy8gRml4IHVwIHRoZSBwb3NpdGlvbgotICAgICAgICAgICAgICAgIG1Db3VudCA9IG1CdWxrQ3Vyc29yLmNvdW50KCk7Ci0gICAgICAgICAgICAgICAgaWYgKG1Qb3MgPCBtQ291bnQpIHsKLSAgICAgICAgICAgICAgICAgICAgaW50IG9sZFBvcyA9IG1Qb3M7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb3MgPSAtMTsKLSAgICAgICAgICAgICAgICAgICAgbW92ZVRvUG9zaXRpb24ob2xkUG9zKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBtUG9zID0gbUNvdW50OwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8vIFNlbmQgdGhlIGNoYW5nZSBub3RpZmljYXRpb24KLSAgICAgICAgICAgICAgICBvbkNoYW5nZSh0cnVlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiByZXN1bHQ7Ci0gICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgTG9nLmUoVEFHLCAiVW5hYmxlIHRvIGRlbGV0ZSByb3cgYmVjYXVzZSB0aGUgcmVtb3RlIHByb2Nlc3MgaXMgZGVhZCIpOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0gICAgfQotCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIFN0cmluZ1tdIGdldENvbHVtbk5hbWVzKCkgewogICAgICAgICBpZiAobUNvbHVtbnMgPT0gbnVsbCkgewpAQCAtMjE5LDQ0ICsxODUsNiBAQAogICAgICAgICByZXR1cm4gbUNvbHVtbnM7CiAgICAgfQogCi0gICAgLyoqCi0gICAgICogQGhpZGUKLSAgICAgKiBAZGVwcmVjYXRlZAotICAgICAqLwotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBib29sZWFuIGNvbW1pdFVwZGF0ZXMoTWFwPD8gZXh0ZW5kcyBMb25nLAotICAgICAgICAgICAgPyBleHRlbmRzIE1hcDxTdHJpbmcsT2JqZWN0Pj4gYWRkaXRpb25hbFZhbHVlcykgewotICAgICAgICBpZiAoIXN1cHBvcnRzVXBkYXRlcygpKSB7Ci0gICAgICAgICAgICBMb2cuZShUQUcsICJjb21taXRVcGRhdGVzIG5vdCBzdXBwb3J0ZWQgb24gdGhpcyBjdXJzb3IsIGRpZCB5b3UgaW5jbHVkZSB0aGUgX2lkIGNvbHVtbj8iKTsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIHN5bmNocm9uaXplZChtVXBkYXRlZFJvd3MpIHsKLSAgICAgICAgICAgIGlmIChhZGRpdGlvbmFsVmFsdWVzICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtVXBkYXRlZFJvd3MucHV0QWxsKGFkZGl0aW9uYWxWYWx1ZXMpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobVVwZGF0ZWRSb3dzLnNpemUoKSA8PSAwKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIGJvb2xlYW4gcmVzdWx0ID0gbUJ1bGtDdXJzb3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x1bW4gbmFtZSwgb3IgLTEgaWYgdGhlIGNvbHVtbiBkb2Vzbid0IGV4aXN0LgogICAgICAqIElmIHlvdSBleHBlY3QgdGhlIGNvbHVtbiB0byBleGlzdCB1c2Uge0BsaW5rICNnZXRDb2x1bW5JbmRleE9yVGhyb3coU3RyaW5nKX0gaW5zdGVhZCwgd2hpY2gKICAgICAgKiB3aWxsIG1ha2UgdGhlIGVycm9yIG1vcmUgY2xlYXIuCkBAIC0yOTUsNiArMjk4LDI3IEBACiAgICAgZG91YmxlIGdldERvdWJsZShpbnQgY29sdW1uSW5kZXgpOwogCiAgICAgLyoqCisgICAgICogUmV0dXJucyBkYXRhIHR5cGUgb2YgdGhlIGdpdmVuIGNvbHVtbidzIHZhbHVlLgorICAgICAqIFRoZSBwcmVmZXJyZWQgdHlwZSBvZiB0aGUgY29sdW1uIGlzIHJldHVybmVkIGJ1dCB0aGUgZGF0YSBtYXkgYmUgY29udmVydGVkIHRvIG90aGVyIHR5cGVzCisgICAgICogYXMgZG9jdW1lbnRlZCBpbiB0aGUgZ2V0LXR5cGUgbWV0aG9kcyBzdWNoIGFzIHtAbGluayAjZ2V0SW50KGludCl9LCB7QGxpbmsgI2dldEZsb2F0KGludCl9CisgICAgICogZXRjLgorICAgICAqPHA+CisgICAgICogUmV0dXJuZWQgY29sdW1uIHR5cGVzIGFyZQorICAgICAqIDx1bD4KKyAgICAgKiAgIDxsaT57QGxpbmsgI0ZJRUxEX1RZUEVfTlVMTH08L2xpPgorICAgICAqICAgPGxpPntAbGluayAjRklFTERfVFlQRV9JTlRFR0VSfTwvbGk+CisgICAgICogICA8bGk+e0BsaW5rICNGSUVMRF9UWVBFX0ZMT0FUfTwvbGk+CisgICAgICogICA8bGk+e0BsaW5rICNGSUVMRF9UWVBFX1NUUklOR308L2xpPgorICAgICAqICAgPGxpPntAbGluayAjRklFTERfVFlQRV9CTE9CfTwvbGk+CisgICAgICo8L3VsPgorICAgICAqPC9wPgorICAgICAqCisgICAgICogQHBh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ICAgKiBAcmV0dXJuIHtAY29kZSB0cnVlfSBpZiBnaXZlbiBmaWVsZCBpcyB7QGNvZGUgTlVMTH0KKyAgICAgKiBAZGVwcmVjYXRlZCB1c2Uge0BsaW5rICNnZXRUeXBlKGludCwgaW50KX0gaW5zdGVhZAogICAgICAqLworICAgIEBEZXByZWNhdGVkCiAgICAgcHVibGljIGJvb2xlYW4gaXNOdWxsKGludCByb3csIGludCBjb2wpIHsKLSAgICAgICAgYWNxdWlyZVJlZmVyZW5jZSgpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgcmV0dXJuIGlzTnVsbF9uYXRpdmUocm93IC0gbVN0YXJ0UG9zLCBjb2wpOwotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgcmVsZWFzZVJlZmVyZW5jZSgpOwotICAgICAgICB9CisgICAgICAgIHJldHVybiBnZXRUeXBlKHJvdywgY29sKSA9PSBDdXJzb3IuRklFTERfVFlQRV9OVUxMOwogICAgIH0KICAgICAKLSAgICBwcml2YXRlIG5hdGl2ZSBib29sZWFuIGlzTnVsbF9uYXRpdmUoaW50IHJvdywgaW50IGNvbCk7Ci0gICAgCiAgICAgLyoqCiAgICAgICogUmV0dXJucyBhIGJ5dGUgYXJyYXkgZm9yIHRoZSBnaXZlbiBmaWVsZC4KICAgICAgKgpAQCAtMjQ4LDE5ICsyNDMsNDMgQEAKICAgICBwcml2YXRlIG5hdGl2ZSBieXRlW10gZ2V0QmxvYl9uYXRpdmUoaW50IHJvdywgaW50IGNvbCk7CiAKICAgICAvKioKKyAgICAgKiBSZXR1cm5zIGRhdGEgdHlwZSBvZiB0aGUgZ2l2ZW4gY29sdW1uJ3MgdmFsdWUuCisgICAgICo8cD4KKyAgICAgKiBSZXR1cm5lZCBjb2x1bW4gdHlwZXMgYXJlCisgICAgICogPHVsPgorICAgICAqICAgPGxpPntAbGluayBDdXJzb3IjRklFTERfVFlQRV9OVUxMfTwvbGk+CisgICAgICogICA8bGk+e0BsaW5rIEN1cnNv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AgICAqIEByZXR1cm4ge0Bjb2RlIHRydWV9IGlmIGdpdmVuIGZpZWxkIGlzIHtAY29kZSBOVUxMfSBvciBhIGJsb2IKKyAgICAgKiBAZGVwcmVjYXRlZCB1c2Uge0BsaW5rICNnZXRUeXBlKGludCwgaW50KX0gaW5zdGVhZAogICAgICAqLworICAgIEBEZXByZWNhdGVkCiAgICAgcHVibGljIGJvb2xlYW4gaXNCbG9iKGludCByb3csIGludCBjb2wpIHsKLSAgICAgICAgYWNxdWlyZVJlZmVyZW5jZSgpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgcmV0dXJuIGlzQmxvYl9uYXRpdmUocm93IC0gbVN0YXJ0UG9zLCBjb2wpOwotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgcmVsZWFzZVJlZmVyZW5jZSgpOwotICAgICAgICB9CisgICAgICAgIGludCB0eXBlID0gZ2V0VHlwZShyb3csIGNvbCk7CisgICAgICAgIHJldHVybiB0eXBlID09IEN1cnNvci5GSUVMRF9UWVBFX0JMT0IgfHwgdHlwZSA9PSBDdXJzb3IuRklFTERfVFlQRV9OVUxMOwogICAgIH0KIAogICAgIC8qKgpAQCAtMjY5LDE0ICsyODgsMTEgQEAKICAgICAgKiBAcGFyYW0gcm93IHRoZSByb3cgdG8gcmVhZCBmcm9tLCByb3cgLSBnZXRTdGFydFBvc2l0aW9uKCkgYmVpbmcgdGhlIGFjdHVhbCByb3cgaW4gdGhlIHdpbmRvdwogICAgICAqIEBwYXJhbSBjb2wgdGhlIGNvbHVtbiB0byByZWFkIGZyb20KICAgICAgKiBAcmV0dXJuIHtAY29kZSB0cnVlfSBpZiBnaXZlbiBmaWVsZCBpcyBhIGxvbmcKKyAgICAgKiBAZGVwcmVjYXRlZCB1c2Uge0BsaW5rICNnZXRUeXBlKGludCwgaW50KX0gaW5zdGVhZAogICAgICAqLworICAgIEBEZXByZWNhdGVkCiAgICAgcHVibGljIGJvb2xlYW4gaXNMb25nKGludCByb3csIGludCBjb2wpIHsKLSAgICAgICAgYWNxdWlyZVJlZmVyZW5jZSgpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgcmV0dXJuIGlzSW50ZWdlcl9uYXRpdmUocm93IC0gbVN0YXJ0UG9zLCBjb2wpOwotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgcmVsZWFzZVJlZmVyZW5jZSgpOwotICAgICAgICB9CisgICAgICAgIHJldHVybiBnZXRUeXBlKHJvdywgY29sKSA9PSBDdXJzb3IuRklFTERfVFlQRV9JTlRFR0VSOwogICAgIH0KIAogICAgIC8qKgpAQCAtMjg1LDE0ICszMDEsMTEgQEAKICAgICAgKiBAcGFyYW0gcm93IHRoZSByb3cgdG8gcmVhZCBmcm9tLCByb3cgLSBnZXRTdGFydFBvc2l0aW9uKCkgYmVpbmcgdGhlIGFjdHVhbCByb3cgaW4gdGhlIHdpbmRvdwogICAgICAqIEBwYXJhbSBjb2wgdGhlIGNvbHVtbiB0byByZWFkIGZyb20KICAgICAgKiBAcmV0dXJuIHtAY29kZSB0cnVlfSBpZiBnaXZlbiBmaWVsZCBpcyBhIGZsb2F0CisgICAgICogQGRlcHJlY2F0ZWQgdXNlIHtAbGluayAjZ2V0VHlwZShpbnQsIGludCl9IGluc3RlYWQKICAgICAgKi8KKyAgICBARGVwcmVjYXRlZAogICAgIHB1YmxpYyBib29sZWFuIGlzRmxvYXQoaW50IHJvdywgaW50IGNvbCkgewotICAgICAgICBhY3F1aXJlUmVmZXJlbmNlKCk7Ci0gICAgICAgIHRyeSB7Ci0gICAgICAgICAgICByZXR1cm4gaXNGbG9hdF9uYXRpdmUocm93IC0gbVN0YXJ0UG9zLCBjb2wpOwotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgcmVsZWFzZVJlZmVyZW5jZSgpOwotICAgICAgICB9CisgICAgICAgIHJldHVybiBnZXRUeXBlKHJvdywgY29sKSA9PSBDdXJzb3IuRklFTERfVFlQRV9GTE9BVDsKICAgICB9CiAKICAgICAv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yIEBACiAgICAgICovCiAgICAgcHVibGljIHZvaWQgbm90aWZ5Q2hhbmdlZCgpIHsKICAgICAgICAgc3luY2hyb25pemVkKG1PYnNlcnZlcnMpIHsKLSAgICAgICAgICAgIGZvciAoRGF0YVNldE9ic2VydmVyIG9ic2VydmVyIDogbU9ic2VydmVycykgewotICAgICAgICAgICAgICAgIG9ic2VydmVyLm9uQ2hhbmdlZCgpOworICAgICAgICAgICAgLy8gc2luY2Ugb25DaGFuZ2VkKCkgaXMgaW1wbGVtZW50ZWQgYnkgdGhlIGFwcCwgaXQgY291bGQgZG8gYW55dGhpbmcsIGluY2x1ZGluZworICAgICAgICAgICAgLy8gcmVtb3ZpbmcgaXRzZWxmIGZyb20ge0BsaW5rIG1PYnNlcnZlcnN9IC0gYW5kIHRoYXQgY291bGQgY2F1c2UgcHJvYmxlbXMgaWYKKyAgICAgICAgICAgIC8vIGFuIGl0ZXJhdG9yIGlzIHVzZWQgb24gdGhlIEFycmF5TGlzdCB7QGxpbmsgbU9ic2VydmVyc30uCisgICAgICAgICAgICAvLyB0byBhdm9pZCBzdWNoIHByb2JsZW1zLCBqdXN0IG1hcmNoIHRocnUgdGhlIGxpc3QgaW4gdGhlIHJldmVyc2Ugb3JkZXIuCisgICAgICAgICAgICBmb3IgKGludCBpID0gbU9ic2VydmVycy5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgeworICAgICAgICAgICAgICAgIG1PYnNlcnZlcnMuZ2V0KGkpLm9uQ2hhbmdlZCgpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQpAQCAtMzksOCArNDMsOCBAQAogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIG5vdGlmeUludmFsaWRhdGVkKCkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKG1PYnNlcnZlcnMpIHsKLSAgICAgICAgICAgIGZvciAoRGF0YVNldE9ic2VydmVyIG9ic2VydmVyIDogbU9ic2VydmVycykgewotICAgICAgICAgICAgICAgIG9ic2VydmVyLm9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aGljaCB3aWxsIGNhdXNlIHN1YnNlcXVlbnQgb3BlcmF0aW9ucyB0byBmYWlsLgorICAgICAgICAgICAgLy8gYmVmb3JlIHRoYXQsIGdldCB0aGUgYXR0YWNoZWQgZGF0YWJhc2UgbGlzdCBmaXJzdC4KKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgYXR0YWNoZWREYnMgPSBkYk9iai5nZXRBdHRhY2hlZERicygpOworICAgICAgICAgICAgfSBjYXRjaCAoU1FMaXRlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAvKiBpZ25vcmUgKi8KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgZGJPYmouY2xvc2UoKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKFNRTGl0ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgLyogaWdub3JlICovCisgICAgICAgICAgICB9CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAvLyBEZWxldGUgYWxsIGZpbGVzIG9mIHRoaXMgY29ycnVwdCBkYXRhYmFzZSBhbmQvb3IgYXR0YWNoZWQgZGF0YWJhc2VzCisgICAgICAgICAgICBpZiAoYXR0YWNoZWREYnMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZvciAoUGFpcjxTdHJpbmcsIFN0cmluZz4gcCA6IGF0dGFjaGVkRGJzKSB7CisgICAgICAgICAgICAgICAgICAgIGRlbGV0ZURhdGFiYXNlRmlsZShwLnNlY29uZCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBhdHRhY2hlZERicyA9IG51bGwgaXMgcG9zc2libGUgd2hlbiB0aGUgZGF0YWJhc2UgaXMgc28gY29ycnVwdCB0aGF0IGV2ZW4KKyAgICAgICAgICAgICAgICAvLyAiUFJBR01BIGRhdGFiYXNlX2xpc3Q7IiBhbHNvIGZhaWxz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AqIHNpbmdsZS1kaWdpdCB2YWx1ZXMuCisgICAgICovCisgICAgcHJpdmF0ZSBmaW5hbCBBcnJheUxpc3Q8UG9vbE9iaj4gbVBvb2wgPSBuZXcgQXJyYXlMaXN0PFBvb2xPYmo+KG1NYXhQb29sU2l6ZSk7CisKKyAgICAvKiogdGhlIG1haW4gZGF0YWJhc2UgY29ubmVjdGlvbiB0byB3aGljaCB0aGlzIGNvbm5lY3Rpb24gcG9vbCBpcyBhdHRhY2hlZCAqLworICAgIHByaXZhdGUgZmluYWwgU1FMaXRlRGF0YWJhc2UgbVBhcmVudERiT2JqOworCisgICAgLyogcGFja2FnZSAqLyBEYXRhYmFzZUNvbm5lY3Rpb25Qb29sKFNRTGl0ZURhdGFiYXNlIGRiKSB7CisgICAgICAgIHRoaXMubVBhcmVudERiT2JqID0gZGI7CisgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgIExvZy5kKFRBRywgIk1heCBQb29sIFNpemU6ICIgKyBtTWF4UG9vbFNpemUpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogY2xvc2UgYWxsIGRhdGFiYXNlIGNvbm5lY3Rpb25zIGluIHRoZSBwb29sIC0gZXZlbiBpZiB0aGV5IGFyZSBpbiB1c2UhCisgICAgICovCisgICAgLyogcGFja2FnZSAqLyB2b2lkIGNsb3NlKCkgeworICAgICAgICBzeW5jaHJvbml6ZWQobVBhcmVudERiT2JqKSB7CisgICAgICAgICAgICBmb3IgKGludCBpID0gbVBvb2wuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pIHsKKyAgICAgICAgICAgICAgICBtUG9vbC5nZXQoaSkubURiLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtUG9vbC5jbGVhcigpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogZ2V0IGEgZnJlZSBjb25uZWN0aW9uIGZyb20gdGhlIHBvb2wKKyAgICAgKgorICAgICAqIEBwYXJhbSBzcWwgaWYgbm90IG51bGwsIHRyeSB0byBmaW5kIGEgY29ubmVjdGlvbiBpbnRoZSBwb29sIHdoaWNoIGFscmVhZHkgaGFzIGNhY2hlZAorICAgICAqIHRoZSBjb21waWxlZCBzdGF0ZW1lbnQgZm9yIHRoaXMgc3FsLgorICAgICAqIEByZXR1cm4gdGhlIERhdGFiYXNlIGNvbm5lY3Rpb24gdGhhdCB0aGUgY2FsbGVyIGNhbiB1c2UKKyAgICAgKi8KKyAgICAvKiBwYWNrYWdlICovIFNRTGl0ZURhdGFiYXNlIGdldChTdHJpbmcgc3FsKSB7CisgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgIGRvQXNzZXJ0cygpOworICAgICAgICB9CisKKyAgICAgICAgU1FMaXRlRGF0YWJhc2UgZGIgPSBudWxsOworICAgICAgICBQb29sT2JqIHBvb2xPYmogPSBudWxsOworICAgICAgICBzeW5jaHJvbml6ZWQobVBhcmVudERiT2JqKSB7CisgICAgICAgICAgICBpZiAoZ2V0RnJlZVBvb2xTaXplKCkgPT0gMCkgeworICAgICAgICAgICAgICAgIGlmIChtTWF4UG9vbFNpemUgPT0gbVBvb2wuc2l6ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIG1heGVkIG91dC4gY2FuJ3Qgb3BlbiBhbnkgbW9yZSBjb25uZWN0aW9ucy4KKyAgICAgICAgICAgICAgICAgICAgLy8gbGV0IHRoZSBjYWxsZXIgd2FpdCBvbiBvbmUgb2YgdGhlIHBvb2xlZCBjb25uZWN0aW9ucworICAgICAgICAgICAgICAgICAgICBpZiAobU1heFBvb2xTaXplID09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvb2xPYmogPSBtUG9vbC5nZXQoMCk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBnZXQgYSByYW5kb20gbnVtYmVyIGJldHdlZW4gMCBhbmQgKG1NYXhQb29sU2l6ZS0xKQorICAgICAgICAgICAgICAgICAgICAgICAgcG9vbE9iaiA9IG1Qb29sLmdldCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFJhbmRvbShTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKSkubmV4dEludChtTWF4UG9vbFNpemUtMSkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGRiID0gcG9vbE9iai5tRGI7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIGEgbmV3IGNvbm5lY3Rpb24gYW5kIGFkZCBpdCB0byB0aGUgcG9vbCwgc2luY2Ugd2UgaGF2ZW4ndCByZWFjaGVkCisgICAgICAgICAgICAgICAgICAgIC8vIG1heCBwb29sIHNpemUgYWxsb3dlZAorICAgICAgICAgICAgICAgICAgICBpbnQgcG9vbFNpemUgPSBnZXRQb29sU2l6ZSgpOworICAgICAgICAgICAgICAgICAgICBkYiA9IG1QYXJlbnREYk9iai5jcmVhdGVQb29sQ29ubmVjdGlvbigoc2hvcnQpKHBvb2xTaXplICsgMSkpOworICAgICAgICAgICAgICAgICAgICBwb29sT2JqID0gbmV3IFBvb2xPYmooZGIpOworICAgICAgICAgICAgICAgICAgICBtUG9vbC5hZGQocG9vbFNpemUsIHBvb2xPYmopOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gdGhlcmUgYXJlIGZyZWUgY29ubmVjdGlvbnMgYXZhaWxhYmxlLiBwaWNrIG9uZQorICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSBtUG9vbC5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgeworICAgICAgICAgICAgICAgICAgICBwb29sT2JqID0gbVBvb2wuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICBpZiAoIXBvb2xPYmouaXNGcmVlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vIGl0IGlzIGZyZWUgLSBidXQgZG9lcyBpdHMgZGF0YWJhc2Ugb2JqZWN0IGFscmVhZHkgaGF2ZSB0aGUgZ2l2ZW4gc3FsIGluIGl0cworICAgICAgICAgICAgICAgICAgICAvLyBzdGF0ZW1lbnQtY2FjaGU/CisgICAgICAgICAgICAgICAgICAgIGRiID0gcG9vbE9iai5tRGI7CisgICAgICAgICAgICAgICAgICAgIGlmIChzcWwgPT0gbnVsbCB8fCBkYi5pc1NxbEluU3RhdGVtZW50Q2FjaGUoc3FsKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gZm91bmQgYSBmcmVlIGNvbm5lY3Rpb24gd2UgY2FuIHVzZQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLy8gaGF2ZW4ndCBmb3VuZCBhIGRhdGFiYXNlIG9iamVjdCB3aGljaCBoYXMgdGhlIGdpdmVuIHNxbCBpbiBpdHMKKyAgICAgICAgICAgICAgICAgICAgLy8gc3RhdGVtZW50LWNhY2hlCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBhc3NlcnQgcG9vbE9iaiAhPSBudWxsOworICAgICAgICAgICAgYXNzZXJ0IHBvb2xPYmoubURiID09IGRiOworCisgICAgICAgICAgICBwb29sT2JqLmFjcXVpcmUoKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgIExvZy5kKFRBRywgIkVORCBnZXQtY29ubmVjdGlvbjogIiArIHRvU3RyaW5nKCkgKyBwb29sT2JqLnRvU3RyaW5nKCkpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBkYjsKKyAgICAgICAgLy8gVE9ETyBpZiBhIHRocmVhZCBhY3F1aXJlcyBhIGNvbm5lY3Rpb24gYW5kIGRpZXMgd2l0aG91dCByZWxlYXNpbmcgdGhlIGNvbm5lY3Rpb24sIHRoZW4KKyAgICAgICAgLy8gdGhlcmUgY291bGQgYmUgYSBjb25uZWN0aW9uIGxlYWsuCisgICAgfQorCisgICAgLyoqCisgICAgICogcmVsZWFzZSB0aGUgZ2l2ZW4gZGF0YWJhc2UgY29ubmVjdGlvbiBiYWNrIHRvIHRoZSBwb29sLgorICAgICAqIEBwYXJhbSBkYiB0aGUgY29ubmVjdGlvbiB0byBiZSByZWxlYXNlZAorICAgICAqLworICAgIC8qIHBhY2thZ2UgKi8gdm9pZCByZWxlYXNlKFNRTGl0ZURhdGFiYXNlIGRiKSB7CisgICAgICAgIFBvb2xPYmogcG9vbE9iajsKKyAgICAgICAgc3luY2hyb25pemVkKG1QYXJlbnREYk9iaikgeworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLkRFQlVHKSkgeworICAgICAgICAgICAgICAgIGFzc2VydCBkYi5tQ29ubmVjdGlvbk51bSA+IDA7CisgICAgICAgICAgICAgICAgZG9Bc3NlcnRzKCk7CisgICAgICAgICAgICAgICAgYXNzZXJ0IG1Qb29sLmdldChkYi5tQ29ubmVjdGlvbk51bSAtIDEpLm1EYiA9PSBkYjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcG9vbE9iaiA9IG1Qb29sLmdldChkYi5tQ29ubmVjdGlvbk51bSAtIDEpOworCisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiQkVHSU4gcmVsZWFzZS1jb25uOiAiICsgdG9TdHJpbmcoKSArIHBvb2xPYmoudG9TdHJpbmcoKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChwb29sT2JqLmlzRnJlZSgpKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiUmVsZWFzaW5nIG9iamVjdCBhbHJlYWR5IGZyZWVkOiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRiLm1Db25uZWN0aW9uTnVtKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcG9vbE9iai5yZWxlYXNlKCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICBMb2cuZChUQUcsICJFTkQgcmVsZWFzZS1jb25uOiAiICsgdG9TdHJpbmcoKSArIHBvb2xPYmoudG9TdHJpbmcoKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIGEgbGlzdCBvZiBhbGwgZGF0YWJhc2UgY29ubmVjdGlvbnMgaW4gdGhlIHBvb2wgKGJvdGggZnJlZSBhbmQgYnVzeSBjb25uZWN0aW9ucykuCisgICAgICogVGhpcyBtZXRob2QgaXMgdXNlZCB3aGVuICJhZGIgYnVncmVwb3J0IiBpcyBkb25lLgorICAgICAqLworICAgIC8qIHBhY2thZ2UgKi8gQXJyYXlMaXN0PFNRTGl0ZURhdGFiYXNlPiBnZXRDb25uZWN0aW9uTGlzdCgpIHsKKyAgICAgICAgQXJyYXlMaXN0PFNRTGl0ZURhdGFiYXNlPiBsaXN0ID0gbmV3IEFycmF5TGlzdDxTUUxpdGVEYXRhYmFzZT4oKTsKKyAgICAgICAgc3luY2hyb25pemVkKG1QYXJlbnREYk9iaikgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IG1Qb29sLnNpemUoKSAtIDE7IGkgPj0gMDsgaS0tKSB7CisgICAgICAgICAgICAgICAgbGlzdC5hZGQobVBvb2wuZ2V0KGkpLm1EYik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGxpc3Q7CisgICAgfQorCisgICAgLyogcGFja2FnZSAqLyBpbnQgZ2V0UG9vbFNpemUoKSB7CisgICAgICAgIHN5bmNocm9uaXplZChtUGFyZW50RGJPYmopIHsKKyAgICAgICAgICAgIHJldHVybiBtUG9vbC5zaXplKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGludCBnZXRGcmVlUG9vbFNpemUoKSB7CisgICAgICAgIGludCBjb3VudCA9IDA7CisgICAgICAgIGZvciAoaW50IGkgPSBtUG9vbC5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgeworICAgICAgICAgICAgaWYgKG1Qb29sLmdldChpKS5pc0ZyZWUoKSkgeworICAgICAgICAgICAgICAgIGNvdW50Kys7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGNvdW50Kys7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgcmV0dXJuICJkYjogIiArIG1QYXJlbnREYk9iai5nZXRQYXRoKCkgKworICAgICAgICAgICAgICAgICIsIHRocmVhZGlkID0gIiArIFRocmVhZC5jdXJyZW50VGhyZWFkKCkuZ2V0SWQoKSArCisgICAgICAgICAgICAgICAgIiwgdG90YWxzaXplID0gIiArIG1Qb29sLnNpemUoKSArICIsICNmcmVlID0gIiArIGdldEZyZWVQb29sU2l6ZSgpICsKKyAgICAgICAgICAgICAgICAiLCBtYXhwb29sc2l6ZSA9ICIgKyBtTWF4UG9vbFNpemU7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGRvQXNzZXJ0cygpIHsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtUG9vbC5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgbVBvb2wuZ2V0KGkpLnZlcmlmeSgpOworICAgICAgICAgICAgYXNzZXJ0IG1Qb29sLmdldChpKS5tRGIubUNvbm5lY3Rpb25OdW0gPT0gKGkgKyAxKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIHBhY2thZ2UgKi8gdm9pZCBzZXRNYXhQb29sU2l6ZShpbnQgc2l6ZSkgeworICAgICAgICBzeW5jaHJvbml6ZWQobVBhcmVudERiT2JqKSB7CisgICAgICAgICAgICBtTWF4UG9vbFNpemUgPSBzaXplOworICAgICAgICB9CisgICAgfQorCisgICAgLyogcGFja2FnZSAqLyBpbnQgZ2V0TWF4UG9vbFNpemUoKSB7CisgICAgICAgIHN5bmNocm9uaXplZChtUGFyZW50RGJPYmopIHsKKyAgICAgICAgICAgIHJldHVybiBtTWF4UG9vbFNpemU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiByZXByZXNlbnRzIG9iamVjdHMgaW4gdGhlIGNvbm5lY3Rpb24gcG9vbC4KKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBQb29sT2JqIHsKKworICAgICAgICBwcml2YXRlIGZpbmFsIFNRTGl0ZURhdGFiYXNlIG1EYjsKKyAgICAgICAgcHJpdmF0ZSBib29sZWFuIG1GcmVlQnVzeUZsYWcgPSBGUkVFOworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBib29sZWFuIEZSRUUgPSB0cnVlOworICAgICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBib29sZWFuIEJVU1kgPSBmYWxzZTsKKworICAgICAgICAvKiogdGhlIG51bWJlciBvZiB0aHJlYWRzIGhvbGRpbmcgdGhpcyBjb25uZWN0aW9uICovCisgICAgICAgIC8vIEBHdWFyZGVkQnkoInRoaXMiKQorICAgICAgICBwcml2YXRlIGludCBtTnVtSG9sZGVycyA9IDA7CisKKyAgICAgICAgLyoqIGNvbnRhaW5zIHRoZSB0aHJlYWRJZHMgb2YgdGhlIHRocmVhZHMgaG9sZGluZyB0aGlzIGNvbm5lY3Rpb24uCisgICAgICAgICAqIHVzZWQgZm9yIGRlYnVnZ2luZyBwdXJwb3NlcyBvbmx5LgorICAgICAgICAgKi8KKyAgICAgICAgLy8gQEd1YXJkZWRCeSgidGhpcyIpCisgICAgICAgIHByaXZhdGUgSGFzaFNldDxMb25nPiBtSG9sZGVySWRzID0gbmV3IEhhc2hTZXQ8TG9uZz4oKTsKKworICAgICAgICBwdWJsaWMgUG9vbE9iaihTUUxpdGVEYXRhYmFzZSBkYikgeworICAgICAgICAgICAgbURiID0gZGI7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIGFjcXVpcmUoKSB7CisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICAgICAgYXNzZXJ0IGlzRnJlZSgpOworICAgICAgICAgICAgICAgIGxvbmcgaWQgPSBUaHJlYWQuY3VycmVudFRocmVhZCgpLmdldElkKCk7CisgICAgICAgICAgICAgICAgYXNzZXJ0ICFtSG9sZGVySWRzLmNvbnRhaW5zKGlkKTsKKyAgICAgICAgICAgICAgICBtSG9sZGVySWRzLmFkZChpZCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1OdW1Ib2xkZXJzKys7CisgICAgICAgICAgICBtRnJlZUJ1c3lGbGFnID0gQlVTWTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgcmVsZWFzZSgpIHsKKyAgICAgICAgICAgIGlmIChMb2cuaXNMb2dnYWJsZShUQUcsIExvZy5ERUJVRykpIHsKKyAgICAgICAgICAgICAgICBsb25nIGlkID0gVGhyZWFkLmN1cnJlbnRUaHJlYWQoKS5nZXRJZCgpOworICAgICAgICAgICAgICAgIGFzc2VydCBtSG9sZGVySWRzLnNpemUoKSA9PSBtTnVtSG9sZGVyczsKKyAgICAgICAgICAgICAgICBhc3NlcnQgbUhvbGRlcklkcy5jb250YWlucyhpZCk7CisgICAgICAgICAgICAgICAgbUhvbGRlcklkcy5yZW1vdmUoaWQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtTnVtSG9sZGVycy0tOworICAgICAgICAgICAgaWYgKG1OdW1Ib2xkZXJzID09IDApIHsKKyAgICAgICAgICAgICAgICBtRnJlZUJ1c3lGbGFnID0gRlJFRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgc3luY2hyb25pemVkIGJvb2xlYW4gaXNGcmVlKCkgeworICAgICAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLkRFQlVHKSkgeworICAgICAgICAgICAgICAgIHZlcmlmeSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIChtRnJlZUJ1c3lGbGFnID09IEZSRUUpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgdm9pZCB2ZXJpZnkoKSB7CisgICAgICAgICAgICBpZiAobUZyZWVCdXN5RmxhZyA9PSBGUkVFKSB7CisgICAgICAgICAgICAgICAgYXNzZXJ0IG1OdW1Ib2xkZXJzID09IDA7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGFzc2VydCBtTnVtSG9sZGVycyA+IDA7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVmZiA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgICAgICBidWZmLmFwcGVuZCgiLCBjb25uICMgIik7CisgICAgICAgICAgICBidWZmLmFwcGVuZChtRGIubUNvbm5lY3Rpb25OdW0pOworICAgICAgICAgICAgYnVmZi5hcHBlbmQoIiwgbUNvdW50SG9sZGVycyA9ICIpOworICAgICAgICAgICAgc3luY2hyb25pemVkKHRoaXMpIHsKKyAgICAgICAgICAgICAgICBidWZmLmFw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l0ZURlYnVnLkRFQlVHX0FDVElWRV9DVVJTT1JfRklOQUxJWkFUSU9OKSB7CiAgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiY2xvc2VkIGFuZCBkZWFsbG9jYXRlZCBEYk9iaiAoaWQjIiArIG5TdGF0ZW1lbnQgKyIpIik7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgbmF0aXZlX2ZpbmFsaXplKCk7Ci0gICAgICAgICAgICAgICAgblN0YXRlbWVudCA9IDA7Ci0gICAgICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgICAgIG1EYXRhYmFzZS51bmxvY2soKTsKLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1EYXRhYmFzZS5maW5hbGl6ZVN0YXRlbWVudExhdGVyKG5TdGF0ZW1lbnQpOworICAgICAgICAgICAgblN0YXRlbWVudCA9IDA7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTEzNCw2ICsxMjIsMTAgQEAKICAgICAgICAgbUluVXNlID0gZmFsc2U7CiAgICAgfQogCisgICAgLyogcGFja2FnZSAqLyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBpc0luVXNlKCkgeworICAgICAgICByZXR1cm4gbUluVXNlOworICAgIH0KKwogICAgIC8qKgogICAgICAqIE1ha2Ugc3VyZSB0aGF0IHRoZSBuYXRpdmUgcmVzb3VyY2UgaXMgY2xlYW5lZCB1cC4KICAgICAgKi8KQEAgLTE2Miw1ICsxNTQsNCBAQAogICAgICAqIEBwYXJhbSBzcWwgVGhlIFNRTCB0byBjb21waWxlLgogICAgICAqLwogICAgIHByaXZhdGUgZmluYWwgbmF0aXZlIHZvaWQgbmF0aXZlX2NvbXBpbGUoU3RyaW5nIHNxbCk7Ci0gICAgcHJpdmF0ZSBmaW5hbCBuYXRpdmUgdm9pZCBuYXRpdmVfZmluYWxpemUoKTsKIH0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ICAgLyoqCi0gICAgICogQGhpZGUKLSAgICAgKiBAZGVwcmVjYXRlZAotICAgICAqLwotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBib29sZWFuIGNvbW1pdFVwZGF0ZXMoTWFwPD8gZXh0ZW5kcyBMb25nLAotICAgICAgICAgICAgPyBleHRlbmRzIE1hcDxTdHJpbmcsIE9iamVjdD4+IGFkZGl0aW9uYWxWYWx1ZXMpIHsKLSAgICAgICAgaWYgKCFzdXBwb3J0c1VwZGF0ZXMoKSkgewotICAgICAgICAgICAgTG9nLmUoVEFHLCAiY29tbWl0VXBkYXRlcyBub3Qgc3VwcG9ydGVkIG9uIHRoaXMgY3Vyc29yLCBkaWQgeW91ICIKLSAgICAgICAgICAgICAgICAgICAgKyAiaW5jbHVkZSB0aGUgX2lkIGNvbHVtbj8iKTsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFByZXZlbnQgb3RoZXIgdGhyZWFkcyBmcm9tIGNoYW5naW5nIHRoZSB1cGRhdGVkIHJvd3Mgd2hpbGUgdGhleSdyZQotICAgICAgICAgKiBiZWluZyBwcm9jZXNzZWQgaGVyZS4KLSAgICAgICAgICovCi0gICAgICAgIHN5bmNocm9uaXplZCAobVVwZGF0ZWRSb3dzKSB7Ci0gICAgICAgICAgICBpZiAoYWRkaXRpb25hbFZhbHVlcyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbVVwZGF0ZWRSb3dzLnB1dEFsbChhZGRpdGlvbmFsVmFsdWVzKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1VcGRhdGVkUm93cy5zaXplKCkgPT0gMCkgewotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogUHJldmVudCBvdGhlciB0aHJlYWRzIGZyb20gY2hhbmdpbmcgdGhlIGRhdGFiYXNlIHN0YXRlIHdoaWxlCi0gICAgICAgICAgICAgKiB3ZSBwcm9jZXNzIHRoZSB1cGRhdGVkIHJvd3MsIGFuZCBwcmV2ZW50cyB1cyBmcm9tIGNoYW5naW5nIHRoZQotICAgICAgICAgICAgICogZGF0YWJhc2UgYmVoaW5kIHRoZSBiYWNrIG9mIGFub3RoZXIgdGhyZWFkLgotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBtRGF0YWJhc2UuYmVnaW5UcmFuc2FjdGlvbigpOwotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIHNxbCA9IG5ldyBTdHJpbmdCdWlsZGVyKDEyOCk7Ci0KLSAgICAgICAgICAgICAgICAvLyBGb3IgZWFjaCByb3cgdGhhdCBoYXMgYmVlbiB1cGRhdGVkCi0gICAgICAgICAgICAgICAgZm9yIChNYXAuRW50cnk8TG9uZywgTWFwPFN0cmluZywgT2JqZWN0Pj4gcm93RW50cnkgOgotICAgICAgICAgICAgICAgICAgICAgICAgbVVwZGF0ZWRSb3dzLmVudHJ5U2V0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgTWFwPFN0cmluZywgT2JqZWN0PiB2YWx1ZXMgPSByb3dFbnRyeS5nZXRWYWx1ZSgpOwotICAgICAgICAgICAgICAgICAgICBMb25nIHJvd0lkT2JqID0gcm93RW50cnkuZ2V0S2V5KCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHJvd0lkT2JqID09IG51bGwgfHwgdmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIm51bGwgcm93SWQgb3IgdmFsdWVzIGZvdW5kISByb3dJZCA9ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyByb3dJZE9iaiArICIsIHZhbHVlcyA9ICIgKyB2YWx1ZXMpOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlcy5zaXplKCkgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBsb25nIHJvd0lkID0gcm93SWRPYmoubG9uZ1ZhbHVlKCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgSXRlcmF0b3I8TWFwLkVudHJ5PFN0cmluZywgT2JqZWN0Pj4gdmFsdWVzSXRlciA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVzLmVudHJ5U2V0KCkuaXRlcmF0b3IoKTsKLQotICAgICAgICAgICAgICAgICAgICBzcWwuc2V0TGVuZ3RoKDApOwotICAgICAgICAgICAgICAgICAgICBzcWwuYXBwZW5kKCJVUERBVEUgIiArIG1FZGl0VGFibGUgKyAiIFNFVCAiKTsKLQotICAgICAgICAgICAgICAgICAgICAvLyBGb3IgZWFjaCBjb2x1bW4gdmFsdWUgdGhhdCBoYXMgYmVlbiB1cGRhdGVkCi0gICAgICAgICAgICAgICAgICAgIE9iamVjdFtdIGJpbmRpbmdzID0gbmV3IE9iamVjdFt2YWx1ZXMuc2l6ZSgpXTsKLSAgICAgICAgICAgICAgICAgICAgaW50IGkgPSAwOwotICAgICAgICAgICAgICAgICAgICB3aGlsZSAodmFsdWVzSXRlci5oYXNOZXh0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIE1hcC5FbnRyeTxTdHJpbmcsIE9iamVjdD4gZW50cnkgPSB2YWx1ZXNJdGVyLm5leHQoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNxbC5hcHBlbmQoZW50cnkuZ2V0S2V5KCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgc3FsLmFwcGVuZCgiPT8iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJpbmRpbmdzW2ldID0gZW50cnkuZ2V0VmFsdWUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZXNJdGVyLmhhc05leHQoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNxbC5hcHBlbmQoIiwgIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBpKys7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBzcWwuYXBwZW5kKCIgV0hFUkUgIiArIG1Db2x1bW5zW21Sb3dJZENvbHVtbkluZGV4XQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgJz0nICsgcm93SWQpOwotICAgICAgICAgICAgICAgICAgICBzcWwuYXBwZW5kKCc7Jyk7Ci0gICAgICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5leGVjU1FMKHNxbC50b1N0cmluZygpLCBiaW5kaW5ncyk7Ci0gICAgICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5yb3dVcGRhdGVkKG1FZGl0VGFibGUsIHJvd0lkKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbURhdGFiYXNlLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOwotICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICBtRGF0YWJhc2UuZW5kVHJhbnNhY3Rpb24oKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbVVwZGF0ZWRSb3dzLmNsZWFyKCk7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBMZXQgYW55IGNoYW5nZSBvYnNlcnZlcnMga25vdyBhYm91dCB0aGUgdXBkYXRlCi0gICAgICAgIG9uQ2hhbmdlKHRydWUpOwotCi0gICAgICAgIHJldHVybiB0cnVlOwotICAgIH0KLQogICAgIHByaXZhdGUgdm9pZCBkZWFjdGl2YXRlQ29tbW9uKCkgewogICAgICAgICBpZiAoQ29uZmlnLkxPR1YpIExvZy52KFRBRywgIjw8PCBSZWxlYXNpbmcgY3Vyc29yICIgKyB0aGlzKTsKICAgICAgICAgbUN1cnNvclN0YXRlID0gMDsKQEAgLTUwNiwxMSArMzU1LDMwIEBACiAgICAgICAgIG1Ecml2ZXIuY3Vyc29yQ2xvc2VkKCk7CiAgICAgfQogCisgICAgLyoqCisgICAgICogU2hvdyBhIHdhcm5pbmcgYWdhaW5zdCB0aGUgdXNlIG9mIHJlcXVlcnkoKSBpZiBjYWxsZWQgb24gdGhlIG1haW4gdGhyZWFkLgorICAgICAqIFRoaXMgd2FybmluZyBpcyBzaG93biBwZXIgZGF0YWJhc2UgcGVyIHByb2Nlc3MuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIHdhcm5JZlVpVGhyZWFkKCkgeworICAgICAgICBpZiAoTG9vcGVyLmdldE1haW5Mb29wZXIoKSA9PSBMb29wZXIubXlMb29wZXIoKSkgeworICAgICAgICAgICAgU3RyaW5nIGRhdGFiYXNlUGF0aCA9IG1EYXRhYmFzZS5nZXRQYXRoKCk7CisgICAgICAgICAgICAvLyBXZSBzaG93IHRoZSB3YXJuaW5nIG9uY2UgcGVyIGRhdGFiYXNlIGluIG9yZGVyIG5vdCB0byBzcGFtIGxvZ2NhdC4KKyAgICAgICAgICAgIGlmICghc0FscmVhZHlXYXJuZWQuY29udGFpbnNLZXkoZGF0YWJhc2VQYXRoKSkgeworICAgICAgICAgICAgICAgIHNBbHJlYWR5V2FybmVkLnB1dChkYXRhYmFzZVBhdGgsIHRydWUpOworICAgICAgICAgICAgICAgIFN0cmluZyBwYWNrYWdlTmFtZSA9IEFjdGl2aXR5VGhyZWFkLmN1cnJlbnRQYWNrYWdlTmFtZSgpOworICAgICAgICAgICAgICAgIExvZy53KFRBRywgInNob3VsZCBub3QgYXR0ZW1wdCByZXF1ZXJ5IG9uIG1haW4gKFVJKSB0aHJlYWQ6IGFwcCA9ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgcGFja2FnZU5hbWUgPT0gbnVsbCA/ICIndW5rbm93biciIDogcGFja2FnZU5hbW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IHRoaXMgaXMgY2FsbGVkLCB0aGUgY2FsbGVyIG11c3QgYmUgdHJ5aW5nIHRvIGFkZCBhIGp1c3QtY29tcGlsZWQgc3RtdAorICAgICAgICAgICAgICAgIC8vIHRvIGNhY2hlOyBpLmUuLCBjYWxsZXIgc2hvdWxkIGFscmVhZHkgaGF2ZSBhY3F1aXJlZCBkYXRhYmFzZSBsb2NrIEFORAorICAgICAgICAgICAgICAgIC8vIHRoZSBsb2NrIG9uIG1Db21waWxlZFF1ZXJpZXMuIGRvIGFzIGFzc2VydCBvZiB0aGVzZSB0d28gMiBmYWN0cy4KKyAgICAgICAgICAgICAgICB2ZXJpZnlMb2NrT3duZXIoKTsKKyAgICAgICAgICAgICAgICBpZiAodGhpcy5zaXplKCkgPD0gbU1heFNxbENhY2hlU2l6ZSkgeworICAgICAgICAgICAgICAgICAgICAvLyBjYWNoZSBpcyBub3QgZnVsbC4gbm90aGluZyBuZWVkcyB0byBiZSByZW1vdmVkCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gY2FjaGUgaXMgZnVsbC4gZWxkZXN0IHdpbGwgYmUgcmVtb3ZlZC4KKyAgICAgICAgICAgICAgICBTUUxpdGVDb21waWxlZFNxbCBlbnRyeSA9IGVsZGVzdC5nZXRWYWx1ZSgpOworICAgICAgICAgICAgICAgIGlmICghZW50cnkuaXNJblVzZSgpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMge0BsaW5rIFNRTGl0ZUNvbXBpbGVkU3FsfSBpcyBub3QgaW4gdXNlLiByZWxlYXNlIGl0LgorICAgICAgICAgICAgICAgICAgICBlbnRyeS5yZWxlYXNlU3FsU3RhdGVtZW50KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIHJldHVybiB0cnVlLCBzbyB0aGF0IHRoaXMgZW50cnkgaXMgcmVtb3ZlZCBhdXRvbWF0aWNhbGx5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RTChDT01NSVRfU1FMKTsKKyAgICAgICAgICAgICAgICAvLyBpZiB3cml0ZS1haGVhZCBsb2dnaW5nIGlzIHVzZWQsIHdlIGhhdmUgdG8gdGFrZSBjYXJlIG9mIGNoZWNrcG9pbnQuCisgICAgICAgICAgICAgICAgLy8gVE9ETzogc2hvdWxkIGFwcGxpY2F0aW9ucyBiZSBnaXZlbiB0aGUgZmxleGliaWxpdHkgb2YgY2hvb3Npbmcgd2hlbiB0bworICAgICAgICAgICAgICAgIC8vIHRyaWdnZXIgY2hlY2twb2ludD8KKyAgICAgICAgICAgICAgICAvLyBmb3Igbm93LCBkbyBjaGVja3BvaW50IGFmdGVyIGV2ZXJ5IENPTU1JVCBiZWNhdXNlIHRoYXQgaXMgdGhlIGZhc3Rlc3QKKyAgICAgICAgICAgICAgICAvLyB3YXkgdG8gZ3VhcmFudGVlIHRoYXQgcmVhZGVycyB3aWxsIHNlZSBsYXRlc3QgZGF0YS4KKyAgICAgICAgICAgICAgICAvLyBidXQgdGhpcyBpcyB0aGUgc2xvd2VzdCB3YXkgdG8gcnVuIHNxbGl0ZSB3aXRoIGluIHdyaXRlLWFoZWFkIGxvZ2dpbmcgbW9kZS4KKyAgICAgICAgICAgICAgICBpZiAodGhpcy5tQ29ubmVjdGlvblBvb2wgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBleGVjU1FMKCJQUkFHTUEgd2FsX2NoZWNrcG9pbnQ7Iik7CisgICAgICAgICAgICAgICAgICAgIGlmIChTUUxpdGVEZWJ1Zy5ERUJVR19TUUxfU1RBVEVNRU5UUykgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiUFJBR01BIHdhbF9DaGVja3BvaW50IGRvbmUiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgZXhlY1NRTCgiUk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scy5sb25nRm9yUXVlcnkodGhpcywgIlBSQUdNQSB1c2VyX3ZlcnNpb247IiwgbnVsbCkpLmludFZhbHVlKCk7CiAgICAgfQogCiAgICAgLyoqCkBAIC05NDgsMjAgKzExMDksOCBAQAogICAgICAqIEByZXR1cm4gdGhlIG5ldyBtYXhpbXVtIGRhdGFiYXNlIHNpemUKICAgICAgKi8KICAgICBwdWJsaWMgbG9uZyBnZXRNYXhpbXVtU2l6ZSgpIHsKLSAgICAgICAgU1FMaXRlU3RhdGVtZW50IHByb2cgPSBudWxsOwotICAgICAgICBsb2NrKCk7Ci0gICAgICAgIGlmICghaXNPcGVuKCkpIHsKLSAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oImRhdGFiYXNlIG5vdCBvcGVuIik7Ci0gICAgICAgIH0KLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIHByb2cgPSBuZXcgU1FMaXRlU3RhdGVtZW50KHRoaXMsCi0gICAgICAgICAgICAgICAgICAgICJQUkFHTUEgbWF4X3BhZ2VfY291bnQ7Iik7Ci0gICAgICAgICAgICBsb25nIHBhZ2VDb3VudCA9IHByb2cuc2ltcGxlUXVlcnlGb3JMb25nKCk7Ci0gICAgICAgICAgICByZXR1cm4gcGFnZUNvdW50ICogZ2V0UGFnZVNpemUoKTsKLSAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIGlmIChwcm9nICE9IG51bGwpIHByb2cuY2xvc2UoKTsKLSAgICAgICAgICAgIHVubG9jaygpOwotICAgICAgICB9CisgICAgICAgIGxvbmcgcGFnZUNvdW50ID0gRGF0YWJhc2VVdGlscy5sb25nRm9yUXVlcnkodGhpcywgIlBSQUdNQSBtYXhfcGFnZV9jb3VudDsiLCBudWxsKTsKKyAgICAgICAgcmV0dXJuIHBhZ2VDb3VudCAqIGdldFBhZ2VTaXplKCk7CiAgICAgfQogCiAgICAgLyoqCkBAIC05NzIsMjYgKzExMjEsMTUgQEAKICAgICAgKiBAcmV0dXJuIHRoZSBuZXcgbWF4aW11bSBkYXRhYmFzZSBzaXplCiAgICAgICovCiAgICAgcHVibGljIGxvbmcgc2V0TWF4aW11bVNpemUobG9uZyBudW1CeXRlcykgewotICAgICAgICBTUUxpdGVTdGF0ZW1lbnQgcHJvZyA9IG51bGw7Ci0gICAgICAgIGxvY2soKTsKLSAgICAgICAgaWYgKCFpc09wZW4oKSkgewotICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiZGF0YWJhc2Ugbm90IG9wZW4iKTsKKyAgICAgICAgbG9uZyBwYWdlU2l6ZSA9IGdldFBhZ2VTaXplKCk7CisgICAgICAgIGxvbmcgbnVtUGFnZXMgPSBudW1CeXRlcyAvIHBhZ2VTaXplOworICAgICAgICAvLyBJZiBudW1CeXRlcyBpc24ndCBhIG11bHRpcGxlIG9mIHBhZ2VTaXplLCBidW1wIHVwIGEgcGFnZQorICAgICAgICBpZiAoKG51bUJ5dGVzICUgcGFnZVNpemUpICE9IDApIHsKKyAgICAgICAgICAgIG51bVBhZ2VzKys7CiAgICAgICAgIH0KLSAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIGxvbmcgcGFnZVNpemUgPSBnZXRQYWdlU2l6ZSgpOwotICAgICAgICAgICAgbG9uZyBudW1QYWdlcyA9IG51bUJ5dGVzIC8gcGFnZVNpemU7Ci0gICAgICAgICAgICAvLyBJZiBudW1CeXRlcyBpc24ndCBhIG11bHRpcGxlIG9mIHBhZ2VTaXplLCBidW1wIHVwIGEgcGFnZQotICAgICAgICAgICAgaWYgKChudW1CeXRlcyAlIHBhZ2VTaXplKSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgbnVtUGFnZXMrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHByb2cgPSBuZXcgU1FMaXRlU3RhdGVtZW50KHRoaXMsCi0gICAgICAgICAgICAgICAgICAgICJQUkFHTUEgbWF4X3BhZ2VfY291bn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ICAgICAgICAgICByZXR1cm4gc2l6ZTsKLSAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgIGlmIChwcm9nICE9IG51bGwpIHByb2cuY2xvc2UoKTsKLSAgICAgICAgICAgIHVubG9jaygpOwotICAgICAgICB9CisgICAgICAgIHJldHVybiBEYXRhYmFzZVV0aWxzLmxvbmdGb3JRdWVyeSh0aGlzLCAiUFJBR01BIHBhZ2Vfc2l6ZTsiLCBudWxsKTsKICAgICB9CiAKICAgICAvKioKQEAgLTExMDEsNyArMTIyNiw3IEBACiAgICAgICAgIGlmIChpbmZvICE9IG51bGwpIHsKICAgICAgICAgICAgIGV4ZWNTUUwoIlVQREFURSAiICsgaW5mby5tYXN0ZXJUYWJsZQogICAgICAgICAgICAgICAgICAgICArICIgU0VUIF9zeW5jX2RpcnR5PTEgV0hFUkUgX2lkPShTRUxFQ1QgIiArIGluZm8uZm9yZWlnbktleQotICAgICAgICAgICAgICAgICAgICArICIgRlJPTSAiICsgdGFibGUgKyAiIFdIRVJFIF9pZD0iICsgcm93SWQgKyAiKSIpOworICAgICAgICAgICAgICAgICAgICArICIgRlJPTSAiICsgdGFibGUgKyAiIFdIRVJFIF9pZD0/KSIsIG5ldyBTdHJpbmdbXSB7U3RyaW5nLnZhbHVlT2Yocm93SWQpfSk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTExNDEsMTQgKzEyNjYsMTkgQEAKICAgICAgKiB7QGxpbmsgU1FMaXRlU3RhdGVtZW50fXMgYXJlIG5vdCBzeW5jaHJvbml6ZWQsIHNlZSB0aGUgZG9jdW1lbnRhdGlvbiBmb3IgbW9yZSBkZXRhaWxzLgogICAgICAqLwogICAgIHB1YmxpYyBTUUxpdGVTdGF0ZW1lbnQgY29tcGlsZVN0YXRlbWVudChTdHJpbmcgc3FsKSB0aHJvd3MgU1FMRXhjZXB0aW9uIHsKLSAgICAgICAgbG9jaygpOwotICAgICAgICBpZiAoIWlzT3BlbigpKSB7Ci0gICAgICAgICAg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KHRoaXMsIHNxbCwgZWRpdFRhYmxlKTsKKyAgICAgICAgU1FMaXRlRGF0YWJhc2UgZGIgPSBnZXREYkNvbm5lY3Rpb24oc3FsKTsKKyAgICAgICAgU1FMaXRlQ3Vyc29yRHJpdmVyIGRyaXZlciA9IG5ldyBTUUxpdGVEaXJlY3RDdXJzb3JEcml2ZXIoZGIsIHNxbCwgZWRpdFRhYmxlKTsKIAogICAgICAgICBDdXJzb3IgY3Vyc29yID0gbnVsbDsKICAgICAgICAgdHJ5IHsKQEAgLTEzNzUsNiArMTUwMiw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiPG51bGw+IikgICsgIiwgY291bnQgaXMgIiArIGNvdW50KTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CisgICAgICAgICAgICByZWxlYXNlRGJDb25uZWN0aW9uKGRiKTsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gY3Vyc29yOwogICAgIH0KQEAgLTE1MDEsMTAgKzE2MjksOCBAQAogICAgICAqLwogICAgIHB1YmxpYyBsb25nIGluc2VydFdpdGhPbkNvbmZsaWN0KFN0cmluZyB0YWJsZSwgU3RyaW5nIG51bGxDb2x1bW5IYWNrLAogICAgICAgICAgICAgQ29udGVudFZhbHVlcyBpbml0aWFsVmFsdWVzLCBpbnQgY29uZmxpY3RBbGdvcml0aG0pIHsKKyAgICAgICAgdmVyaWZ5RGJJc09wZW4oKTsKICAgICAgICAgQmxvY2tHdWFyZC5nZXRUaHJlYWRQb2xpY3koKS5vbldyaXRlVG9EaXNrKCk7Ci0gICAgICAgIGlmICghaXNPcGVuKCkpIHsKLSAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oImRhdGFiYXNlIG5vdCBvcGVuIik7Ci0gICAgICAgIH0KIAogICAgICAgICAvLyBNZWFzdXJlbWVudHMgc2hvdyBtb3N0IHNxbCBsZW5ndGhzIDw9IDE1MgogICAgICAgICBTdHJ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AgICAqIDxwPgorICAgICAqIEZvciBVUERBVEUgc3RhdGVtZW50cywgdXNlIGFueSBvZiB0aGUgZm9sbG93aW5nIGluc3RlYWQuCisgICAgICogPHVsPgorICAgICAqICAgPGxpPntAbGluayAjdXBkYXRlKFN0cmluZywgQ29udGVudFZhbHVlcywgU3RyaW5nLCBTdHJpbmdbXSl9PC9saT4KKyAgICAgKiAgIDxsaT57QGxpbmsgI3VwZGF0ZVdpdGhPbkNvbmZsaWN0KFN0cmluZywgQ29udGVudFZhbHVlcywgU3RyaW5nLCBTdHJpbmdbXSwgaW50KX08L2xpPgorICAgICAqIDwvdWw+CisgICAgICogPHA+CisgICAgICogRm9yIERFTEVURSBzdGF0ZW1lbnRzLCB1c2UgYW55IG9mIHRoZSBmb2xsb3dpbmcgaW5zdGVhZC4KKyAgICAgKiA8dWw+CisgICAgICogICA8bGk+e0BsaW5rICNkZWxldGUoU3RyaW5nLCBTdHJpbmcsIFN0cmluZ1tdKX08L2xpPgorICAgICAqIDwvdWw+CisgICAgICogPHA+CisgICAgICogRm9yIGV4YW1wbGUsIHRoZSBmb2xsb3dpbmcgYXJlIGdvb2QgY2FuZGlkYXRlcyBmb3IgdXNpbmcgdGhpcyBtZXRob2Q6CisgICAgICogPHVsPgorICAgICAqICAgPGxpPkFMVEVSIFRBQkxFPC9saT4KKyAgICAgKiAgIDxsaT5DUkVBVEUgb3IgRFJPUCB0YWJsZSAvIHRyaWdnZXIgLyB2aWV3IC8gaW5kZXggLyB2aXJ0dWFsIHRhYmxlPC9saT4KKyAgICAgKiAgIDxsaT5SRUlOREVYPC9saT4KKyAgICAgKiAgIDxsaT5SRUxFQVNFPC9saT4KKyAgICAgKiAgIDxsaT5TQVZFUE9JTlQ8L2xpPgorICAgICAqICAgPGxpPlBSQUdNQSB0aGF0IHJldHVybnMgbm8gZGF0YTwvbGk+CisgICAgICogPC91bD4KKyAgICAgKiA8L3A+CiAgICAgICoKLSAgICAgKiBAcGFyYW0gc3FsCisgICAgICogQH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GVuKCk7CisgICAgICAgIGlmIChtTG9ja2luZ0VuYWJsZWQgJiYgIWlzRGJMb2NrZWRCeUN1cnJlbnRUaHJlYWQoKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiRG9uJ3QgaGF2ZSBkYXRhYmFzZSBsb2NrISIpOworICAgICAgICB9CisgICAgfQorCiAgICAgLyoKICAgICAgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAgICoKQEAgLTE5NzcsMjIgKzIxNDEsMTQgQEAKICAgICAgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAgICovCiAgICAgLyoqCi0gICAgICogYWRkcyB0aGUgZ2l2ZW4gc3FsIGFuZCBpdHMgY29tcGlsZWQtc3RhdGVtZW50LWlkLXJldHVybmVkLWJ5LXNxbGl0ZSB0byB0aGUKKyAgICAgKiBBZGRzIHRoZSBnaXZlbiBTUUwgYW5kIGl0cyBjb21waWxlZC1zdGF0ZW1lbnQtaWQtcmV0dXJuZWQtYnktc3FsaXRlIHRvIHRoZQogICAgICAqIGNhY2hlIG9mIGNvbXBpbGVkUXVlcmllcyBhdHRhY2hlZCB0byAndGhpcycuCi0gICAgICoKLSAgICAgKiBpZiB0aGVyZSBpcyBhbHJlYWR5IGEge0BsaW5rIFNRTGl0ZUNvbXBpbGVkU3FsfSBpbiBjb21waWxlZFF1ZXJpZXMgZm9yIHRoZSBnaXZlbiBzcWwsCisgICAgICogPHA+CisgICAgICogSWYgdGhlcmUgaXMgYWxyZWFkeSBhIHtAbGluayBTUUxpdGVDb21waWxlZFNxbH0gaW4gY29tcGlsZWRRdWVyaWVzIGZvciB0aGUgZ2l2ZW4gU1FMLAogICAgICAqIHRoZSBuZXcge0BsaW5rIFNRTGl0ZUNvbXBpbGVkU3FsfSBvYmplY3QgaXMgTk9UIGluc2VydGVkIGludG8gdGhlIGNhY2hlIChpLmUuLHRoZSBjdXJyZW50CiAgICAgICogbWFwcGluZyBpcyBOT1QgcmVwbGFjZWQgd2l0aCB0aGUgbmV3IG1hcHBpbmcpLgogICAgICAqLwogICAgIC8qIHBhY2thZ2UgKi8gdm9pZCBhZGRUb0NvbXBpbGVkUXVlcmllcyhTdHJpbmcgc3FsLCBTUUxpdGVDb21waWxlZFNxbCBjb21waWxlZFN0YXRlbWVudCkgewotICAgICAgICBpZiAobU1heFNxbENhY2hlU2l6ZSA9PSAwKSB7Ci0gICAgICAgICAgICAvLyBmb3IgdGhpcyBkYXRhYmFzZSwgdGhlcmUgaXMgbm8gY2FjaGUgb2YgY29tcGlsZWQgc3FsLgotICAgICAgICAgICAgaWYgKFNRTGl0ZURlYnVnLkRFQlVHX1NRTF9DQUNIRSkgewotICAgICAgICAgICAgICAgIExvZy52KFRBRywgInxOT1QgYWRkaW5nX3NxbF90b19jYWNoZXwiICsgZ2V0UGF0aCgpICsgInwiICsgc3FsKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotCiAgICAgICAgIFNRTGl0ZUNvbXBpbGVkU3FsIGNvbXBpbGVkU3FsID0gbnVsbDsKICAgICAgICAgc3luY2hyb25pemVkKG1Db21waWxlZFF1ZXJpZXMpIHsKICAgICAgICAgICAgIC8vIGRvbid0IGluc2VydCB0aGUgbmV3IG1hcHBpbmcgaWYgYSBtYXBwaW5nIGFscmVhZHkgZXhpc3RzCkBAIC0yMDAwLDM1ICsyMTU2LDMwIEBACiAgICAgICAgICAgICBpZiAoY29tcGlsZWRTcWwgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIGFkZCB0aGlzIDxzcWwsIGNvbXBpbGVkU3RhdGVtZW50PiB0byB0aGUgY2FjaGUKKwogICAgICAgICAgICAgaWYgKG1Db21waWxlZFF1ZXJpZXMuc2l6ZSgpID09IG1NYXhTcWxDYWNoZVNpemUpIHsKICAgICAgICAgICAgICAgICAvKgogICAgICAgICAgICAgICAgICAqIGNhY2hlIHNpemUgb2Yge0BsaW5rICNtTWF4U3FsQ2FjaGVTaXplfSBpcyBub3QgZW5vdWdoIGZvciB0aGlzIGFwcC4KLSAgICAgICAgICAgICAgICAgKiBsb2cgYSB3YXJuaW5nIE1BWF9XQVJOSU5HU19PTl9DQUNIRVNJWkVfQ09ORElUSU9OIHRpbWVzCi0gICAgICAgICAgICAgICAgICogY2hhbmNlcyBhcmUgaXQgaXMgTk9UIHVzaW5nID8gZm9yIGJpbmRhcmdzIC0gc28gY2FjaGluZyBpcyB1c2VsZXNzLgotICAgICAgICAgICAgICAgICAqIFRPRE86IGVpdGhlciBsZXQgdGhlIGNhbGxlcnMgc2V0IG1heCBjY2hlc2l6ZSBmb3IgdGhlaXIgYXBwLCBvciBpbnRlbGxpZ2VudGx5Ci0gICAgICAgICAgICAgICAgICogZmlndXJlIG91dCB3aGF0IHNob3VsZCBiZSBjYWNoZWQgZm9yIGEgZ2l2ZW4gYXBwLgorICAgICAgICAgICAgICAgICAqIGxvZyBhIHdhcm5pbmcuCisgICAgICAgICAgICAgICAgICogY2hhbmNlcyBhcmUgaXQgaXMgTk9UIHVzaW5nID8gZm9yIGJpbmRhcmdzIC0gb3IgY2FjaGVzaXplIGlzIHRvbyBzbWFsbC4KICAgICAgICAgICAgICAgICAgKi8KICAgICAgICAgICAgICAgICBpZiAoKyttQ2FjaGVGdWxsV2FybmluZ3MgPT0gTUFYX1dBUk5JTkdTX09OX0NBQ0hFU0laRV9DT05ESVRJT04pIHsKICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiUmVhY2hlZCBNQVggc2l6ZSBmb3IgY29tcGlsZWQtc3FsIHN0YXRlbWVudCBjYWNoZSBmb3IgZGF0YWJhc2UgIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0UGF0aCgpICsgIjsgaS5lLiwgTk8gc3BhY2UgZm9yIHRoaXMgc3FsIHN0YXRlbWVudCBpbiBjYWNoZTogIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3FsICsgIi4gUGxlYXNlIGNoYW5nZSB5b3VyIHNxbCBzdGF0ZW1lbnRzIHRvIHVzZSAnPycgZm9yICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJiaW5kYXJncywgaW5zdGVhZCBvZiB1c2luZyBhY3R1YWwgdmFsdWVzIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0UGF0aCgpICsgIi4gQ29uc2lkZXIgaW5jcmVhc2luZyBjYWNoZXNpemUuIik7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIGRvbid0IGFkZCB0aGlzIGVudHJ5IHRvIGNhY2hlCi0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIC8vIGNhY2hlIGlzIE5PVCBmdWxsLiBhZGQgdGhpcyB0byBjYWNoZS4KLSAgICAgICAgICAgICAgICBtQ29tcGlsZWRRdWVyaWVzLnB1dChzcWwsIGNvbXBpbGVkU3RhdGVtZW50KTsKLSAgICAgICAgICAgICAgICBpZiAoU1FMaXRlRGVidWcuREVCVUdfU1FMX0NBQ0hFKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgInxhZGRpbmdfc3FsX3RvX2NhY2hlfCIgKyBnZXRQYXRoKCkgKyAifCIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db21waWxlZFF1ZXJpZXMuc2l6ZSgpICsgInwiICsgc3FsKTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IAorICAgICAgICAgICAgLyogYWRkIHRoZSBnaXZlbiBTUUxpdGVDb21waWxlZFNxbCBjb21waWxlZFN0YXRlbWVudCB0byBjYWNoZS4KKyAgICAgICAgICAgICAqIG5vIG5lZWQgdG8gd29ycnkgYWJvdXQgdGhlIGNhY2hlIHNpemUgLSBiZWNhdXNlIHtAbGluayAjbUNvbXBpbGVkUXVlcmllc30KKyAgICAgICAgICAgICAqIHNlbGYtbGltaXRzIGl0cyBzaXplIHRvIHtAbGluayAjbU1heFNxbENhY2hlU2l6ZX0uCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIG1Db21waWxlZFF1ZXJpZXMucHV0KHNxbCwgY29tcGlsZWRTdGF0ZW1lbnQpOworICAgICAgICAgICAgaWYgKFNRTGl0ZURlYnVnLkRFQlVHX1NRTF9DQUNIRSkgeworICAgICAgICAgICAgICAgIExvZy52KFRBRywgInxhZGRpbmdfc3FsX3RvX2NhY2hlfCIgKyBnZXRQYXRoKCkgKyAifCIgKworICAgICAgICAgICAgICAgICAgICAgICAgbUNvbXBpbGVkUXVlcmllcy5zaXplKCkgKyAifCIgKyBzcWwpOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIHJldHVybjsKICAgICB9CiAKLQogICAgIHByaXZhdGUgdm9pZCBkZWFsbG9jQ2FjaGVkU3FsU3RhdGVtZW50cygpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtQ29tcGlsZWRRdWVyaWVzKSB7CiAgICAgICAgICAgICBmb3IgKFNRTGl0ZUNvbXBpbGVkU3FsIGNvbXBpbGVkU3FsIDogbUNvbXBpbGVkUXVlcmllcy52YWx1ZXMoKSkgewpAQCAtMjAzOSwyMCArMjE5MCwxMyBAQAogICAgIH0KIAogICAgIC8qKgotICAgICAqIGZyb20gdGhlIGNvbXBpbGVkUXVlcmllcyBjYWNoZSwgcmV0dXJucyB0aGUgY29tcGlsZWQtc3RhdGVtZW50LWlkIGZvciB0aGUgZ2l2ZW4gc3FsLgotICAgICAqIHJldHVybnMgbnVsbCwgaWYgbm90IGZvdW5kIGluIHRoZSBjYWNoZS4KKyAgICAgKiBGcm9tIHRoZSBjb21waWxlZFF1ZXJpZXMgY2FjaGUsIHJldHVybnMgdGhl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gpICsKICAgICAgICAgICAgICAgICAgICAgInwiICsgbU51bUNhY2hlSGl0cyArICJ8IiArIG1OdW1DYWNoZU1pc3NlcyArCi0gICAgICAgICAgICAgICAgICAgICJ8IiArIGNhY2hlSGl0ICsgInwiICsgbVRpbWVPcGVuZWQgKyAifCIgKyBtVGltZUNsb3NlZCArICJ8IiArIHNxbCk7CisgICAgICAgICAgICAgICAgICAgICJ8IiArIGNhY2hlSGl0ICsgInwiICsgc3FsKTsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gY29tcGlsZWRTdGF0ZW1lbnQ7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogcmV0dXJucyB0cnVlIGlmIHRoZSBnaXZlbiBzcWwgaXMgY2FjaGVkIGluIGNvbXBpbGVkLXNxbCBjYWNoZS4KLSAgICAgKiBAaGlkZQotICAgICAqLwotICAgIHB1YmxpYyBib29sZWFuIGlzSW5Db21waWxlZFNxbENhY2hlKFN0cmluZyBzcWwpIHsKLSAgICAgICAgc3luY2hyb25pemVkKG1Db21waWxlZFF1ZXJpZXMpIHsKLSAgICAgICAgICAgIHJldHVybiBtQ29tcGlsZWRRdWVyaWVzLmNvbnRhaW5zS2V5KHNxbCk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBwdXJnZXMgdGhlIGdpdmVuIHNxbCBmcm9tIHRoZSBjb21waWxlZC1zcWwgY2FjaGUuCi0gICAgICogQGhpZGUKLSAgICAgKi8KLSAgICBwdWJsaWMgdm9pZCBwdXJnZUZyb21Db21waWxlZFNxbENhY2hlKFN0cmluZyBzcWwpIHsKLSAgICAgICAgc3luY2hyb25pemVkKG1Db21waWxlZFF1ZXJpZXMpIHsKLSAgICAgICAgICAgIG1Db21waWxlZFF1ZXJpZXMucmVtb3ZlKHNxbCk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiByZW1vdmUgZXZlcnl0aGluZyBmcm9tIHRoZSBjb21waWxlZCBzcWw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IgZmluYWxpemF0aW9uLgorICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1DbG9zZWRTdGF0ZW1lbnRJZHMuYWRkKGlkKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIHB1YmxpYyB2aXNpYmlsaXR5IG9ubHkgZm9yIHRlc3RpbmcuIG90aGVyd2lzZSwgcGFja2FnZSB2aXNpYmlsaXR5IGlzIHN1ZmZpY2llbnQKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGNsb3NlUGVuZGluZ1N0YXRlbWVudHMoKSB7CisgICAgICAgIGlmICghaXNPcGVuKCkpIHsKKyAgICAgICAgICAgIC8vIHNpbmNlIHRoaXMgZGF0YWJhc2UgaXMgYWxyZWFkeSBjbG9zZWQsIG5vIG5lZWQgdG8gZmluYWxpemUgYW55dGhpbmcuCisgICAgICAgICAgICBtQ2xvc2VkU3RhdGVtZW50SWRzLmNsZWFyKCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgdmVyaWZ5TG9ja093bmVyKCk7CisgICAgICAgIC8qIHRvIG1pbmltaXplIHN5bmNocm9uaXphdGlvbiBvbiBtQ2xvc2VkU3RhdGVtZW50SWRzLCBtYWtlIGEgY29weSBvZiB0aGUgbGlzdCAqLworICAgICAgICBBcnJheUxpc3Q8SW50ZWdlcj4gbGlzdCA9IG5ldyBBcnJheUxpc3Q8SW50ZWdlcj4obUNsb3NlZFN0YXRlbWVudElkcy5zaXplKCkpOworICAgICAgICBzeW5jaHJvbml6ZWQobUNsb3NlZFN0YXRlbWVudElkcykgeworICAgICAgICAgICAgbGlzdC5hZGRBbGwobUNsb3NlZFN0YXRlbWVudElkcyk7CisgICAgICAgICAgICBtQ2xvc2VkU3RhdGVtZW50SWRzLmNsZWFyKCk7CisgICAgICAgIH0KKyAgICAgICAgLy8gZmluYWxpemUgYWxsIHRoZSBzdGF0Z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byBiZSBpbiByZWFkYWJsZSBieSB0aHJlYWRzIGV4ZWN1dGluZyBxdWVyaWVzLgorICAgICAqIDwvcD4KKyAgICAgKgorICAgICAqIEByZXR1cm4gdHJ1ZSBpZiB3cml0ZS1haGVhZC1sb2dnaW5nIGlzIHNldC4gZmFsc2Ugb3RoZXJ3aXNlCisgICAgICovCisgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGVuYWJsZVdyaXRlQWhlYWRMb2dnaW5nKCkgeworICAgICAgICBpZiAobVBhdGguZXF1YWxzSWdub3JlQ2FzZShNRU1PUllfREJfUEFUSCkpIHsKKyAgICAgICAgICAgIExvZy5pKFRBRywgImNhbid0IGVuYWJsZSBXQUwgZm9yIG1lbW9yeSBkYXRhYmFzZXMuIik7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICAvLyBtYWtlIHN1cmUgdGhpcyBkYXRhYmFzZSBoYXMgTk8gYXR0YWNoZWQgZGF0YWJhc2VzIGJlY2F1c2Ugc3FsaXRlJ3Mgd3JpdGUtYWhlYWQtbG9nZ2luZworICAgICAgICAvLyBkb2Vzbid0IHdvcmsgZm9yIGRhdGFiYXNlcyB3aXRoIGF0dGFjaGVkIGRhdGFiYXNlcworICAgICAgICBpZiAoZ2V0QXR0YWNoZWREYnMoKS5zaXplKCkgPiAxKSB7CisgICAgICAgICAgICBMb2cuaShUQUcsICJ0aGlzIGRhdGFiYXNlOiAiICsgbVBhdGggKyAiIGhhcyBhdHRhY2hlZCBkYXRhYmFzZXMuIGNhbid0ICBlbmFibGUgV0FMLiIpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIGlmIChtQ29ubmVjdGlvblBvb2wgPT0gbnVsbCkgeworICAgICAgICAgICAgbUNvbm5lY3Rpb25Qb29sID0gbmV3IERhdGFiYXNlQ29ubmVjdGlvblBvb2wodGhpcyk7CisgICAgICAgICAgICBzZXRKb3VybmFsTW9kZSht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Y2hyb25pemVkIHZvaWQgc2V0Q29ubmVjdGlvblBvb2xTaXplKGludCBzaXplKSB7CisgICAgICAgIGlmIChtQ29ubmVjdGlvblBvb2wgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxTdGF0ZUV4Y2VwdGlvbigiY29ubmVjdGlvbiBwb29sIG5vdCBlbmFibGVkIik7CisgICAgICAgIH0KKyAgICAgICAgaW50IGkgPSBtQ29ubmVjdGlvblBvb2wuZ2V0TWF4UG9vbFNpemUoKTsKKyAgICAgICAgaWYgKHNpemUgPCBpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAiY2Fubm90IHNldCBtYXggcG9vbCBzaXplIHRvIGEgdmFsdWUgbGVzcyB0aGFuIHRoZSBjdXJyZW50IG1heCB2YWx1ZSg9IiArCisgICAgICAgICAgICAgICAgICAgIGkgKyAiKSIpOworICAgICAgICB9CisgICAgICAgIG1Db25uZWN0aW9uUG9vbC5zZXRNYXhQb29sU2l6ZShzaXplKTsKKyAgICB9CisKKyAgICAvKiBwYWNrYWdlICovIFNRTGl0ZURhdGFiYXNlIGNyZWF0ZVBvb2xDb25uZWN0aW9uKHNob3J0IGNvbm5lY3Rpb25OdW0pIHsKKyAgICAgICAgcmV0dXJuIG9wZW5EYXRhYmFzZShtUGF0aCwgbUZhY3RvcnksIG1GbGFncywgbUVycm9ySGFuZGxlciwgY29ubmVjdGlvbk51bSk7CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGlzUG9vbGVkQ29ubmVjdGlvbigpIHsKKyAgICAgICAgcmV0dXJuIHRoaXMubUNvbm5lY3Rpb25OdW0gPiAwOworICAgIH0KKworICAgIHByaXZhdGUgU1FMaXRlRGF0YWJhc2UgZ2V0RGJDb25uZWN0aW9uKFN0cmluZyBzcWwpIHsKKyAgICAgICAgdmVyaWZ5RGJJc09wZW4oKTsKKworICAgICAgICAvLyB1c2UgdGhlIGN1cnJlbnQgY29ubmVjdGlvbiBoYW5kbGUgaWYKKyAgICAgICAgLy8gMS4gdGhpcyBpcyBhIHBvb2xlZCBjb25uZWN0aW9uIGhhbmRsZQorICAgICAgICAvLyAyLiBPUiwgaWYgdGhpcyB0aHJlYWQgaXMgaW4gYSB0cmFuc2FjdGlvbgorICAgICAgICAvLyAzLiBPUiwgaWYgdGhlcmUgaXMgTk8gY29ubmVjdGlvbiBoYW5kbGUgcG9vbCBzZXR1cAorICAgICAgICBTUUxpdGVEYXRhYmFzZSBkYiA9IG51bGw7CisgICAgICAgIGlmIChpc1Bvb2xlZENvbm5lY3Rpb24oKSB8fAorICAgICAgICAgICAgICAgIChpblRyYW5zYWN0aW9uKCkgJiYgbUxvY2suaXNIZWxkQnlDdXJyZW50VGhyZWFkKCkpIHx8CisgICAgICAgICAgICAgICAgKHRoaXMubUNvbm5lY3Rpb25Qb29sID09IG51bGwpKSB7CisgICAgICAgICAgICBkYiA9IHRoaXM7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBnZXQgYSBjb25uZWN0aW9uIGhhbmRsZSBmcm9tIHRoZSBwb29sCisgICAgICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICAgICAgYXNzZXJ0IG1Db25uZWN0aW9uUG9vbCAhPSBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZGIgPSBtQ29ubmVjdGlvblBvb2wuZ2V0KHNxbCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKExvZy5pc0xvZ2dhYmxlKFRBRywgTG9nLkRFQlVHKSkgeworICAgICAgICAgICAgTG9nLmQoVEFHLCAiZ2V0RGJDb25uZWN0aW9uIHRocmVhZGlkID0gIiArIFRocmVhZC5jdXJyZW50VGhyZWFkKCkuZ2V0SWQoKSArCisgICAgICAgICAgICAgICAgICAgICIsIHJlcXVlc3Qgb24gIyAiICsgbUNvbm5lY3Rpb25OdW0gKworICAgICAgICAgICAgICAgICAgICAiLCBhc3NpZ25lZCAjICIgKyBkYi5tQ29ubmVjdGlvbk51bSArICIsICIgKyBnZXRQYXRoKCkpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBkYjsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcmVsZWFzZURiQ29ubmVjdGlvbihTUUxpdGVEYXRhYmFzZSBkYikgeworICAgICAgICAvLyBpZ25vcmUgdGhpcyByZWxlYXNlIGNhbGwgaWYKKyAgICAgICAgLy8gMS4gdGhlIGRhdGFiYXNlIGlzIGNsb3NlZAorICAgICAgICAvLyAyLiBPUiwgaWYgZGIgaXMgTk9UIGEgcG9vbGVkIGNvbm5lY3Rpb24gaGFuZGxlCisgICAgICAgIC8vIDMuIE9SLCBpZiB0aGUgZGF0YWJhc2UgYmVpbmcgcmVsZWFzZWQgaXMgc2FtZSBhcyAndGhpcycgKHRoaXMgY29uZGl0aW9uIG1lYW5zCisgICAgICAgIC8vICAgICB0aGF0IHdlIHNob3VsZCBhbHdheXMgYmUgcmVsZWFzaW5nIGEgcG9vbGVkIGNvbm5lY3Rpb24gaGFuZGxlIGJ5IGNhbGxpbmcgdGhpcyBtZXRob2QKKyAgICAgICAgLy8gICAgIGZyb20gdGhlICdtYWluJyBjb25uZWN0aW9uIGhhbmRsZQorICAgICAgICBpZiAoIWlzT3BlbigpIHx8ICFkYi5pc1Bvb2xlZENvbm5lY3Rpb24oKSB8fCAoZGIgPT0gdGhpcykpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBpZiAoTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuREVCVUcpKSB7CisgICAgICAgICAgICBhc3NlcnQgaXNQb29sZWRDb25uZWN0aW9uKCk7CisgICAgICAgICAgICBhc3NlcnQgbUNvbm5lY3Rpb25Qb29sICE9IG51bGw7CisgICAgICAgICAgICBMb2cuZChUQUcsICJyZWxlYXNlRGJ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XJyYXlMaXN0PFBhaXI8U3RyaW5nLCBTdHJpbmc+PiBhdHRhY2hlZERicyA9IGdldEF0dGFjaGVkRGJzKGRiKTsKLSAgICAgICAgICAgIGlmIChhdHRhY2hlZERicyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGF0dGFjaGVkRGJzLnNpemUoKTsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgUGFpcjxTdHJpbmcsIFN0cmluZz4gcCA9IGF0dGFjaGVkRGJzLmdldChpKTsKLSAgICAgICAgICAgICAgICBsb25nIHBhZ2VDb3VudCA9IGdldFByYWdtYVZhbChkYiwgcC5maXJzdCArICIucGFnZV9jb3VudDsiKTsKKyAgICAgICAgICAgICAgICAvLyBnZXQgdGhlIGxhc3Rub2RlIG9mIHRoZSBkYm5hbWUKKyAgICAgICAgICAgICAgICBTdHJpbmcgcGF0aCA9IGRiLmdldFBhdGgoKTsKKyAgICAgICAgICAgICAgICBpbnQgaW5keCA9IHBhdGgubGFzdEluZGV4T2YoIi8iKTsKKyAgICAgICAgICAgICAgICBTdHJpbmcgbGFzdG5vZGUgPSBwYXRoLnN1YnN0cmluZygoaW5keCAhPSAtMSkgPyArK2luZHggOiAwKTsKIAotICAgICAgICAgICAgICAgIC8vIGZpcnN0IGVudHJ5IGluIHRoZSBhdHRhY2hlZCBkYiBsaXN0IGlzIGFsd2F5cyB0aGUgbWFpbiBkYXRhYmFzZQotICAgICAgICAgICAgICAgIC8vIGRvbid0IHdvcnJ5IGFib3V0IHByZWZpeGluZyB0aGUgZGJuYW1lIHdpdGggIm1haW4iCi0gICAgICAgICAgICAgICAgU3RyaW5nIGRiTmFtZTsKLSAgICAgICAgICAgICAgICBpZiAoaSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRiTmFtZSA9IGxhc3Rub2RlOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIGxvb2thc2lkZSBpcyBvbmx5IHJlbGV2YW50IGZvciB0aGUgbWFpbiBkYgotICAgICAgICAgICAgICAgICAgICBsb29rYXNpZGVVc2VkID0gMDsKLSAgICAgICAgICAgICAgICAgICAgZGJOYW1lID0gIiAgKGF0dGFjaGVkKSAiICsgcC5maXJzdDsKLSAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlIGF0dGFjaGVkIGRiIGhhcyBhIHBhdGgsIGF0dGFjaCB0aGUgbGFzdG5vZGUgZnJvbSB0aGUgcGF0aCB0byBhYm92ZQotICAgICAgICAgICAgICAgICAgICBpZiAocC5zZWNvbmQudHJpbSgpLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50IGlkeCA9IHAuc2Vjb25kLmxhc3RJbmRleE9mKCIvIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkYk5hbWUgKz0gIiA6ICIgKyBwLnNlY29uZC5zdWJzdHJpbmcoKGlkeCAhPSAtMSkgPyArK2lkeCA6IDApOworICAgICAgICAgICAgICAgIC8vIGdldCBsaXN0IG9mIGF0dGFjaGVkIGRicyBhbmQgZm9yIGVhY2ggZGIsIGdldCBpdHMgc2l6ZSBhbmQgcGFnZXNpemUKKyAgICAgICAgICAgICAgICBBcnJheUxpc3Q8UGFpcjxTdHJpbmcsIFN0cmluZz4+IGF0dGFjaGVkRGJzID0gZGIuZ2V0QXR0YWNoZWREYnMoKTsKKyAgICAgICAgICAgICAgICBpZiAoYXR0YWNoZWREYnMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBhdHRhY2hlZERicy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBQYWlyPFN0cmluZywgU3RyaW5nPiBwID0gYXR0YWNoZWREYnMuZ2V0KGkpOworICAgICAgICAgICAgICAgICAgICBsb25nIHBhZ2VDb3VudCA9IERhdGFiYXNlVXRpbHMubG9uZ0ZvclF1ZXJ5KGRiLCAiUFJBR01BICIgKyBwLmZpcnN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLnBhZ2VfY291bnQ7IiwgbnVsbCk7CisKKyAgICAgICAgICAgICAgICAgICAgLy8gZmlyc3QgZW50cnkgaW4gdGhlIGF0dGFjaGVkIGRiIGxpc3QgaXMgYWx3YXlzIHRoZSBtYWluIGRhdGFiYXNlCisgICAgICAgICAgICAgICAgICAgIC8vIGRvbid0IHdvcnJ5IGFib3V0IHByZWZpeGluZyB0aGUgZGJuYW1lIHdpdGggIm1haW4iCisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBkYk5hbWU7CisgICAgICAgICAgICAgICAgICAgIGlmIChpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRiTmFtZSA9IGxhc3Rub2RlOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gbG9va2FzaWRlIGlzIG9ubHkgcmVsZXZhbnQgZm9yIHRoZSBtYWluIGRiCisgICAgICAgICAgICAgICAgICAgICAgICBsb29rYXNpZGVVc2VkID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRiTmFtZSA9ICIgIChhdHRhY2hlZCkgIiArIHAuZmlyc3Q7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGUgYXR0YWNoZWQgZGIgaGFzIGEgcGF0aCwgYXR0YWNoIHRoZSBsYXN0bm9kZSBmcm9tIHRoZSBwYXRoIHRvIGFib3ZlCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocC5zZWNvbmQudHJpbSgpLmxlbmd0aCgpID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpZHggPSBwLnNlY29uZC5sYXN0SW5kZXhPZigiLyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRiTmFtZSArPSAiIDogIiArIHAuc2Vjb25kLnN1YnN0cmluZygoaWR4ICE9IC0xKSA/ICsraWR4IDogMCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHBhZ2VDb3VudCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRiU3RhdHNMaXN0LmFkZChuZXcgRGJTdGF0cyhkYk5hbWUsIHBhZ2VDb3VudCwgZGIuZ2V0UGFnZVNpemUoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9va2FzaWRlVXNlZCwgZGIubU51bUNhY2hlSGl0cywgZGIubU51bUNhY2hlTWlzc2VzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYi5tQ29tcGlsZWRRdWVyaWVzLnNpemUoKSkpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChwYWdlQ291bnQgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRiU3RhdHNMaXN0LmFkZChuZXcgRGJTdGF0cyhkYk5hbWUsIHBhZ2VDb3VudCwgZGIuZ2V0UGFnZVNpemUoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb29rYXNpZGVVc2VkKSk7CisgICAgICAgICAgICAgICAgLy8gaWYgdGhlcmUgYXJlIHBvb2xlZCBjb25uZWN0aW9ucywgcmV0dXJuIHRoZSBjYWNoZSBzdGF0cyBmb3IgdGhlbSBhbHNvLgorICAgICAgICAgICAgICAgIGlmIChkYi5tQ29ubmVjdGlvblBvb2wgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmb3IgKFNRTGl0ZURhdGFiYXNlIHBEYiA6IGRiLm1Db25uZWN0aW9uUG9vbC5nZXRDb25uZWN0aW9uTGlzdCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkYlN0YXRzTGlzdC5hZGQobmV3IERiU3RhdHMoIihwb29sZWQgIyAiICsgcERiLm1Db25uZWN0aW9uTnVtICsgIikgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGxhc3Rub2RlLCAwLCAwLCAwLCBwRGIubU51bUNhY2hlSGl0cywgcERiLm1OdW1DYWNoZU1pc3NlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERiLm1Db21waWxlZFF1ZXJpZXMuc2l6ZSgpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGNhdGNoIChTUUxpdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIC8vIGlnbm9yZS4gd2UgZG9uJ3QgY2FyZSBhYm91dCBleGNlcHRpb25zIHdoZW4gd2UgYXJlIHRha2luZyBhZGIKKyAgICAgICAgICAgICAgICAvLyBidWdyZXBvcnQhCiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIGRiU3RhdHNMaXN0OwogICAgIH0KIAogICAgIC8qKgotICAgICAqIGdldCB0aGUgc3BlY2lmaWVkIHByYWdtYSB2YWx1ZSBmcm9tIHNxbGl0ZSBmb3IgdGhlIHNwZWNpZmllZCBkYXRhYmFzZS4KLSAgICAgKiBvbmx5IGhhbmRsZXMgcHJhZ21hJ3MgdGhhdCByZXR1cm4gaW50L2xvbmcuCi0gICAgICogTk8gSkFWQSBsb2NrcyBhcmUgaGVsZCBpbiB0aGlzIG1ldGhvZC4KLSAgICAgKiBUT0RPOiB1c2UgdGhpcyB0byBkbyBhbGwgcHJhZ21hJ3MgaW4gdGhpcyBjbGFzcworICAgICAqIFJldHVybnMgbGlzdCBvZiBmdWxsIHBhdGhuYW1lcyBvZiBhbGwgYXR0YWNoZWQgZGF0YWJhc2VzIGluY2x1ZGluZyB0aGUgbWFpbiBkYXRhYmFzZQorICAgICAqIGJ5IGV4ZWN1dGluZyAncHJhZ21hIGRhd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mFzZSBkYk9iaikgewotICAgICAgICBpZiAoIWRiT2JqLmlzT3BlbigpKSB7CisgICAgcHVibGljIEFycmF5TGlzdDxQYWlyPFN0cmluZywgU3RyaW5nPj4gZ2V0QXR0YWNoZWREYnMoKSB7CisgICAgICAgIGlmICghaXNPcGVuKCkpIHsKICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9CiAgICAgICAgIEFycmF5TGlzdDxQYWlyPFN0cmluZywgU3RyaW5nPj4gYXR0YWNoZWREYnMgPSBuZXcgQXJyYXlMaXN0PFBhaXI8U3RyaW5nLCBTdHJpbmc+PigpOwotICAgICAgICBDdXJzb3IgYyA9IGRiT2JqLnJhd1F1ZXJ5KCJwcmFnbWEgZGF0YWJhc2VfbGlzdDsiLCBudWxsKTsKLSAgICAgICAgd2hpbGUgKGMubW92ZVRvTmV4dCgpKSB7Ci0gICAgICAgICAgICAgYXR0YWNoZWREYnMuYWRkKG5ldyBQYWlyPFN0cmluZywgU3RyaW5nPihjLmdldFN0cmluZygxKSwgYy5nZXRTdHJpbmcoMikpKTsKKyAgICAgICAgQ3Vyc29yIGMgPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgYyA9IHJhd1F1ZXJ5KCJwcmFnbWEgZGF0YWJhc2VfbGlzdDsiLCBudWxsKTsKKyAgICAgICAgICAgIHdoaWxlIChjLm1vdmVUb05leHQoKSkgeworICAgICAgICAgICAgICAgIC8vIHNxbGl0ZSByZXR1cm5zIGEgcm93IGZvciBlYWNoIGRhdGFiYXNlIGluIHRoZSByZXR1cm5lZCBsaXN0IG9mIGRhdGFiYXNlcy4KKyAgICAgICAgICAgICAgICAvLyAgIGluIGVhY2ggcm93LAorICAgICAgICAgICAgICAgIC8vICAgICAgIDFzdCBjb2x1bW4gaXMgdGhlIGRhdGFiYXNlIG5hbWUgc3VjaCBhcyBtYWluLCBvciB0aGUgZGF0YWJhc2UKKyAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgIC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gfSBlbHNlIHsKLSAgICAgICAgICAgIG1BcG5UeXBlVG9XYXRjaEZvciA9IG1BcG5UeXBlOwotICAgICAgICB9CiAKICAgICAgICAgbVBob25lU2VydmljZSA9IG51bGw7Ci0gICAgICAgIGlmKG5ldFR5cGUgPT0gQ29ubmVjdGl2aXR5TWFuYWdlci5UWVBFX01PQklMRSkgewotICAgICAgICAgICAgbUVuYWJsZWQgPSB0cnVlOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbUVuYWJsZWQgPSBmYWxzZTsKLSAgICAgICAgfQogCi0gICAgICAgIG1EbnNQcm9wTmFtZXMgPSBuZXcgU3RyaW5nW10geworICAgICAgICBzRG5zUHJvcE5hbWVzID0gbmV3IFN0cmluZ1tdIHsKICAgICAgICAgICAgICAgICAibmV0LnJtbmV0MC5kbnMxIiwKICAgICAgICAgICAgICAgICAibmV0LnJtbmV0MC5kbnMyIiwKICAgICAgICAgICAgICAgICAibmV0LmV0aDAuZG5zMSIsCkBAIC05NCw2ICs5Myw1MyBAQAogICAgIH0KIAogICAgIC8qKgorICAgICAqIFJldHVybiB0aGUgSVAgYWRkcmVzc2VzIG9mIHRoZSBETlMgc2VydmVycyBhdmFpbGFibGUgZm9yIHRoZSBtb2JpbGUgZGF0YQorICAgICAqIG5ldHdvcmsgaW50ZXJmYWNlLgorICAgICAqIEByZXR1cm4gYSBsaXN0IG9mIEROUyBhZGRyZXNzZXMsIHdpdGggbm8gaG9sZXMuCisgICAgICovCisgICAgcHVibGljIFN0cmluZ1tdIGdldERuc1Byb3BOYW1lcygpIHsKKyAgICAgICAgcmV0dXJuIHNEbnNQcm9wTmFtZXM7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJuIHRoZSBuYW1lIG9mIG91ciBuZXR3b3JrIGludGVyZmFjZS4KKyAgICAgKiBAcmV0dXJuIHRoZSBuYW1lIG9mIG91ciBpbnRlcmZhY2UuCisgICAgICovCisgICAgcHVibGljIFN0cmluZyBnZXRJbnRlcmZhY2VOYW1lKCkgeworICAgICAgICByZXR1cm4gbUludGVyZmFjZU5hbWU7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNQcml2YXRlRG5zUm91dGVTZXQoKSB7CisgICAgICAgIHJldHVybiBtUHJpdmF0ZURuc1JvdXRlU2V0OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHByaXZhdGVEbnNSb3V0ZVNldChib29sZWFuIGVuYWJsZWQpIHsKKyAgICAgICAgbVByaXZhdGVEbnNSb3V0ZVNldCA9IGVuYWJsZWQ7CisgICAgfQorCisgICAgcHVibGljIE5ldHdvcmtJbmZvIGdldE5ldHdvcmtJbmZvKCkgeworICAgICAgICByZXR1cm4gbU5ldHdvcmtJbmZvOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0RGVmYXVsdEdhdGV3YXlBZGRyKCkgeworICAgICAgICByZXR1cm4gbURlZmF1bHRHYXRld2F5QWRkcjsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc0RlZmF1bHRSb3V0ZVNldCgpIHsKKyAgICAgICAgcmV0dXJuIG1EZWZhdWx0Um91dGVTZXQ7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgZGVmYXVsdFJvdXRlU2V0KGJvb2xlYW4gZW5hYmxlZCkgeworICAgICAgICBtRGVmYXVsdFJvdXRlU2V0ID0gZW5hYmxlZDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGlzIGlzIG5vdCBpbXBsZW1lbnRlZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCByZWxlYXNlV2FrZUxvY2soKSB7CisgICAgfQorCisgICAgLyoqCiAgICAgICogQmVnaW4gbW9uaXRvcmluZyBtb2JpbGUgZGF0YSBjb25uZWN0aXZpdHkuCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc3RhcnRNb25pdG9yaW5nKCkgewpAQCAtMTAzLDM4ICsxNDksMzQgQEAKICAgICAgICAgZmlsdGVyLmFkZEFjdGlvb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1MCArMTg0LDI5IEBACiAgICAgICAgICAgICBzeW5jaHJvbml6ZWQodGhpcykgewogICAgICAgICAgICAgICAgIGlmIChpbnRlbnQuZ2V0QWN0aW9uKCkuZXF1YWxzKFRlbGVwaG9ueUludGVudHMuCiAgICAgICAgICAgICAgICAgICAgICAgICBBQ1RJT05fQU5ZX0RBVEFfQ09OTkVDVElPTl9TVEFURV9DSEFOR0VEKSkgewotICAgICAgICAgICAgICAgICAgICBQaG9uZS5EYXRhU3RhdGUgc3RhdGUgPSBnZXRNb2JpbGVEYXRhU3RhdGUoaW50ZW50KTsKKyAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGFwblR5cGUgPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuREFUQV9BUE5fVFlQRV9LRVkpOworCisgICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmVxdWFscyhhcG5UeXBlLCBtQXBuVHlwZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBQaG9uZS5EYXRhU3RhdGUgc3RhdGUgPSBFbnVtLnZhbHVlT2YoUGhvbmUuRGF0YVN0YXRlLmNsYXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5TVEFURV9LRVkpKTsKICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHJlYXNvbiA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5TVEFURV9DSEFOR0VfUkVBU09OX0tFWSk7CiAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBhcG5OYW1lID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfQVBOX0tFWSk7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBhcG5UeXBlTGlzdCA9IGludGVudC5nZXRTdHJpbmdFeHRyYShQaG9uZS5EQVRBX0FQTl9UWVBFU19LRVkpOwotICAgICAgICAgICAgICAgICAgICBtQXBuTmFtZSA9IGFwbk5hbWU7CiAKICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiB1bmF2YWlsYWJsZSA9IGludGVudC5nZXRCb29sZWFuRXh0cmEoUGhvbmUuTkVUV09SS19VTkFWQUlMQUJMRV9LRVksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UpOwotCi0gICAgICAgICAgICAgICAgICAgIC8vIHNldCB0aGlzIHJlZ2FyZGxlc3Mgb2YgdGhlIGFwblR5cGVMaXN0LiAgSXQncyBhbGwgdGhlIHNhbWUgcmFkaW8vbmV0d29yawotICAgICAgICAgICAgICAgICAgICAvLyB1bmRlcm5lYXRoCiAgICAgICAgICAgICAgICAgICAgIG1OZXR3b3JrSW5mby5zZXRJc0F2YWlsYWJsZSghdW5hdmFpbGFibGUpOwogCi0gICAgICAgICAgICAgICAgICAgIGlmIChpc0FwblR5cGVJbmNsdWRlZChhcG5UeXBlTGlzdCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRW5hYmxlZCA9PSBmYWxzZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIHdlJ3JlIG5vdCBlbmFibGVkIGJ1dCB0aGUgQVBOIFR5cGUgaXMgc3VwcG9ydGVkIGJ5IHRoaXMgY29ubmVjdGlvbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIHNob3VsZCByZWNvcmQgdGhlIGludGVyZmFjZSBuYW1lIGlmIG9uZSdzIHByb3ZpZGVkLiAgSWYgdGhlIHVzZXIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0dXJucyBvbiB0aGlzIG5ldHdvcmsgd2Ugd2lsbCBuZWVkIHRoZSBpbnRlcmZhY2VuYW1lIGJ1dCB3b24ndCBnZXQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhIGZyZXNoIGNvbm5lY3RlZCBtZXNzYWdlIC0gVE9ETyBmaXggdGhpcyB3aGVuIHdlIGdldCBwZXItQVBOCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm90aWZpY2F0aW9ucwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGF0ZSA9PSBQaG9uZS5EYXRhU3RhdGUuQ09OTkVDVEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgInJlcGxhY2luZyBvbGQgbUludGVyZmFjZU5hbWUgKCIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1JbnRlcmZhY2VOYW1lICsgIikgd2l0aCAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuREFUQV9JRkFDRV9OQU1FX0tFWSkgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgZm9yICIgKyBtQXBuVHlwZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1JbnRlcmZhY2VOYW1lID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfSUZBQ0VfTkFNRV9LRVkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgICAgIH0KLQogICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChUQUcsIG1BcG5UeXBlICsgIiBSZWNlaXZlZCBzdGF0ZT0gIiArIHN0YXRlICsgIiwgb2xkPSAiICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTW9iaWxlRGF0YVN0YXRlICsgIiwgcmVhc29uPSAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAocmVhc29uID09IG51bGwgPyAiKHVuc3BlY2lmaWVkKSIgOiByZWFzb24pICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLCBhcG5UeXBlTGlzdD0gIiArIGFwblR5cGVMaXN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAocmVhc29uID09IG51bGwgPyAiKHVuc3BlY2lmaWVkKSIgOiByZWFzb24pKTsKIAogICAgICAgICAgICAgICAgICAgICBpZiAobU1vYmlsZURhdGFTdGF0ZSAhPSBzdGF0ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgbU1vYmlsZURhdGFTdGF0ZSA9IHN0YXRlOwogICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChzdGF0ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgRElTQ09OTkVDVEVEOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpc1RlYXJkb3duUmVxdWVzdGVkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1FbmFibGVkID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUZWFyZG93blJlcXVlc3RlZChmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIApAQCAtMjE4LDExICsyMzksMTQgQEAKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW50ZW50LmdldEFjdGlvbigpLgogICAgICAgICAgICAgICAgICAgICAgICAgZXF1YWxzKFRlbGVwaG9ueUludGVudHMuQUNUSU9OX0RBVEFfQ09OTkVDVElPTl9GQUlMRUQpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1FbmFibGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBhcG5UeXBlID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKFBob25lLkRBVEFfQVBOX1RZUEVfS0VZKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuZXF1YWxzKGFwblR5cGUsIG1BcG5UeXBlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIFN0cmluZyByZWFzb24gPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuRkFJTFVSRV9SRUFTT05fS0VZKTsKICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGFwbk5hbWUgPSBpbnRlbnQuZ2V0U3RyaW5nRXh0cmEoUGhvbmUuREFUQV9BUE5fS0VZKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCAiUmVjZWl2ZWQgIiArIGludGVudC5nZXRBY3Rpb24oKSArICIgYnJvYWRjYXN0IiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVhc29uID09IG51bGwgPyAiIiA6ICIoIiArIHJlYXNvbiArICIpIik7CisgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKFRBRywgbUFwblR5cGUgKyAiUmVjZWl2ZWQgIiArIGludGVudC5nZXRBY3Rpb24oKSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBicm9hZGNhc3QiICsgcmVhc29uID09IG51bGwgPyAiIiA6ICIoIiArIHJlYXNvbiArICIpIik7CiAgICAgICAgICAgICAgICAgICAgIHNldERldGFpbGVkU3RhdGUoRGV0YWlsZWRTdGF0ZS5GQUlMRUQsIHJlYXNvbiwgYXBuTmFtZSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIFRlbGVwaG9ueU1hbmFnZXIgdG0gPSBUZWxlcGhvbnlNYW5hZ2VyLmdldERlZmF1bHQoKTsKQEAgLTMyMCw3MCArMzQ0LDg4IEBACiAgICAgLyoqCiAgICAgICogVGVhciBk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HJhKFBob25lLkRBVEFfQVBOX0tFWSwgbUFwbk5hbWUpOwotICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShQaG9uZS5EQVRBX0lGQUNFX05BTUVfS0VZLCBtSW50ZXJmYWNlTmFtZSk7Ci0gICAgICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKFBob25lLk5FVFdPUktfVU5BVkFJTEFCTEVfS0VZLCBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgaWYgKG1TdGF0ZVJlY2VpdmVyICE9IG51bGwpIG1TdGF0ZVJlY2VpdmVyLm9uUmVjZWl2ZShtQ29udGV4dCwgaW50ZW50KTsKKyAgICAgICAgICAgICAgICByZXRWYWx1ZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBjYXNlIFBob25lLkFQTl9SRVFVRVNUX1NUQVJURUQ6Ci0gICAgICAgICAgICAgICAgbUVuYWJsZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgIC8vIG5vIG5lZWQgdG8gZG8gYW55dGhpbmcgLSB3ZSdyZSBhbHJlYWR5IGR1ZSBzb21lIHN0YXR1cyB1cGRhdGUgaW50ZW50cworICAgICAgICAgICAgICAgIHJldFZhbHVlID0gdHJ1ZTsKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIGNhc2UgUGhvbmUuQVBOX1JFUVVFU1RfRkFJTEVEOgotICAgICAgICAgICAgICAgIGlmIChtUGhvbmVTZXJ2aWNlID09IG51bGwgJiYgbUFwblR5cGUgPT0gUGhvbmUuQVBOX1RZUEVfREVGQVVMVCkgewotICAgICAgICAgICAgICAgICAgICAvLyBvbiBzdGFydHVwIHdlIG1heSB0cnkgdG8gdGFsayB0byB0aGUgcGhvbmUgYmVmb3JlIGl0J3MgcmVhZHkKLSAgICAgICAgICAgICAgICAgICAgLy8gc2luY2UgdGhlIHBob25lIHdpbGwgY29tZSB1cCBlbmFibGVkLCBnbyB3aXRoIHRoYXQuCi0gICAgICAgICAgICAgICAgICAgIC8vIFRPRE8gLSB0aGlzIGFsc28gY29tZXMgdXAgb24gdGVsZXBob255IGNyYXNoOiBpZiB3ZSB0aGluayBtb2JpbGUgZGF0YSBpcwotICAgICAgICAgICAgICAgICAgICAvLyBvZmYgYW5kIHRoZSB0ZWxlcGhvbnkgc3R1ZmYgY3Jhc2hlcyBhbmQgaGFzIHRvIHJlc3RhcnQgaXQgd2lsbCBjb21lIHVwCi0gICAgICAgICAgICAgICAgICAgIC8vIGVuYWJsZWQgKG1ha2luZyBhIGRhdGEgY29ubmVjdGlvbikuICBXZSB3aWxsIHRoZW4gYmUgb3V0IG9mIHN5bmMuCi0gICAgICAgICAgICAgICAgICAgIC8vIEEgcG9zc2libGUgc29sdXRpb24gaXMgYSBicm9hZGNhc3Qgd2hlbiB0ZWxlcGhvbnkgcmVzdGFydHMuCi0gICAgICAgICAgICAgICAgICAgIG1FbmFibGVkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAvLyBlbHNlIGZhbGwgdGhyb3VnaAogICAgICAgICAgICAgY2FzZSBQaG9uZS5BUE5fVFlQRV9OT1RfQVZBSUxBQkxFOgotICAgICAgICAgICAgICAgIC8vIERlZmF1bHQgaXMgYWx3YXlzIGF2YWlsYWJsZSwgYnV0IG1heSBiZSBvZmYgZHVlIHRvCi0gICAgICAgICAgICAgICAgLy8gQWlycGxhbmVNb2RlIG9yIEUtQ2FsbCBvciB3aGF0ZXZlci4uCi0gICAgICAgICAgICAgICAgaWYgKG1BcG5UeXBlICE9IFBob25lLkFQTl9UWVBFX0RFRkFVTFQpIHsKLSAgICAgICAgICAgICAgICAgICAgbUVuYWJsZWQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgIExvZy5lKF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RVdGlscy5lcXVhbHModmFsdWUsICIwLjAuMC4wIikpIHsKLSAgICAgICAgICAgICAgICBkbnNBZGRyZXNzZXNbaisrXSA9IHZhbHVlOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBkbnNBZGRyZXNzZXM7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgYWRkUHJpdmF0ZURuc1JvdXRlcygpIHsKLSAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgTG9nLmQoVEFHLCAiYWRkUHJpdmF0ZURuc1JvdXRlcyBmb3IgIiArIHRoaXMgKwotICAgICAgICAgICAgICAgICAgICAiKCIgKyBtSW50ZXJmYWNlTmFtZSArICIpIC0gbVByaXZhdGVEbnNSb3V0ZVNldCA9ICIrbVByaXZhdGVEbnNSb3V0ZVNldCk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKG1JbnRlcmZhY2VOYW1lICE9IG51bGwgJiYgIW1Qcml2YXRlRG5zUm91dGVTZXQpIHsKLSAgICAgICAgICAgIGZvciAoU3RyaW5nIGFkZHJTdHJpbmcgOiBnZXROYW1lU2VydmVycygpKSB7Ci0gICAgICAgICAgICAgICAgaW50IGFkZHIgPSBOZXR3b3JrVXRpbHMubG9va3VwSG9zdChhZGRyU3RyaW5nKTsKLSAgICAgICAgICAgICAgICBpZiAoYWRkciAhPSAtMSAmJiBhZGRyICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoVEFHLCAiICBhZGRpbmcgIithZGRyU3RyaW5nKyIgKCIrYWRkcisiKSIpOwotICAgICAgICAgICAgICAgICAgICBOZXR3b3JrVXRpbHMuYWRkSG9zdFJvdXRlKG1JbnRlcmZhY2VOYW1lLCBhZGRyKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtUHJpdmF0ZURuc1JvdXRlU2V0ID0gdHJ1ZTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIHJlbW92ZVByaXZhdGVEbnNSb3V0ZXMoKSB7Ci0gICAgICAgIC8vIFRPRE8gLSB3ZSBzaG91bGQgZG8gdGhpcyBleHBsaWNpdGx5IGJ1dCB0aGUgTmV0VXRpbHMgYXBpIGRvZXNudAotICAgICAgICAvLyBzdXBwb3J0IHRoaXMgeWV0IC0gbXVzdCByZW1vdmUgYWxsLiAgTm8gd29yc2UgdGhhbiBiZWZvcmUKLSAgICAgICAgaWYgKG1JbnRlcmZhY2VOYW1lICE9IG51bGwgJiYgbVByaXZhdGVEbnNSb3V0ZVNldCkgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKFRBRywgInJlbW92ZVByaXZhdGVEbnNSb3V0ZXMgZm9yICIgKyBtTmV0d29ya0luZm8uZ2V0VHlwZU5hbWUoKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAiICgiICsgbUludGVyZmFjZU5hbWUgKyAiKSIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgTmV0d29ya1V0aWxzLnJlbW92ZUhvc3RSb3V0ZXMobUludGVyZmFjZU5hbWUpOwotICAgICAgICAgICAgbVByaXZhdGVEbnNSb3V0ZVNldCA9IGZhbHNlOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgYWRkRGVmYXVsdFJvdXRlKCkgewotICAgICAgICBpZiAoKG1JbnRlcmZhY2VOYW1lICE9IG51bGwpICYmIChtRGVmYXVsdEdhdGV3YXlBZGRyICE9IDApICYmCi0gICAgICAgICAgICAgICAgbURlZmF1bHRSb3V0ZVNldCA9PSBmYWxzZSkgewotICAgICAgICAgICAgaWYgKERCRykgewotICAgICAgICAgICAgICAgIExvZy5kKFRBRywgImFkZERlZmF1bHRSb3V0ZSBmb3IgIiArIG1OZXR3b3JrSW5mby5nZXRUeXBlTmFtZSgpICsKLSAgICAgICAgICAgICAgICAgICAgICAgICIgKCIgKyBtSW50ZXJmYWNlTmFtZS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SAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHByZWZpeCA9ICIvc3lzL2tlcm5lbC9pcHY0L3RjcF8iOwotICAgICAgICAgICAgICAgIHN0cmluZ1RvRmlsZShwcmVmaXggKyAicm1lbV9taW4iLCB2YWx1ZXNbMF0pOwotICAgICAgICAgICAgICAgIHN0cmluZ1RvRmlsZShwcmVmaXggKyAicm1lbV9kZWYiLCB2YWx1ZXNbMV0pOwotICAgICAgICAgICAgICAgIHN0cmluZ1RvRmlsZShwcmVmaXggKyAicm1lbV9tYXgiLCB2YWx1ZXNbMl0pOwotICAgICAgICAgICAgICAgIHN0cmluZ1RvRmlsZShwcmVmaXggKyAid21lbV9taW4iLCB2YWx1ZXNbM10pOwotICAgICAgICAgICAgICAgIHN0cmluZ1RvRmlsZShwcmVmaXggKyAid21lbV9kZWYiLCB2YWx1ZXNbNF0pOwotICAgICAgICAgICAgICAgIHN0cmluZ1RvRmlsZShwcmVmaXggKyAid21lbV9tYXgiLCB2YWx1ZXNbNV0pOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJJbnZhbGlkIGJ1ZmZlcnNpemUgc3RyaW5nOiAiICsgYnVmZmVyU2l6ZXMpOwotICAgICAgICAgICAgfQotICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICBMb2cuZShUQUcsICJDYW4ndCBzZXQgdGNwIGJ1ZmZlciBzaXplczoiICsgZSk7Ci0gICAgICAgIH0KLSAgICB9CisgICAgcHVibGljIGludCBnZXREZWZhdWx0R2F0ZXdheUFkZHIoKTsKIAogICAgIC8qKgotICAgICAqIFdyaXRlcyBzdHJpbmcgdG8gZmlsZS4gQmFzaWNhbGx5IHNhbWUgYXMgImVjaG8gLW4gJHN0cmluZyA+ICRmaWxlbmFtZSIKLSAgICAgKiAKLSAgICAgKiBAcGFyYW0gZmlsZW5hbWUKLSAgICAgKiBAcGFyYW0gc3RyaW5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rSW5mby5nZXRTdGF0ZSgpID09IE5ldHdvcmtJbmZvLlN0YXRlLkNPTk5FQ1RJTkcpOwotICAgICAgICAgICAgU3RyaW5nIGxhc3RSZWFzb24gPSBtTmV0d29ya0luZm8uZ2V0UmVhc29uKCk7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogSWYgYSByZWFzb24gd2FzIHN1cHBsaWVkIHdoZW4gdGhlIENPTk5FQ1RJTkcgc3RhdGUgd2FzIGVudGVyZWQsIGFuZCBubwotICAgICAgICAgICAgICogcmVhc29uIHdhcyBzdXBwbGllZCBmb3IgZW50ZXJpbmcgdGhlIENPTk5FQ1RFRCBzdGF0ZSwgdGhlbiByZXRhaW4gdGhlCi0gICAgICAgICAgICAgKiByZWFzb24gdGhhdCB3YXMgc3VwcGxpZWQgd2hlbiBnb2luZyB0byBDT05ORUNUSU5HLgotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBpZiAod2FzQ29ubmVjdGluZyAmJiBzdGF0ZSA9PSBOZXR3b3JrSW5mby5EZXRhaWxlZFN0YXRlLkNPTk5FQ1RFRCAmJiByZWFzb24gPT0gbnVsbAotICAgICAgICAgICAgICAgICAgICAmJiBsYXN0UmVhc29uICE9IG51bGwpCi0gICAgICAgICAgICAgICAgcmVhc29uID0gbGFzdFJlYXNvbjsKLSAgICAgICAgICAgIG1OZXR3b3JrSW5mby5zZXREZXRhaWxlZFN0YXRlKHN0YXRlLCByZWFzb24sIGV4dHJhSW5mbyk7Ci0gICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1UYXJnZXQub2J0YWluTWVzc2FnZShFVkVOVF9TVEFURV9DSEFOR0VELCBtTmV0d29ya0luZm8pOwotICAgICAgICAgICAgbXNnLnNlbmRUb1RhcmdldCgpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcHJvdGVjdGVkIHZvaWQgc2V0RGV0YWlsZWRTdGF0ZUludGVybmFsKE5ldHdvcmtJbmZvLkRldGFpbGVkU3RhdGUgc3RhdGUp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orICAgIHByaXZhdGUgc3RhdGljIFN0cmluZ1tdIHRleHRDb250ZW50VHlwZXMgPSBuZXcgU3RyaW5nW10geworICAgICAgICAgICAgInRleHQvIiwKKyAgICAgICAgICAgICJhcHBsaWNhdGlvbi94bWwiLAorICAgICAgICAgICAgImFwcGxpY2F0aW9uL2pzb24iCisgICAgfTsKIAogICAgIC8qKiBJbnRlcmNlcHRvciB0aHJvd3MgYW4gZXhjZXB0aW9uIGlmIHRoZSBleGVjdXRpbmcgdGhyZWFkIGlzIGJsb2NrZWQgKi8KICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBIdHRwUmVxdWVzdEludGVyY2VwdG9yIHNUaHJlYWRDaGVja0ludGVyY2VwdG9yID0KQEAgLTM1OCw3ICszNjQsNyBAQAogICAgICAgICB9CiAgICAgICAgIGlmIChsZXZlbCA8IExvZy5WRVJCT1NFIHx8IGxldmVsID4gTG9nLkFTU0VSVCkgewogICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiTGV2ZWwgaXMgb3V0IG9mIHJhbmdlIFsiCi0gICAgICAgICAgICAgICAgKyBMb2cuVkVSQk9TRSArICIuLiIgKyBMb2cuQVNTRVJUICsgIl0iKTsgICAgCisgICAgICAgICAgICAgICAgKyBMb2cuVkVSQk9TRSArICIuLiIgKyBMb2cuQVNTRVJUICsgIl0iKTsKICAgICAgICAgfQogCiAgICAgICAgIGN1cmxDb25maWd1cmF0aW9uID0gbmV3IExvZ2dpbmdDb25maWd1cmF0aW9uKG5hbWUsIGxldmVsKTsKQEAgLTQzMSwxMiArNDM3LDE3IEBACiAgICAgICAgICAgICAgICAgaWYgKGVudGl0eS5nZXRDb250ZW50TGVuZ3RoKCkgPCAxMDI0KSB7CiAgICAgICAgICAgICAgICAgICAgIEJ5dGVBcnJheU91dHB1dFN0cmVhbSBzdHJlYW0gPSBuZXcgQnl0ZUFycmF5T3V0cHV0U3RyZWFtKCk7CiAgICAgICAgICAgICAgICAgICAgIGVudGl0eS53cml0ZVRvKHN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBlbnRpdHlTdHJpbmcgPSBzdHJlYW0udG9TdHJpbmcoKTsKIAotICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBDaGVjayB0aGUgY29udGVudCB0eXBlLCB0b28uCi0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIgLS1kYXRhLWFzY2lpIFwiIikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKGVudGl0eVN0cmluZykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCJcIiIpOworICAgICAgICAgICAgICAgICAgICBpZiAoaXNCaW5hcnlDb250ZW50KHJlcXVlc3QpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYmFzZTY0ID0gQmFzZTY0LmVuY29kZVRvU3RyaW5nKHN0cmVhbS50b0J5dGVBcnJheSgpLCBCYXNlNjQuTk9fV1JBUCk7CisgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmluc2VydCgwLCAiZWNobyAnIiArIGJhc2U2NCArICInIHwgYmFzZTY0IC1kID4gL3RtcC8kJC5iaW47ICIpOworICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiAtLWRhdGEtYmluYXJ5IEAvdG1wLyQkLmJpbiIpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGVudGl0eVN0cmluZyA9IHN0cmVhbS50b1N0cmluZygpOworICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIiAtLWRhdGEtYXNjaWkgXCIiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKGVudGl0eVN0cmluZykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgiXCIiKTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIgW1RPTyBNVUNIIERBVEEgVE8gSU5DTFVERV0iKTsKICAgICAgICAgICAgICAgICB9CkBAIC00NDYsNiArNDU3LDMwIEBACiAgICAgICAgIHJldHVybiBidWlsZGVyLnRvU3RyaW5nKCk7CiAgICAgfQogCisgICAgcHJpdmF0ZSBzdGF0aWMgYm9vbGVhbiBpc0JpbmFyeUNvbnRlbnQoSHR0cFVyaVJlcXVlc3QgcmVxdWVzdCkgeworICAgICAgICBIZWFkZXJbXSBoZWFkZXJzOworICAgICAgICBoZWFkZXJzID0gcmVxdWVzdC5nZXRIZWFkZXJzKEhlYWRlcnMuQ09OVEVOVF9FTkNPRElORyk7CisgICAgICAgIGlmIChoZWFkZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoSGVhZGVyIGhlYWRlciA6IGhlYWRlcnMpIHsKKyAgICAgICAgICAgICAgICBpZiAoImd6aXAiLmVxdWFsc0lnbm9yZUNhc2UoaGVhZGVyLmdldFZhbHVlKCkpKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGhlYWRlcnMgPSByZXF1ZXN0LmdldEhlYWRlcnMoSGVhZGVycy5DT05URU5UX1RZUEUpOworICAgICAgICBpZiAoaGVhZGVycyAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKEhlYWRlciBoZWFkZXIgOiBoZWFkZXJzKSB7CisgICAgICAgICAgICAgICAgZm9yIChTdHJpbmcgY29udGVudFR5cGUgOiB0ZXh0Q29udGVudFR5cGVzKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChoZWFkZXIuZ2V0VmFsdWUoKS5zdGFydHNXaXRoKGNvbnRlbnRUeXBlKSkgeworICAgICAgIC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ICAgICAgIFRleHRVdGlscy5pc0VtcHR5KGRpc3BsYXlOYW1lKSk7Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBDb250ZW50VmFsdWVzIGdldFByaW1hcnlDb250ZW50VmFsdWUoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBDb250ZW50VmFsdWVzIHByaW1hcnlDb250ZW50VmFsdWVzID0gbnVsbDsKLSAgICAgICAgQ29udGVudFZhbHVlcyBzdWJwcmltYXJ5Q29udGVudFZhbHVlcyA9IG51bGw7Ci0gICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgIGlmIChjb250ZW50VmFsdWVzID09IG51bGwpewotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgSW50ZWdlciBpc1N1cGVyUHJpbWFyeSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKFN0cnVjdHVyZWROYW1lLklTX1NVUEVSX1BSSU1BUlkpOwotICAgICAgICAgICAgaWYgKGlzU3VwZXJQcmltYXJ5ICE9IG51bGwgJiYgaXNTdXBlclByaW1hcnkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgLy8gV2UgY2hvb3NlICJzdXBlciBwcmltYXJ5IiBDb250ZW50VmFsdWVzLgotICAgICAgICAgICAgICAgIHByaW1hcnlDb250ZW50VmFsdWVzID0gY29udGVudFZhbHVlczsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAocHJpbWFyeUNvbnRlbnRWYWx1ZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIC8vIFdlIGNob29zZSB0aGUgZmlyc3QgInByaW1hcnkiIENvbnRlbnRWYWx1ZXMKLSAgICAgICAgICAgICAgICAvLyBpZiAic3VwZXIgcHJpbWFyeSIgQ29udGVudFZhbHVlcyBkb2VzIG5vdCBleGlzdC4KLSAgICAgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIGlzUHJpbWFyeSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKFN0cnVjdHVyZWROYW1lLklTX1BSSU1BUlkpOwotICAgICAgICAgICAgICAgIGlmIChpc1ByaW1hcnkgIT0gbnVsbCAmJiBpc1ByaW1hcnkgPiAwICYmCi0gICAgICAgICAgICAgICAgICAgICAgICBjb250YWluc05vbkVtcHR5TmFtZShjb250ZW50VmFsdWVzKSkgewotICAgICAgICAgICAgICAgICAgICBwcmltYXJ5Q29udGVudFZhbHVlcyA9IGNvbnRlbnRWYWx1ZXM7Ci0gICAgICAgICAgICAgICAgICAgIC8vIERvIG5vdCBicmVhaywgc2luY2UgdGhlcmUgbWF5IGJlIENvbnRlbnRWYWx1ZXMgd2l0aCAic3VwZXIgcHJpbWFyeSIKLSAgICAgICAgICAgICAgICAgICAgLy8gYWZ0ZXJ3b3JkLgotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3VicHJpbWFyeUNvbnRlbnRWYWx1ZXMgPT0gbnVsbCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgY29udGFpbnNOb25FbXB0eU5hbWUoY29udGVudFZhbHVlcykpIHsKLSAgICAgICAgICAgICAgICAgICAgc3VicHJpbWFyeUNvbnRlbnRWYWx1ZXMgPSBjb250ZW50VmFsdWVzOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChwcmltYXJ5Q29udGVudFZhbHVlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICBpZiAoc3VicHJpbWFyeUNvbnRlbnRWYWx1ZXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIC8vIFdlIGNob29zZSB0aGUgZmlyc3QgQ29udGVudFZhbHVlcyBpZiBhbnkgInByaW1hcnkiIENvbnRlbnRWYWx1ZXM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ZE5hbWUuRElTUExBWV9OQU1FKTsKLQotICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGZhbWlseU5hbWUpIHx8ICFUZXh0VXRpbHMuaXNFbXB0eShnaXZlbk5hbWUpKSB7Ci0gICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseUFwcGVuZENoYXJzZXRQYXJhbWV0ZXJUb05hbWUgPQotICAgICAgICAgICAgICAgICAgICBzaG91bGRBcHBlbmRDaGFyc2V0UGFyYW0oZmFtaWx5TmFtZSwgZ2l2ZW5OYW1lLCBtaWRkbGVOYW1lLCBwcmVmaXgsIHN1ZmZpeCk7Ci0gICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZVRvTmFtZSA9Ci0gICAgICAgICAgICAgICAgICAgICghbVJlZnJhaW5zUVBUb05hbWVQcm9wZXJ0aWVzICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIShWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShmYW1pbHlOYW1lKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkoZ2l2ZW5OYW1lKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkobWlkZGxlTmFtZSkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKHByZWZpeCkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKHN1ZmZpeCkpKTsKLQotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGZvcm1hdHRlZE5hbWU7Ci0gICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGRpc3BsYXlOYW1lKSkgewotICAgICAgICAgICAgICAgIGZvcm1hdHRlZE5hbWUgPSBkaXNwbGF5TmFtZTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZm9ybWF0dGVkTmFtZSA9IFZDYXJkVXRpbHMuY29uc3RydWN0TmFtZUZyb21FbGVtZW50cygKLSAgICAgICAgICAgICAgICAgICAgICAgIFZDYXJkQ29uZmlnLmdldE5hbWVPcmRlclR5cGUobVZDYXJkVHlwZSksCi0gICAgICAgICAgICAgICAgICAgICAgICBmYW1pbHlOYW1lLCBtaWRkbGVOYW1lLCBnaXZlbk5hbWUsIHByZWZpeCwgc3VmZml4KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcmVhbGx5QXBwZW5kQ2hhcnNldFBhcmFtZXRlclRvRk4gPQotICAgICAgICAgICAgICAgICAgICBzaG91bGRBcHBlbmRDaGFyc2V0UGFyYW0oZm9ybWF0dGVkTmFtZSk7Ci0gICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZVRvRk4gPQotICAgICAgICAgICAgICAgICAgICAhbVJlZnJhaW5zUVBUb05hbWVQcm9wZXJ0aWVzICYmCi0gICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShmb3JtYXR0ZWROYW1lKTsKLQotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRGYW1pbHk7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZEdpdmVuOwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRNaWRkbGU7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5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AgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9EQVRBX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoZW5jb2RlZEZvcm1hdHRlZG5hbWUpOwotICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0VORF9PRl9MSU5FKTsKLSAgICAgICAgfSBlbHNlIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoZGlzcGxheU5hbWUpKSB7Ci0gICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZVRvRGlzcGxheU5hbWUgPQotICAgICAgICAgICAgICAgICghbVJlZnJhaW5zUVBUb05hbWVQcm9wZXJ0aWVzICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkoZGlzcGxheU5hbWUpKTsKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkRGlzcGxheU5hbWUgPQotICAgICAgICAgICAgICAgICAgICByZWFsbHlVc2VRdW90ZWRQcmludGFibGVUb0Rpc3BsYXlOYW1lID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmNvZGVRdW90ZWRQcmludGFibGUoZGlzcGxheU5hbWUpIDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXNjYXBlQ2hhcmFjdGVycyhkaXNwbGF5TmFtZSk7Ci0KLSAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9OKTsKLSAgICAgICAgICAgIGlmIChzaG91bGRBcHBlbmRDaGFyc2V0UGFyYW0oZGlzcGxheU5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BBUkFNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKG1W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kZXIuYXBwZW5kKFZDQVJEX0lURU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfSVRFTV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9FTkRfT0ZfTElORSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBUcnkgdG8gZW1pdCB0aGUgZmllbGQocykgcmVsYXRlZCB0byBwaG9uZXRpYyBuYW1lLgotICAgICAgICBpZiAobUlzVjMwKSB7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgc29ydFN0cmluZyA9IFZDYXJkVXRpbHMKLSAgICAgICAgICAgICAgICAgICAgLmNvbnN0cnVjdE5hbWVGcm9tRWxlbWVudHMobVZDYXJkVHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaG9uZXRpY0ZhbWlseU5hbWUsIHBob25ldGljTWlkZGxlTmFtZSwgcGhvbmV0aWNHaXZlbk5hbWUpOwotICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX1NPUlRfU1RSSU5HKTsKLSAgICAgICAgICAgIGlmIChzaG91bGRBcHBlbmRDaGFyc2V0UGFyYW0oc29ydFN0cmluZykpIHsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQobVZDYXJkQ2hhcnNldFBhcmFtZXRlcik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfREFUQV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKGVzY2FwZUNoYXJhY3RlcnMoc29ydFN0cmluZykpOwotICAg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WFrYXdhO0RhaXN1a2U7OzsKLSAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9TT1VORCk7Ci0gICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1hfSVJNQ19OKTsKLQotICAgICAgICAgICAgYm9vbGVhbiByZWFsbHlVc2VRdW90ZWRQcmludGFibGUgPQotICAgICAgICAgICAgICAgICghbVJlZnJhaW5zUVBUb05hbWVQcm9wZXJ0aWVzCi0gICAgICAgICAgICAgICAgICAgICAgICAmJiAhKFZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaG9uZXRpY0ZhbWlseU5hbWUpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIFZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBob25ldGljTWlkZGxlTmFtZSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGhvbmV0aWNHaXZlbk5hbWUpKSk7Ci0KLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkUGhvbmV0aWNGYW1pbHlOYW1lOwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRQaG9uZXRpY01pZGRsZU5hbWU7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZFBob25ldGljR2l2ZW5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Q2hhcnNldFBhcmFtZXRlcik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfREFUQV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGJvb2xlYW4gZmlyc3QgPSB0cnVlOwotICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoZW5jb2RlZFBob25ldGljRmFtaWx5TmFtZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKGVuY29kZWRQaG9uZXRpY0ZhbWlseU5hbWUpOwotICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGVuY29kZWRQaG9uZXRpY01pZGRsZU5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChmaXJzdCkgewotICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3QgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZCgnICcpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChlbmNvZGVkUGhvbmV0aWNNaWRkbGVOYW1lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShlbmNvZGVkUGhvbmV0aWNHaXZlbk5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghZmlyc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZCgnICcpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChlbmNvZGVkUGhvbmV0aWNHaXZlbk5hbWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfSVRFTV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0lURU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfRU5EX09GX0xJTkUpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1Vc2VzRGVmYWN0UHJvcGVydHkpIHsKLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkocGhvbmV0aWNHaXZlbk5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiByZWFsbHlVc2VRdW90ZWRQcmludGFibGUgPQotICAgICAgICAgICAgICAgICAgICAobVNob3VsZFVzZVF1b3RlZFByaW50YWJsZSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShwaG9uZXRpY0dpdmVuTmFtZSkpOwotICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkUGhvbmV0aWNHaXZlbk5hbWU7Ci0gICAgICAgICAgICAgICAgaWYgKHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSkgewotICAgICAgICAgICAgICAgICAgICBlbmNvZGVkUGhvbmV0aWNHaXZlbk5hbWUgPSBlbmNvZGVRdW90ZWRQcmludGFibGUocGhvbmV0aWNHaXZlbk5hbWUpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGVuY29kZWRQaG9uZXRpY0dpdmVuTmFtZSA9IGVzY2FwZUNoYXJhY3RlcnMocGhvbmV0aWNHaXZlbk5hbWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfWF9QSE9ORVRJQ19GSVJTVF9OQU1FKTsKLSAgICAgICAgICAgICAgICBpZiAoc2hvdWxkQXBwZW5kQ2hhcnNldFBhcmFtKHBob25ldGljR2l2ZW5OYW1lKSkgewotICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKG1WQ2FyZENoYXJzZXRQYXJhbWV0ZXIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAocmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9QQVJBTV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fRU5DT0RJTkdfUVApOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfREFUQV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChlbmNvZGVkUGhvbmV0aWNHaXZlbk5hbWUpOwotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9FTkRfT0ZfTElORSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHBob25ldGljTWlkZGxlTmFtZSkpIHsKLSAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSA9Ci0gICAgICAgICAgICAgICAgICAgIChtU2hvdWxkVXNlUXVvdGVkUHJpbnRhYmxlICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIVZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKHBob25ldGljTWlkZGxlTmFtZSkpOwotICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkUGhvbmV0aWNNaWRkbGVOYW1lOwotICAgICAgICAgICAgICAgIGlmIChyZWFsbHlVc2VRdW90ZWRQcmludGFibGUpIHsKLSAgICAgICAgICAgICAgICAgICAgZW5jb2RlZFBob25ldGljTWlkZGxlTmFtZSA9IGVuY29kZVF1b3RlZFByaW50YWJsZShwaG9uZXRpY01pZGRsZU5hbWUpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGVuY29kZWRQaG9uZXRpY01pZGRsZU5hbWUgPSBlc2NhcGVDaGFyYWN0ZXJzKHBob25ldGljTWlkZGxlTmFtZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9YX1BIT05FVElDX01JRERMRV9OQU1FKTsKLSAgICAgICAgICAgICAgICBpZiAoc2hvdWxkQXBwZW5kQ2hhcnNldFBhcmFtKHBob25ldGljTWlkZGxlTmFtZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BBUkFNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChtVkNhcmRDaGFyc2V0UGFyYW1ldGVyKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSkgewotICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BBUkFNX0VOQ09ESU5HX1FQKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0RBVEFfU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoZW5jb2RlZFBob25ldGljTWlkZGxlTmFtZSk7Ci0gICAgICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0VORF9PRl9MSU5FKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkocGhvbmV0aWNGYW1pbHlOYW1lKSkgewotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlID0KLSAgICAgICAgICAgICAgICAgICAgKG1TaG91bGRVc2VRdW90ZWRQcmludGFibGUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkocGhvbmV0aWNGYW1pbHlOYW1lKSk7Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRQaG9uZXRpY0ZhbWlseU5hbWU7Ci0gICAgICAgICAgICAgICAgaWYgKHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSkgewotICAgICAgICAgICAgICAgICAgICBlbmNvZGVkUGhvbmV0aWNGYW1pbHlOYW1lID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHBob25ldGljRmFtaWx5TmFtZSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZW5jb2RlZFBob25ldGljRmFtaWx5TmFtZSA9IGV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ICAgZmluYWwgYm9vbGVhbiB1c2VBbmRyb2lkUHJvcGVydHk7Ci0gICAgICAgIGlmIChtSXNWMzApIHsKLSAgICAgICAgICAgIHVzZUFuZHJvaWRQcm9wZXJ0eSA9IGZhbHNlOwotICAgICAgICB9IGVsc2UgaWYgKG1Vc2VzQW5kcm9pZFByb3BlcnR5KSB7Ci0gICAgICAgICAgICB1c2VBbmRyb2lkUHJvcGVydHkgPSB0cnVlOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgLy8gVGhlcmUncyBubyB3YXkgdG8gYWRkIHRoaXMgZmllbGQuCi0gICAgICAgICAgICByZXR1cm4gdGhpczsKLSAgICAgICAgfQotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBuaWNrbmFtZSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoTmlja25hbWUuTkFNRSk7Ci0gICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KG5pY2tuYW1lKSkgewotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHVzZUFuZHJvaWRQcm9wZXJ0eSkgewotICAgICAgICAgICAgICAgICAgICBhcHBlbmRBbmRyb2lkU3BlY2lmaWNQcm9wZXJ0eShOaWNrbmFtZS5DT05URU5UX0lURU1fVFlQRSwgY29udGVudFZhbHVlcyk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYXBwZW5kTGluZVdpdGhDaGFyc2V0QW5kUVBEZXRlY3Rpb24oVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfTklDS05BTUUsIG5pY2tuYW1lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHRoaXM7Ci0gICAgfQotCi0gICAgcHVibGljIFZDYXJkQnVpbGRlciBhcHBlbmRQaG9uZXMoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBib29sZWFuIHBob25lTGluZUV4aXN0cyA9IGZhbHNlOwotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgU2V0PFN0cmluZz4gcGhvbmVTZXQgPSBuZXcgSGFzaFNldDxTdHJpbmc+KCk7Ci0gICAgICAgICAgICBmb3IgKENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNMaXN0KSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgSW50ZWdlciB0eXBlQXNPYmplY3QgPSBjb250ZW50VmFsdWVzLmdldEFzSW50ZWdlcihQaG9uZS5UWVBFKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbGFiZWwgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKFBob25lLkxBQkVMKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIGlzUHJpbWFyeUFzSW50ZWdlciA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKFBob25lLklTX1BSSU1BUlkpOwotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNQcmltYXJ5ID0gKGlzUHJpbWFyeUFzSW50ZWdlciAhPSBudWxsID8KLSAgICAgICAgICAgICAgICAgICAgICAgIChpc1ByaW1hcnlBc0ludGVnZXIgPiAwKSA6IGZhbHNlKTsKLSAgICAgICAgICAgICAgICBTdHJpbmcgcGhvbmVOdW1iZXIgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKFBob25lLk5VTUJFUik7Ci0gICAgICAgICAgICAgICAgaWYgKHBob25lTnVtYmVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgcGhvbmVOdW1iZXIgPSBwaG9uZU51bWJlci50cmltKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShwaG9uZU51bWJlcikpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLy8gUEFHRVIgbnVtYmVyIG5lZWRzIHVuZm9ybWF0dGVkICJwaG9uZSBudW1iZXIiLgotICAgICAgICAgICAgICAgIGZpbmFsIGludCB0eXBlID0gKHR5cGVBc09iamVjdCAhPSBudWxsID8gdHlwZUFzT2JqZWN0IDogREVGQVVMVF9QSE9ORV9UWVBFKTsKLSAgICAgICAgICAgICAgICBpZiAodHlwZSA9PSBQaG9uZS5UWVBFX1BBR0VSIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICBWQ2FyZENvbmZpZy5yZWZyYWluUGhvbmVOdW1iZXJGb3JtYXR0aW5nKG1WQ2FyZFR5cGUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBob25lTGluZUV4aXN0cyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghcGhvbmVTZXQuY29udGFpbnMocGhvbmVOdW1iZXIpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwaG9uZVNldC5hZGQocGhvbmVOdW1iZXIpOwotICAgICAgICAgICAgICAgICAgICAgICAgYXBwZW5kVGVsTGluZSh0eXBlLCBsYWJlbCwgcGhvbmVOdW1iZXIsIGlzUHJpbWFyeSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBmaW5hbCBMaXN0PFN0cmluZz4gcGhvbmVOdW1iZXJMaXN0ID0gc3BsaXRBbmRUcmltUGhvbmVOdW1iZXJzKHBob25lTnVtYmVyKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHBob25lTnVtYmVyTGlzdC5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHBob25lTGluZUV4aXN0cyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIGFjdHVhbFBob25lTnVtYmVyIDogcGhvbmVOdW1iZXJMaXN0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXBob25lU2V0LmNvbnRhaW5zKGFjdHVhbFBob25lTnVtYmVyKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCBmb3JtYXQgPSBWQ2FyZFV0aWxzLmdldFBob25lTnVtYmVyRm9ybWF0KG1WQ2FyZFR5cGUpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBmb3JtYXR0ZWRQaG9uZU51bWJlciA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQaG9uZU51bWJlclV0aWxzLmZvcm1hdE51bWJlcihhY3R1YWxQaG9uZU51bWJlciwgZm9ybWF0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaG9uZVNldC5hZGQoYWN0dWFsUGhvbmVOdW1iZXIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVuZFRlbExpbmUodHlwZSwgbGFiZWwsIGZvcm1hdHRlZFBob25lTnVtYmVyLCBpc1ByaW1hcnkpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9ICAvLyBmb3IgKFN0cmluZyBhY3R1YWxQaG9uZU51bWJlciA6IHBob25lTnVtYmVyTGlzdCkgewotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmICgh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XIuYXBwZW5kKGNoKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoKGNoID09ICc7JyB8fCBjaCA9PSAnXG4nKSAmJiBidWlsZGVyLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgIHBob25lTGlzdC5hZGQoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAoYnVpbGRlci5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgIHBob25lTGlzdC5hZGQoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBwaG9uZUxpc3Q7Ci0gICAgfQotCi0gICAgcHVibGljIFZDYXJkQnVpbGRlciBhcHBlbmRFbWFpbHMoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBib29sZWFuIGVtYWlsQWRkcmVzc0V4aXN0cyA9IGZhbHNlOwotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZmluYWwgU2V0PFN0cmluZz4gYWRkcmVzc1NldCA9IG5ldyBIYXNoU2V0PFN0cmluZz4oKTsKLSAgICAgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgICAgICBTdHJpbmcgZW1haWxBZGRyZXNzID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhFbWFpbC5EQVRBKTsKLSAgICAgICAgICAgICAgICBpZiAoZW1haWxBZGRyZXNzICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgZW1haWxBZGRyZXNzID0gZW1haWxBZGRyZXNzLnRyaW0oKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KGVtYWlsQWRkcmVzcykpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIEludGVnZXIgdHlwZUFzT2JqZWN0ID0gY29udGVudFZhbHVlcy5nZXRBc0ludGVnZXIoRW1haWwuVFlQRSk7Ci0gICAgICAgICAgICAgICAgZmluYWwgaW50IHR5cGUgPSAodHlwZUFzT2JqZWN0ICE9IG51bGwgPwotICAgICAgICAgICAgICAgICAgICAgICAgdHlwZUFzT2JqZWN0IDogREVGQVVMVF9FTUFJTF9UWVBFKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbGFiZWwgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKEVtYWlsLkxBQkVMKTsKLSAgICAgICAgICAgICAgICBJbnRlZ2VyIGlzUHJpbWFyeUFzSW50ZWdlciA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKEVtYWlsLklTX1BSSU1BUlkpOwotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNQcmltYXJ5ID0gKGlzUHJpbWFyeUFzSW50ZWdlciAhPSBudWxsID8KLSAgICAgICAgICAgICAgICAgICAgICAgIChpc1ByaW1hcnlBc0ludGVnZXIgPiAwKSA6IGZhbHNlKTsKLSAgICAgICAgICAgICAgICBlbWFpbEFkZHJlc3NFeGlzdHMgPSB0cnVlOwotICAgICAgICAgICAgICAgIGlmICghYWRkcmVzc1NldC5jb250YWlucyhlbWFpbEFkZHJlc3MpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGFkZHJlc3NTZXQuYWRkKGVtYWlsQWRkcmVzcyk7Ci0gICAgICAgICAgICAgICAgICAgIGFwcGVuZEVtYWlsTGluZSh0eXBlLCBsYWJlbCwgZW1haWxBZGRyZXNzLCBpc1ByaW1hcnkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmICghZW1haWxBZGRyZXNzRXhpc3RzICYmIG1Jc0RvQ29NbykgewotICAgICAgICAgICAgYXBwZW5kRW1haWxMaW5lKEVtYWlsLlRZUEVfSE9NRSwgIiIsICIiLCBmYWxzZSk7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gdGhpczsKLSAgICB9Ci0KLSAgICBwdWJsaWMgVkNhcmRCdWlsZGVyIGFwcGVuZFBvc3RhbHMoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgPT0gbnVsbCB8fCBjb250ZW50VmFsdWVzTGlzdC5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgIGlmIChtSXNEb0NvTW8pIHsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfQURSKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9IT01FKTsKLSAgICAgICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfREFUQV9TRVBBUkFUT1IpOwotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9FTkRfT0ZfTElORSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAobUlzRG9Db01vKSB7Ci0gICAgICAgICAgICAgICAgYXBwZW5kUG9zdGFsc0ZvckRvQ29Nbyhjb250ZW50VmFsdWVzTGlzdCk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGFwcGVuZFBvc3RhbHNGb3JHZW5lcmljKGNvbnRl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F9WQUxVRTsKLSAgICAgICAgQ29udGVudFZhbHVlcyBjdXJyZW50Q29udGVudFZhbHVlcyA9IG51bGw7Ci0gICAgICAgIGZvciAoZmluYWwgQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgIGlmIChjb250ZW50VmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZpbmFsIEludGVnZXIgdHlwZUFzSW50ZWdlciA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKFN0cnVjdHVyZWRQb3N0YWwuVFlQRSk7Ci0gICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIHByaW9yaXR5QXNJbnRlZ2VyID0gc1Bvc3RhbFR5cGVQcmlvcml0eU1hcC5nZXQodHlwZUFzSW50ZWdlcik7Ci0gICAgICAgICAgICBmaW5hbCBpbnQgcHJpb3JpdHkgPQotICAgICAgICAgICAgICAgICAgICAocHJpb3JpdHlBc0ludGVnZXIgIT0gbnVsbCA/IHByaW9yaXR5QXNJbnRlZ2VyIDogSW50ZWdlci5NQVhfVkFMVUUpOwotICAgICAgICAgICAgaWYgKHByaW9yaXR5IDwgY3VycmVudFByaW9yaXR5KSB7Ci0gICAgICAgICAgICAgICAgY3VycmVudFByaW9yaXR5ID0gcHJpb3JpdHk7Ci0gICAgICAgICAgICAgICAgY3VycmVudFR5cGUgPSB0eXBlQXNJbnRlZ2VyOwotICAgICAgICAgICAgICAgIGN1cnJlbnRDb250ZW50VmFsdWVzID0gY29udGVudFZhbHVlczsKLSAgICAgICAgICAgICAgICBpZiAocHJpb3JpdHkgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoY3VycmVudENvbnRlbnRWYWx1ZXMg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AgICBmaW5hbCBTdHJpbmcgZW5jb2RlZExvY2FsaXR5OwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGVuY29kZWRSZWdpb247Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZFBvc3RhbENvZGU7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZENvdW50cnk7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZE5laWdoYm9yaG9vZDsKLQotICAgICAgICAgICAgZmluYWwgU3RyaW5nIHJhd0xvY2FsaXR5MjsKLSAgICAgICAgICAgIC8vIFRoaXMgbG9va3MgaW5lZmZpY2llbnQgc2luY2Ugd2UgZW5jb2RlIHJhd0xvY2FsaXR5IGFuZCByYXdOZWlnaGJvcmhvb2QgdHdpY2UsCi0gICAgICAgICAgICAvLyBidXQgdGhpcyBpcyBpbnRlbnRpb25hbC4KLSAgICAgICAgICAgIC8vCi0gICAgICAgICAgICAvLyBRUCBlbmNvZGluZyBtYXkgYWRkIGxpbmUgZmVlZHMgd2hlbiBuZWVkZWQgYW5kIHRoZSByZXN1bHQgb2YKLSAgICAgICAgICAgIC8vIC0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHJhd0xvY2FsaXR5ICsgIiAiICsgcmF3TmVpZ2hib3Job29kKQotICAgICAgICAgICAgLy8gbWF5IGJlIGRpZmZlcmVudCBmcm9tCi0gICAgICAgICAgICAvLyAtIGVuY29kZWRMb2NhbGl0eSArICIgIiArIGVuY29kZWROZWlnaGJvcmhvb2QuCi0gICAgICAgICAgICAvLwotICAgICAgICAgICAgLy8gV2UgdXNlIHNhZmVyIHdheS4KLSAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShyYXdMb2NhbGl0eSkpIHsKLSAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkocmF3TmVpZ2hib3Job29kKSkgewotICAgICAgICAgICAgICAgICAgICByYXdMb2NhbGl0eTIgPSAiIjsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICByYXdMb2NhbGl0eTIgPSByYXdOZWlnaGJvcmhvb2Q7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkocmF3TmVpZ2hib3Job29kKSkgewotICAgICAgICAgICAgICAgICAgICByYXdMb2NhbGl0eTIgPSByYXdMb2NhbGl0eTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICByYXdMb2NhbGl0eTIgPSByYXdMb2NhbGl0eSArICIgIiArIHJhd05laWdoYm9yaG9vZDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAocmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlKSB7Ci0gICAgICAgICAgICAgICAgZW5jb2RlZFBvQm94ID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHJhd1BvQm94KTsKLSAgICAgICAgICAgICAgICBlbmNvZGVkU3RyZWV0ID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHJhd1N0cmVldCk7Ci0gICAgICAgICAgICAgICAgZW5jb2RlZExvY2FsaXR5ID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHJhd0xvY2FsaXR5Mik7Ci0gICAgICAgICAgICAgICAgZW5jb2RlZFJlZ2lvbiA9IGVuY29kZVF1b3RlZFByaW50YWJsZShyYXdSZWdpb24pOwotICAgICAgICAgICAgICAgIGVuY29kZWRQb3N0YWxDb2RlID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHJhd1Bvc3RhbENvZGUpOwotICAgICAgICAgICAgICAgIGVuY29kZWRDb3VudHJ5ID0gZW5jb2RlUXVvdGVkUHJpbnRhYmxlKHJhd0NvdW50cnkpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAg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fQotICAgICAgICAgICAgZmluYWwgYm9vbGVhbiByZWFsbHlVc2VRdW90ZWRQcmludGFibGUgPQotICAgICAgICAgICAgICAgIChtU2hvdWxkVXNlUXVvdGVkUHJpbnRhYmxlICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlOb25DckxmUHJpbnRhYmxlQXNjaWkocmF3Rm9ybWF0dGVkQWRkcmVzcykpOwotICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBhcHBlbmRDaGFyc2V0ID0KLSAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlQcmludGFibGVBc2NpaShyYXdGb3JtYXR0ZWRBZGRyZXNzKTsKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBlbmNvZGVkRm9ybWF0dGVkQWRkcmVzczsKLSAgICAgICAgICAgIGlmIChyZWFsbHlVc2VRdW90ZWRQcmludGFibGUpIHsKLSAgICAgICAgICAgICAgICBlbmNvZGVkRm9ybWF0dGVkQWRkcmVzcyA9IGVuY29kZVF1b3RlZFByaW50YWJsZShyYXdGb3JtYXR0ZWRBZGRyZXNzKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZW5jb2RlZEZvcm1hdHRlZEFkZHJlc3MgPSBlc2NhcGVDaGFyYWN0ZXJzKHJhd0Zvcm1hdHRlZEFkZHJlc3MpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBXZSB1c2UgdGhlIHNlY29uZCB2YWx1ZSAoIkV4dGVuZGVkIEFkZHJlc3MiKSBqdXN0IGJlY2F1c2UgSmFwYW5lc2UgbW9iaWxlIHBob25lcwotICAgICAgICAgICAgLy8gZG8gc28uIElmIHRoZSBvdGhlciBpbXBvcnRlciBleHBlY3RzIHRoZSB2YWx1ZSBiZSBpbiB0aGUgb3RoZXIgZmllbGQsIHNvbWUgZmxhZyBtYXkKLSAgICAgICAgICAgIC8vIGJlIG5lZWRlZC4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W5hbCBJbnRlZ2VyIHByb3RvY29sQXNPYmplY3QgPSBjb250ZW50VmFsdWVzLmdldEFzSW50ZWdlcihJbS5QUk9UT0NPTCk7Ci0gICAgICAgICAgICAgICAgaWYgKHByb3RvY29sQXNPYmplY3QgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHByb3BlcnR5TmFtZSA9IFZDYXJkVXRpbHMuZ2V0UHJvcGVydHlOYW1lRm9ySW0ocHJvdG9jb2xBc09iamVjdCk7Ci0gICAgICAgICAgICAgICAgaWYgKHByb3BlcnR5TmFtZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBTdHJpbmcgZGF0YSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoSW0uREFUQSk7Ci0gICAgICAgICAgICAgICAgaWYgKGRhdGEgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBkYXRhID0gZGF0YS50cmltKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShkYXRhKSkgewotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHR5cGVBc1N0cmluZzsKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIEludGVnZXIgdHlwZUFzSW50ZWdlciA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKEltLlRZUEUpOwotICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHR5cGVBc0ludGVnZXIgIT0gbnVsbCA/IHR5cGVBc0ludGVnZXIgOiBJbS5UWVBFX09USEVSKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEltLlRZUEVfSE9NRTogewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVBc1N0cmluZyA9IFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfSE9NRTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgSW0uVFlQRV9XT1JLOiB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZUFzU3RyaW5nID0gVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9XT1JLOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBJbS5UWVBFX0NVU1RPTTogewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBsYWJlbCA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoSW0uTEFCRUwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVBc1N0cmluZyA9IChsYWJlbCAhPSBudWxsID8gIlgtIiArIGxhYmVsIDogbnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEltLlRZUEVfT1RIRVI6ICAvLyBJZ25vcmUKLSAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlQXNTdHJpbmcgPSBudWxsOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgIC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ENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNMaXN0KSB7Ci0gICAgICAgICAgICAgICAgU3RyaW5nIHdlYnNpdGUgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKFdlYnNpdGUuVVJMKTsKLSAgICAgICAgICAgICAgICBpZiAod2Vic2l0ZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHdlYnNpdGUgPSB3ZWJzaXRlLnRyaW0oKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvLyBOb3RlOiB2Q2FyZCAzLjAgZG9lcyBub3QgYWxsb3cgYW55IHBhcmFtZXRlciBhZGRpdGlvbiB0b3dhcmQgIlVSTCIKLSAgICAgICAgICAgICAgICAvLyAgICAgICBwcm9wZXJ0eSwgd2hpbGUgdGhlcmUncyBubyBkb2N1bWVudCBpbiB2Q2FyZCAyLjEuCi0gICAgICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eSh3ZWJzaXRlKSkgewotICAgICAgICAgICAgICAgICAgICBhcHBlbmRMaW5lV2l0aENoYXJzZXRBbmRRUERldGVjdGlvbihWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9VUkwsIHdlYnNpdGUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gdGhpczsKLSAgICB9Ci0KLSAgICBwdWJsaWMgVkNhcmRCdWlsZGVyIGFwcGVuZE9yZ2FuaXphdGlvbnMoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICAgICAgICAgIFN0cmluZyBjb21wYW55ID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhPcmdhbml6YXRpb24uQ09NUEFOWSk7Ci0gICAgICAgICAgICAgICAgaWYgKGNvbXBhbnkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjb21wYW55ID0gY29tcGFueS50cmltKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFN0cmluZyBkZXBhcnRtZW50ID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhPcmdhbml6YXRpb24uREVQQVJUTUVOVCk7Ci0gICAgICAgICAgICAgICAgaWYgKGRlcGFydG1lbnQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBkZXBhcnRtZW50ID0gZGVwYXJ0bWVudC50cmltKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFN0cmluZyB0aXRsZSA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNTdHJpbmcoT3JnYW5pemF0aW9uLlRJVExFKTsKLSAgICAgICAgICAgICAgICBpZiAodGl0bGUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnRyaW0oKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIG9yZ0J1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoY29tcGFueSkpIHsKLSAgICAgICAgICAgICAgICAgICAgb3JnQnVpbGRlci5hcHBlbmQoY29tcGFueSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoZGVwYXJ0bWVudCkpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG9yZ0J1aWxkZXIubGVuZ3RoKCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBvcmdCdWlsZGVyLmFwcGVuZCgnOycpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG9yZ0J1aWxkZXIuYXBwZW5kKGRlcGFydG1lbnQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgb3JnbGluZSA9IG9yZ0J1aWxkZXIudG9TdHJpbmcoKTsKLSAgICAgICAgICAgICAgICBhcHBlbmRMaW5lKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX09SRywgb3JnbGluZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seVByaW50YWJsZUFzY2lpKG9yZ2xpbmUpLAotICAgICAgICAgICAgICAgICAgICAgICAgKG1TaG91bGRVc2VRdW90ZWRQcmludGFibGUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIVZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKG9yZ2xpbmUpKSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHRpdGxlKSkgewotICAgICAgICAgICAgICAgICAgICBhcHBlbmRMaW5lKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX1RJVExFLCB0aXRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlQcmludGFibGVBc2NpaSh0aXRsZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1TaG91bGRVc2VRdW90ZWRQcmludGFibGUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaSh0aXRsZSkpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHRoaXM7Ci0gICAgfQotCi0gICAgcHVibGljIFZDYXJkQnVpbGRlciBhcHBlbmRQaG90b3MoZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBpZiAoY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICAgICAgICAgIGlmIChjb250ZW50VmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJ5dGVbXSBkYXRhID0gY29udGVudFZhbHVlcy5nZXRBc0J5dGVBcnJheShQaG90by5QSE9UTyk7Ci0gICAgICAgICAgICAgICAgaWYgKGRhdGEgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHBob3RvVHlwZSA9IFZDYXJkVXRpbHMuZ3Vlc3NJbWFnZVR5cGUoZGF0YSk7Ci0gICAgICAgICAgICAgICAgaWYgKHBob3RvVHlwZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJVbmtub3duIHBob3RvIHR5cGUuIElnbm9yZWQuIik7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgcGhvdG9TdHJpbmcgPSBuZXcgU3RyaW5nKEJhc2U2NC5lbmNvZGVCYXNlNjQoZGF0YSkpOwotICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkocGhvdG9TdHJpbmcpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGFwcGVuZFBob3RvTGluZShwaG90b1N0cmluZywgcGhvdG9UeXBlKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHRoaXM7Ci0gICAgfQotCi0gICAgcHVibGljIFZDYXJkQnVpbGRlciBhcHBlbmROb3RlcyhmaW5hbCBMaXN0PENvbnRlbnRWYWx1ZXM+IGNvbnRlbnRWYWx1ZXNMaXN0KSB7Ci0gICAgICAgIGlmIChjb250ZW50VmFsdWVzTGlzdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBpZiAobU9ubHlPbmVOb3RlRmllbGRJc0F2YWlsYWJsZSkgewotICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZ0J1aWxkZXIgbm90ZUJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgIGJvb2xlYW4gZmlyc3QgPSB0cnVlOwotICAgICAgICAgICAgICAgIGZvciAoZmluYWwgQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIG5vdGUgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKE5vdGUuTk9URSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChub3RlID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5vdGUgPSAiIjsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAobm90ZS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaXJzdCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdGVCdWlsZGVyLmFwcGVuZCgnXG4nKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIG5vdGVCdWlsZGVyLmFwcGVuZChub3RlKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbm90ZVN0ciA9IG5vdGVCdWlsZGVyLnRvU3RyaW5nKCk7Ci0gICAgICAgICAgICAgICAgLy8gVGhpcyBtZWFucyB3ZSBzY2FuIG5vdGVTdHIgY29tcGxldGVseSB0d2ljZSwgd2hpY2ggaXMgcmVkdW5kYW50LgotICAgICAgICAgICAgICAgIC8vIEJ1dCBmb3Igbm93LCB3ZSBhc3N1bWUgdGhpcyBpcyBub3Qgc28gdGltZS1jb25zdW1pbmcuLgotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gc2hvdWxkQXBwZW5kQ2hhcnNldEluZm8gPQotICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlQcmludGFibGVBc2NpaShub3RlU3RyKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAobVNob3VsZFVzZVF1b3RlZFByaW50YWJsZSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShub3RlU3RyKSk7Ci0gICAgICAgICAgICAgICAgYXBwZW5kTGluZShWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9OT1RFLCBub3RlU3RyLAotICAgICAgICAgICAgICAgICAgICAgICAgc2hvdWxkQXBwZW5kQ2hhcnNldEluZm8sIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIG5vdGVTdHIgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKE5vdGUuTk9URSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkobm90ZVN0cikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gc2hvdWxkQXBwZW5kQ2hhcnNldEluZm8gPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhVkNhcmRVdGlscy5jb250YWluc09ubHlQcmludGFibGVBc2NpaShub3RlU3RyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gcmVhbGx5VXNlUXVvdGVkUHJpbnRhYmxlID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1TaG91bGRVc2VRdW90ZWRQcmludGFibGUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShub3RlU3RyKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhcHBlbmRMaW5lKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX05PVEUsIG5vdGVTdHIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3VsZEFwcGVuZENoYXJzZXRJbmZvLCByZWFsbHlVc2VRdW90ZWRQcmludGFibGUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiB0aGlzOwotICAgIH0KLQotICAgIHB1YmxpYyBWQ2FyZEJ1aWxkZXIgYXBwZW5kRXZlbnRzKGZpbmFsIExpc3Q8Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgaWYgKGNvbnRlbnRWYWx1ZXNMaXN0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIFN0cmluZyBwcmltYXJ5QmlydGhkYXkgPSBudWxsOwotICAgICAgICAgICAgU3RyaW5nIHNlY29uZGFyeUJpcnRoZGF5ID0gbnVsbDsKLSAgICAgICAgICAgIGZvciAoZmluYWwgQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzIDogY29udGVudFZhbHVlc0xpc3QpIHsKLSAgICAgICAgICAgICAgICBpZiAoY29udGVudFZhbHVlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIGV2ZW50VHlwZUFzSW50ZWdlciA9IGNvbnRlbnRWYWx1ZXMuZ2V0QXNJbnRlZ2VyKEV2ZW50LlRZUEUpOwotICAgICAgICAgICAgICAgIGZpbmFsIGludCBldmVudFR5cGU7Ci0gICAgICAgICAgICAgICAgaWYgKGV2ZW50VHlwZUFzSW50ZWdlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGV2ZW50VHlwZSA9IGV2ZW50VHlwZUFzSW50ZWdlcjsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBldmVudFR5cGUgPSBFdmVudC5UWVBFX09USEVSOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoZXZlbnRUeXBlID09IEV2ZW50LlRZUEVfQklSVEhEQVkpIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGJpcnRoZGF5Q2FuZGlkYXRlID0gY29udGVudFZhbHVlcy5nZXRBc1N0cmluZyhFdmVudC5TVEFSVF9EQVRFKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGJpcnRoZGF5Q2FuZGlkYXRlID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIEludGVnZXIgaXNTdXBlclByaW1hcnlBc0ludGVnZXIgPQotICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlcy5nZXRBc0ludGVnZXIoRXZlbnQuSVNfU1VQRVJfUFJJTUFSWSk7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNTdXBlclByaW1hcnkgPSAoaXNTdXBlclByaW1hcnlBc0ludGVnZXIgIT0gbnVsbCA/Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGlzU3VwZXJQcmltYXJ5QXNJbnRlZ2VyID4gMCkgOiBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChpc1N1cGVyUHJpbWFyeSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gInN1cGVyIHByaW1hcnkiIGJpcnRoZGF5IHNob3VsZCB0aGUgcHJlZmVyZWQgb25lLgotICAgICAgICAgICAgICAgICAgICAgICAgcHJpbWFyeUJpcnRoZGF5ID0gYmlydGhkYXlDYW5kaWRhdGU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIGlzUHJpbWFyeUFzSW50ZWdlciA9Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50VmFsdWVzLmdldEFzSW50ZWdlcihFdmVudC5JU19QUklNQVJZKTsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBpc1ByaW1hcnkgPSAoaXNQcmltYXJ5QXNJbnRlZ2VyICE9IG51bGwgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpc1ByaW1hcnlBc0ludGVnZXIgPiAwKSA6IGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGlzUHJpbWFyeSkgewotICAgICAgICAgICAgICAgICAgICAgICA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GwpewotICAgICAgICAgICAgICAgIGFwcGVuZExpbmVXaXRoQ2hhcnNldEFuZFFQRGV0ZWN0aW9uKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX0JEQVksCi0gICAgICAgICAgICAgICAgICAgICAgICBzZWNvbmRhcnlCaXJ0aGRheS50cmltKCkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiB0aGlzOwotICAgIH0KLQotICAgIHB1YmxpYyBWQ2FyZEJ1aWxkZXIgYXBwZW5kUmVsYXRpb24oZmluYWwgTGlzdDxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICBpZiAobVVzZXNBbmRyb2lkUHJvcGVydHkgJiYgY29udGVudFZhbHVlc0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChmaW5hbCBDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzTGlzdCkgewotICAgICAgICAgICAgICAgIGlmIChjb250ZW50VmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGFwcGVuZEFuZHJvaWRTcGVjaWZpY1Byb3BlcnR5KFJlbGF0aW9uLkNPTlRFTlRfSVRFTV9UWVBFLCBjb250ZW50VmFsdWVzKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gdGhpczsKLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCBhcHBlbmRQb3N0YWxMaW5lKGZpbmFsIGludCB0eXBlLCBmaW5hbCBTdHJpbmcgbGFiZWwsCi0gICAgICAgICAgICBmaW5hbCBDb250ZW50VmFsdWVzIGNvbnRlbnRWYWx1ZXMsCi0gICAgICAgICAgICBmaW5hbCBib29sZWFuIGlzUHJpbWFyeSwgZmluYWwgYm9vbGVhbiBlbWl0TGluZUV2ZXJ5VGltZSkgewotICAgICAgICBmaW5hbCBib29sZWFuIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZTsKLSAgICAgICAgZmluYWwgYm9vbGVhbiBhcHBlbmRDaGFyc2V0OwotICAgICAgICBmaW5hbCBTdHJpbmcgYWRkcmVzc1ZhbHVlOwotICAgICAgICB7Ci0gICAgICAgICAgICBQb3N0YWxTdHJ1Y3QgcG9zdGFsU3RydWN0ID0gdHJ5Q29uc3RydWN0UG9zdGFsU3RydWN0KGNvbnRlbnRWYWx1ZXMpOwotICAgICAgICAgICAgaWYgKHBvc3RhbFN0cnVjdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGVtaXRMaW5lRXZlcnlUaW1lKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBhcHBlbmRDaGFyc2V0ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIGFkZHJlc3NWYWx1ZSA9ICIiOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJlYWxseVVzZVF1b3RlZFByaW50YWJsZSA9IHBvc3RhbFN0cnVjdC5yZWFsbHlVc2VRdW90ZWRQcmludGFibGU7Ci0gICAgICAgICAgICAgICAgYXBwZW5kQ2hhcnNldCA9IHBvc3RhbFN0cnVjdC5hcHBlbmRDaGFyc2V0OwotICAgICAgICAgICAgICAgIGFkZHJlc3NWYWx1ZSA9IHBvc3RhbFN0cnVjdC5hZGRyZXNzRGF0YTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIExpc3Q8U3RyaW5nPiBwYXJhbWV0ZXJMaXN0ID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7Ci0gICAgICAgIGlmIChpc1ByaW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ICAgLy8gQWxzbyBjaGVja3MgdGhlIGxhYmVsIG9iZXlzIHdpdGggdkNhcmQgMy4wIHNwZWMuCi0gICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKCJYLSIgKyBsYWJlbCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBTdHJ1Y3R1cmVkUG9zdGFsLlRZUEVfT1RIRVI6IHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGRlZmF1bHQ6IHsKLSAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiVW5rbm93biBTdHJ1Y3R1cmVkUG9zdGFsIHR5cGU6ICIgKyB0eXBlKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9BRFIpOwotICAgICAgICBpZiAoIXBhcmFtZXRlckxpc3QuaXNFbXB0eSgpKSB7Ci0gICAgICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNBUkRfUEFSQU1fU0VQQVJBVE9SKTsKLSAgICAgICAgICAgIGFwcGVuZFR5cGVQYXJhbWV0ZXJzKHBhcmFtZXRlckxpc3QpOwotICAgICAgICB9Ci0gICAgICAgIGlmIChhcHBlbmRDaGFyc2V0KSB7Ci0gICAgICAgICAgICAvLyBTdHJpY3RseSwgdkNhcmQgMy4wIGRvZXMgbm90IGFsbG93IGV4cG9ydGVycyB0byBlbWl0IGNoYXJzZXQgaW5mb3JtYXRpb24sCi0gICAgICAgICAgICAvLyBidXQgd2Ugd2lsbCBhZGQgaXQgc2luY2UgdGhlIGluZm9ybWF0aW9uIHNob3VsZCBiZSB1c2VmdWwgZm9yIGltcG9ydGVycywKLSAgICAgICAgICAgIC8vCi0gICAg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UFzU3RyaW5nID0gVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9DRUxMOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIVRleHRVdGlscy5pc0VtcHR5KGxhYmVsKQotICAgICAgICAgICAgICAgICAgICAgICAgJiYgVkNhcmRVdGlscy5jb250YWluc09ubHlBbHBoYURpZ2l0SHlwaGVuKGxhYmVsKSkgewotICAgICAgICAgICAgICAgICAgICB0eXBlQXNTdHJpbmcgPSAiWC0iICsgbGFiZWw7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgdHlwZUFzU3RyaW5nID0gbnVsbDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIEVtYWlsLlRZUEVfSE9NRTogewotICAgICAgICAgICAgICAgIHR5cGVBc1N0cmluZyA9IFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfSE9NRTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgRW1haWwuVFlQRV9XT1JLOiB7Ci0gICAgICAgICAgICAgICAgdHlwZUFzU3RyaW5nID0gVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9XT1JLOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBFbWFpbC5UWVBFX09USEVSOiB7Ci0gICAgICAgICAgICAgICAgdHlwZUFzU3RyaW5nID0gbnVsbDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgRW1haWwuVFlQRV9NT0JJTEU6IHsKLSAgICAgICAgICAgICAgICB0eXBlQXNTdHJpbmcgPSBWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0NFTEw7Ci0gICAgICAgICAgICAgICAgYnJlYWs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V9TRVBBUkFUT1IpOwotCi0gICAgICAgIGZpbmFsIGludCB0eXBlOwotICAgICAgICBpZiAodHlwZUFzSW50ZWdlciA9PSBudWxsKSB7Ci0gICAgICAgICAgICB0eXBlID0gUGhvbmUuVFlQRV9PVEhFUjsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHR5cGUgPSB0eXBlQXNJbnRlZ2VyOwotICAgICAgICB9Ci0KLSAgICAgICAgQXJyYXlMaXN0PFN0cmluZz4gcGFyYW1ldGVyTGlzdCA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOwotICAgICAgICBzd2l0Y2ggKHR5cGUpIHsKLSAgICAgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9IT01FOiB7Ci0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGRBbGwoCi0gICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfSE9NRSkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX1dPUks6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZEFsbCgKLSAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9XT1JLKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfRkFYX0hPTUU6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZEFsbCgKLSAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9IT01FLCBWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0ZBWCkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX0ZBWF9XT1JLOiB7Ci0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGRBbGwoCi0gICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfV09SSywgVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9GQVgpKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9NT0JJTEU6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0NFTEwpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX1BBR0VSOiB7Ci0gICAgICAgICAgICAgICAgaWYgKG1Jc0RvQ29NbykgewotICAgICAgICAgICAgICAgICAgICAvLyBOb3Qgc3VyZSBhYm91dCB0aGUgcmVhc29uLCBidXQgcHJldmlvdXMgaW1wbGVtZW50YXRpb24gaGFkCi0gICAgICAgICAgICAgICAgICAgIC8vIHVzZWQgIlZPSUNFIiBpbnN0ZWFkIG9mICJQQUdFUiIKLSAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9WT0lDRSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9QQUdFUik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX09USEVSOiB7Ci0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9WT0lDRSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfQ0FSOiB7Ci0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9DQVIpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX0NPTVBBTllfTUFJTjogewotICAgICAgICAgICAgICAgIC8vIFRoZXJlJ3Mgbm8gcmVsZXZhbnQgZmllbGQgaW4gdkNhcmQgKGF0IGxlYXN0IDIuMSkuCi0gICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9XT1JLKTsKLSAgICAgICAgICAgICAgICBpc1ByaW1hcnkgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX0lTRE46IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0lTRE4pOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX01BSU46IHsKLSAgICAgICAgICAgICAgICBpc1ByaW1hcnkgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX09USEVSX0ZBWDogewotICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfRkFYKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9URUxFWDogewotICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfVExYKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9XT1JLX01PQklMRTogewotICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkQWxsKAotICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1dPUkssIFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfQ0VMTCkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBQaG9uZS5UWVBFX1dPUktfUEFHRVI6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1dPUkspOwotICAgICAgICAgICAgICAgIC8vIFNlZSBhYm92ZS4KLSAgICAgICAgICAgICAgICBpZiAobUlzRG9Db01vKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfVk9JQ0UpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfUEFHRVIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgUGhvbmUuVFlQRV9NTVM6IHsKLSAgICAgICAgICAgICAgICBwYXJhbWV0ZXJMaXN0LmFkZChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX01TRyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfQ1VTVE9NOiB7Ci0gICAgICAgICAgICAgICAgaWYgKFRleHRVdGlscy5pc0VtcHR5KGxhYmVsKSkgewotICAgICAgICAgICAgICAgICAgICAvLyBKdXN0IGlnbm9yZSB0aGUgY3VzdG9tIHR5cGUuCi0gICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfVk9JQ0UpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoVkNhcmRVdGlscy5pc01vYmlsZVBob25lTGFiZWwobGFiZWwpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfQ0VMTCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIHVwcGVyTGFiZWwgPSBsYWJlbC50b1VwcGVyQ2FzZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAoVkNhcmRVdGlscy5pc1ZhbGlkSW5WMjFCdXRVbmtub3duVG9Db250YWN0c1Bob3RlVHlwZSh1cHBlckxhYmVsKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVyTGlzdC5hZGQodXBwZXJMYWJlbCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoVkNhcmRVdGlscy5jb250YWluc09ubHlBbHBoYURpZ2l0SHlwaGVuKGxhYmVsKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gTm90ZTogU3RyaWN0bHksIHZDYXJkIDIuMSBkb2VzIG5vdCBhbGxvdyAiWC0iIHBhcmFtZXRlciB3aXRob3V0Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAiVFlQRT0iIHN0cmluZy4KLSAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKCJYLSIgKyBsYWJlbCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfUkFESU86Ci0gICAgICAgICAgICBjYXNlIFBob25lLlRZUEVfVFRZX1RERDoKLSAgICAgICAgICAgIGRlZmF1bHQ6IHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChpc1ByaW1hcnkpIHsKLSAgICAgICAgICAgIHBhcmFtZXRlckxpc3QuYWRkKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfUFJFRik7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAocGFyYW1ldGVyTGlzdC5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgIGFwcGVuZFVuY29tbW9uUGhvbmVUeXBlKG1CdWlsZGVyLCB0eXBlKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGFwcGVuZFR5cGVQYXJhbWV0ZXJzKHBhcmFtZXRlckxpc3QpOwotICAgICAgICB9Ci0KLSAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0RBVEFfU0VQQVJBVE9SKTsKLSAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKGVuY29kZWRWYWx1ZSk7Ci0gICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9FTkRfT0ZfTElORSk7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogQXBwZW5kcyBwaG9uZSB0eXBlIHN0cmluZyB3aGljaCBtYXkgbm90IGJlIGF2YW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AgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgICAgICBmaW5hbCBMaXN0PFN0cmluZz4gcmF3VmFsdWVMaXN0ID0gbmV3IEFycmF5TGlzdDxTdHJpbmc+KCk7Ci0gICAgICAgIGZvciAoaW50IGkgPSAxOyBpIDw9IFZDYXJkQ29uc3RhbnRzLk1BWF9EQVRBX0NPTFVNTjsgaSsrKSB7Ci0gICAgICAgICAgICBTdHJpbmcgdmFsdWUgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKCJkYXRhIiArIGkpOwotICAgICAgICAgICAgaWYgKHZhbHVlID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICB2YWx1ZSA9ICIiOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmF3VmFsdWVMaXN0LmFkZCh2YWx1ZSk7Ci0gICAgICAgIH0KLQotICAgICAgICBib29sZWFuIG5lZWRDaGFyc2V0ID0KLSAgICAgICAgICAgIChtU2hvdWxkQXBwZW5kQ2hhcnNldFBhcmFtICYmCi0gICAgICAgICAgICAgICAgICAgICFWQ2FyZFV0aWxzLmNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShyYXdWYWx1ZUxpc3QpKTsKLSAgICAgICAgYm9vbGVhbiByZWFsbHlVc2VRdW90ZWRQcmludGFibGUgPQotICAgICAgICAgICAgKG1TaG91bGRVc2VRdW90ZWRQcmludGFibGUgJiYKLSAgICAgICAgICAgICAgICAgICAgIVZDYXJkVXRpbHMuY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKHJhd1ZhbHVlTGlzdCkpOwotICAgICAgICBtQnVpbGRlci5hcHBlbmQoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfWF9BTkRST0lEX0NVU1RPTSk7Ci0gICAgICAgIGlmIChuZWVkQ2hhcnNldCkgewotICAgICAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX1BBUkFNX1NFUEFSQVRPUik7Ci0gICAgICAgICAgICBt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ApOwotICAgICAgICB9Ci0KLSAgICAgICAgbUJ1aWxkZXIuYXBwZW5kKFZDQVJEX0RBVEFfU0VQQVJBVE9SKTsKLSAgICAgICAgYm9vbGVhbiBmaXJzdCA9IHRydWU7Ci0gICAgICAgIGZvciAoU3RyaW5nIHJhd1ZhbHVlIDogcmF3VmFsdWVMaXN0KSB7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgZW5jb2RlZFZhbHVlOwotICAgICAgICAgICAgaWYgKG5lZWRRdW90ZWRQcmludGFibGUpIHsKLSAgICAgICAgICAgICAgICBlbmNvZGVkVmFsdWUgPSBlbmNvZGVRdW90ZWRQcmludGFibGUocmF3VmFsdWUpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBUT0RPOiBvbmUgbGluZSBtYXkgYmUgdG9vIGh1Z2UsIHdoaWNoIG1heSBiZSBpbnZhbGlkIGluIHZDYXJkIDMuMAotICAgICAgICAgICAgICAgIC8vICAgICAgICAod2hpY2ggc2F5cyAiV2hlbiBnZW5lcmF0aW5nIGEgY29udGVudCBsaW5lLCBsaW5lcyBsb25nZXIgdGhhbgotICAgICAgICAgICAgICAgIC8vICAgICAgICA3NSBjaGFyYWN0ZXJzIFNIT1VMRCBiZSBmb2xkZWQiKSwgdGhvdWdoIHNldmVyYWwKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgKGV2ZW4gd2VsbC1rbm93bikgYXBwbGljYXRpb25zIGRvIG5vdCBjYXJlIHRoaXMuCi0gICAgICAgICAgICAgICAgZW5jb2RlZFZhbHVlID0gZXNjYXBlQ2hhcmFjdGVycyhyYXdWYWx1ZSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChmaXJzdCkgewotICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG1CdWlsZGVyLmFwcGVuZChWQ0FSRF9JVEVNX1NFUEFSQ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W5hbCBjaGFyIGNoID0gdW5lc2NhcGVkLmNoYXJBdChpKTsKLSAgICAgICAgICAgIHN3aXRjaCAoY2gpIHsKLSAgICAgICAgICAgICAgICBjYXNlICc7JzogewotICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZCgnXFwnKTsKLSAgICAgICAgICAgICAgICAgICAgdG1wQnVpbGRlci5hcHBlbmQoJzsnKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhc2UgJ1xyJzogewotICAgICAgICAgICAgICAgICAgICBpZiAoaSArIDEgPCBsZW5ndGgpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgbmV4dENoYXIgPSB1bmVzY2FwZWQuY2hhckF0KGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRDaGFyID09ICdcbicpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2gKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjYXNlICdcbic6IHsKLSAgICAgICAgICAgICAgICAgICAgLy8gSW4gdkNhcmQgMi4xLCB0aGVyZSdzIG5vIHNwZWNpZmljYXRpb24gYWJvdXQgdGhpcywgd2hpbGUKLSAgICAgICAgICAgICAgICAgICAgLy8gdkNhcmQgMy4wIGV4cGxpY2l0bHkgcmVxdWlyZXMgdGhpcyBzaG91bGQgYmUgZW5jb2RlZCB0byAiXG4iLgotICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZCgiXFxuIik7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjYXNlICdcXCc6IHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1Jc1YzMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgdG1wQnVpbGRlci5hcHBlbmQoIlxcXFwiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoCi0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgY2FzZSAnPCc6Ci0gICAgICAgICAgICAgICAgY2FzZSAnPic6IHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1Jc0RvQ29NbykgewotICAgICAgICAgICAgICAgICAgICAgICAgdG1wQnVpbGRlci5hcHBlbmQoJ1xcJyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZChjaCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZChjaCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhc2UgJywnOiB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtSXNWMzApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcEJ1aWxkZXIuYXBwZW5kKCJcXCwiKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcEJ1aWxkZXIuYXBwZW5kKGNoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZGVmYXVsdDogewotICAgICAgICAgICAgICAgICAgICB0bXBCdWlsZGVyLmFwcGVuZChjaCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gdG1wQnVpbGRlci50b1N0cmluZygpOwotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7Ci0gICAgICAgIGlmICghbUVuZEFwcGVuZGVkKSB7Ci0gICAgICAgICAgICBpZiAobUlzRG9Db01vKSB7Ci0gICAgICAgICAgICAgICAgYXBwZW5kTGluZShWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9YX0NMQVNTLCBWQ0FSRF9EQVRBX1BVQkxJQyk7Ci0gICAgICAgICAgICAgICAgYXBwZW5kTGluZShWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9YX1JFRFVDVElPTiwgIiIpOwotICAgICAgICAgICAgICAgIGFwcGVuZExpbmUoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfWF9OTywgIiIpOwotICAgICAgICAgICAgICAgIGFwcGVuZExpbmUoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfWF9EQ01fSE1OX01PREUsICIiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGFwcGVuZExpbmUoVkNhcmRDb25zdGFudHMuUFJPUEVSVFlfRU5ELCBWQ0FSRF9EQVRBX1ZDQVJEKTsKLSAgICAgICAgICAgIG1FbmRBcHBlbmRlZCA9IHRydWU7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIG1CdWlsZGVyLnRvU3RyaW5nKCk7Ci0gICAgfQotfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvcGltL3ZjYXJkL1ZDYXJkQ29tcG9zZXIuam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gICAgY29tcG9zZXIuYWRkSGFuZGxlcigKLSAqICAgICAgICAgICAgIGNvbXBvc2VyLm5ldyBIYW5kbGVyRm9yT3V0cHV0U3RyZWFtKG91dHB1dFN0cmVhbSkpOwotICogICAgIGlmICghY29tcG9zZXIuaW5pdCgpKSB7Ci0gKiAgICAgICAgIC8vIERvIHNvbWV0aGluZyBoYW5kbGluZyB0aGUgc2l0dWF0aW9uLgotICogICAgICAgICByZXR1cm47Ci0gKiAgICAgfQotICogICAgIHdoaWxlICghY29tcG9zZXIuaXNBZnRlckxhc3QoKSkgewotICogICAgICAgICBpZiAobUNhbmNlbGVkKSB7Ci0gKiAgICAgICAgICAgICAvLyBBc3N1bWUgYSB1c2VyIG1heSBjYW5jZWwgdGhpcyBvcGVyYXRpb24gZHVyaW5nIHRoZSBleHBvcnQuCi0gKiAgICAgICAgICAgICByZXR1cm47Ci0gKiAgICAgICAgIH0KLSAqICAgICAgICAgaWYgKCFjb21wb3Nlci5jcmVhdGVPbmVFbnRyeSgpKSB7Ci0gKiAgICAgICAgICAgICAvLyBEbyBzb21ldGhpbmcgaGFuZGxpbmcgdGhlIGVycm9yIHNpdHVhdGlvbi4KLSAqICAgICAgICAgICAgIHJldHVybjsKLSAqICAgICAgICAgfQotICogICAgIH0KLSAqIH0gZmluYWxseSB7Ci0gKiAgICAgaWYgKGNvbXBvc2VyICE9IG51bGwpIHsKLSAqICAgICAgICAgY29tcG9zZXIudGVybWluYXRlKCk7Ci0gKiAgICAgfQotICogfSA8L3ByZT4KLSAqLwotcHVibGljIGNsYXNzIFZDYXJkQ29tcG9zZXIgewotICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyBMT0dfVEFHID0gIlZDYXJkQ29tcG9zZXIiOwotCi0gICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgREVGQVVMVF9QSE9ORV9UWVBFID0gUGhvbmUuVFlQRV9IT01FOwotICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IERFRkFVT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FHLCAiVW5zdXBwb3J0ZWQgY2hhcnNldDogIiArIG1DaGFyc2V0U3RyaW5nKTsKLSAgICAgICAgICAgICAgICBtRXJyb3JSZWFzb24gPSAiRW5jb2RpbmcgaXMgbm90IHN1cHBvcnRlZCAodXN1YWxseSB0aGlzIGRvZXMgbm90IGhhcHBlbiEpOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICArIG1DaGFyc2V0U3RyaW5nOwotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1Jc0RvQ29NbykgewotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBvbmUgZW1wdHkgZW50cnkuCi0gICAgICAgICAgICAgICAgICAgIG1Xcml0ZXIud3JpdGUoY3JlYXRlT25lRW50cnlJbnRlcm5hbCgiLTEiLCBudWxsKSk7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoVkNhcmRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiVkNhcmRFeGNlcHRpb24gaGFzIGJlZW4gdGhyb3duIGR1cmluZyBvbiBJbml0KCk6ICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUuZ2V0TWVzc2FnZSgpKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSU9FeGNlcHRpb24gb2NjdXJyZWQgZHVyaW5nIGV4cG9ydE9uZUNvbnRhY3REYXRhOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGUuZ2V0TWVzc2FnZSgpKTsKLSAgICAgICAgICAgICAgICAgICAgbUVycm9yUmVhc29uID0gIklPRXhjZXB0aW9uIG9jY3VycmVkOiAiICsgZS5nZXRNZXNzYWdlKCk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBib29sZWFuIG9uRW50cnlDcmVhdGVkKFN0cmluZyB2Y2FyZCkgewotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBtV3JpdGVyLndyaXRlKHZjYXJkKTsKLSAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgIklPRXhjZXB0aW9uIG9jY3VycmVkIGR1cmluZyBleHBvcnRPbmVDb250YWN0RGF0YTogIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGUuZ2V0TWVzc2FnZSgpKTsKLSAgICAgICAgICAgICAgICBtRXJyb3JSZWFzb24gPSAiSU9FeGNlcHRpb24gb2NjdXJyZWQ6ICIgKyBlLmdldE1lc3NhZ2UoKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIG9uVGVybWluYXRlKCkgewotICAgICAgICAgICAgbU9uVGVybWluYXRlSXNDYWxsZWQgPSB0cnVlOwotICAgICAgICAgICAgaWYgKG1Xcml0ZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIEZsdXNoIGFuZCBzeW5jIHRoZSBkYXRhIHNvIHRoYXQgYSB1c2VyIGlzIGFibGUgdG8gcHVsbAotICAgICAgICAgICAgICAgICAgICAvLyB0aGUgU0RDYXJkIGp1c3QgYWZ0ZXIKLSAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGV4cG9ydC4KLSAgICAgICAgICAgICAgICAgICAgbVdyaXRlci5mbHVzaCgpOwotICAgICAgICAgICAgICAgICAgICBpZiAobU91dHB1dFN0cmVhbSAhPSBudWxsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbU91dHB1dFN0cmVhbSBpbnN0YW5jZW9mIEZpbGVPdXRwdXRTdHJlYW0pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKEZpbGVPdXRwdXRTdHJlYW0pIG1PdXRwdXRTdHJlYW0pLmdldEZEKCkuc3luYygpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZChMT0dfVEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJJT0V4Y2VwdGlvbiBkdXJpbmcgY2xvc2luZyB0aGUgb3V0cHV0IHN0cmVhbTogIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBlLmdldE1lc3NhZ2UoKSk7Ci0gICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Xcml0ZXIuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyB2b2lkIGZpbmFsaXplKCkgewotICAgICAgICAgICAgaWYgKCFtT25UZXJtaW5hdGVJc0NhbGxlZCkgewotICAgICAgICAgICAgICAgIG9uVGVybWluYXRlKCk7Ci0gICAgIC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gZmluYWwgU3RyaW5nIHNvcnRPcmRlcikgewotICAgICAgICBpZiAoY29udGVudFVyaSA9PSBudWxsKSB7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobUNhcmVIYW5kbGVyRXJyb3JzKSB7Ci0gICAgICAgICAgICBMaXN0PE9uZUVudHJ5SGFuZGxlcj4gZmluaXNoZWRMaXN0ID0gbmV3IEFycmF5TGlzdDxPbmVFbnRyeUhhbmRsZXI+KAotICAgICAgICAgICAgICAgICAgICBtSGFuZGxlckxpc3Quc2l6ZSgpKTsKLSAgICAgICAgICAgIGZvciAoT25lRW50cnlIYW5kbGVyIGhhbmRsZXIgOiBtSGFuZGxlckxpc3QpIHsKLSAgICAgICAgICAgICAgICBpZiAoIWhhbmRsZXIub25Jbml0KG1Db250ZXh0KSkgewotICAgICAgICAgICAgICAgICAgICBmb3IgKE9uZUVudHJ5SGFuZGxlciBmaW5pc2hlZCA6IGZpbmlzaGVkTGlzdCkgewotICAgICAgICAgICAgICAgICAgICAgICAgZmluaXNoZWQub25UZXJtaW5hdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgLy8gSnVzdCBpZ25vcmUgdGhlIGZhbHNlIHJldHVybmVkIGZyb20gb25Jbml0KCkuCi0gICAgICAgICAgICBmb3IgKE9uZUVudHJ5SGFuZGxlciBoYW5kbGVyIDogbUhhbmRsZXJMaXN0KSB7Ci0gICAgICAgICAgICAgICAgaGFuZGxlci5vbkluaXQobUNvbnRleHQpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgZmluYWwgU3RyaW5nW10gcHJvamVjdGlvbjsKLSAgICAgICAgaWYgKENvbnRhY3RzLkNPTlRFTlRfVVJJLmVxdWFscyhjb250Z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8T25lRW50cnlIYW5kbGVyPigKLSAgICAgICAgICAgICAgICAgICAgbUhhbmRsZXJMaXN0LnNpemUoKSk7Ci0gICAgICAgICAgICBmb3IgKE9uZUVudHJ5SGFuZGxlciBoYW5kbGVyIDogbUhhbmRsZXJMaXN0KSB7Ci0gICAgICAgICAgICAgICAgaWYgKCFoYW5kbGVyLm9uRW50cnlDcmVhdGVkKHZjYXJkKSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZm9yIChPbmVFbnRyeUhhbmRsZXIgaGFuZGxlciA6IG1IYW5kbGVyTGlzdCkgewotICAgICAgICAgICAgICAgIGhhbmRsZXIub25FbnRyeUNyZWF0ZWQodmNhcmQpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBTdHJpbmcgY3JlYXRlT25lRW50cnlJbnRlcm5hbChmaW5hbCBTdHJpbmcgY29udGFjdElkLAotICAgICAgICAgICAgTWV0aG9kIGdldEVudGl0eUl0ZXJhdG9yTWV0aG9kKSB0aHJvd3MgVkNhcmRFeGNlcHRpb24gewotICAgICAgICBmaW5hbCBNYXA8U3RyaW5nLCBMaXN0PENvbnRlbnRWYWx1ZXM+PiBjb250ZW50VmFsdWVzTGlzdE1hcCA9Ci0gICAgICAgICAgICAgICAgbmV3IEhhc2hNYXA8U3RyaW5nLCBMaXN0PENvbnRlbnRWYWx1ZXM+PigpOwotICAgICAgICAvLyBUaGUgcmVzb2x2ZXIgbWF5IHJldHVybiB0aGUgZW50aXR5IGl0ZXJhdG9yIHdpdGggbm8gZGF0YS4gSXQgaXMgcG9zc2libGUuCi0gICAgICAgIC8vIGUuZy4gSWYgYWxsIHRoZSBkYXRhIGluIHRoZSBjb250YWN0IG9mIHRoZSBnaXZlbiBjb250YWN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ICB9IGNhdGNoIChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIGhhcyBiZWVuIHRocm93bjogIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5nZXRNZXNzYWdlKCkpOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBY2Nlc3NFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiSWxsZWdhbEFjY2Vzc0V4Y2VwdGlvbiBoYXMgYmVlbiB0aHJvd246ICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUuZ2V0TWVzc2FnZSgpKTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnZvY2F0aW9uVGFyZ2V0RXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkludm9jYXRpb25UYXJnZXRFeGNlcHRpb24gaGFzIGJlZW4gdGhyb3duOiAiKTsKLSAgICAgICAgICAgICAgICAgICAgU3RhY2tUcmFjZUVsZW1lbnRbXSBzdGFja1RyYWNlRWxlbWVudHMgPSBlLmdldENhdXNlKCkuZ2V0U3RhY2tUcmFjZSgpOwotICAgICAgICAgICAgICAgICAgICBmb3IgKFN0YWNrVHJhY2VFbGVtZW50IGVsZW1lbnQgOiBzdGFja1RyYWNlRWxlbWVudHMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICIgICAgYXQgIiArIGVsZW1lbnQudG9TdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKCJJbnZvY2F0aW9uVGFyZ2V0RXhjZXB0aW9uIGhhcyBiZWVuIHRocm93bjogIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5nZXRDYXVzZSgpLmdldE1lc3NhZ2UoKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBlbnRpdHlJdGVyYXRvciA9IFJhd0NvbnRhY3RzLm5ld0VudGl0eUl0ZXJhdG9yKG1Db250ZW50UmVzb2x2ZXIucXVlcnkoCi0gICAgICAgICAgICAgICAgICAgICAgICB1cmksIG51bGwsIHNlbGVjdGlvbiwgc2VsZWN0aW9uQXJncywgbnVsbCkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoZW50aXR5SXRlcmF0b3IgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJFbnRpdHlJdGVyYXRvciBpcyBudWxsIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuICIiOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIWVudGl0eUl0ZXJhdG9yLmhhc05leHQoKSkgewotICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJEYXRhIGRvZXMgbm90IGV4aXN0LiBjb250YWN0SWQ6ICIgKyBjb250YWN0SWQpOwotICAgICAgICAgICAgICAgIHJldHVybiAiIjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgd2hpbGUgKGVudGl0eUl0ZXJhdG9yLmhhc05leHQoKSkgewotICAgICAgICAgICAgICAgIEVudGl0eSBlbnRpdHkgPSBlbnRpdHlJdGVyYXRvci5uZXh0KCk7Ci0gICAgICAgICAgICAgICAgZm9yIChOYW1lZENvbnRlbnRWYWx1ZXMgbmFtZWRDb250ZW50VmFsdWVzIDogZW50aXR5LmdldFN1YlZhbHVlcygpKSB7Ci0gICAgICAgICAgICAgICAgICAgIENvbnRlbnRWYWx1ZXMgY29udGVudFZhbHVlcyA9IG5hbWVkQ29udGVudFZhbHVlcy52YWx1ZXM7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBrZXkgPSBjb250ZW50VmFsdWVzLmdldEFzU3RyaW5nKERhdGEuTUlNRVRZUEUpOwotICAgICAgICAgICAgICAgICAgICBpZiAoa2V5ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExpc3Q8Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0xpc3QgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50VmFsdWVzTGlzdE1hcC5nZXQoa2V5KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb250ZW50VmFsdWVzTGlzdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlc0xpc3QgPSBuZXcgQXJyYXlMaXN0PENvbnRlbnRWYWx1ZXM+KCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlc0xpc3RNYXAucHV0KGtleSwgY29udGVudFZhbHVlc0xpc3QpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlc0xpc3QuYWRkKGNvbnRlbnRWYWx1ZXMpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgaWYgKGVudGl0eUl0ZXJhdG9yICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBlbnRpdHlJdGVyYXRvci5jbG9zZSgpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgZmluYWwgVkNhcmRCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgVkNhcmRCdWlsZGVyKG1WQ2FyZFR5cGUpOwotICAgICAgICBidWlsZGVyLmFwcGVuZE5hbWVQcm9wZXJ0aWVzKGNvbnRlbnRWYWx1ZXNMaXN0TWFwLmdldChTdHJ1Y3R1cmVkTmFtZS5DT05URU5UX0lURU1fV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ZXNMaXN0TWFwLmdldChFdmVudC5DT05URU5UX0lURU1fVFlQRSkpCi0gICAgICAgICAgICAgICAgLmFwcGVuZEltcyhjb250ZW50VmFsdWVzTGlzdE1hcC5nZXQoSW0uQ09OVEVOVF9JVEVNX1RZUEUpKQotICAgICAgICAgICAgICAgIC5hcHBlbmRSZWxhdGlvbihjb250ZW50VmFsdWVzTGlzdE1hcC5nZXQoUmVsYXRpb24uQ09OVEVOVF9JVEVNX1RZUEUpKTsKLSAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCB0ZXJtaW5hdGUoKSB7Ci0gICAgICAgIGZvciAoT25lRW50cnlIYW5kbGVyIGhhbmRsZXIgOiBtSGFuZGxlckxpc3QpIHsKLSAgICAgICAgICAgIGhhbmRsZXIub25UZXJtaW5hdGUoKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtQ3Vyc29yICE9IG51bGwpIHsKLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgbUN1cnNvci5jbG9zZSgpOwotICAgICAgICAgICAgfSBjYXRjaCAoU1FMaXRlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiU1FMaXRlRXhjZXB0aW9uIG9uIEN1cnNvciNjbG9zZSgpOiAiICsgZS5nZXRNZXNzYWdlKCkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUN1cnNvciA9IG51bGw7Ci0gICAgICAgIH0KLQotICAgICAgICBtVGVybWluYXRlSXNDYWxsZWQgPSB0cnVlOwotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyB2b2lkIGZpbmFsaXplKCkgewotICAgICAgICBpZiAoIW1UZXJtaW5hdGVJc0NhbGxlZCkgewotICAgICAgICAgICAgdGVybWluYXRlKCk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwdWJsaWMgaW50IG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AgICAgICAgcHVibGljIGJvb2xlYW4gaXNQcmltYXJ5OwotICAgICAgICBwdWJsaWMgUGhvbmVEYXRhKGludCB0eXBlLCBTdHJpbmcgZGF0YSwgU3RyaW5nIGxhYmVsLCBib29sZWFuIGlzUHJpbWFyeSkgewotICAgICAgICAgICAgdGhpcy50eXBlID0gdHlwZTsKLSAgICAgICAgICAgIHRoaXMuZGF0YSA9IGRhdGE7Ci0gICAgICAgICAgICB0aGlzLmxhYmVsID0gbGFiZWw7Ci0gICAgICAgICAgICB0aGlzLmlzUHJpbWFyeSA9IGlzUHJpbWFyeTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgewotICAgICAgICAgICAgaWYgKCEob2JqIGluc3RhbmNlb2YgUGhvbmVEYXRhKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIFBob25lRGF0YSBwaG9uZURhdGEgPSAoUGhvbmVEYXRhKW9iajsKLSAgICAgICAgICAgIHJldHVybiAodHlwZSA9PSBwaG9uZURhdGEudHlwZSAmJiBkYXRhLmVxdWFscyhwaG9uZURhdGEuZGF0YSkgJiYKLSAgICAgICAgICAgICAgICAgICAgbGFiZWwuZXF1YWxzKHBob25lRGF0YS5sYWJlbCkgJiYgaXNQcmltYXJ5ID09IHBob25lRGF0YS5pc1ByaW1hcnkpOwotICAgICAgICB9Ci0KLSAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7Ci0gICAgICAgICAgICByZXR1cm4gU3RyaW5nLmZvcm1hdCgidHlwZTogJWQsIGRhdGE6ICVzLCBsYWJlbDogJXMsIGlzUHJpbWFyeTogJXMiLAotICAgICAgICAgICAgICAgICAgICB0eXBlLCBkYXRhLCBsYWJlbCwgaXNQcmltYXJ5KTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHN0YXRpYyBwdWJsaWMgY2xhc3MgRW1haWxEYXRhIHsKLSAgICAgICAgcHVibGljIGZpbmFsIGludCB0eXBlOwotICAgICAgICBwdWJsaWMgZmluYWwgU3RyaW5nIGRhdGE7Ci0gICAgICAgIC8vIFVzZWQgb25seSB3aGVuIFRZUEUgaXMgVFlQRV9DVVNUT00uCi0gICAgICAgIHB1YmxpYyBmaW5hbCBTdHJpbmcgbGFiZWw7Ci0gICAgICAgIC8vIGlzUHJpbWFyeSBpcyBjaGFuZ2FibGUgb25seSB3aGVuIHRoZXJlJ3Mgbm8gYXBwcm9wcmlhdGUgb25lIGV4aXN0aW5nIGluCi0gICAgICAgIC8vIHRoZSBvcmlnaW5hbCBWQ2FyZC4KLSAgICAgICAgcHVibGljIGJvb2xlYW4gaXNQcmltYXJ5OwotICAgICAgICBwdWJsaWMgRW1haWxEYXRhKGludCB0eXBlLCBTdHJpbmcgZGF0YSwgU3RyaW5nIGxhYmVsLCBib29sZWFuIGlzUHJpbWFyeSkgewotICAgICAgICAgICAgdGhpcy50eXBlID0gdHlwZTsKLSAgICAgICAgICAgIHRoaXMuZGF0YSA9IGRhdGE7Ci0gICAgICAgICAgICB0aGlzLmxhYmVsID0gbGFiZWw7Ci0gICAgICAgICAgICB0aGlzLmlzUHJpbWFyeSA9IGlzUHJpbWFyeTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgewotICAgICAgICAgICAgaWYgKCEob2JqIGluc3RhbmNlb2YgRW1haWxEYXRhKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIEVtYWlsRGF0YSBlbWFpbERhdGEgPSAoRW1haWxEYXRhKW9iajsKLSAgICAgICAgICAgIHJldHVybiAodHlwZSA9PSBlbWFpbERhdGEudHlwZSAmJiBkYXRhLmV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YWxDb2RlOwotICAgICAgICBwdWJsaWMgZmluYWwgU3RyaW5nIGNvdW50cnk7Ci0gICAgICAgIHB1YmxpYyBmaW5hbCBpbnQgdHlwZTsKLSAgICAgICAgcHVibGljIGZpbmFsIFN0cmluZyBsYWJlbDsKLSAgICAgICAgcHVibGljIGJvb2xlYW4gaXNQcmltYXJ5OwotCi0gICAgICAgIHB1YmxpYyBQb3N0YWxEYXRhKGZpbmFsIGludCB0eXBlLCBmaW5hbCBMaXN0PFN0cmluZz4gcHJvcFZhbHVlTGlzdCwKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbGFiZWwsIGJvb2xlYW4gaXNQcmltYXJ5KSB7Ci0gICAgICAgICAgICB0aGlzLnR5cGUgPSB0eXBlOwotICAgICAgICAgICAgZGF0YUFycmF5ID0gbmV3IFN0cmluZ1tBRERSX01BWF9EQVRBX1NJWkVdOwotCi0gICAgICAgICAgICBpbnQgc2l6ZSA9IHByb3BWYWx1ZUxpc3Quc2l6ZSgpOwotICAgICAgICAgICAgaWYgKHNpemUgPiBBRERSX01BWF9EQVRBX1NJWkUpIHsKLSAgICAgICAgICAgICAgICBzaXplID0gQUREUl9NQVhfREFUQV9TSVpFOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBhZHItdmFsdWUgPSAwKjYodGV4dC12YWx1ZSAiOyIpIHRleHQtdmFsdWUKLSAgICAgICAgICAgIC8vICAgICAgICAgICA7IFBPIEJveCwgRXh0ZW5kZWQgQWRkcmVzcywgU3RyZWV0LCBMb2NhbGl0eSwgUmVnaW9uLCBQb3N0YWwKLSAgICAgICAgICAgIC8vICAgICAgICAgICA7IENvZGUsIENvdW50cnkgTmFtZQotICAgICAgICAgICAgLy8KLSAgICAgICAgICAgIC8vIFVzZSBJdGVyYXRvciBhc3N1bWluZyBMaXN0IG1heSBiZSBMaW5rZWRMaXN0LCB0aG91Z2ggYWN0dWFsbHkgaXQgaXMKLSAgICAgICAgICAgIC8vIGFsd2F5cyBBcnJheUxpc3QgaW4gdGhlIGN1cnJlbnQgaW1wbGVtZW50YXRpb24uCi0gICAgICAgICAgICBpbnQgaSA9IDA7Ci0gICAgICAgICAgICBmb3IgKFN0cmluZyBhZGRyZXNzRWxlbWVudCA6IHByb3BWYWx1ZUxpc3QpIHsKLSAgICAgICAgICAgICAgICBkYXRhQXJyYXlbaV0gPSBhZGRyZXNzRWxlbWVudDsKLSAgICAgICAgICAgICAgICBpZiAoKytpID49IHNpemUpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgd2hpbGUgKGkgPCBBRERSX01BWF9EQVRBX1NJWkUpIHsKLSAgICAgICAgICAgICAgICBkYXRhQXJyYXlbaSsrXSA9IG51bGw7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHRoaXMucG9ib3ggPSBkYXRhQXJyYXlbMF07Ci0gICAgICAgICAgICB0aGlzLmV4dGVuZGVkQWRkcmVzcyA9IGRhdGFBcnJheVsxXTsKLSAgICAgICAgICAgIHRoaXMuc3RyZWV0ID0gZGF0YUFycmF5WzJdOwotICAgICAgICAgICAgdGhpcy5sb2NhbHR5ID0gZGF0YUFycmF5WzNdOwotICAgICAgICAgICAgdGhpcy5yZWdpb24gPSBkYXRhQXJyYXlbNF07Ci0gICAgICAgICAgICB0aGlzLnBvc3RhbENvZGUgPSBkYXRhQXJyYXlbNV07Ci0gICAgICAgICAgICB0aGlzLmNvdW50cnkgPSBkYXRhQXJyYXlbNl07Ci0gICAgICAgICAgICB0aGlzLmxhYmVsID0gbGFiZWw7Ci0gICAgICAgICAgICB0aGlzLmlzUHJpbWFyeSA9IGlzUHJpbWFyeTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgewotICAgICAgICAgICAgaWYgKCEob2JqIGluc3RhbmNlb2YgUG9zdGFsRGF0YSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmaW5hbCBQb3N0YWxEYXRhIHBvc3RhbERhdGEgPSAoUG9zdGFsRGF0YSlvYmo7Ci0gICAgICAgICAgICByZXR1cm4gKEFycmF5cy5lcXVhbHMoZGF0YUFycmF5LCBwb3N0YWxEYXRhLmRhdGFBcnJheSkgJiYKLSAgICAgICAgICAgICAgICAgICAgKHR5cGUgPT0gcG9zdGFsRGF0YS50eXBlICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHR5cGUgPT0gU3RydWN0dXJlZFBvc3RhbC5UWVBFX0NVU1RPTSA/Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGFiZWwgPT0gcG9zdGFsRGF0YS5sYWJlbCkgOiB0cnVlKSkgJiYKLSAgICAgICAgICAgICAgICAgICAgKGlzUHJpbWFyeSA9PSBwb3N0YWxEYXRhLmlzUHJpbWFyeSkpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIFN0cmluZyBnZXRGb3JtYXR0ZWRBZGRyZXNzKGZpbmFsIGludCB2Y2FyZFR5cGUpIHsKLSAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICBib29sZWFuIGVtcHR5ID0gdHJ1ZTsKLSAgICAgICAgICAgIGlmIChWQ2FyZENvbmZpZy5pc0phcGFuZXNlRGV2aWNlKHZjYXJkVHlwZSkpIHsKLSAgICAgICAgICAgICAgICAvLyBJbiBKYXBhbiwgdGhlIG9yZGVyIGlzIHJldmVyc2VkLgotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSBBRERSX01BWF9EQVRBX1NJWkUgLSAxOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYWRkcmVzc1BhcnQgPSBkYXRhQXJyYXlbaV07Ci0gICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoYWRkcmVzc1BhcnQpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWVtcHR5KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJyAnKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW1wdHkgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGFkZHJlc3NQYXJ0KTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBBRERSX01BWF9EQVRBX1NJWkU7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgYWRkcmVzc1BhcnQgPSBkYXRhQXJyYXlbaV07Ci0gICAgICAgICAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoYWRkcmVzc1BhcnQpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWVtcHR5KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJyAnKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW1wdHkgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGFkZHJlc3NQYXJ0KTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKS50cmltKCk7Ci0gICAgICAgIH0KLQotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKLSAgICAgICAgICAgIHJldHVybiBTdHJpbmcuZm9ybWF0KCJ0eXBlOiAlZCwgbGFiZWw6ICVzLCBpc1ByaW1hcnk6ICVzIiwKLSAgICAgICAgICAgICAgICAgICAgdHlwZSwgbGFiZWwsIGlzUHJpbWFyeSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBzdGF0aWMgcHVibGljIGNsYXNzIE9yZ2FuaXphdGlvbkRhdGEgewotICAgICAgICBwdWJsaWMgZmluYWwgaW50IHR5cGU7Ci0gICAgICAgIC8vIG5vbi1maW5hbCBpcyBJbnRlbnRpb25hbDogd2UgbWF5IGNoYW5nZSB0aGUgdmFsdWVzIHNpbmNlIHRoaXMgaW5mbyBpcyBzZXBhcmF0ZWQgaW50bwotICAgICAgICAvLyB0d28gcGFydHMgaW4gdkNhcmQ6ICJPUkciICsgIlRJVExFIi4KLSAgICAgICAgcHVibGljIFN0cmluZyBjb21wYW55TmFtZTsKLSAgICAgICAgcHVibGljIFN0cmluZyBkZXBhcnRtZW50TmFtZTsKLSAgICAgICAgcHVibGljIFN0cmluZyB0aXRsZU5hbWU7Ci0gICAgICAgIHB1YmxpYyBib29sZWFuIGlzUHJpbWFyeTsKLQotICAgICAgICBwdWJsaWMgT3JnYW5pemF0aW9uRGF0YShpbnQgdHlwZSwKLSAgICAgICAgICAgICAgICBTdHJpbmcgY29tcGFueU5hbWUsCi0gICAgICAgICAgICAgICAgU3RyaW5nIGRlcGFydG1lbnROYW1lLAotICAgICAgICAgICAgICAgIFN0cmluZyB0aXRsZU5hbWUsCi0gICAgICAgICAgICAgICAgYm9vbGVhbiBpc1ByaW1hcnkpIHsKLSAgICAgICAgICAgIHRoaXMudHlwZSA9IHR5cGU7Ci0gICAgICAgICAgICB0aGlzLmNvbXBhbnlOYW1lID0gY29tcGFueU5hbWU7Ci0gICAgICAgICAgICB0aGlzLmRlcGFydG1lbnROYW1lID0gZGVwYXJ0bWVudE5hbWU7Ci0gICAgICAgICAgICB0aGlzLnRpdGxlTmFtZSA9IHRpdGxlTmFtZTsKLSAgICAgICAgICAgIHRoaXMuaXNQcmltYXJ5ID0gaXNQcmltYXJ5OwotICAgICAgICB9Ci0KLSAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyBib29sZWFuIGVxdWFscyhPYmplY3Qgb2JqKSB7Ci0gICAgICAgICAgICBpZiAoIShvYmogaW5zdGFuY2VvZiBPcmdhbml6YXRpb25EYXRhKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIE9yZ2FuaXphdGlvbkRhdGEgb3JnYW5pemF0aW9uID0gKE9yZ2FuaXphdGlvbkRhdGEpb2JqOwotICAgICAgICAgICAgcmV0dXJuICh0eXBlID09IG9yZ2FuaXphdGlvbi50eXBlICYmCi0gICAgICAgICAgICAgICAgICAgIFRleHRVdGlscy5lcXVhbHMoY29tcGFueU5hbWUsIG9yZ2FuaXphdGlvbi5jb21wYW55TmFtZSkgJiYKLSAgICAgICAgICAgICAgICAgICAgVGV4dFV0aWxzLmVxdWFscyhkZXBhcnRtZW50TmFtZSwgb3JnYW5pemF0aW9uLmRlcGFydG1lbnROYW1lKSAmJgotICAgICAgICAgICAgICAgICAgICBUZXh0VXRpbHMuZXF1YWxzKHRpdGxlTmFtZSwgb3JnYW5pemF0aW9uLnRpdGxlTmFtZSkgJiYKLSAgICAgICAgICAgICAgICAgICAgaXNQcmltYXJ5ID09IG9yZ2FuaXphdGlvbi5pc1ByaW1hcnkpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIFN0cmluZyBnZXRGb3JtYXR0ZWRTdHJpbmcoKSB7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eShjb21wYW55TmFtZSkpIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChjb21wYW55TmFtZSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkoZGVwYXJ0bWVudE5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGJ1aWxkZXIubGVuZ3RoKCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIsICIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChkZXBhcnRtZW50TmFtZSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICghVGV4dFV0aWxzLmlzRW1wdHkodGl0bGVOYW1lKSkgewotICAgICAgICAgICAgICAgIGlmIChidWlsZGVyLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiLCAiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQodGl0bGVOYW1lKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgewotICAgICAgICAgICAgcmV0dXJuIFN0cmluZy5mb3JtYXQoCi0gICAgICAgICAgICAgICAgICAgICJ0eXBlOiAlZCwgY29tcGFueTogJXMsIGRlcGFydG1lbnQ6ICVzLCB0aXRsZTogJXMsIGlzUHJpbWFyeTogJXMiLAotICAgICAgICAgICAgICAgICAgICB0eXBlLCBjb21wYW55TmFtZSwgZ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GlzIG5vdCBkZWZpbmVkIGluIENvbnRhY3RzQ29udHJhY3QuCi0gICAgICAgIHB1YmxpYyBmaW5hbCBieXRlW10gcGhvdG9CeXRlczsKLSAgICAgICAgcHVibGljIGZpbmFsIGJvb2xlYW4gaXNQcmltYXJ5OwotCi0gICAgICAgIHB1YmxpYyBQaG90b0RhdGEoaW50IHR5cGUsIFN0cmluZyBmb3JtYXROYW1lLCBieXRlW10gcGhvdG9CeXRlcywgYm9vbGVhbiBpc1ByaW1hcnkpIHsKLSAgICAgICAgICAgIHRoaXMudHlwZSA9IHR5cGU7Ci0gICAgICAgICAgICB0aGlzLmZvcm1hdE5hbWUgPSBmb3JtYXROYW1lOwotICAgICAgICAgICAgdGhpcy5waG90b0J5dGVzID0gcGhvdG9CeXRlczsKLSAgICAgICAgICAgIHRoaXMuaXNQcmltYXJ5ID0gaXNQcmltYXJ5OwotICAgICAgICB9Ci0KLSAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyBib29sZWFuIGVxdWFscyhPYmplY3Qgb2JqKSB7Ci0gICAgICAgICAgICBpZiAoIShvYmogaW5zdGFuY2VvZiBQaG90b0RhdGEpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgUGhvdG9EYXRhIHBob3RvRGF0YSA9IChQaG90b0RhdGEpb2JqOwotICAgICAgICAgICAgcmV0dXJuICh0eXBlID09IHBob3RvRGF0YS50eXBlICYmCi0gICAgICAgICAgICAgICAgICAgIChmb3JtYXROYW1lID09IG51bGwgPyAocGhvdG9EYXRhLmZvcm1hdE5hbWUgPT0gbnVsbCkgOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcm1hdE5hbWUuZXF1YWxzKHBob3RvRGF0YS5mb3JtYXROYW1lKSkgJiYKLSAgICAgICAgICAgICAgICAgICAgKEFycmF5cy5lcXVhbHMocGhvdG9CeXRlcywgcGhvdG9EYXRhLnBob3RvQnl0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ICAgICAgICBtQWNjb3VudCA9IGFjY291bnQ7Ci0gICAgfQotCi0gICAgcHJpdmF0ZSB2b2lkIGFkZFBob25lKGludCB0eXBlLCBTdHJpbmcgZGF0YSwgU3RyaW5nIGxhYmVsLCBib29sZWFuIGlzUHJpbWFyeSkgewotICAgICAgICBpZiAobVBob25lTGlzdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICBtUGhvbmVMaXN0ID0gbmV3IEFycmF5TGlzdDxQaG9uZURhdGE+KCk7Ci0gICAgICAgIH0KLSAgICAgICAgZmluYWwgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgZmluYWwgU3RyaW5nIHRyaW1lZCA9IGRhdGEudHJpbSgpOwotICAgICAgICBmaW5hbCBTdHJpbmcgZm9ybWF0dGVkTnVtYmVyOwotICAgICAgICBpZiAodHlwZSA9PSBQaG9uZS5UWVBFX1BBR0VSIHx8IFZDYXJkQ29uZmlnLnJlZnJhaW5QaG9uZU51bWJlckZvcm1hdHRpbmcobVZDYXJkVHlwZSkpIHsKLSAgICAgICAgICAgIGZvcm1hdHRlZE51bWJlciA9IHRyaW1lZDsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGZpbmFsIGludCBsZW5ndGggPSB0cmltZWQubGVuZ3RoKCk7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgY2hhciBjaCA9IHRyaW1lZC5jaGFyQXQoaSk7Ci0gICAgICAgICAgICAgICAgaWYgKCgnMCcgPD0gY2ggJiYgY2ggPD0gJzknKSB8fCAoaSA9PSAwICYmIGNoID09ICcrJykpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gVXNlIE5BTlAgaW4gZGVmYXVs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SAgICAgICAgZmluYWwgaW50IHNpemUgPSBvcmdMaXN0LnNpemUoKTsKLSAgICAgICAgc3dpdGNoIChzaXplKSB7Ci0gICAgICAgICAgICBjYXNlIDA6IHsKLSAgICAgICAgICAgICAgICBjb21wYW55TmFtZSA9ICIiOwotICAgICAgICAgICAgICAgIGRlcGFydG1lbnROYW1lID0gbnVsbDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgMTogewotICAgICAgICAgICAgICAgIGNvbXBhbnlOYW1lID0gb3JnTGlzdC5nZXQoMCk7Ci0gICAgICAgICAgICAgICAgZGVwYXJ0bWVudE5hbWUgPSBudWxsOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZGVmYXVsdDogeyAgLy8gTW9yZSB0aGFuIDEuCi0gICAgICAgICAgICAgICAgY29tcGFueU5hbWUgPSBvcmdMaXN0LmdldCgwKTsKLSAgICAgICAgICAgICAgICAvLyBXZSdyZSBub3Qgc3VyZSB3aGljaCBpcyB0aGUgY29ycmVjdCBzdHJpbmcgZm9yIGRlcGFydG1lbnQuCi0gICAgICAgICAgICAgICAgLy8gSW4gb3JkZXIgdG8ga2VlcCBhbGwgdGhlIGRhdGEsIGNvbmNhdGluYXRlIHRoZSByZXN0IG9mIGVsZW1lbnRzLgotICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDE7IGkgPCBzaXplOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGkgPiAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgnICcpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKG9yZ0xpc3QuZ2V0KGkp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yB1c2UgdGhpcyBvcmRlci4KLSAgICAgICAgaWYgKHNpemUgPiAzKSB7Ci0gICAgICAgICAgICBzaXplID0gMzsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChlbGVtcy5nZXQoMCkubGVuZ3RoKCkgPiAwKSB7Ci0gICAgICAgICAgICBib29sZWFuIG9ubHlGaXJzdEVsZW1Jc05vbkVtcHR5ID0gdHJ1ZTsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAxOyBpIDwgc2l6ZTsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGVsZW1zLmdldChpKS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgb25seUZpcnN0RWxlbUlzTm9uRW1wdHkgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG9ubHlGaXJzdEVsZW1Jc05vbkVtcHR5KSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nW10gbmFtZXNBcnJheSA9IGVsZW1zLmdldCgwKS5zcGxpdCgiICIpOwotICAgICAgICAgICAgICAgIGZpbmFsIGludCBuYW1lQXJyYXlMZW5ndGggPSBuYW1lc0FycmF5Lmxlbmd0aDsKLSAgICAgICAgICAgICAgICBpZiAobmFtZUFycmF5TGVuZ3RoID09IDMpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gQXNzdW1lIHRoZSBzdHJpbmcgaXMgIkZhbWlseSBNaWRkbGUgR2l2ZW4iLgotICAgICAgICAgICAgICAgICAgICBtUGhvbmV0aWNGYW1pbHlOYW1lID0gbmFtZXNBcnJheVswXTsKLSAgICAgICAgICAgICAgICAgICAgbVBob25ldGljTWlkZGxlTmFtZSA9IG5hbWVzQXJyYXlbMV07Ci0gICAgICAgICAgICAgICAgICAgIG1QaG9uZXRpY0dpdmVuTmFtZSA9IG5hbWVzQXJyYXlbMl07Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChuYW1lQXJyYXlMZW5ndGggPT0gMikgewotICAgICAgICAgICAgICAgICAgICAvLyBBc3N1bWUgdGhlIHN0cmluZyBpcyAiRmFtaWx5IEdpdmVuIiBiYXNlZCBvbiB0aGUgSmFwYW5lc2UgbW9iaWxlCi0gICAgICAgICAgICAgICAgICAgIC8vIHBob25lcycgcHJlZmVyZW5jZS4KLSAgICAgICAgICAgICAgICAgICAgbVBob25ldGljRmFtaWx5TmFtZSA9IG5hbWVzQXJyYXlbMF07Ci0gICAgICAgICAgICAgICAgICAgIG1QaG9uZXRpY0dpdmVuTmFtZSA9IG5hbWVzQXJyYXlbMV07Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVBob25ldGljRnVsbE5hbWUgPSBlbGVtcy5nZXQoMCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHN3aXRjaCAoc2l6ZSkgewotICAgICAgICAgICAgLy8gZmFsbHRocm91Z2gKLSAgICAgICAgICAgIGNhc2UgMzogbVBob25ldGljTWlkZGxlTmFtZSA9IGVsZW1zLmdldCgyKTsKLSAgICAgICAgICAgIGNhc2UgMjogbVBob25ldGljR2l2ZW5OYW1lID0gZWxlbXMuZ2V0KDEpOwotICAgICAgICAgICAgZGVmYXVsdDogbVBob25ldGljRmFtaWx5TmFtZSA9IGVsZW1zLmdldCgwKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIGFkZFByb3BlcnR5KGZpbmFsIFByb3BlcnR5IHByb3BlcnR5KSB7Ci0gICAgICAgIGZpbmFsIFN0cmluZyBwcm9wTmFtZSA9IHByb3BlcnR5Lm1Qcm9wZXJ0eU5hbWU7Ci0gICAgICAgIGZpbmFsIE1hcDxTdHJpbmcsIENvbGxlY3Rpb248U3RyaW5nPj4gcGFyYW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ICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAodmFsdWVzQXJlQWxsRW1wdHkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGludCB0eXBlID0gLTE7Ci0gICAgICAgICAgICBTdHJpbmcgbGFiZWwgPSAiIjsKLSAgICAgICAgICAgIGJvb2xlYW4gaXNQcmltYXJ5ID0gZmFsc2U7Ci0gICAgICAgICAgICBDb2xsZWN0aW9uPFN0cmluZz4gdHlwZUNvbGxlY3Rpb24gPSBwYXJhbU1hcC5nZXQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRSk7Ci0gICAgICAgICAgICBpZiAodHlwZUNvbGxlY3Rpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGVTdHJpbmcgOiB0eXBlQ29sbGVjdGlvbikgewotICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nID0gdHlwZVN0cmluZy50b1VwcGVyQ2FzZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAodHlwZVN0cmluZy5lcXVhbHMoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9QUkVGKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgaXNQcmltYXJ5ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlU3RyaW5nLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0hPTUUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gU3RydWN0dXJlZFBvc3RhbC5UWVBFX0hPTUU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsYWJlbCA9ICIiOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfV09SSykgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nLmVxdWFsc0lnbm9yZUNhc2UoVkNhcmRDb25zdGFudHMuUEFSQU1fRVhUUkFfVFlQRV9DT01QQU5ZKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gIkNPTVBBTlkiIHNlZW1zIGVtaXR0ZWQgYnkgV2luZG93cyBNb2JpbGUsIHdoaWNoIGlzIG5vdAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3BlY2lmaWNhbGx5IHN1cHBvcnRlZCBieSB2Q2FyZCAyLjEuIFdlIGFzc3VtZSB0aGlzIGlzIHNhbWUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFzICJXT1JLIi4KLSAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBTdHJ1Y3R1cmVkUG9zdGFsLlRZUEVfV09SSzsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gIiI7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZVN0cmluZy5lcXVhbHMoVkNhcmRDb25zdGFudHMuUEFSQU1fQURSX1RZUEVfUEFSQ0VMKSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX0FEUl9UWVBFX0RPTSkgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QQVJBTV9BRFJfVFlQRV9JTlRMKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgZG8gbm90IGhhdmUgYW55IGFwcHJvcHJpYXRlIHdheSB0byBzdG9yZSB0aGlzIGluZm9ybWF0aW9uLgotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVTdHJpbmcuc3RhcnRzV2l0aCgiWC0iKSAmJiB0eXBlIDwgMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcgPSB0eXBlU3RyaW5nLnN1YnN0cmluZygyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHZDYXJkIDMuMCBhbGxvd3MgaWFuYS10b2tlbi4gQWxzbyBzb21lIHZDYXJkIDIuMSBleHBvcnRlcnMKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVtaXQgbm9uLXN0YW5kYXJkIHR5cGVzLiBXZSBkbyBub3QgaGFuZGxlIHRoZWlyIHZhbHVlcyBub3cuCi0gICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gU3RydWN0dXJlZFBvc3RhbC5UWVBFX0NVU1RPTTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gdHlwZVN0cmluZzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIFdlIHVzZSAiSE9NRSIgYXMgZGVmYXVsdAotICAgICAgICAgICAgaWYgKHR5cGUgPCAwKSB7Ci0gICAgICAgICAgICAgICAgdHlwZSA9IFN0cnVjdHVyZWRQb3N0YWwuVFlQRV9IT01FOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBhZGRQb3N0YWwodHlwZSwgcHJvcFZhbHVlTGlzdCwgbGFiZWwsIGlzUHJpbWFyeSk7Ci0gICAgICAgIH0gZWxzZSBpZiAocHJvcE5hbWUuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX0VNQUlMKSkgewotICAgICAgICAgICAgaW50IHR5cGUgPSAtMTsKLSAgICAgICAgICAgIFN0cmluZyBsYWJlbCA9IG51bGw7Ci0gICAgICAgICAgICBib29sZWFuIGlzUHJpbWFyeSA9IGZhbHNlOwotICAgICAgICAgICAgQ29sbGVjdGlvbjxTdHJpbmc+IHR5cGVDb2xsZWN0aW9uID0gcGFyYW1NYXAuZ2V0KFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEUpOwotICAgICAgICAgICAgaWYgKHR5cGVDb2xsZWN0aW9uICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyB0eXBlU3RyaW5nIDogdHlwZUNvbGxlY3Rpb24pIHsKLSAgICAgICAgICAgICAgICAgICAgdHlwZVN0cmluZyA9IHR5cGVTdHJpbmcudG9VcHBlckNhc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfUFJFRikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZVN0cmluZy5lcXVhbHMoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9IT01FKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IEVtYWlsLlRZUEVfSE9NRTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlU3RyaW5nLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1dPUkspKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gRW1haWwuVFlQRV9XT1JLOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfQ0VMTCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBFbWFpbC5UWVBFX01PQklMRTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlU3RyaW5nLnN0YXJ0c1dpdGgoIlgtIikgJiYgdHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlU3RyaW5nID0gdHlwZVN0cmluZy5zdWJzdHJpbmcoMik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyB2Q2FyZCAzLjAgYWxsb3dzIGlhbmEtdG9rZW4uCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBtYXkgaGF2ZSBJTlRFUk5FVCAoc3BlY2lmaWVkIGluIHZDYXJkIHNwZWMpLAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gU0NIT09MLCBldGMuCi0gICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gRW1haWwuVFlQRV9DVVNUT007Ci0gICAgICAgICAgICAgICAgICAgICAgICBsYWJlbCA9IHR5cGVTdHJpbmc7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAodHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICB0eXBlID0gRW1haWwuVFlQRV9PVEhFUjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGFkZEVtYWlsKHR5cGUsIHByb3BWYWx1ZSwgbGFiZWwsIGlzUHJpbWFyeSk7Ci0gICAgICAgIH0gZWxzZSBpZiAocHJvcE5hbWUuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBST1BFUlRZX09SRykpIHsKLSAgICAgICAgICAgIC8vIHZDYXJkIHNwZWNpZmljYXRpb24gZG9lcyBub3Qgc3BlY2lmeSBvdGhlciB0eXBlcy4KLSAgICAgICAgICAgIGZpbmFsIGludCB0eXBlID0gT3JnYW5pemF0aW9uLlRZUEVfV09SSzsKLSAgICAgICAgICAgIGJvb2xlYW4gaXNQcmltYXJ5ID0gZmFsc2U7Ci0gICAgICAgICAgICBDb2xsZWN0aW9uPFN0cmluZz4gdHlwZUNvbGxlY3Rpb24gPSBwYXJhbU1hcC5nZXQo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BhcmFtTWFwLmdldCgiVkFMVUUiKTsKLSAgICAgICAgICAgIGlmIChwYXJhbU1hcFZhbHVlICE9IG51bGwgJiYgcGFyYW1NYXBWYWx1ZS5jb250YWlucygiVVJMIikpIHsKLSAgICAgICAgICAgICAgICAvLyBDdXJyZW50bHkgd2UgZG8gbm90IGhhdmUgYXBwcm9wcmlhdGUgZXhhbXBsZSBmb3IgdGVzdGluZyB0aGlzIGNhc2UuCi0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGZpbmFsIENvbGxlY3Rpb248U3RyaW5nPiB0eXBlQ29sbGVjdGlvbiA9IHBhcmFtTWFwLmdldCgiVFlQRSIpOwotICAgICAgICAgICAgICAgIFN0cmluZyBmb3JtYXROYW1lID0gbnVsbDsKLSAgICAgICAgICAgICAgICBib29sZWFuIGlzUHJpbWFyeSA9IGZhbHNlOwotICAgICAgICAgICAgICAgIGlmICh0eXBlQ29sbGVjdGlvbiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGVWYWx1ZSA6IHR5cGVDb2xsZWN0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9QUkVGLmVxdWFscyh0eXBlVmFsdWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNQcmltYXJ5ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZm9ybWF0TmFtZSA9PSBudWxsKXsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXROYW1lID0gdHlwZVZhbHVlOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGFkZFBob3RvQnl0ZXMoZm9ybWF0TmFtZSwgcHJvcEJ5dGVzLCBpc1ByaW1hcnkpOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgaWYgKHByb3BOYW1lLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QUk9QRVJUWV9URUwpKSB7Ci0gICAgICAgICAgICBmaW5hbCBDb2xsZWN0aW9uPFN0cmluZz4gdHlwZUNvbGxlY3Rpb24gPSBwYXJhbU1hcC5nZXQoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRSk7Ci0gICAgICAgICAgICBmaW5hbCBPYmplY3QgdHlwZU9iamVjdCA9Ci0gICAgICAgICAgICAgICAgVkNhcmRVdGlscy5nZXRQaG9uZVR5cGVGcm9tU3RyaW5ncyh0eXBlQ29sbGVjdGlvbiwgcHJvcFZhbHVlKTsKLSAgICAgICAgICAgIGZpbmFsIGludCB0eXBlOwotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGxhYmVsOwotICAgICAgICAgICAgaWYgKHR5cGVPYmplY3QgaW5zdGFuY2VvZiBJbnRlZ2VyKSB7Ci0gICAgICAgICAgICAgICAgdHlwZSA9IChJbnRlZ2VyKXR5cGVPYmplY3Q7Ci0gICAgICAgICAgICAgICAgbGFiZWwgPSBudWxsOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICB0eXBlID0gUGhvbmUuVFlQRV9DVVNUT007Ci0gICAgICAgICAgICAgICAgbGFiZWwgPSB0eXBlT2JqZWN0LnRvU3RyaW5nKCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gaXNQcmltYXJ5OwotICAgICAgICAgICAgaWYgKHR5cGVDb2xsZWN0aW9uICE9IG51bGwgJiYgdHlwZUNvbGxlY3Rpb24uY29udGFpbnMoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9QUkVGKSkgewotICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IHRydWU7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlzUHJpbWFyeSA9IGZhbHNlOw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pbmFsIENvbGxlY3Rpb248U3RyaW5nPiB0eXBlQ29sbGVjdGlvbiA9IHBhcmFtTWFwLmdldChWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFKTsKLSAgICAgICAgICAgIGlmICh0eXBlQ29sbGVjdGlvbiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgZm9yIChTdHJpbmcgdHlwZVN0cmluZyA6IHR5cGVDb2xsZWN0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlU3RyaW5nLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX1BSRUYpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpc1ByaW1hcnkgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZVN0cmluZy5lcXVhbHNJZ25vcmVDYXNlKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfSE9NRSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlID0gSW0uVFlQRV9IT01FOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlU3RyaW5nLmVxdWFsc0lnbm9yZUNhc2UoVkNhcmRDb25zdGFudHMuUEFSQU1fVFlQRV9XT1JLKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBJbS5UWVBFX1dPUks7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAodHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICB0eXBlID0gUGhvbmUuVFlQRV9IT01FOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYWRkSW0ocHJvdG9jb2wsIG51bGwsIHR5cGUsIHByb3BWYWx1ZSwga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0aFZhbHVlKFJhd0NvbnRhY3RzLkFDQ09VTlRfTkFNRSwgbUFjY291bnQubmFtZSk7Ci0gICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShSYXdDb250YWN0cy5BQ0NPVU5UX1RZUEUsIG1BY2NvdW50LnR5cGUpOwotCi0gICAgICAgICAgICAvLyBBc3N1bWUgdGhhdCBjYWxsZXIgc2lkZSBjcmVhdGVzIHRoaXMgZ3JvdXAgaWYgaXQgZG9lcyBub3QgZXhpc3QuCi0gICAgICAgICAgICBpZiAoQUNDT1VOVF9UWVBFX0dPT0dMRS5lcXVhbHMobUFjY291bnQudHlwZSkpIHsKLSAgICAgICAgICAgICAgICBmaW5hbCBDdXJzb3IgY3Vyc29yID0gcmVzb2x2ZXIucXVlcnkoR3JvdXBzLkNPTlRFTlRfVVJJLCBuZXcgU3RyaW5nW10gewotICAgICAgICAgICAgICAgICAgICAgICAgR3JvdXBzLlNPVVJDRV9JRCB9LAotICAgICAgICAgICAgICAgICAgICAgICAgR3JvdXBzLlRJVExFICsgIj0/IiwgbmV3IFN0cmluZ1tdIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEdPT0dMRV9NWV9DT05UQUNUU19HUk9VUCB9LCBudWxsKTsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBpZiAoY3Vyc29yICE9IG51bGwgJiYgY3Vyc29yLm1vdmVUb0ZpcnN0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG15R3JvdXBzSWQgPSBjdXJzb3IuZ2V0U3RyaW5nKDApOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnNvciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3IuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgI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1ZmZpeCk7Ci0KLSAgICAgICAgICAgIGlmICghKFRleHRVdGlscy5pc0VtcHR5KG1QaG9uZXRpY0dpdmVuTmFtZSkKLSAgICAgICAgICAgICAgICAgICAgJiYgVGV4dFV0aWxzLmlzRW1wdHkobVBob25ldGljRmFtaWx5TmFtZSkKLSAgICAgICAgICAgICAgICAgICAgJiYgVGV4dFV0aWxzLmlzRW1wdHkobVBob25ldGljTWlkZGxlTmFtZSkpKSB7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfR0lWRU5fTkFNRSwgbVBob25ldGljR2l2ZW5OYW1lKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShTdHJ1Y3R1cmVkTmFtZS5QSE9ORVRJQ19GQU1JTFlfTkFNRSwgbVBob25ldGljRmFtaWx5TmFtZSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfTUlERExFX05BTUUsIG1QaG9uZXRpY01pZGRsZU5hbWUpOwotICAgICAgICAgICAgfSBlbHNlIGlmICghVGV4dFV0aWxzLmlzRW1wdHkobVBob25ldGljRnVsbE5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfR0lWRU5fTkFNRSwgbVBob25ldGljRnVsbE5hbWUpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShTdHJ1Y3R1cmVkTmFtZS5ESVNQTEFZX05BTUUsIGdldERpc3BsYXlOYW1lKCkpOwotICAgICAgICAgICAgb3BlcmF0aW9uTGlzdC5hZGQoYnVpbGRlci5idWlsZCgpKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtTmlja05hbWVMaXN0ICE9IG51bGwgJiYgbU5pY2tOYW1lTGlzdC5zaX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gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoUGhvbmUuVFlQRSwgcGhvbmVEYXRhLnR5cGUpOwotICAgICAgICAgICAgICAgIGlmIChwaG9uZURhdGEudHlwZSA9PSBQaG9uZS5UWVBFX0NVU1RPTSkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShQaG9uZS5MQUJFTCwgcGhvbmVEYXRhLmxhYmVsKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoUGhvbmUuTlVNQkVSLCBwaG9uZURhdGEuZGF0YSk7Ci0gICAgICAgICAgICAgICAgaWYgKHBob25lRGF0YS5pc1ByaW1hcnkpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoUGhvbmUuSVNfUFJJTUFSWSwgMSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG9wZXJhdGlvbkxpc3QuYWRkKGJ1aWxkZXIuYnVpbGQoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobU9yZ2FuaXphdGlvbkxpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChPcmdhbml6YXRpb25EYXRhIG9yZ2FuaXphdGlvbkRhdGEgOiBtT3JnYW5pemF0aW9uTGlzdCkgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3SW5zZXJ0KERhdGEuQ09OVEVOVF9VUkkpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlQmFja1JlZmVyZW5jZShPcmdhbml6YXRpb24uUkFXX0NPTlRBQ1RfSUQsIDApOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuTUlNRVRZUEUsIE9yZ2FuaXphdGlvbi5DT05URU5UX0lURU1fVFlQRSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoT3JnYW5pemF0aW9uLlRZUEUsIG9yZ2FuaXphdGlvbkRhdGEudHlwZSk7Ci0gICAgICAgICAgICAgICAgaWYgKG9yZ2FuaXphdGlvbkRhdGEuY29tcGFueU5hbWUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShPcmdhbml6YXRpb24uQ09NUEFOWSwgb3JnYW5pemF0aW9uRGF0YS5jb21wYW55TmFtZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChvcmdhbml6YXRpb25EYXRhLmRlcGFydG1lbnROYW1lICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoT3JnYW5pemF0aW9uLkRFUEFSVE1FTlQsIG9yZ2FuaXphdGlvbkRhdGEuZGVwYXJ0bWVudE5hbWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAob3JnYW5pemF0aW9uRGF0YS50aXRsZU5hbWUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShPcmdhbml6YXRpb24uVElUTEUsIG9yZ2FuaXphdGlvbkRhdGEudGl0bGVOYW1lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKG9yZ2FuaXphdGlvbkRhdGEuaXNQcmltYXJ5KSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKE9yZ2FuaXphdGlvbi5JU19QUklNQVJZLCAxKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgb3BlcmF0aW9uTGlzdC5hZGQoYnVpbGRlci5idWlsZCgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtRW1haWxMaXN0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZvciAoRW1haWxEYXRhIGVtYWlsRGF0YSA6IG1FbWFpbExpc3QpIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkNPTlRFTlRfVVJJKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZUJhY2tSZWZlcmVuY2UoRW1haWwuUkFXX0NPTlRBQ1RfSUQsIDApOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuTUlNRVRZUEUsIEVtYWlsLkNPTlRFTlRfSVRFTV9UWVBFKTsKLQotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKEVtYWlsLlRZUEUsIGVtYWlsRGF0YS50eXBlKTsKLSAgICAgICAgICAgICAgICBpZiAoZW1haWxEYXRhLnR5cGUgPT0gRW1haWwuVFlQRV9DVVNUT00pIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRW1haWwuTEFCRUwsIGVtYWlsRGF0YS5sYWJlbCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKEVtYWlsLkRBVEEsIGVtYWlsRGF0YS5kYXRhKTsKLSAgICAgICAgICAgICAgICBpZiAoZW1haWxEYXRhLmlzUHJpbWFyeSkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShEYXRhLklTX1BSSU1BUlksIDEpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBvcGVyYXRpb25MaXN0LmFkZChidWlsZGVyLmJ1aWxkKCkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1Qb3N0YWxMaXN0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZvciAoUG9zdGFsRGF0YSBwb3N0YWxEYXRhIDogbVBvc3RhbExpc3QpIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkNPTlRFTlRfVVJJKTsKLSAgICAgICAgICAgICAgICBWQ2FyZFV0aWxzLmluc2VydFN0cnVjdHVyZWRQb3N0YWxEYXRhVXNpbmdDb250YWN0c1N0cnVjdCgKLSAgICAgICAgICAgICAgICAgICAgICAgIG1WQ2FyZFR5cGUsIGJ1aWxkZXIsIHBvc3RhbERhdGEpOwotICAgICAgICAgICAgICAgIG9wZXJhdGlvbkxpc3QuYWRkKGJ1aWxkZXIuYnVpbGQoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobUltTGlzdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBmb3IgKEltRGF0YSBpbURhdGEgOiBtSW1MaXN0KSB7Ci0gICAgICAgICAgICAgICAgYnVpbGRlciA9IENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5uZXdJbnNlcnQoRGF0YS5DT05URU5UX1VSSSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWVCYWNrUmVmZXJlbmNlKEltLlJBV19DT05UQUNUX0lELCAwKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZShEYXRhLk1JTUVUWVBFLCBJbS5DT05URU5UX0lURU1fVFlQRSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoSW0uVFlQRSwgaW1EYXRhLnR5cGUpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKEltLlBST1RPQ09MLCBpbURhdGEucHJvdG9jb2wpOwotICAgICAgICAgICAgICAgIGlmIChpbURhdGEucHJvdG9jb2wgPT0gSW0uUFJPVE9DT0xfQ1VTVE9NKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKEltLkNVU1RPTV9QUk9UT0NPTCwgaW1EYXRhLmN1c3RvbVByb3RvY29sKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGltRGF0YS5pc1ByaW1hcnkpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRGF0YS5JU19QUklNQVJZLCAxKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobU5vdGVMaXN0ICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZvciAoU3RyaW5nIG5vdGUgOiBtTm90ZUxpc3QpIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gQ29udGVudFByb3ZpZGVyT3BlcmF0aW9uLm5ld0luc2VydChEYXRhLkNPTlRFTlRfVVJJKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZUJhY2tSZWZlcmVuY2UoTm90ZS5SQVdfQ09OVEFDVF9JRCwgMCk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoRGF0YS5NSU1FVFlQRSwgTm90ZS5DT05URU5UX0lURU1fVFlQRSk7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci53aXRoVmFsdWUoTm90ZS5OT1RFLCBub3RlKTsKLSAgICAgICAgICAgICAgICBvcGVyYXRpb25MaXN0LmFkZChidWlsZGVyLmJ1aWxkKCkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1QaG90b0xpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgZm9yIChQaG90b0RhdGEgcGhvdG9EYXRhIDogbVBob3RvTGlzdCkgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBDb250ZW50UHJvdmlkZXJPcGVyYXRpb24ubmV3SW5zZXJ0KERhdGEuQ09OVEVOVF9VUkkpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlQmFja1JlZmVyZW5jZShQaG90by5SQVdfQ09OVEFDVF9JRCw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ci0gICAgICAgICAgICAgICAgaWYgKHNpemUgPCAyIHx8IFRleHRVdGlscy5pc0VtcHR5KGN1c3RvbVByb3BlcnR5TGlzdC5nZXQoMCkpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2l6ZSA+IFZDYXJkQ29uc3RhbnRzLk1BWF9EQVRBX0NPTFVNTiArIDEpIHsKLSAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IFZDYXJkQ29uc3RhbnRzLk1BWF9EQVRBX0NPTFVNTiArIDE7Ci0gICAgICAgICAgICAgICAgICAgIGN1c3RvbVByb3BlcnR5TGlzdCA9Ci0gICAgICAgICAgICAgICAgICAgICAgICBjdXN0b21Qcm9wZXJ0eUxpc3Quc3ViTGlzdCgwLCBWQ2FyZENvbnN0YW50cy5NQVhfREFUQV9DT0xVTU4gKyAyKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpbnQgaSA9IDA7Ci0gICAgICAgICAgICAgICAgZm9yIChmaW5hbCBTdHJpbmcgY3VzdG9tUHJvcGVydHlWYWx1ZSA6IGN1c3RvbVByb3BlcnR5TGlzdCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgbWltZVR5cGUgPSBjdXN0b21Qcm9wZXJ0eVZhbHVlOwotICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlciA9IENvbnRlbnRQcm92aWRlck9wZXJhdGlvbi5uZXdJbnNlcnQoRGF0YS5DT05URU5UX1VSSSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLndpdGhWYWx1ZUJhY2tSZWZlcmVuY2UoR3JvdXBNZW1iZXJzaGlwLlJBV19DT05UQUNUX0lELCAwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIud2l0aFZhbHVlKERhdGEuTU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LSAgICAgICAgICAgIENvbnRlbnRQcm92aWRlclJlc3VsdFtdIHJlc3VsdHMgPSByZXNvbHZlci5hcHBseUJhdGNoKAotICAgICAgICAgICAgICAgICAgICAgICAgQ29udGFjdHNDb250cmFjdC5BVVRIT1JJVFksIG9wZXJhdGlvbkxpc3QpOwotICAgICAgICAgICAgLy8gdGhlIGZpcnN0IHJlc3VsdCBpcyBhbHdheXMgdGhlIHJhd19jb250YWN0LiByZXR1cm4gaXQncyB1cmkgc28KLSAgICAgICAgICAgIC8vIHRoYXQgaXQgY2FuIGJlIGZvdW5kIGxhdGVyLiBkbyBudWxsIGNoZWNraW5nIGZvciBiYWRseSBiZWhhdmluZwotICAgICAgICAgICAgLy8gQ29udGVudFJlc29sdmVycwotICAgICAgICAgICAgcmV0dXJuIChyZXN1bHRzID09IG51bGwgfHwgcmVzdWx0cy5sZW5ndGggPT0gMCB8fCByZXN1bHRzWzBdID09IG51bGwpCi0gICAgICAgICAgICAgICAgPyBudWxsCi0gICAgICAgICAgICAgICAgOiByZXN1bHRzWzBdLnVyaTsKLSAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgIExvZy5lKExPR19UQUcsIFN0cmluZy5mb3JtYXQoIiVzOiAlcyIsIGUudG9TdHJpbmcoKSwgZS5nZXRNZXNzYWdlKCkpKTsKLSAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICB9IGNhdGNoIChPcGVyYXRpb25BcHBsaWNhdGlvbkV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICBMb2cuZShMT0dfVEFHLCBTdHJpbmcuZm9ybWF0KCIlczogJXMiLCBlLnRvU3RyaW5nKCksIGUuZ2V0TWVzc2FnZSgpKSk7Ci0gICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHB1YmxpYyBzdGF0aWMgVkNhcmRFbnRyeSBidWlsZEZyb21SZXNvbHZlcihDb250ZW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KCJCQVNFNjQiKSB8fCBlbmNvZGluZy5lcXVhbHMoIkIiKSkgewotICAgICAgICAgICAgICAgIG1DdXJyZW50UHJvcGVydHkuc2V0UHJvcGVydHlCeXRlcyhCYXNlNjQuZGVjb2RlQmFzZTY0KHZhbHVlLmdldEJ5dGVzKCkpKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGVuY29kaW5nLmVxdWFscygiUVVPVEVELVBSSU5UQUJMRSIpKSB7Ci0gICAgICAgICAgICAgICAgLy8gIj0gIiAtPiAiICIsICI9XHQiIC0+ICJcdCIuCi0gICAgICAgICAgICAgICAgLy8gUHJldmlvdXMgY29kZSBoYWQgZG9uZSB0aGlzIHJlcGxhY2VtZW50LiBLZWVwIG9uIHRoZSBzYWZlIHNpZGUuCi0gICAgICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgICAgICBpbnQgbGVuZ3RoID0gdmFsdWUubGVuZ3RoKCk7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBjaGFyIGNoID0gdmFsdWUuY2hhckF0KGkpOwotICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT0gJz0nICYmIGkgPCBsZW5ndGggLSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjaGFyIG5leHRDaCA9IHZhbHVlLmNoYXJBdChpICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dENoID09ICcgJyB8fCBuZXh0Q2ggPT0gJ1x0JykgewotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobmV4dENoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBTdHJpbmcgcXVvdGVkUHJpbnRhYmxlID0gYnVpbGRlci50b1N0cmluZygpOwotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIFN0cmluZ1tdIGxpbmVzOwotICAgICAgICAgICAgICAgIGlmIChtU3RyaWN0TGluZUJyZWFrUGFyc2luZykgewotICAgICAgICAgICAgICAgICAgICBsaW5lcyA9IHF1b3RlZFByaW50YWJsZS5zcGxpdCgiXHJcbiIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBxdW90ZWRQcmludGFibGUubGVuZ3RoKCk7Ci0gICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxTdHJpbmc+IGxpc3QgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgY2hhciBjaCA9IHF1b3RlZFByaW50YWJsZS5jaGFyQXQoaSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT0gJ1xuJykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QuYWRkKGJ1aWxkZXIudG9TdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09ICdccicpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0LmFkZChidWlsZGVyLnRvU3RyaW5nKCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpIDwgbGVuZ3RoIC0gMSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyIG5leHRDaCA9IHF1b3RlZFByaW50YWJsZS5jaGFyQXQoaSArIDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dENoID09ICdcbicpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBmaW5hbExpbmUgPSBidWlsZGVyLnRvU3RyaW5nKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChmaW5hbExpbmUubGVuZ3RoKCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsaXN0LmFkZChmaW5hbExpbmUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGxpbmVzID0gbGlzdC50b0FycmF5KG5ldyBTdHJpbmdbMF0pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBsaW5lIDogbGluZXMpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGxpbmUuZW5kc1dpdGgoIj0iKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbGluZSA9IGxpbmUuc3Vic3RyaW5nKDAsIGxpbmUubGVuZ3RoKCkgLSAxKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChsaW5lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnl0ZVtdIGJ5dGVzOwotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ5dGVzID0gYnVpbGRlci50b1N0cmluZygpLmdldEJ5dGVzKG1JbnB1dENoYXJzZXQpOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFVuc3VwcG9ydGVkRW5jb2RpbmdFeGNlcHRpb24gZTEpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkZhaWxlZCB0byBlbmNvZGU6IGNoYXJzZXQ9IiArIG1JbnB1dENoYXJzZXQpOwotICAgICAgICAgICAgICAgICAgICBieXRlcyA9IGJ1aWxkZXIudG9TdHJpbmcoKS5nZXRCeXRlcygpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBieXRlcyA9IFF1b3RlZFByaW50YWJsZUNvZGVjLmRlY29kZVF1b3RlZFByaW50YWJsZShieXRlcyk7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoRGVjb2RlckV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJGYWlsZWQgdG8gZGVjb2RlIHF1b3RlZC1wcmludGFibGU6ICIgKyBlKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuICIiOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybi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BkZXRlY3RvcikgewotICAgICAgICB0aGlzKGRldGVjdG9yICE9IG51bGwgPyBkZXRlY3Rvci5nZXRFc3RpbWF0ZWRUeXBlKCkgOiBWQ2FyZENvbmZpZy5QQVJTRV9UWVBFX1VOS05PV04pOwotICAgIH0KLQotICAgIHB1YmxpYyBWQ2FyZFBhcnNlcl9WMjEoaW50IHBhcnNlVHlwZSkgewotICAgICAgICBzdXBlcihwYXJzZVR5cGUpOwotICAgICAgICBpZiAocGFyc2VUeXBlID09IFZDYXJkQ29uZmlnLlBBUlNFX1RZUEVfRk9NQSkgewotICAgICAgICAgICAgbU5lc3RDb3VudCA9IDE7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBQYXJzZXMgdGhlIGZpbGUgYXQgdGhlIGdpdmVuIHBvc2l0aW9uLgotICAgICAqCi0gICAgICogdmNhcmRfZmlsZSA9IFt3c2xzXSB2Y2FyZCBbd3Nsc10KLSAgICAgKi8KLSAgICBwcm90ZWN0ZWQgdm9pZCBwYXJzZVZDYXJkRmlsZSgpIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24gewotICAgICAgICBib29sZWFuIGZpcnN0UmVhZGluZyA9IHRydWU7Ci0gICAgICAgIHdoaWxlICh0cnVlKSB7Ci0gICAgICAgICAgICBpZiAobUNhbmNlbGVkKSB7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIXBhcnNlT25lVkNhcmQoZmlyc3RSZWFkaW5nKSkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZmlyc3RSZWFkaW5nID0gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobU5lc3RDb3VudCA+IDApIHsKLSAgICAgICAgICAgIGJvb2xlYW4gdXNlQ2FjaGUgPSB0cnVlOwotICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7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SZWFjaGVkIGVuZCBvZiBidWZmZXIuIik7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmUudHJpbSgpLmxlbmd0aCgpID4gMCkgeyAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICByZXR1cm4gbGluZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIHZjYXJkID0gIkJFR0lOIiBbd3NdICI6IiBbd3NdICJWQ0FSRCIgW3dzXSAxKkNSTEYKLSAgICAgKiAgICAgICAgIGl0ZW1zICpDUkxGCi0gICAgICogICAgICAgICAiRU5EIiBbd3NdICI6IiBbd3NdICJWQ0FSRCIKLSAgICAgKi8KLSAgICBwcml2YXRlIGJvb2xlYW4gcGFyc2VPbmVWQ2FyZChib29sZWFuIGZpcnN0UmVhZGluZykgdGhyb3dzIElPRXhjZXB0aW9uLCBWQ2FyZEV4Y2VwdGlvbiB7Ci0gICAgICAgIGJvb2xlYW4gYWxsb3dHYXJiYWdlID0gZmFsc2U7Ci0gICAgICAgIGlmIChmaXJzdFJlYWRpbmcpIHsKLSAgICAgICAgICAgIGlmIChtTmVzdENvdW50ID4gMCkgewotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbU5lc3RDb3VudDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghcmVhZEJlZ2luVkNhcmQoYWxsb3dHYXJiYWdlKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGFsbG93R2FyYmFnZSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCFyZWFkQmVnaW5WQ2FyZChhbGxvd0dhcmJhZ2UpKSB7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICA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mFnZSkgdGhyb3dzIElPRXhjZXB0aW9uLCBWQ2FyZEV4Y2VwdGlvbiB7Ci0gICAgICAgIFN0cmluZyBsaW5lOwotICAgICAgICBkbyB7Ci0gICAgICAgICAgICB3aGlsZSAodHJ1ZSkgewotICAgICAgICAgICAgICAgIGxpbmUgPSBnZXRMaW5lKCk7Ci0gICAgICAgICAgICAgICAgaWYgKGxpbmUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChsaW5lLnRyaW0oKS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgU3RyaW5nW10gc3RyQXJyYXkgPSBsaW5lLnNwbGl0KCI6IiwgMik7Ci0gICAgICAgICAgICBpbnQgbGVuZ3RoID0gc3RyQXJyYXkubGVuZ3RoOwotCi0gICAgICAgICAgICAvLyBUaG91Z2ggdkNhcmQgMi4xLzMuMCBzcGVjaWZpY2F0aW9uIGRvZXMgbm90IGFsbG93IGxvd2VyIGNhc2VzLAotICAgICAgICAgICAgLy8gdkNhcmQgZmlsZSBlbWl0dGVkIGJ5IHNvbWUgZXh0ZXJuYWwgdkNhcmQgZXhwb3RlciBoYXZlIHN1Y2ggaW52YWxpZCBTdHJpbmdzLgotICAgICAgICAgICAgLy8gU28gd2UgYWxsb3cgaXQuCi0gICAgICAgICAgICAvLyBlLmcuIEJFR0lOOnZDYXJkCi0gICAgICAgICAgICBpZiAobGVuZ3RoID09IDIgJiYKLSAgICAgICAgICAgICAgICAgICAgc3RyQXJyYXlbMF0udHJpbSgpLmVxdWFsc0lnbm9yZUNhc2UoIkJFR0lOIikgJiYKLSAgICAgICAgICAgICAgICAgICAgc3RyQXJyYXlbMV0udHJpbSgpLmVxdWFsc0lnbm9yZUNhc2UoIlZDQVJEIikpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoIWFsbG93R2FyYmFnZSkgewotICAgICAgICAgICAgICAgIGlmIChtTmVzdENvdW50ID4gMCkgewotICAgICAgICAgICAgICAgICAgICBtUHJldmlvdXNMaW5lID0gbGluZTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBWQ2FyZEV4Y2VwdGlvbigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRXhwZWN0ZWQgU3RyaW5nIFwiQkVHSU46VkNBUkRcIiBkaWQgbm90IGNvbWUgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIihJbnN0ZWFkLCBcIiIgKyBsaW5lICsgIlwiIGNhbWUpIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IHdoaWxlKGFsbG93R2FyYmFnZSk7Ci0KLSAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKCJSZWFjaGVkIHdoZXJlIG11c3Qgbm90IGJlIHJlYWNoZWQuIik7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogVGhlIGFyZ3VtZW50cyB1c2VDYWNoZSBhbmQgYWxsb3dHYXJiYXNlIGFyZSB1c3VhbGx5IHRydWUgYW5kIGZhbHNlIGFjY29yZGluZ2x5IHdoZW4KLSAgICAgKiB0aGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBvdXRzaWRlIHRoaXMgZnVuY3Rpb24gaXRzZWxmLiAKLSAgICAgKgotICAgICAqIEBwYXJhbSB1c2VDYWNoZSBXaGVuIHRydWUsIGxpbmUgaXMgb2J0YWluZWQgZnJvbSBtUHJldmlvdXNsaW5lLiBPdGhlcndpc2UsIGdldExpbmUoKQotICAgICAqIGlzIHVzZWQuCi0gICAgICogQHBhcmFtIGFsbG93R2FyYmFnZSBXaGVuIHRydWUsIGlnbm9yZSBub24gIkVORDpWQ0FSRCIgbGluZS4KLSAgICAgKiBAdGhyb3dzIElPRXhjZXB0aW9uCi0gICAgICogQHRocm93cyBWQ2FyZEV4Y2VwdGlvbgotICAgICAqLwotICAgIHByb3RlY3RlZCB2b2lkIHJlYWRFbmRWQ2FyZChib29sZWFuIHVzZUNhY2hlLCBib29sZWFuIGFsbG93R2FyYmFnZSkKLSAgICAgICAgICAgIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24gewotICAgICAgICBTdHJpbmcgbGluZTsKLSAgICAgICAgZG8gewotICAgICAgICAgICAgaWYgKHVzZUNhY2hlKSB7Ci0gICAgICAgICAgICAgICAgLy8gVGhvdWdoIHZDYXJkIHNwZWNpZmljYXRpb24gZG9lcyBub3QgYWxsb3cgbG93ZXIgY2FzZXMsCi0gICAgICAgICAgICAgICAgLy8gc29tZSBkYXRhIG1heSBoYXZlIHRoZW0sIHNvIHdlIGFsbG93IGl0LgotICAgICAgICAgICAgICAgIGxpbmUgPSBtUHJldmlvdXNMaW5lOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICB3aGlsZSAodHJ1ZSkgewotICAgICAgICAgICAgICAgICAgICBsaW5lID0gZ2V0TGluZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAobGluZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIkV4cGVjdGVkIEVORDpWQ0FSRCB3YXMgbm90IGZvdW5kLiIpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmUudHJpbSgpLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIFN0cmluZ1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cGVydHlOYW1lLmVxdWFscygiQUdFTlQiKSkgewotICAgICAgICAgICAgaGFuZGxlQWdlbnQocHJvcGVydHlWYWx1ZSk7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0gZWxzZSBpZiAoaXNWYWxpZFByb3BlcnR5TmFtZShwcm9wZXJ0eU5hbWUpKSB7Ci0gICAgICAgICAgICBpZiAocHJvcGVydHlOYW1lLmVxdWFscygiQkVHSU4iKSkgewotICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0eVZhbHVlLmVxdWFscygiVkNBUkQiKSkgewotICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmROZXN0ZWRFeGNlcHRpb24oIlRoaXMgdkNhcmQgaGFzIG5lc3RlZCB2Q2FyZCBkYXRhIGluIGl0LiIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBWQ2FyZEV4Y2VwdGlvbigiVW5rbm93biBCRUdJTiB0eXBlOiAiICsgcHJvcGVydHlWYWx1ZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmIChwcm9wZXJ0eU5hbWUuZXF1YWxzKCJWRVJTSU9OIikgJiYKLSAgICAgICAgICAgICAgICAgICAgIXByb3BlcnR5VmFsdWUuZXF1YWxzKGdldFZlcnNpb25TdHJpbmcoKSkpIHsKLSAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRWZXJzaW9uRXhjZXB0aW9uKCJJbmNvbXBhdGlibGUgdmVyc2lvbjogIiArIAotICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlWYWx1ZSArICIgIT0gIiArIGdldFZlcnNpb25TdHJpbmcoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzdGFydCA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwotICAgICAgICAgICAgaGFuZGxlUHJvcGVydHlWYWx1Z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gICAgICBpZiAobGVuZ3RoID4gMCAmJiBsaW5lLmNoYXJBdCgwKSA9PSAnIycpIHsKLSAgICAgICAgICAgIHRocm93IG5ldyBWQ2FyZEludmFsaWRDb21tZW50TGluZUV4Y2VwdGlvbigpOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgewotICAgICAgICAgICAgY2hhciBjaCA9IGxpbmUuY2hhckF0KGkpOyAKLSAgICAgICAgICAgIHN3aXRjaCAoc3RhdGUpIHsKLSAgICAgICAgICAgICAgICBjYXNlIFNUQVRFX0dST1VQX09SX1BST1BOQU1FOiB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PSAnOicpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBwcm9wZXJ0eU5hbWUgPSBsaW5lLnN1YnN0cmluZyhuYW1lSW5kZXgsIGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHByb3BlcnR5TmFtZS5lcXVhbHNJZ25vcmVDYXNlKCJFTkQiKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c0xpbmUgPSBsaW5lOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1CdWlsZGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQnVpbGRlci5wcm9wZXJ0eU5hbWUocHJvcGVydHlOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5TmFtZUFuZFZhbHVlWzBdID0gcHJvcGVydHlOYW1lOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPCBsZW5ndGggLSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlOYW1lQW5kVmFsdWVbMV0gPSBsaW5lLnN1YnN0cmluZyhpICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5TmFtZUFuZFZhbHVlWzFdID0gIiI7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHJvcGVydHlOYW1lQW5kVmFsdWU7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gJy4nKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZ3JvdXBOYW1lID0gbGluZS5zdWJzdHJpbmcobmFtZUluZGV4LCBpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIucHJvcGVydHlHcm91cChncm91cE5hbWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgbmFtZUluZGV4ID0gaSArIDE7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gJzsnKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcHJvcGVydHlOYW1lID0gbGluZS5zdWJzdHJpbmcobmFtZUluZGV4LCBpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0eU5hbWUuZXF1YWxzSWdub3JlQ2FzZSgiRU5EIikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJldmlvdXNMaW5lID0gbGluZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIucHJvcGVydHlOYW1lKHByb3BlcnR5TmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eU5hbWVBbmRWYWx1ZVswXSA9IHByb3BlcnR5TmFtZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVJbmRleCA9IGkgKyAxOwotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9QQVJBTVM7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhc2UgU1RBVEVfUEFSQU1TOiB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PSAnIicpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gU1RBVEVfUEFSQU1TX0lOX0RRVU9URTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnOycpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZVBhcmFtcyhsaW5lLnN1YnN0cmluZyhuYW1lSW5kZXgsIGkpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVJbmRleCA9IGkgKyAxOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09ICc6JykgewotICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlUGFyYW1zKGxpbmUuc3Vic3RyaW5nKG5hbWVJbmRleCwgaSkpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPCBsZW5ndGggLSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydHlOYW1lQW5kVmFsdWVbMV0gPSBsaW5lLnN1YnN0cmluZyhpICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5TmFtZUFuZFZhbHVlWzFdID0gIiI7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHJvcGVydHlOYW1lQW5kVmFsdWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNhc2UgU1RBVEVfUEFSQU1TX0lOX0RRVU9URTogewotICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT0gJyInKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX1BBUkFNUzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIHRocm93IG5ldyBWQ2FyZEludmFsaWRMaW5lRXhjZXB0aW9uKCJJbnZhbGlkIGxpbmU6IFwiIiArIGxpbmUgKyAiXCIiKTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBwYXJhbXMgICAgID0gIjsiIFt3c10gcGFyYW1saXN0Ci0gICAgICogcGFyYW1saXN0ICA9IHBhcmFtbGlzdCBbd3NdICI7IiBbd3NdIHBhcmFtCi0gICAgICogICAgICAgICAgICAvIHBhcmFtCi0gICAgICogcGFyYW0gICAgICA9ICJUWVBFIiBbd3NdICI9IiBbd3NdIHB0eXBldmFsCi0gICAgICogICAgICAgICAgICAvICJWQUxVRSIgW3dzXSAiPSIgW3dzXSBwdmFsdWV2YWwKLSAgICAgKiAgICAgICAgICAgIC8gIkVOQ09ESU5HIiBbd3NdICI9IiBbd3NdIHBlbmNvZGluZ3ZhbAotICAgICAqICAgICAgICAgICAgLyAiQ0hBUlNFVCIgW3dzXSAiPSIgW3dzXSBjaGFyc2V0dmFsCi0gICAgICogICAgICAgICAgICAvICJMQU5HVUFHRSIgW3dzXSAiPSIgW3dzXSBsYW5ndmFsCi0gICAgICogICAgICAgICAgICAvICJYLSIgd29yZCBbd3NdICI9IiBbd3NdIHdvcmQKLSAgICAgKiAgICAgICAgICAgIC8ga25vd250eXBlCi0gICAgICovCi0gICAgcHJvdGVjdGVkIHZvaWQgaGFuZGxlUGFyYW1zKFN0cmluZyBwYXJhbXMpIHRocm93cyBWQ2FyZEV4Y2VwdGlvbiB7Ci0gICAgICAgIFN0cmluZ1tdIHN0ckFycmF5ID0gcGFyYW1zLnNwbGl0KCI9IiwgMik7Ci0gICAgICAgIGlmIChzdHJBcnJheS5sZW5ndGggPT0gMikgewotICAgICAgICAgICAgZmluYWwgU3RyaW5nIHBhcmFtTmFtZSA9IHN0ckFycmF5WzBdLnRyaW0oKS50b1VwcGVyQ2FzZSgpOwotICAgICAgICAgICAgU3RyaW5nIHBhcmFtVmFsdWUgPSBzdHJBcnJheVsxXS50cmltKCk7Ci0gICAgICAgICAgICBpZiAocGFyYW1OYW1lLmVxdWFscygiVFlQRSIpKSB7Ci0gICAgICAgICAgICAgICAgaGFuZGxlVHlwZShwYXJhbVZhbHVlKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAocGFyYW1OYW1lLmVxdWFscygiVkFMVUUiKSkgewotICAgICAgICAgICAgICAgIGhhbmRsZVZhbHVlKHBhcmFtVmFsdWUpOwotICAgICAgICAgICAgfSBlbHNlIGlmIChwYXJhbU5hbWUuZXF1YWxzKCJFTkNPRElORyIpKSB7Ci0gICAgICAgICAgICAgICAgaGFuZGxlRW5jb2RpbmcocGFyYW1WYWx1ZSk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHBhcmFtTmFtZS5lcXVhbHMoIkNIQVJTRVQiKSkgewotICAgICAgICAgICAgICAgIGhhbmRsZUNoYXJzZXQocGFyYW1WYWx1ZSk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHBhcmFtTmFtZS5lcXV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G1heSBiZSBzbyBiaWcgdGhhdAotICAgICAgICAgICAgLy8gT3V0T2ZNZW1vcnlFcnJvciBvY2N1cnMuIFRvIGlnbm9yZSBzdWNoIGNhc2VzLCB1c2UgdHJ5LWNhdGNoLgotICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgcmVzdWx0ID0gZ2V0QmFzZTY0KHByb3BlcnR5VmFsdWUpOwotICAgICAgICAgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxTdHJpbmc+IHYgPSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKLSAgICAgICAgICAgICAgICAgICAgdi5hZGQocmVzdWx0KTsKLSAgICAgICAgICAgICAgICAgICAgbUJ1aWxkZXIucHJvcGVydHlWYWx1ZXModik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBjYXRjaCAoT3V0T2ZNZW1vcnlFcnJvciBlcnJvcikgewotICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJPdXRPZk1lbW9yeUVycm9yIGhhcHBlbmVkIGR1cmluZyBwYXJzaW5nIEJBU0U2NCBkYXRhISIpOwotICAgICAgICAgICAgICAgIGlmIChtQnVpbGRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1CdWlsZGVyLnByb3BlcnR5VmFsdWVzKG51bGwpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1UaW1lSGFuZGxlQmFzZTY0ICs9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpIC0gc3RhcnQ7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoIShtRW5jb2RpbmcgPT0gbnVsbCB8fCBtRW5jb2RpbmcuZXF1YWxzSWdub3JlQ2FzZSgiN0JJVCIpCi0gICAgICAgICAgICAgICAgICAgIHx8IG1FbmNv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nbWVudCB0cmFuc3BvcnQtcGFkZGluZyBDUkxGKQotICAgICAgICAvLyAgICAgICAgICAgIHFwLXBhcnQgdHJhbnNwb3J0LXBhZGRpbmcKLSAgICAgICAgLy8gcXAtc2VnbWVudCA6PSBxcC1zZWN0aW9uICooU1BBQ0UgLyBUQUIpICI9IgotICAgICAgICAvLyAgICAgICAgICAgICA7IE1heGltdW0gbGVuZ3RoIG9mIDc2IGNoYXJhY3RlcnMKLSAgICAgICAgLy8KLSAgICAgICAgLy8gZS5nLiAoZnJvbSBSRkMgMjA0NSkKLSAgICAgICAgLy8gTm93J3MgdGhlIHRpbWUgPQotICAgICAgICAvLyBmb3IgYWxsIGZvbGsgdG8gY29tZT0KLSAgICAgICAgLy8gIHRvIHRoZSBhaWQgb2YgdGhlaXIgY291bnRyeS4KLSAgICAgICAgaWYgKGZpcnN0U3RyaW5nLnRyaW0oKS5lbmRzV2l0aCgiPSIpKSB7Ci0gICAgICAgICAgICAvLyByZW1vdmUgInRyYW5zcG9ydC1wYWRkaW5nIgotICAgICAgICAgICAgaW50IHBvcyA9IGZpcnN0U3RyaW5nLmxlbmd0aCgpIC0gMTsKLSAgICAgICAgICAgIHdoaWxlKGZpcnN0U3RyaW5nLmNoYXJBdChwb3MpICE9ICc9JykgewotICAgICAgICAgICAgfQotICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGZpcnN0U3RyaW5nLnN1YnN0cmluZygwLCBwb3MgKyAxKSk7Ci0gICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXHJcbiIpOwotICAgICAgICAgICAgU3RyaW5nIGxpbmU7Ci0gICAgICAgICAgICB3aGlsZSAodHJ1ZSkgewotICAgICAgICAgICAgICAgIGxpbmUgPSBnZXRMaW5lKCk7Ci0gICAgICAgICAgICAgICAgaWYgKGxpbmUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIkZpbGUgZW5kZWQgZHVyaW5nIHBhcnNpbmcgcXVvdGVkLXByaW50YWJsZSBTdHJpbmciKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGxpbmUudHJpbSgpLmVuZHNXaXRoKCI9IikpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gcmVtb3ZlICJ0cmFuc3BvcnQtcGFkZGluZyIKLSAgICAgICAgICAgICAgICAgICAgcG9zID0gbGluZS5sZW5ndGgoKSAtIDE7Ci0gICAgICAgICAgICAgICAgICAgIHdoaWxlKGxpbmUuY2hhckF0KHBvcykgIT0gJz0nKSB7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGluZS5zdWJzdHJpbmcoMCwgcG9zICsgMSkpOwotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXHJcbiIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxpbmUpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOyAKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldHVybiBmaXJzdFN0cmluZzsKLSAgICAgICAgfQotICAgIH0KLSAgICAKLSAgICBwcm90ZWN0ZWQgU3RyaW5nIGdldEJhc2U2NChTdHJpbmcgZmlyc3RTdHJpbmcpIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24gewotICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICBidWlsZGVyLmFwcGVuZChmaXJzdFN0cmluZyk7Ci0gICAgICAgIAotICAgICAgICB3aGlsZSAodHJ1ZSkgewotICAgICAgICAgICAgU3RyaW5nIGxpbmUgPSBnZXRMaW5lKCk7Ci0gICAgICAgICAgICBpZiAobGluZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKAotICAgICAgICAgICAgICAgICAgICAgICAgIkZpbGUgZW5kZWQgZHVyaW5nIHBhcnNpbmcgQkFTRTY0IGJpbmFyeSIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGxpbmUubGVuZ3RoKCkgPT0gMCkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGluZSk7Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIHJldHVybiBidWlsZGVyLnRvU3RyaW5nKCk7Ci0gICAgfQotICAgIAotICAgIC8qKgotICAgICAqIE1haW5seSBmb3IgIkFEUiIsICJPUkciLCBhbmQgIk4iCi0gICAgICogV2UgZG8gbm90IGNhcmUgdGhlIG51bWJlciBvZiBzdHJub3NlbWkgaGVyZS4KLSAgICAgKiAKLSAgICAgKiBhZGRyZXNzcGFydHMgPSAwKjYoc3Rybm9zZW1pICI7Iikgc3Rybm9zZW1pCi0gICAgICogICAgICAgICAgICAgIDsgUE8gQm94LCBFeHRlbmRlZCBBZGRyLCBTdHJlZXQsIExvY2FsaXR5LCBSZWdpb24sCi0gICAgICogICAgICAgICAgICAgICAgUG9zdGFsIENvZGUsIENvdW50cnkgTmFtZQotICAgICAqIG9yZ3BhcnRzICAgICA9ICooc3Rybm9zZW1pICI7Iikgc3Rybm9zZW1pCi0gICAgICogICAgICAgICAgICAgIDsgRmlyc3QgaXMgT3JnYW5pemF0aW9uIE5hbWUsCi0gICAgICogICAgICAgICAgICAgICAgcmVtYWluZGVyIGFyZ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QgU3RyaW5nIGdldE5vbkVtcHR5TGluZSgpIHRocm93cyBJT0V4Y2VwdGlvbiwgVkNhcmRFeGNlcHRpb24gewotICAgICAgICBTdHJpbmcgbGluZTsKLSAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbnVsbDsKLSAgICAgICAgd2hpbGUgKHRydWUpIHsKLSAgICAgICAgICAgIGxpbmUgPSBtUmVhZGVyLnJlYWRMaW5lKCk7Ci0gICAgICAgICAgICBpZiAobGluZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGJ1aWxkZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVByZXZpb3VzTGluZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyByZXQgPSBtUHJldmlvdXNMaW5lOwotICAgICAgICAgICAgICAgICAgICBtUHJldmlvdXNMaW5lID0gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFZDYXJkRXhjZXB0aW9uKCJSZWFjaGVkIGVuZCBvZiBidWZmZXIuIik7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmUubGVuZ3RoKCkgPT0gMCkgewotICAgICAgICAgICAgICAgIGlmIChidWlsZGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1QcmV2aW91c0xpbmUgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcmV0ID0gbVByZXZpb3VzTGluZTsKLSAgICAgICAgICAgICAgICAgICAgbVByZXZpb3VzTGluZSA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmIChsaW5lLmNoYXJBdCgwKSA9PSAnICcgfHwgbGluZS5jaGFyQXQoMCkgPT0gJ1x0JykgewotICAgICAgICAgICAgICAgIGlmIChidWlsZGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gU2VlIFNlY3Rpb24gNS44LjEgb2YgUkZDIDI0MjUgKE1JTUUtRElSIGRvY3VtZW50KS4KLSAgICAgICAgICAgICAgICAgICAgLy8gRm9sbG93aW5nIGlzIHRoZSBleGNlcnB0cyBmcm9tIGl0LiAgCi0gICAgICAgICAgICAgICAgICAgIC8vCi0gICAgICAgICAgICAgICAgICAgIC8vIERFU0NSSVBUSU9OOlRoaXMgaXMgYSBsb25nIGRlc2NyaXB0aW9uIHRoYXQgZXhpc3RzIG9uIGEgbG9uZyBsaW5lLgotICAgICAgICAgICAgICAgICAgICAvLyAKLSAgICAgICAgICAgICAgICAgICAgLy8gQ2FuIGJlIHJlcHJlc2VudGVkIGFzOgotICAgICAgICAgICAgICAgICAgICAvLwotICAgICAgICAgICAgICAgICAgICAvLyBERVNDUklQVElPTjpUaGlzIGlzIGEgbG9uZyBkZXNjcmlwdGlvbgotICAgICAgICAgICAgICAgICAgICAvLyAgdGhhdCBleGlzdHMgb24gYSBsb25nIGxpbmUuCi0gICAgICAgICAgICAgICAgICAgIC8vCi0gICAgICAgICAgICAgICAgICAgIC8vIEl0IGNvdWxkIGFsc28gYmUgcmVwcmVzZW50ZWQgYXM6Ci0gICAgICAgICAgICAgICAgICAgIC8vCi0gICAgICAgICAgICAgICAgICAgIC8vIERFU0NSSVBUSU9OOlRoaXMgaXMgYSBsb25nIGRlc2NyaXAKLSAgICAgICAgICAgICAgICAgICAgLy8gIHRpb24gdGhhdCBleGlzdHMgbwotICAgICAgICAgICAgICAgICAgICAvLyAgbiBhIGxvbmcgbGluZS4KLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGluZS5zdWJzdHJpbmcoMSkpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVByZXZpb3VzTGluZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChtUHJldmlvdXNMaW5lKTsKLSAgICAgICAgICAgICAgICAgICAgbVByZXZpb3VzTGluZSA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxpbmUuc3Vic3RyaW5nKDEpKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVkNhcmRFeGNlcHRpb24oIlNwYWNlIGV4aXN0cyBhdCB0aGUgYmVnaW5uaW5nIG9mIHRoZSBsaW5lIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAobVByZXZpb3VzTGluZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c0xpbmUgPSBsaW5lOwotICAgICAgICAgICAgICAgICAgICBpZiAoYnVpbGRlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHJldCA9IG1QcmV2aW91c0xpbmU7Ci0gICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c0xpbmUgPSBsaW5lOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmV0OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICAKLSAgICAKLSAgICAvKioKLSAg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IGR1cmluZyBwYXJzaW5nIEJBU0U2NCBiaW5hcnkiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChsaW5lLmxlbmd0aCgpID09IDApIHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoIWxpbmUuc3RhcnRzV2l0aCgiICIpICYmICFsaW5lLnN0YXJ0c1dpdGgoIlx0IikpIHsKLSAgICAgICAgICAgICAgICBtUHJldmlvdXNMaW5lID0gbGluZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGxpbmUpOwotICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwotICAgIH0KLSAgICAKLSAgICAvKioKLSAgICAgKiBFU0NBUEVELUNIQVIgPSAiXFwiIC8gIlw7IiAvICJcLCIgLyAiXG4iIC8gIlxOIikKLSAgICAgKiAgICAgICAgICAgICAgOyBcXCBlbmNvZGVzIFwsIFxuIG9yIFxOIGVuY29kZXMgbmV3bGluZQotICAgICAqICAgICAgICAgICAgICA7IFw7IGVuY29kZXMgOywgXCwgZW5jb2RlcyAsCi0gICAgICogICAgICAgICAgICAgIAotICAgICAqIE5vdGU6IEFwcGxlIGVzY2FwZXMgJzonIGludG8gJ1w6JyB3aGlsZSBkb2VzIG5vdCBlc2NhcGUgJ1wnCi0gICAgICovCi0gICAgQE92ZXJyaWRlCi0gICAgcHJvdGVjdGVkIFN0cmluZyBtYXliZVVuZXNjYXBlVGV4dChTdHJpbmcgdGV4dCkgewotICAgICAgICByZXR1cm4gdW5lc2NhcGVUZXh0KHRleHQpOwotICAgIH0KLQotICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIHVuZXNjYXBlVGV4dChTdHJpbmcgdGV4dCkgewotICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICBpbnQgbGVuZ3RoID0gdGV4dC5sZW5ndGgoKTsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgewotICAgICAgICAgICAgY2hhciBjaCA9IHRleHQuY2hhckF0KGkpOwotICAgICAgICAgICAgaWYgKGNoID09ICdcXCcgJiYgaSA8IGxlbmd0aCAtIDEpIHsKLSAgICAgICAgICAgICAgICBjaGFyIG5leHRfY2ggPSB0ZXh0LmNoYXJBdCgrK2kpOyAKLSAgICAgICAgICAgICAgICBpZiAobmV4dF9jaCA9PSAnbicgfHwgbmV4dF9jaCA9PSAnTicpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIlxuIik7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobmV4dF9jaCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChjaCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIGJ1aWxkZXIudG9TdHJpbmcoKTsgICAgICAgIAotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHByb3RlY3RlZCBTdHJpbmcgbWF5YmVVbmVzY2FwZUNoYXJhY3RlcihjaGFyIGNoKSB7Ci0gICAgICAgIHJldHVybiB1bmVzY2FwZUNoYXJhY3RlcihjaCk7Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyBTdHJpbmcgdW5lc2NhcGVDaGFyYWN0ZXIoY2hhciBjaCkgewotICAgICAgICBpZiAoY2ggPT0gJ24nIHx8IGNoID09ICdOJykgewotICAgICAgICAgICAgcmV0dXJuICJcbiI7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICByZXR1cm4gU3RyaW5nLnZhbHVlT2YoY2gpOw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Ci0KLSAgICAvKioKLSAgICAgKiBSZXR1cm5zIEludGVyZ2VyIHdoZW4gdGhlIGdpdmVuIHR5cGVzIGNhbiBiZSBwYXJzZWQgYXMga25vd24gdHlwZS4gUmV0dXJucyBTdHJpbmcgb2JqZWN0Ci0gICAgICogd2hlbiBub3QsIHdoaWNoIHNob3VsZCBiZSBzZXQgdG8gbGFiZWwuIAotICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgT2JqZWN0IGdldFBob25lVHlwZUZyb21TdHJpbmdzKENvbGxlY3Rpb248U3RyaW5nPiB0eXBlcywKLSAgICAgICAgICAgIFN0cmluZyBudW1iZXIpIHsKLSAgICAgICAgaWYgKG51bWJlciA9PSBudWxsKSB7Ci0gICAgICAgICAgICBudW1iZXIgPSAiIjsKLSAgICAgICAgfQotICAgICAgICBpbnQgdHlwZSA9IC0xOwotICAgICAgICBTdHJpbmcgbGFiZWwgPSBudWxsOwotICAgICAgICBib29sZWFuIGlzRmF4ID0gZmFsc2U7Ci0gICAgICAgIGJvb2xlYW4gaGFzUHJlZiA9IGZhbHNlOwotICAgICAgICAKLSAgICAgICAgaWYgKHR5cGVzICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZvciAoU3RyaW5nIHR5cGVTdHJpbmcgOiB0eXBlcykgewotICAgICAgICAgICAgICAgIGlmICh0eXBlU3RyaW5nID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcgPSB0eXBlU3RyaW5nLnRvVXBwZXJDYXNlKCk7Ci0gICAgICAgICAgICAgICAgaWYgKHR5cGVTdHJpbmcuZXF1YWxzKFZDYXJkQ29uc3RhbnRzLlBBUkFNX1RZUEVfUFJFRikpIHsKLSAgICAgICAgICAgICAgICAgICAgaGFzUHJlZiA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlU3RyaW5nLmVxdWFscyhWQ2FyZENvbnN0YW50cy5QQVJBTV9UWVBFX0ZBWCkpIHsKLSAgICAgICAgICAgICAgICAgICAgaXNGYXggPSB0cnVlOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlU3RyaW5nLnN0YXJ0c1dpdGgoIlgtIikgJiYgdHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVTdHJpbmcgPSB0eXBlU3RyaW5nLnN1YnN0cmluZygyKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAodHlwZVN0cmluZy5sZW5ndGgoKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIHRtcCA9IHNLbm93blBob25lVHlwZU1hcF9TdG9JLmdldCh0eXBlU3RyaW5nKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRtcCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgdHlwZUNhbmRpZGF0ZSA9IHRtcDsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRZUEVfUEFHRVIgaXMgcHJlZmVyZWQgd2hlbiB0aGUgbnVtYmVyIGNvbnRhaW5zIEAgc3Vycm9uZGVkIGJ5Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBhIHBhZ2VyIG51bWJlciBhbmQgYSBkb21haW4gbmFtZS4KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGUuZy4KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIG8gMTExMUBkb21haW4uY29tCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyB4IEBkb21haW4uY29tCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyB4IDExMTFACi0gICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgaW5kZXhPZkF0ID0gbnVtYmVyLmluZGV4T2YoIkAiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodHlwZUNhbmRpZGF0ZSA9PSBQaG9uZS5UWVBFX1BBR0VSCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIDAgPCBpbmRleE9mQXQgJiYgaW5kZXhPZkF0IDwgbnVtYmVyLmxlbmd0aCgpIC0gMSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgdHlwZSA8IDAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgdHlwZSA9PSBQaG9uZS5UWVBFX0NVU1RPTSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSB0bXA7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSBQaG9uZS5UWVBFX0NVU1RPTTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gdHlwZVN0cmluZzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAodHlwZSA8IDApIHsKLSAgICAgICAgICAgIGlmIChoYXNQcmVmKSB7Ci0gICAgICAgICAgICAgICAgdHlwZSA9IFBob25lLlRZUEVfTUFJTjsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLy8gZGVmYXVsdCB0byBUWVBFX0hPTUUKLSAgICAgICAgICAgICAgICB0eXBlID0gUGhvbmUuVFlQRV9IT01FOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGlmIChpc0ZheCkgewotICAgICAgICAgICAgaWYgKHR5cGUgPT0gUGhvbmUuVFlQRV9IT01FKSB7Ci0gICAgICAgICAgICAgICAgdHlwZ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2V0LmNvbnRhaW5zKGxhYmVsKSk7Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyBib29sZWFuIGlzVmFsaWRJblYyMUJ1dFVua25vd25Ub0NvbnRhY3RzUGhvdGVUeXBlKGZpbmFsIFN0cmluZyBsYWJlbCkgewotICAgICAgICByZXR1cm4gc1Bob25lVHlwZXNVbmtub3duVG9Db250YWN0c1NldC5jb250YWlucyhsYWJlbCk7Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyBTdHJpbmcgZ2V0UHJvcGVydHlOYW1lRm9ySW0oZmluYWwgaW50IHByb3RvY29sKSB7Ci0gICAgICAgIHJldHVybiBzS25vd25JbVByb3BOYW1lTWFwX0l0b1MuZ2V0KHByb3RvY29sKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgc3RhdGljIFN0cmluZ1tdIHNvcnROYW1lRWxlbWVudHMoZmluYWwgaW50IHZjYXJkVHlwZSwKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBmYW1pbHlOYW1lLCBmaW5hbCBTdHJpbmcgbWlkZGxlTmFtZSwgZmluYWwgU3RyaW5nIGdpdmVuTmFtZSkgewotICAgICAgICBmaW5hbCBTdHJpbmdbXSBsaXN0ID0gbmV3IFN0cmluZ1szXTsKLSAgICAgICAgZmluYWwgaW50IG5hbWVPcmRlclR5cGUgPSBWQ2FyZENvbmZpZy5nZXROYW1lT3JkZXJUeXBlKHZjYXJkVHlwZSk7Ci0gICAgICAgIHN3aXRjaCAobmFtZU9yZGVyVHlwZSkgewotICAgICAgICAgICAgY2FzZSBWQ2FyZENvbmZpZy5OQU1FX09SREVSX0pBUEFORVNFOiB7Ci0gICAgICAgICAgICAgICAgaWYgKGNvbnRhaW5zT25seVByaW50YWJsZUFzY2lpKGZhbWlseU5hbWUpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICBjb250YWluc09ubHlQcmludGFibGVBc2NpaShnaXZlbk5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxpc3RbMF0gPSBnaXZlbk5hbWU7Ci0gICAgICAgICAgICAgICAgICAgIGxpc3RbMV0gPSBtaWRkbGVOYW1lOwotICAgICAgICAgICAgICAgICAgICBsaXN0WzJdID0gZmFtaWx5TmFtZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBsaXN0WzBdID0gZmFtaWx5TmFtZTsKLSAgICAgICAgICAgICAgICAgICAgbGlzdFsxXSA9IG1pZGRsZU5hbWU7Ci0gICAgICAgICAgICAgICAgICAgIGxpc3RbMl0gPSBnaXZlbk5hbWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBWQ2FyZENvbmZpZy5OQU1FX09SREVSX0VVUk9QRTogewotICAgICAgICAgICAgICAgIGxpc3RbMF0gPSBtaWRkbGVOYW1lOwotICAgICAgICAgICAgICAgIGxpc3RbMV0gPSBnaXZlbk5hbWU7Ci0gICAgICAgICAgICAgICAgbGlzdFsyXSA9IGZhbWlseU5hbWU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBkZWZhdWx0OiB7Ci0gICAgICAgICAgICAgICAgbGlzdFswXSA9IGdpdmVuTmFtZTsKLSAgICAgICAgICAgICAgICBsaXN0WzFdID0gbWlkZGxlTmFtZTsKLSAgICAgICAgICAgICAgICBsaXN0WzJdID0gZmFtaWx5TmFtZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gbGlzdDsKLSAgICB9Ci0KLSAgICBwdWJsaWMgc3RhdGljIGludCBnZXRQaG9uZU51bWJlckZvcm1hdChmaW5hbCBpbnQgdmNhcmRUeXBlKSB7Ci0gICAgICAgIGlmIChWQ2FyZENvbmZpZy5pc0phcGFuZXNlRGV2aWNlKHZjYXJkVHlwZSkpIHsKLSAg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H0KLSAgICAgICAgfQotICAgICAgICBpZiAoIVRleHRVdGlscy5pc0VtcHR5KHN1ZmZpeCkpIHsKLSAgICAgICAgICAgIGlmICghZmlyc3QpIHsKLSAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgnICcpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoc3VmZml4KTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOwotICAgIH0KLQotICAgIHB1YmxpYyBzdGF0aWMgTGlzdDxTdHJpbmc+IGNvbnN0cnVjdExpc3RGcm9tVmFsdWUoZmluYWwgU3RyaW5nIHZhbHVlLAotICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBpc1YzMCkgewotICAgICAgICBmaW5hbCBMaXN0PFN0cmluZz4gbGlzdCA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOwotICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICBpbnQgbGVuZ3RoID0gdmFsdWUubGVuZ3RoKCk7Ci0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHsKLSAgICAgICAgICAgIGNoYXIgY2ggPSB2YWx1ZS5jaGFyQXQoaSk7Ci0gICAgICAgICAgICBpZiAoY2ggPT0gJ1xcJyAmJiBpIDwgbGVuZ3RoIC0gMSkgewotICAgICAgICAgICAgICAgIGNoYXIgbmV4dENoID0gdmFsdWUuY2hhckF0KGkgKyAxKTsKLSAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgdW5lc2NhcGVkU3RyaW5nID0KLSAgICAgICAgICAgICAgICAgICAgKGlzVjMwID8gVkNhcmRQYXJzZXJfVjMwLnVuZXNjYXBlQ2hhcmFjdGVyKG5leHRDaCkgOgotICAgICAgICAgICAgICAgICAgICAgICAgVkNhcmRQYXJzZXJfVjIxLnVuZXNjYXBlQ2hhcmFjdGVyKG5leHRDaCkpOwotICAgICAgICAgICAgICAgIGlmICh1bmVzY2FwZWRTdHJpbmcgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCh1bmVzY2FwZWRTdHJpbmcpOwotICAgICAgICAgICAgICAgICAgICBpKys7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gJzsnKSB7Ci0gICAgICAgICAgICAgICAgbGlzdC5hZGQoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY2gpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGxpc3QuYWRkKGJ1aWxkZXIudG9TdHJpbmcoKSk7Ci0gICAgICAgIHJldHVybiBsaXN0OwotICAgIH0KLQotICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiBjb250YWluc09ubHlQcmludGFibGVBc2NpaShmaW5hbCBTdHJpbmcuLi52YWx1ZXMpIHsKLSAgICAgICAgaWYgKHZhbHVlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gY29udGFpbnNPbmx5UHJpbnRhYmxlQXNjaWkoQXJyYXlzLmFzTGlzdCh2YWx1ZXMpKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgc3RhdGljIGJvb2xlYW4gY29udGFpbnNPbmx5UHJpbnRhYmxlQXNjaWkoZmluYWwgQ29sbGVjdGlvbjxTdHJpbmc+IHZhbHVlcykgewotICAgICAgICBpZiAodmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0gICAgICAgIGZvciAoZmluYWwgU3RyaW5nIHZhbHVlIDogdmFsdWVzKSB7Ci0gICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkodmFsdWUpKSB7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIVRleHRVdGlscy5pc1ByaW50YWJsZUFzY2lpT25seSh2YWx1ZSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogVGhpcyBpcyB1c2VmdWwgd2hlbiBjaGVja2luZyB0aGUgc3RyaW5nIHNob3VsZCBiZSBlbmNvZGVkIGludG8gcXVvdGVkLXByaW50YWJsZQotICAgICAqIG9yIG5vdCwgd2hpY2ggaXMgcmVxdWlyZWQgYnkgdkNhcmQgMi4xLgotICAgICAqIFNlZSB0aGUgZGVmaW5pdGlvbiBvZiAiN2JpdCIgaW4gdkNhcmQgMi4xIHNwZWMgZm9yIG1vcmUgaW5mb3JtYXRpb24uCi0gICAgICovCi0gICAgcHVibGljIHN0YXRpYyBib29sZWFuIGNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShmaW5hbCBTdHJpbmcuLi52YWx1ZXMpIHsKLSAgICAgICAgaWYgKHZhbHVlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gY29udGFpbnNPbmx5Tm9uQ3JMZlByaW50YWJsZUFzY2lpKEFycmF5cy5hc0xpc3QodmFsdWVzKSk7Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyBib29sZWFuIGNvbnRhaW5zT25seU5vbkNyTGZQcmludGFibGVBc2NpaShmaW5hbCBDb2xsZWN0aW9uPFN0cmluZz4gdmFsdWVzKSB7Ci0gICAgICAgIGlmICh2YWx1ZXMgPT0gbnVsbCkgewotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLSAgICAgICAgZmluYWwgaW50IGFzY2lpRmlyc3QgPSAweDIwOwotICAgICAgICBmaW5hbCBpbnQgYXNjaWlMYXN0ID0gMHg3RTsgIC8vIGluY2x1ZGVkCi0gICAgICAgIGZvciAoZmluYWwgU3RyaW5nIHZhbHVlIDogdmFsdWVzKSB7Ci0gICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkodmFsdWUpKSB7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmaW5hbCBpbnQgbGVuZ3RoID0gdmFsdWUubGVuZ3RoKCk7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSA9IHZhbHVlLm9mZnNldEJ5Q29kZVBvaW50cyhpLCAxKSkgewotICAgICAgICAgICAgICAgIGZpbmFsIGludCBjID0gdmFsdWUuY29kZVBvaW50QXQoaSk7Ci0gICAgICAgICAgICAgICAgaWYgKCEoYXNjaWlGaXJzdCA8PSBjICYmIGMgPD0gYXNjaWlMYXN0KSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiB0cnVlOwotICAgIH0KLQotICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFNldDxDaGFyYWN0ZXI+IHNVbkFjY2VwdGFibGVBc2NpaUluVjIxV29yZFNldCA9Ci0gICAgICAgIG5ldyBIYXNoU2V0PENoYXJhY3Rlcj4oQXJyYXlzLmFzTGlzdCgnWycsICddJywgJz0nLCAnOicsICcuJywgJywnLCAnICcpKTsKLQotICAgIC8qKgotICAgICAqIFRoaXMg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BlbnRyaWVzIGFycmF5IGFuZCAiICsKKyAgICAgICAgICAgICAgICAgICAgImFuIGVudHJ5VmFsdWVzIGFycmF5LiIpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBib29sZWFuW10gY2hlY2tlZEl0ZW1zID0gZ2V0U2VsZWN0ZWRJdGVtcygpOworICAgICAgICBidWlsZGVyLnNldE11bHRpQ2hvaWNlSXRlbXMobUVudHJpZXMsIGNoZWNrZWRJdGVtcywKKyAgICAgICAgICAgICAgICBuZXcgRGlhbG9nSW50ZXJmYWNlLk9uTXVsdGlDaG9pY2VDbGlja0xpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKERpYWxvZ0ludGVyZmFjZSBkaWFsb2csIGludCB3aGljaCwgYm9vbGVhbiBpc0NoZWNrZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0NoZWNrZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJlZmVyZW5jZUNoYW5nZWQgfD0gbU5ld1ZhbHVlcy5hZGQobUVudHJpZXNbd2hpY2hdLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJlZmVyZW5jZUNoYW5nZWQgfD0gbU5ld1ZhbHVlcy5yZW1vdmUobUVudHJpZXNbd2hpY2hdLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgIG1OZXdWYWx1ZXMuY2xlYXIoKTsKKyAgICAgICAgbU5ld1ZhbHVlcy5hZGRBbGwobVZhbHVlcyk7CisgICAgfQorICAgIAorICAgIHByaXZhdGUgYm9vbGVhbltdIGdldFNlbGVjdGVkSXRlbXMoKSB7CisgICAgICAgIGZpbmFsIENoYXJTZXF1ZW5jZVtdIGVudHJpZXMgPSBtRW50cmllczsKKyAgICAgICAgZmluYWwgaW50IGVudHJ5Q291bnQgPSBlbnRyaWVzLmxlbmd0aDsKKyAgICAgICAgZmluYWwgU2V0PFN0cmluZz4gdmFsdWVzID0gbVZhbHVlczsKKyAgICAgICAgYm9vbGVhbltdIHJlc3VsdCA9IG5ldyBib29sZWFuW2VudHJ5Q291bnRdOworICAgICAgICAKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBlbnRyeUNvdW50OyBpKyspIHsKKyAgICAgICAgICAgIHJlc3VsdFtpXSA9IHZhbHVlcy5jb250YWlucyhlbnRyaWVzW2ldLnRvU3RyaW5nKCkpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKyAgICAKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvbkRpYWxvZ0Nsb3NlZChib29sZWFuIHBvc2l0aXZlUmVzdWx0KSB7CisgICAgICAgIHN1cGVyLm9uRGlhbG9nQ2xvc2VkKHBvc2l0aXZlUmVzdWx0KTsKKyAgICAgICAgCisgICAgICAgIGlmIChwb3NpdGl2ZVJlc3VsdCAmJiBtUHJlZmVyZW5jZUNoYW5nZWQpIHsKKyAgICAgICAgICAgIGZpbmFsIFNldDxTdHJpbmc+IHZhbHVlcyA9IG1OZXdWYWx1ZXM7CisgICAgICAgICAgICBpZiAoY2FsbENoYW5nZUxpc3RlbmVyKHZhbHVlcykpIHsKKyAgICAgICAgICAgICAgICBzZXRWYWx1ZXModmFsdWVzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBtUHJlZmVyZW5jZUNoYW5nZWQgPSBmYWxzZTsKKyAgICB9CisgICAgCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIE9iamVjdCBvbkdldERlZmF1bHRWYWx1ZShUeXBlZEFycmF5IGEsIGludCBpbmRleCkgeworICAgICAgICBmaW5hbCBDaGFyU2VxdWVu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NhdmVkU3RhdGUoc3VwZXJTdGF0ZSk7CisgICAgICAgIG15U3RhdGUudmFsdWVzID0gZ2V0VmFsdWVzKCk7CisgICAgICAgIHJldHVybiBteVN0YXRlOworICAgIH0KKyAgICAKKyAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBTYXZlZFN0YXRlIGV4dGVuZHMgQmFzZVNhdmVkU3RhdGUgeworICAgICAgICBTZXQ8U3RyaW5nPiB2YWx1ZXM7CisgICAgICAgIAorICAgICAgICBwdWJsaWMgU2F2ZWRTdGF0ZShQYXJjZWwgc291cmNlKSB7CisgICAgICAgICAgICBzdXBlcihzb3VyY2UpOworICAgICAgICAgICAgdmFsdWVzID0gbmV3IEhhc2hTZXQ8U3RyaW5nPigpOworICAgICAgICAgICAgU3RyaW5nW10gc3RyaW5ncyA9IHNvdXJjZS5yZWFkU3RyaW5nQXJyYXkoKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgZmluYWwgaW50IHN0cmluZ0NvdW50ID0gc3RyaW5ncy5sZW5ndGg7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHN0cmluZ0NvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICB2YWx1ZXMuYWRkKHN0cmluZ3NbaV0pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgU2F2ZWRTdGF0ZShQYXJjZWxhYmxlIHN1cGVyU3RhdGUpIHsKKyAgICAgICAgICAgIHN1cGVyKHN1cGVyU3RhdGUpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IGZsYWdzKSB7CisgICAgICAgICAgICBzdXBlci53cml0ZVRvUGFyY2VsKGRlc3QsIGZsYWdzKTsKKyAgICAgICAgICAgIGRlc3Qud3JpdGVTdHJpbmdBcnJheSh2YWx1ZXMudG9BcnJheShuZXc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2lzdGVudCwgZ2V0IGFuIGVkaXRvciBmcm9tCisgICAgICogdGhlIHtAbGluayBQcmVmZXJlbmNlTWFuYWdlcn0sIHB1dCBpbiB0aGUgc3RyaW5ncywgYW5kIGNoZWNrIGlmIHdlIHNob3VsZCBjb21taXQgKGFuZAorICAgICAqIGNvbW1pdCBpZiBzbykuCisgICAgICogCisgICAgICogQHBhcmFtIHZhbHVlcyBUaGUgdmFsdWVzIHRvIHBlcnNpc3QuCisgICAgICogQHJldHVybiBUcnVlIGlmIHRoZSBQcmVmZXJlbmNlIGlzIHBlcnNpc3RlbnQuIChUaGlzIGlzIG5vdCB3aGV0aGVyIHRoZQorICAgICAqICAgICAgICAgdmFsdWUgd2FzIHBlcnNpc3RlZCwgc2luY2Ugd2UgbWF5IG5vdCBuZWNlc3NhcmlseSBjb21taXQgaWYgdGhlcmUKKyAgICAgKiAgICAgICAgIHdpbGwgYmUgYSBiYXRjaCBjb21taXQgbGF0ZXIuKQorICAgICAqIEBzZWUgI2dldFBlcnNpc3RlZFN0cmluZyhTZXQpCisgICAgICogCisgICAgICogQGhpZGUgUGVuZGluZyBBUEkgYXBwcm92YWwKKyAgICAgKi8KKyAgICBwcm90ZWN0ZWQgYm9vbGVhbiBwZXJzaXN0U3RyaW5nU2V0KFNldDxTdHJpbmc+IHZhbHVlcykgeworICAgICAgICBpZiAoc2hvdWxkUGVyc2lzdCgpKSB7CisgICAgICAgICAgICAvLyBTaG91bGRuJ3Qgc3RvcmUgbnVsbAorICAgICAgICAgICAgaWYgKHZhbHVlcy5lcXVhbHMoZ2V0UGVyc2lzdGVkU3RyaW5nU2V0KG51bGwpKSkgeworICAgICAgICAgICAgICAgIC8vIEl0J3MgYWxyZWFkeSB0aGVyZSwgc28gdGhlIHNhbWUgYXMgcGVyc2lzdGluZworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBTaGFyZWRQcmVmZXJlbmNlcy5FZGl0b3IgZWRpdG9yID0gbVByZWZlcmVuY2VNYW5hZ2VyLmdldEVkaXRvcigpOworICAgICAgICAgICAgZWRpdG9yLnB1dFN0cmluZ1NldChtS2V5LCB2YWx1ZXMpOworICAgICAgICAgICAgdHJ5Q29tbWl0KGVkaXRvcik7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogQXR0ZW1wdHMgdG8gZ2V0IGEgcGVyc2lzdGVkIHNldCBvZiBTdHJpbmdzIGZyb20gdGhlCisgICAgICoge0BsaW5rIGFuZHJvaWQuY29udGVudC5TaGFyZWRQcmVmZXJlbmNlc30uCisgICAgICogPHA+CisgICAgICogVGhpcyB3aWxsIGNoZWNrIGlmIHRoaXMgUHJlZmVyZW5jZSBpcyBwZXJzaXN0ZW50LCBnZXQgdGhlIFNoYXJlZFByZWZlcmVuY2VzCisgICAgICogZnJvbSB0aGUge0BsaW5rIFByZWZlcmVuY2VNYW5hZ2VyfSwgYW5kIGdldCB0aGUgdmFsdWUuCisgICAgICogCisgICAgICogQHBhcmFtIGRlZmF1bHRSZXR1cm5WYWx1ZSBUaGUgZGVmYXVsdCB2YWx1ZSB0byByZXR1cm4gaWYgZWl0aGVyIHRoZQorICAgICAqICAgICAgICAgICAgUHJlZmVyZW5jZSBpcyBub3QgcGVyc2lzdGVudCBvciB0aGUgUHJlZmVyZW5jZSBpcyBub3QgaW4gdGhlCisgICAgICogICAgICAgICAgICBzaGFyZWQgcHJlZmVyZW5jZXMuCisgICAgICogQHJldHVybiBUaGUgdmFsdWUgZnJvbSB0aGUgU2hhcmVkUHJlZmVyZW5jZXMgb3IgdGhlIGRlZmF1bHQgcmV0dXJuCisgICAgICogICAgICAgICB2YWx1ZS4KKyAgICAgKiBAc2VlICNwZXJzaXN0U3RyaW5nU2V0KFNldCkKKyAgICAgKiAKKyAgICAgKiBAaGlkZSBQZW5kaW5nIEFQS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9uQ2xpY2tMaXN0ZW5lcihuZXcgT25DbGlja0xpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7CisgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChSRVNVTFRfQ0FOQ0VMRUQpOworICAgICAgICAgICAgICAgICAgICBmaW5pc2goKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIG1OZXh0QnV0dG9uID0gKEJ1dHRvbilmaW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5uZXh0X2J1dHRvbik7CisgICAgICAgICAgICBtTmV4dEJ1dHRvbi5zZXRPbkNsaWNrTGlzdGVuZXIobmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoUkVTVUxUX09LKTsKKyAgICAgICAgICAgICAgICAgICAgZmluaXNoKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIC8vIHNldCBvdXIgdmFyaW91cyBidXR0b24gcGFyYW1ldGVycworICAgICAgICAgICAgaWYgKGludGVudC5oYXNFeHRyYShFWFRSQV9QUkVGU19TRVRfTkVYVF9URVhUKSkgeworICAgICAgICAgICAgICAgIFN0cmluZyBidXR0b25UZXh0ID0gaW50ZW50LmdldFN0cmluZ0V4dHJhKEVYVFJBX1BSRUZTX1NFVF9ORVhUX1RFWFQpOworICAgICAgICAgICAgICAgIGlmIChUZXh0VXRpbHMuaXNFbXB0eShidXR0b25UZXh0KSkgeworICAgICAgICAgICAgICAgICAgICBtTmV4dEJ1dHRvbi5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICBtTmV4dEJ1dHRvbi5zZXRUZXh0KGJ1dHRvblRleHQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChpbnRlbnQuaGFzRXh0cmEoRVhUUkFfUFJFRlNfU0VUX0JBQ0tfVEVYVCkpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmcgYnV0dG9uVGV4dCA9IGludGVudC5nZXRTdHJpbmdFeHRyYShFWFRSQV9QUkVGU19TRVRfQkFDS19URVhUKTsKKyAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkoYnV0dG9uVGV4dCkpIHsKKyAgICAgICAgICAgICAgICAgICAgYmFja0J1dHRvbi5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICBiYWNrQnV0dG9uLnNldFRleHQoYnV0dG9uVGV4dCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKICAgICAgICAgbVByZWZlcmVuY2VNYW5hZ2VyID0gb25DcmVhdGVQcmVmZXJlbmNlTWFuYWdlcigpOwogICAgICAgICBnZXRMaXN0VmlldygpLnNldFNjcm9sbEJhclN0eWxlKFZpZXcuU0NST0xMQkFSU19JTlNJREVfT1ZFUkxBWSk7CiAgICAgfQpAQCAtMTEzLDE0ICsxNzEsMTMgQEAKICAgICBAT3ZlcnJpZGUKICAgICBwcm90ZWN0ZWQgdm9pZCBvblN0b3AoKSB7CiAgICAgICAgIHN1cGVyLm9uU3RvcCgpOwotICAgICAgICAKKwogICAgICAgICBtUHJlZmVyZW5jZU1hbmFnZXIuZGlzcGF0Y2hBY3Rpdml0eVN0b3AoKTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKICAgICBwcm90ZWN0ZWQgdm9pZCBvbkRlc3Ryb3koKSB7CiAgICAgICAgIHN1cGVyL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BTF9JRC4gIFdlIGFyZSB1c2luZyBpdCB0byBhdm9pZCBhCisgICAgICAgICAqIHNjaGVtYSBjaGFuZ2UuCisgICAgICAgICAqIFRPRE8gUmVwbGFjZSB0aGlzIHdpdGggc29tZXRoaW5nIG1vcmUgZ2VuZXJhbCBpbiB0aGUgZnV0dXJlLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChsb25nKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIF9TWU5DX0RBVEEgPSAiX3N5bmNfbG9jYWxfaWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBVc2VkIG9ubHkgaW4gcGVyc2lzdGVudCBwcm92aWRlcnMsIGFuZCBvbmx5IGR1cmluZyBtZXJnaW5nLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChsb25nKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIF9TWU5DX01BUksgPSAiX3N5bmNfbWFyayI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFVzZWQgdG8gaW5kaWNhdGUgdGhhdCBsb2NhbCwgdW5zeW5jZWQsIGNoYW5nZXMgYXJlIHByZXNlbnQuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGxvbmcpPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgX1NZTkNfRElSVFkgPSAiX3N5bmNfZGlydHkiOworCisgICAgfQorCisgICAgLyoqCisgICAgICogQ29sdW1ucyBmcm9tIHRoZSBBY2NvdW50IGluZm9ybWF0aW9uIHVzZWQgYnkgQ2FsZW5kYXJzIGFuZCBFdmVudHMgdGFibGVzLgorICAgICAqLworICAgIHB1YmxpYyBpbnRlcmZhY2UgQWNjb3VudENvbHVtbnMgeworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG5hbWUgb2Y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isgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBFbnRpdHlJdGVyYXRvckltcGwgZXh0ZW5kcyBDdXJzb3JFbnRpdHlJdGVyYXRvciB7CisgICAgICAgICAgICBwcml2YXRlIGZpbmFsIENvbnRlbnRSZXNvbHZlciBtUmVzb2x2ZXI7CisgICAgICAgICAgICBwcml2YXRlIGZpbmFsIENvbnRlbnRQcm92aWRlckNsaWVudCBtUHJvdmlkZXI7CisKKyAgICAgICAgICAgIHB1YmxpYyBFbnRpdHlJdGVyYXRvckltcGwoQ3Vyc29yIGN1cnNvciwgQ29udGVudFJlc29sdmVyIHJlc29sdmVyKSB7CisgICAgICAgICAgICAgICAgc3VwZXIoY3Vyc29yKTsKKyAgICAgICAgICAgICAgICBtUmVzb2x2ZXIgPSByZXNvbHZlcjsKKyAgICAgICAgICAgICAgICBtUHJvdmlkZXIgPSBudWxsOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwdWJsaWMgRW50aXR5SXRlcmF0b3JJbXBsKEN1cnNvciBjdXJzb3IsIENvbnRlbnRQcm92aWRlckNsaWVudCBwcm92aWRlcikgeworICAgICAgICAgICAgICAgIHN1cGVyKGN1cnNvcik7CisgICAgICAgICAgICAgICAgbVJlc29sdmVyID0gbnVsbDsKKyAgICAgICAgICAgICAgICBtUHJvdmlkZXIgPSBwcm92aWRlcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgRW50aXR5IGdldEVudGl0eUFuZEluY3JlbWVudEN1cnNvcihDdXJzb3IgY3Vyc29yKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKKyAgICAgICAgICAgICAgICAvLyB3ZSBleHBlY3QgdGhlIGN1cnNvciBpcyBhbHJlYWR5IGF0IHRoZSByb3cgd2UgbmVlZCB0byByZWFkIGZyb20KKyAgICAgICAgICAgICAgICBmaW5hbCBsb25nIGNhbGVuZGFySWQgPSB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GN2LCBfU1lOQ19ESVJUWSk7CisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JMb25nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIF9TWU5DX01BUkspOworCisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JTdHJpbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCBjdiwgQ2FsZW5kYXJzLlNFTEZfVVJMKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LAorICAgICAgICAgICAgICAgICAgICAgICAgQ2FsZW5kYXJzLkVESVRfVVJMKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LAorICAgICAgICAgICAgICAgICAgICAgICAgQ2FsZW5kYXJzLkVWRU5UU19VUkwpOworCisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JTdHJpbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCBjdiwgQ2FsZW5kYXJzLk5BTUUpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsCisgICAgICAgICAgICAgICAgICAgICAgICBDYWxlbmRhcnMuRElTUExBWV9OQU1FKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvckludFRvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBDYWxlbmRhcnMuSElEREVOKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvckludFRvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBDYWxlbmRhcnMuQ09MT1IpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIEFDQ0VTU19MRVZFTCk7CisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JJbnRUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCBjdiwgU0VMRUNURUQpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIFNZTkNfRVZFTlRTKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBDYWxlbmRhcnMuTE9DQVRJT04pOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIFRJTUVaT05FKTsKKyAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LAorICAgICAgICAgICAgICAgICAgICAgICAgQ2FsZW5kYXJzLk9XTkVSX0FDQ09VTlQpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsCisgICAgICAgICAgICAgICAgICAgICAgICBDYWxlbmRhcnMuT1JHQU5JWkVSX0NBTl9SRVNQT05EKTsKKworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIERFTEVURUQpOworCisgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIHRoZSBFbnRpdHkgZnJvbSB0aGUgQ29udGVudFZhbHVlCisgICAgICAgICAgICAgICAgRW50aXR5IGVudGl0eSA9IG5ldyBFbnRpdHkoY3YpOworCisgICAgICAgICAgICAgICAgLy8gU2V0IGN1cnNvciB0byBuZXh0IHJvdworICAgICAgICAgICAgICAgIGN1cnNvci5tb3ZlVG9OZXh0KCk7CisKKyAgICAgICAgICAgICAgICAvLyBSZXR1cm4gdGhlIGNyZWF0ZWQgRW50aXR5CisgICAgICAgICAgICAgICAgcmV0dXJuIGVudGl0eTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICB9CisKKyAgICAvKioKICAgICAgKiBDb250YWlucyBhIGxpc3Qgb2YgYXZhaWxhYmxlIGNhbGVuZGFycy4KICAgICAgKi8KLSAgICBwdWJsaWMgc3RhdGljIGNsYXNzIENhbGVuZGFycyBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zLCBDYWxlbmRhcnNDb2x1bW5zCisgICAgcHVibGljIHN0YXRpYyBjbGFzcyBDYWxlbmRhcnMgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgU3luY0NvbHVtbnMsIEFjY291bnRDb2x1bW5zLAorICAgICAgICAgICAgQ2FsZW5kYXJzQ29sdW1ucwogICAgIHsKICAgICAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIFdIRVJFX0RFTEVURV9GT1JfQUNDT1VOVCA9IENhbGVuZGFycy5fU1lOQ19BQ0NPVU5UICsgIj0/IgogICAgICAgICAgICAgICAgICsgIiBBTkQgIiArIENhbGVuZGFycy5fU1lOQ19BQ0NPVU5UX1RZUEUgKyAiPT8iOwpAQCAtMjU4LDYgKzM2MywyNCBAQAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBVUkwgPSAidXJsIjsKIAogICAgICAgICAvKioKKyAgICAgICAgICogVGhlIFVSTCBmb3IgdGhlIGNhbGVuZGFyIGl0c2VsZgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUIChVUkwpPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0VMRl9VUkwgPSAic2VsZlVybCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBVUkwgZm9yIHRoZSBjYWxlbmRhciB0byBiZSBlZGl0ZWQKKyAgICAgICAgICogPFA+VHlwZTogVEVYVCAoVVJMKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVESVRfVVJMID0gImVkaXRVcmwiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgVVJMIGZvciB0aGUgY2FsZW5kYXIgZXZlbnRzCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQgKFVSTCk8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFVkVOVFNfVVJMID0gImV2ZW50c1VybCI7CisKKyAgICAgICAgLyoqCiAgICAgICAgICAqIFRoZSBuYW1lIG9mIHRoZSBjYWxlbmRhcgogICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgogICAgICAgICAgKi8KQEAgLTI5Niw2ICs0MTksOSBAQAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBPUkdBTklaRVJfQ0FOX1JFU1BPTkQgPSAib3JnYW5pemVyQ2FuUmVzcG9uZCI7CiAgICAgfQogCisgICAgLyoqCisgICAgICogQ29sdW1ucyBmcm9tIHRoZSBBdHRlbmRlZXMgdGFibGUgdGhhdCBvdGhlciB0YWJsZXMgam9pbiBpbnRvIHRoZW1zZWx2ZXMuCisgICAgICovCiAgICAgcHVibGljIGludGVyZmFjZSBBdHRlbmRlZXNDb2x1bW5zIHsKIAogICAgICAgICAvKioKQEAgLTM2MSw4ICs0ODcsNyBAQAogICAgIC8qKgogICAgICAqIENvbHVtbnMgZnJvbSB0aGUgRXZlbnRzIHRhYmxlIHRoYXQgb3RoZXIgdGFibGVzIGpvaW4gaW50byB0aGVtc2VsdmVzLgogICAgICAqLwotICAgIHB1YmxpYyBpbnRlcmZhY2UgRXZlbnRzQ29sdW1ucwotICAgIHsKKyAgICBwdWJsaWMgaW50ZXJmYWNlIEV2ZW50c0NvbHVtbnMgewogICAgICAgICAvKioKICAgICAgICAgICogVGhlIGNhbGVuZGFyIHRoZSBldmVudCBiZWxvbmdzIHRvCiAgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGZvcmVpZ24ga2V5IHRvIHRoZSBDYWxlbmRhcnMgdGFibGUpPC9QPgpAQCAtNDM4LDYgKzU2MywxOCBAQAogICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBEVEVORCA9ICJkdGVuZCI7CiAKICAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB0aW1lIHRoZSBldmVudCBzdGFydHMgd2l0aCBhbGxEYXkgZXZlbnRzIGluIGEgbG9jYWwgdHoKKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAobG9uZzsgbWlsbGlzIHNpbmNlIGVwb2NoKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERUU1RBUlQyID0gImR0c3RhcnQyIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHRpbWUgdGhlIGV2ZW50IGVuZHMgd2l0aCBhbGxEYXkgZXZlbnRzIGluIGEgbG9jYWwgdHoKKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUiAobG9uZzsgbWlsbGlzIHNpbmNlIGVwb2NoKTwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERURU5EMiA9ICJkdGVuZDIiOworCisgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgZHVyYXRpb24gb2YgdGhlIGV2ZW50CiAgICAgICAgICAqIDxQPlR5cGU6IFRFWFQgKGR1cmF0aW9uIGluIFJGQzI0NDUgZm9ybWF0KTwvUD4KICAgICAgICAgICovCkBAIC00NTAsNiArNTg3LDEyIEBACiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEVWRU5UX1RJTUVaT05FID0gImV2ZW50VGltZXpvbmUiOwogCiAgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgdGltZXpvbmUgZm9yIHRoZSBldmVudCwgYWxsRGF5IGV2ZW50cyB3aWxsIGhhdmUgYSBsb2NhbCB0eiBpbnN0ZWFkIG9mIFVUQworICAgICAgICAgKiA8UD5UeXBlOiBURVhUCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFVkVOVF9USU1FWk9ORTIgPSAiZXZlbnRUaW1lem9uZTIiOworCisgICAgICAgIC8qKgogICAgICAgICAgKiBXaGV0aGVyIHRoZSBldmVudCBsYXN0cyBhbGwgZGF5IG9yIG5vdAogICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSIChib29sZWFuKTwvUD4KICAgICAgICAgICovCkBAIC01OTgsNyArNzQxLDggQEAKICAgICAvKioKICAgICAgKiBDb250YWlucyBvbmUgZW50cnkgcGVyIGNhbGVuZGFyIGV2ZW50LiBSZWN1cnJpbmcgZXZlbnRzIHNob3cgdXAgYXMgYSBzaW5nbGUgZW50cnkuCiAgICAgICovCi0gICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBFdmVudHNFbnRpdHkgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgRXZlbnRzQ29sdW1ucywgQ2FsZW5kYXJzQ29sdW1ucyB7CisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBjbGFzcyBFdmVudHNFbnRpdHkgaW1wbGVtZW50cyBCYXNlQ29sdW1ucywgU3luY0NvbHVtbnMsIEFjY291bnRDb2x1bW5zLAorICAgICAgICAgICAgRXZlbnRzQ29sdW1ucyB7CiAgICAgICAgIC8qKgogICAgICAgICAgKiBUaGUgY29udGVudDovLyBzdHlsZSBVUkwgZm9yIHRoaXMgdGFibGUKICAgICAgICAgICovCkBAIC03MDMsOCArODQ3LDkgQEAKICAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIGN2LCBfU1lOQ19EQVRBKTsKICAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvckxvbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCBjdiwgX1NZTkNfRElSVFkpOwogICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIF9TWU5DX1ZFUlNJT04pOwotICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIERFTEVURUQpOwotICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIENhbGVuZGFycy5VUkwpOworICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29ySW50VG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgY3YsIEV2ZW50c0NvbHVtbnMuREVMRVRFRCk7CisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JTdHJpbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCBjdiwKKyAgICAgICAgICAgICAgICAgICAgICAgIENhbGVuZGFycy5FVkVOVFNfVVJMKTsKIAogICAgICAgICAgICAgICAgIEVudGl0eSBlbnRpdHkgPSBuZXcgRW50aXR5KGN2KTsKICAgICAg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lbnREYXlzQ29sdW1ucyB7CkBAIC0xMzc5LDQgKzE1MjUsNDMgQEAKICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVcmkgQ09OVEVOVF9VUkkgPQogICAgICAgICAgICAgICAgIFVyaS53aXRoQXBwZW5kZWRQYXRoKENhbGVuZGFyLkNPTlRFTlRfVVJJLCBDT05URU5UX0RJUkVDVE9SWSk7CiAgICAgfQorCisgICAgLyoqCisgICAgICogQ29sdW1ucyBmcm9tIHRoZSBFdmVudHNSYXdUaW1lcyB0YWJsZQorICAgICAqLworICAgIHB1YmxpYyBpbnRlcmZhY2UgRXZlbnRzUmF3VGltZXNDb2x1bW5zIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBjb3JyZXNwb25kaW5nIGV2ZW50IGlkCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVIgKGxvbmcpPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRVZFTlRfSUQgPSAiZXZlbnRfaWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgUkZDMjQ0NSBjb21wbGlhbnQgdGltZSB0aGUgZXZlbnQgc3RhcnRzCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBEVFNUQVJUXzI0NDUgPSAiZHRzdGFydDI0NDUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgUkZDMjQ0NSBjb21wbGlhbnQgdGltZSB0aGUgZXZlbnQgZW5kcworICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRFRFTkRfMjQ0NSA9ICJkdGVuZDI0NDUiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgUkZDMjQ0NSBjb21wbGlh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VSSSA9CisgICAgICAgICAgICAgICAgVXJpLndpdGhBcHBlbmRlZFBhdGgoQVVUSE9SSVRZX1VSSSwgImRpcmVjdG9yaWVzIik7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBNSU1FLXR5cGUgb2Yge0BsaW5rICNDT05URU5UX1VSSX0gcHJvdmlkaW5nIGEgZGlyZWN0b3J5IG9mCisgICAgICAgICAqIGNvbnRhY3QgZGlyZWN0b3JpZXMuCisgICAgICAgICAqCisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBDT05URU5UX1RZUEUgPQorICAgICAgICAgICAgICAgICJ2bmQuYW5kcm9pZC5jdXJzb3IuZGlyL2NvbnRhY3RfZGlyZWN0b3JpZXMiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgTUlNRSB0eXBlIG9mIGEge0BsaW5rICNDT05URU5UX1VSSX0gaXRlbS4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIENPTlRFTlRfSVRFTV9UWVBFID0KKyAgICAgICAgICAgICAgICAidm5kLmFuZHJvaWQuY3Vyc29yLml0ZW0vY29udGFjdF9kaXJlY3RvcnkiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgbmFtZSBvZiB0aGUgcGFja2FnZSB0aGF0IG93bnMgdGhpcyBkaXJlY3RvcnkuIFRoaXMgZmllbGQgaXMKKyAgICAgICAgICogcmVxdWlyZWQgaW4gYW4gaW5zZXJ0IHJlcXVlc3QgYW5kIG11c3QgbWF0Y2ggdGhlIG5hbWUgb2YgdGhlIHBhY2thZ2UKKyAgICAgICAgICogbWFraW5nIHRoZSByZXF1ZXN0LiBJZiB0aGUgcGFja2FnZSBpcyBsYXRlciB1bmluc3RhbGxlZCwgdGhlCisgICAgICAgICAqIGRpcmVjdG9yaWVzIGl0IG93bnMgYXJlIGF1dG9tYXRpY2FsbHkgcmVtb3ZlZCBmcm9tIHRoaXMgdGFibGUuIE9ubHkKKyAgICAgICAgICogdGhlIHNwZWNpZmllZCBwYWNrYWdlIGlzIGFsbG93ZWQgdG8gbW9kaWZ5IG9yIGRlbGV0ZSB0aGlzIHJvdyBsYXRlci4KKyAgICAgICAgICoKKyAgICAgICAgICogPHA+VFlQRTogVEVYVDwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFBBQ0tBR0VfTkFNRSA9ICJwYWNrYWdlTmFtZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB0eXBlIG9mIGRpcmVjdG9yeSBjYXB0dXJlZCBhcyBhIHJlc291cmNlIElEIGluIHRoZSBjb250ZXh0IG9mIHRoZQorICAgICAgICAgKiBwYWNrYWdlIHtAbGluayAjUEFDS0FHRV9OQU1FfSwgZS5nLiAiQ29ycG9yYXRlIERpcmVjdG9yeSIKKyAgICAgICAgICoKKyAgICAgICAgICogPHA+VFlQRTogSU5URUdFUjwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRZUEVfUkVTT1VSQ0VfSUQgPSAidHlwZVJlc291cmNlSWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBbiBvcHRpb25hbCBuYW1lIHRoYXQgY2FuIGJlIHVzZWQgaW4gdGhlIFVJIHRvIHJlcHJlc2VudCB0aGlzIGRpcmVjdG9yeSwKKyAgICAgICAgICogZS5nLiAiQWNtZSBDb3JwIgorICAgICAgICAgKiA8cD5UWVBFOiB0ZXh0PC9wPgorICAgICAgICAgKgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgRElTUExBWV9OQU1FID0gImRpc3BsYXlOYW1lIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGF1dGhvcml0eSB0byB3aGljaCB0aGUgcmVxdWVzdCBzaG91bGQgZm9yd2FyZGVkIGluIG9yZGVyIHRvIGFjY2VzcworICAgICAgICAgKiB0aGlzIGRpcmVjdG9yeS4KKyAgICAgICAgICoKKyAgICAgICAgICogPHA+VFlQRTogdGV4dDwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERJUkVDVE9SWV9BVVRIT1JJVFkgPSAiYXV0aG9yaXR5IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGFjY291bnQgdHlwZSB3aGljaCB0aGlzIGRpcmVjdG9yeSBpcyBhc3NvY2lhdGVkLgorICAgICAgICAgKgorICAgICAgICAgKiA8cD5UWVBFOiB0ZXh0PC9wPgorICAgICAgICAgKgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQUNDT1VOVF9UWVBFID0gImFjY291bnRUeXBlIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGFjY291bnQgd2l0aCB3aGljaCB0aGlzIGRpcmVjdG9yeSBpcyBhc3NvY2lhdGVkLiBJZiB0aGUgYWNjb3VudCBpcyBsYXRlcgorICAgICAgICAgKiByZW1vdmVkLCB0aGUgZGlyZWN0b3JpZXMgaXQgb3ducyBhcmUgYXV0b21hdGljYWxseSByZW1vdmVkIGZyb20gdGhpcyB0YWJsZS4KKyAgICAgICAgICoKKyAgICAgICAgICogPHA+VFlQRTogdGV4dDwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFDQ09VTlRfTkFNRSA9ICJhY2NvdW50TmFtZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIE9uZSBvZiB7QGxpbmsgI0VYUE9SVF9TVVBQT1JUX05PTkV9LCB7QGxpbmsgI0VYUE9SVF9TVVBQT1JUX0FOWV9BQ0NPVU5UfSwKKyAgICAgICAgICoge0BsaW5rICNFWFBPUlRfU1VQUE9SVF9TQU1FX0FDQ09VTlRfT05MWX0uIFRoaXMgaXMgdGhlIGV4cGVjdGF0aW9uIHRoZQorICAgICAgICAgKiBkaXJlY3RvcnkgaGFzIGZvciBkYXRhIGV4cG9ydGVkIGZyb20gaXQuICBDbGllbnRzIG11c3Qgb2JleSB0aGlzIHNldHRpbmcuCisgICAgICAgICAqCisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBFWFBPUlRfU1VQUE9SVCA9ICJleHBvcnRTdXBwb3J0IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogQW4ge0BsaW5rICNFWFBPUlRfU1VQUE9SVH0gc2V0dGluZyB0aGF0IGluZGljYXRlcyB0aGF0IHRoZSBkaXJlY3RvcnkKKyAgICAgICAgICogZG9lcyBub3QgYWxsb3cgYW55IGRhdGEgdG8gYmUgY29waWVkIG91dCBvZiBpdC4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEVYUE9SVF9TVVBQT1JUX05PTkUgPSAwOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBbiB7QGxpbmsgI0VYUE9SVF9TVVBQT1JUfSBzZXR0aW5nIHRoYXQgaW5kaWNhdGVzIHRoYXQgdGhlIGRpcmVjdG9yeQorICAgICAgICAgKiBhbGxvdyBpdHMgZGF0YSBjb3BpZWQgb25seSB0byB0aGUgYWNjb3VudCBzcGVjaWZpZWQgYnkKKyAgICAgICAgICoge0BsaW5rICNBQ0NPVU5UX1RZUEV9L3tAbGluayAjQUNDT1VOVF9OQU1FfS4KKyAgICAgICAgICoKKyAgICAgICAgICogQGhpZGUKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEVYUE9SVF9TVVBQT1JUX1NBTUVfQUNDT1VOVF9PTkxZID0gMTsKKworICAgICAgICAvKioKKyAgICAgICAgICogQW4ge0BsaW5rICNFWFBPUlRfU1VQUE9SVH0gc2V0dGluZyB0aGF0IGluZGljYXRlcyB0aGF0IHRoZSBkaXJlY3RvcnkKKyAgICAgICAgICogYWxsb3cgaXRzIGRhdGEgY29waWVkIHRvIGFueSBjb250YWN0cyBhY2NvdW50LgorICAgICAgICAgKgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRVhQT1JUX1NVUFBPUlRfQU5ZX0FDQ09VTlQgPSAyOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBfSUQgb2YgdGhlIGRlZmF1bHQgZGlyZWN0b3J5LCB3aGljaCByZXByZXNlbnRzIGxvY2FsbHkgc3RvcmVkIGNvbnRhY3RzLgorICAgICAgICAgKgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBsb25nIERFRkFVTFQgPSAwOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBfSUQgb2YgdGhlIGRpcmVjdG9yeSB0aGF0IHJlcHJlc2VudHMgbG9jYWxseSBzdG9yZWQgaW52aXNpYmxlIGNvbnRhY3RzLgorICAgICAgICAgKgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBsb25nIExPQ0FMX0lOVklTSUJMRSA9IDE7CisgICAgfQorCisgICAgLyoqCiAgICAgICogQGhpZGUgc2hvdWxkIGJlIHJlbW92ZWQgd2hlbiB1c2VycyBhcmUgdXBkYXRlZCB0byByZWZlciB0byBTeW5jU3RhdGUKICAgICAgKiBAZGVwcmVjYXRlZCB1c2UgU3luY1N0YXRlIGluc3RlYWQKICAgICAgKi8KQEAgLTQ5MDIsNiArNTEzNCwyMyBAQAogICAgICAgICAgKiBUeXBlOiBJTlRFR0VSIChib29sZWFuKQogICAgICAgICAgKi8KICAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0hPVUxEX1NZTkMgPSAic2hvdWxkX3N5bmMiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBbnkgbmV3bHkgY3JlYXRlZCBjb250YWN0cyB3aWxsIGF1dG9tYXRpY2FsbHkgYmUgYWRkZWQgdG8gZ3JvdXBzIHRoYXQgaGF2ZSB0aGlzCisgICAgICAgICAqIGZsYWcgc2V0IHRvIHRydWUuCisgICAgICAgICAqIDxwPgorICAgICAgICAgKiBUeXBlOiBJTlRFR0VSIChib29sZWFuKQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgQVVUT19BREQgPSAiYXV0b19hZGQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBXaGVuIGEgY29udGFjdHMgaXMgbWFya2VkIGFzIGEgZmF2b3JpdGVzIGl0IHdpbGwgYmUgYXV0b21hdGljYWxseSBhZGRlZAorICAgICAgICAgKiB0byB0aGUgZ3JvdXBzIHRoYXQgaGF2ZSB0aGlzIGZsYWcgc2V0LCBhbmQgd2hlbiBpdCBpcyByZW1vdmVkIGZyb20gZmF2b3JpdGVzCisgICAgICAgICAqIGl0IHdpbGwgYmUgcmVtb3ZlZCBmcm9tIHRoZXNlIGdyb3Vwcy4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFR5cGU6IElOVEVHRVIgKGJvb2xlYW4pCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBGQVZPUklURVMgPSAiZmF2b3JpdGVzIjsKICAgICB9CiAKICAgICAvKioKQEAgLTUwNDIsNiArNTI5MSw4IEBACiAgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JMb25nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgdmFsdWVzLCBERUxFVEVEKTsKICAgICAgICAgICAgICAgICBEYXRhYmFzZVV0aWxzLmN1cnNvclN0cmluZ1RvQ29udGVudFZhbHVlc0lmUHJlc2VudChjdXJzb3IsIHZhbHVlcywgTk9URVMpOwogICAgICAgICAgICAgICAgIERhdGFiYXNlVXRpbHMuY3Vyc29yU3RyaW5nVG9Db250ZW50VmFsdWVzSWZQcmVzZW50KGN1cnNvciwgdmFsdWVzLCBTSE9VTERfU1lOQyk7CisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JTdHJpbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCB2YWx1ZXMsIEZBVk9SSVRFUyk7CisgICAgICAgICAgICAgICAgRGF0YWJhc2VVdGlscy5jdXJzb3JTdHJpbmdUb0NvbnRlbnRWYWx1ZXNJZlByZXNlbnQoY3Vyc29yLCB2YWx1ZXMsIEFVVE9fQUREKTsKICAgICAgICAgICAgICAgICBjdXJzb3IubW92ZVRvTmV4dCgpOwogICAgICAgICAgICAgICAgIHJldHVybiBuZXcgRW50aXR5KHZhbHVlcyk7CiAgICAgICAgICAgICB9CkBAIC01NTU4LDYgKzU4MDksMjggQEAKICAgICAgICAgICAgICAgICAiY29tLmFuZHJvaWQuY29udGFjdHMuYWN0aW9uLlNIT1dfT1JfQ1JFQVRFX0NPTlRBQ1QiOwogCiAgICAgICAgIC8qKgorICAgICAgICAgKiBTdGFydHMgYW4gQWN0aXZpdHkgdGhhdCBsZXRzIHRoZSB1c2VyIHNlbGVjdCB0aGUgbXVsdGlwbGUgcGhvbmVzIGZyb20gYQorICAgICAgICAgKiBsaXN0IG9mIHBob25lIG51bWJlcnMgd2hpY2ggY29tZSBmcm9tIHRoZSBjb250YWN0cyBvcgorICAgICAgICAgKiB7QGxpbmsgI0VYVFJBX1BIT05FX1VSSVN9LgorICAgICAgICAgKiA8cD4KKyAgICAgICAgICogVGhlIHBob25lIG51bWJlcnMgYmVpbmcgcGFzc2VkIGluIHRocm91Z2gge0BsaW5rICNFWFRSQV9QSE9ORV9VUklTfQorICAgICAgICAgKiBjb3VsZCBiZWxvbmcgdG8gdGhlIGNvbnRhY3RzIG9yIG5vdCwgYW5kIHdpbGwgYmUgc2VsZWN0ZWQgYnkgZGVmYXVsdC4KKyAgICAgICAgICogPHA+CisgICAgICAgICAqIFRoZSB1c2VyJ3Mgc2VsZWN0aW9uIHdpbGwgYmUgcmV0dXJuZWQgZnJvbQorICAgICAgICAgKiB7QGxpbmsgYW5kcm9pZC5hcHAuQWN0aXZpdHkjb25BY3Rpdml0eVJlc3VsdChpbnQsIGludCwgYW5kcm9pZC5jb250ZW50LkludGVudCl9CisgICAgICAgICAqIGlmIHRoZSByZXN1bHRDb2RlIGlzCisgICAgICAgICAqIHtAbGluayBhbmRyb2lkLmFwcC5BY3Rpdml0eSNSRVNVTFRfT0t9LCB0aGUgYXJyYXkgb2YgcGlja2VkIHBob25lCisgICAgICAgICAqIG51bWJlcnMgYXJlIGluIHRoZSBJbnRlbnQncworICAgICAgICAgKiB7QGxpbmsgI0VYVFJBX1BIT05FX1VSSVN9OyBvdGhlcndpc2UsIHRoZQorICAgICAgICAgKiB7QGxpbmsgYW5kcm9pZC5hcHAuQWN0aXZpdHkjUkVTVUxUX0NBTkNFTEVEfSBpcyByZXR1cm5lZCBpZiB0aGUgdXNlcgorICAgICAgICAgKiBsZWZ0IHRoZSBBY3Rpdml0eSB3aXRob3V0IGNoYW5naW5nIHRoZSBzZWxlY3Rpb24uCisgICAgICAgICAqCisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBQ1RJT05fR0VUX01VTFRJUExFX1BIT05FUyA9CisgICAgICAgICAgICAgICAgImN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gICAgIDogSW1hZ2VzLk1lZGlhLkVYVEVSTkFMX0NPTlRFTlRfVVJJKTsKKyAgICAgICAgICAgIEN1cnNvciBjID0gbnVsbDsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbG9uZyBtYWdpYyA9IHRodW1iRmlsZS5nZXRNYWdpYyhvcmlnSWQpOworICAgICAgICAgICAgICAgIGlmIChtYWdpYyAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChraW5kID09IE1JQ1JPX0tJTkQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVbXSBkYXRhID0gbmV3IGJ5dGVbTWluaVRodW1iRmlsZS5CWVRFU19QRVJfTUlOVEhVTUJdOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRodW1iRmlsZS5nZXRNaW5pVGh1bWJGcm9tRmlsZShvcmlnSWQsIGRhdGEpICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRtYXAgPSBCaXRtYXBGYWN0b3J5LmRlY29kZUJ5dGVBcnJheShkYXRhLCAwLCBkYXRhLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJpdG1hcCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgImNvdWxkbid0IGRlY29kZSBieXRlIGFycmF5LiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gYml0bWFwOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoa2luZCA9PSBNSU5JX0tJTkQpIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGNvbHVtbiA9IGlzVmlkZW8gPyAidmlkZW9faWQ9IiA6ICJpbWFnZV9pZD0iOwotICAgICAgICAgICAgICAgICAgICBDdXJzb3IgYyA9IG51bGw7Ci0gICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYml0bWFwOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtpbmQgPT0gTUlOSV9LSU5EKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgY29sdW1uID0gaXNWaWRlbyA/ICJ2aWRlb19pZD0iIDogImltYWdlX2lkPSI7CiAgICAgICAgICAgICAgICAgICAgICAgICBjID0gY3IucXVlcnkoYmFzZVVyaSwgUFJPSkVDVElPTiwgY29sdW1uICsgb3JpZ0lkLCBudWxsLCBudWxsKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjICE9IG51bGwgJiYgYy5tb3ZlVG9GaXJzdCgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYml0bWFwID0gZ2V0TWluaVRodW1iRnJvbUZpbGUoYywgYmFzZVVyaSwgY3IsIG9wdGlvbnMpOwpAQCAtMzQwLDE3ICszNDEsMTMgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJpdG1hcDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYyAhPSBudWxsKSBjLmNsb3NlKCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIEN1cnNvciBjID0gbnVsbDsKLSAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgVXJpIGJsb2NraW5nVXJpID0gYmFzZVVyaS5idWlsZFVwb24oKS5hcHBlbmRRdWVyeVBhcmFtZXRlcigiYmxvY2tpbmciLCAiMSIpCiAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kUXVlcnlQYXJhbWV0ZXIoIm9yaWdfaWQiLCBTdHJpbmcudmFsdWVPZihvcmlnSWQpKQogICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZFF1ZXJ5UGFyYW1ldGVyKCJncm91cF9pZCIsIFN0cmluZy52YWx1ZU9mKGdyb3VwSWQpKS5idWlsZCgpOworICAgICAgICAgICAgICAgIGlmIChjICE9IG51bGwpIGMuY2xvc2UoKTsKICAgICAgICAgICAgICAgICBjID0gY3IucXVlcnkoYmxvY2tpbmdVcmksIFBST0pFQ1RJT04sIG51bGwsIG51bGwsIG51bGwpOwogICAgICAgICAgICAgICAgIC8vIFRoaXMgaGFwcGVucyB3aGVuIG9yaWdpbmFsIGltYWdlL3ZpZGVvIGRvZXNuJ3QgZXhpc3QuCiAgICAgICAgICAgICAgICAgaWYgKGMgPT0gbnVsbCkgcmV0dXJuIG51bGw7CkBAIC0zOTcsNiArMzk0LDkgQEAKICAgICAgICAgICAgICAgICBMb2cudyhUQUcsIGV4KTsKICAgICAgICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgICAgICAgaWYgKGMgIT0gbnVsbCkgYy5jbG9zZSgpOworICAgICAgICAgICAgICAgIC8vIFRvIGF2b2lkIGZpbGUgZGVzY3JpcHRvciBsZWFrIGluIGFwcGxpY2F0aW9uIHByb2Nlc3MuCisgICAgICAgICAgICAgICAgdGh1bWJGaWxlLmRlYWN0aXZhdGUoKTsKKyAgICAgICAgICAgICAgICB0aHVtYkZpbGUgPSBudWxsOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgcmV0dXJuIGJpdG1hcDsKICAgICAgICAgfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvcHJvdmlkZXIvTXRwLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC9wcm92aWRlci9NdHAuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4xNWY4NjY2Ci0tLSAvZGV2L251bGwKKys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AgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBNQU5VRkFDVFVSRVIgPSAibWFudWZhY3R1cmVyIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG1vZGVsIG5hbWUgb2YgdGhlIGRldmljZQorICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTU9ERUwgPSAibW9kZWwiOworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnRhaW5zIGxpc3Qgb2Ygc3RvcmFnZSB1bml0cyBmb3IgYW4gTVRQL1BUUCBkZXZpY2UKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIFN0b3JhZ2UgaW1wbGVtZW50cyBCYXNlQ29sdW1ucyB7CisKKyAgICAgICAgcHVibGljIHN0YXRpYyBVcmkgZ2V0Q29udGVudFVyaShpbnQgZGV2aWNlSUQpIHsKKyAgICAgICAgICAgIHJldHVybiBVcmkucGFyc2UoQ09OVEVOVF9BVVRIT1JJVFlfREVWSUNFX1NMQVNIICsgZGV2aWNlSUQgKyAiL3N0b3JhZ2UiKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBzdGF0aWMgVXJpIGdldENvbnRlbnRVcmkoaW50IGRldmljZUlELCBpbnQgc3RvcmFnZUlEKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX0RFVklDRV9TTEFTSCArIGRldmljZUlEICsgIi9zdG9yYWdlLyIgKyBzdG9yYWdlSUQpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFN0b3JhZ2UgdW5pdCBpZGVudGlmaWVyCisgICAgICAgICAqIDxQPlR5cGU6IFRFWFQ8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBJREVOVElGSUVSID0gImlkZW50aWZpZXIiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBTdG9yYWdlIHVuaXQgZGVzY3JpcHRpb24KKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIERFU0NSSVBUSU9OID0gImRlc2NyaXB0aW9uIjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb250YWlucyBsaXN0IG9mIG9iamVjdHMgb24gYW4gTVRQL1BUUCBkZXZpY2UKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGNsYXNzIE9iamVjdCBpbXBsZW1lbnRzIEJhc2VDb2x1bW5zIHsKKworICAgICAgICBwdWJsaWMgc3RhdGljIFVyaSBnZXRDb250ZW50VXJpKGludCBkZXZpY2VJRCwgaW50IG9iamVjdElEKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX0RFVklDRV9TTEFTSCArIGRldmljZUlECisgICAgICAgICAgICAgICAgICAgICsgIi9vYmplY3QvIiArIG9iamVjdElEKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBzdGF0aWMgVXJpIGdldENvbnRlbnRVcmlGb3JPYmplY3RDaGlsZHJlbihpbnQgZGV2aWNlSUQsIGludCBvYmplY3RJRCkgeworICAgICAgICAgICAgcmV0dXJuIFVyaS5wYXJzZShDT05URU5UX0FVVEhPUklUWV9ERVZJQ0VfU0xBU0ggKyBkZXZpY2VJRAorICAgICAgICAgICAgICAgICAgICArICIvb2JqZWN0LyIgKyBvYmplY3RJRCArICIvY2hpbGQiKTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBzdGF0aWMgVXJpIGdldENvbnRlbnRVcmlGb3JTdG9yYWdlQ2hpbGRyZW4oaW50IGRldmljZUlELCBpbnQgc3RvcmFnZUlEKSB7CisgICAgICAgICAgICByZXR1cm4gVXJpLnBhcnNlKENPTlRFTlRfQVVUSE9SSVRZX0RFVklDRV9TTEFTSCArIGRldmljZUlECisgICAgICAgICAgICAgICAgICAgICsgIi9zdG9yYWdlLyIgKyBzdG9yYWdlSUQgKyAiL2NoaWxkIik7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGZvbGxvd2luZyBjb2x1bW5zIGNvcnJlc3BvbmQgdG8gdGhlIGZpZWxkcyBpbiB0aGUgT2JqZWN0SW5mbyBkYXRhc2V0CisgICAgICAgICAqIGFzIGRlc2NyaWJlZCBpbiB0aGUgTVRQIHNwZWNpZmljYXRpb24uCisgICAgICAgICAqLworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgSUQgb2YgdGhlIHN0b3JhZ2UgdW5pdCBjb250YWluaW5nIHRoZSBvYmplY3QuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBTVE9SQUdFX0lEID0gInN0b3JhZ2VfaWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgb2JqZWN0J3MgZm9ybWF0LiAgQ2FuIGJlIG9uZSBvZiB0aGUgRk9STUFUXyogc3ltYm9scyBiZWxvdywKKyAgICAgICAgICogb3IgYW55IG9mIHRoZSB2YWxpZCBNVFAgb2JqZWN0IGZvcm1hdHMgYXMgZGVmaW5lZCBpbiB0aGUgTVRQIHNwZWNpZmljYXRpb24uCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBGT1JNQVQgPSAiZm9ybWF0IjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHByb3RlY3Rpb24gc3RhdHVzIG9mIHRoZSBvYmplY3QuICBTZWUgdGhlIFBST1RFQ1RJT05fU1RBVFVTXypzeW1ib2xzIGJlbG93LgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUFJPVEVDVElPTl9TVEFUVVMgPSAicHJvdGVjdGlvbl9zdGF0dXMiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgc2l6ZSBvZiB0aGUgb2JqZWN0IGluIGJ5dGVzLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgU0laRSA9ICJzaXplIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIG9iamVjdCdzIHRodW1ibmFpbCBmb3JtYXQuICBDYW4gYmUgb25lIG9mIHRoZSBGT1JNQVRfKiBzeW1ib2xzIGJlbG93LAorICAgICAgICAgKiBvciBhbnkgb2YgdGhlIHZhbGlkIE1UUCBvYmplY3QgZm9ybWF0cyBhcyBkZWZpbmVkIGluIHRoZSBNVFAgc3BlY2lmaWNhdGlvbi4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFRIVU1CX0ZPUk1BVCA9ICJmb3JtYXQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgc2l6ZSBvZiB0aGUgb2JqZWN0J3MgdGh1bWJuYWlsIGluIGJ5dGVzLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEhVTUJfU0laRSA9ICJ0aHVtYl9zaXplIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIHdpZHRoIG9mIHRoZSBvYmplY3QncyB0aHVtYm5haWwgaW4gcGl4ZWxzLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEhVTUJfV0lEVEggPSAidGh1bWJfd2lkdGgiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgaGVpZ2h0IG9mIHRoZSBvYmplY3QncyB0aHVtYm5haWwgaW4gcGl4ZWxzLgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEhVTUJfSEVJR0hUID0gInRodW1iX2hlaWdodCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBvYmplY3QncyB0aHVtYm5haWwuCisgICAgICAgICAqIDxQPlR5cGU6IEJMT0I8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBUSFVNQiA9ICJ0aHVtYiI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSB3aWR0aCBvZiB0aGUgb2JqZWN0IGluIHBpeGVscy4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNQUdFX1dJRFRIID0gImltYWdlX3dpZHRoIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGhlaWdodCBvZiB0aGUgb2JqZWN0IGluIHBpeGVscy4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNQUdFX0hFSUdIVCA9ICJpbWFnZV9oZWlnaHQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgZGVwdGggb2YgdGhlIG9iamVjdCBpbiBiaXRzIHBlciBwaXhlbC4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIElNQUdFX0RFUFRIID0gImltYWdlX2RlcHRoIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIElEIG9mIHRoZSBvYmplY3QncyBwYXJlbnQsIG9yIHplcm8gaWYgdGhlIG9iamVjdAorICAgICAgICAgKiBpcyBpbiB0aGUgcm9vdCBvZiBpdHMgc3RvcmFnZSB1bml0LgorICAgICAgICAgKiA8UD5UeXBlOiBJTlRFR0VSPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgUEFSRU5UID0gInBhcmVudCI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBhc3NvY2lhdGlvbiB0eXBlIGZvciBhIGNvbnRhaW5lciBvYmplY3QuCisgICAgICAgICAqIEZvciBmb2xkZXJzIHRoaXMgaXMgdHlwaWNhbGx5IHtAbGluayAjQVNTT0NJQVRJT05fVFlQRV9HRU5FUklDX0ZPTERFUn0KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEFTU09DSUFUSU9OX1RZUEUgPSAiYXNzb2NpYXRpb25fdHlwZSI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENvbnRhaW5zIGFkZGl0aW9uYWwgaW5mb3JtYXRpb24gYWJvdXQgY29udGFpbmVyIG9iamVjdHMuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBBU1NPQ0lBVElPTl9ERVNDID0gImFzc29jaWF0aW9uX2Rlc2MiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgc2VxdWVuY2UgbnVtYmVyIG9mIHRoZSBvYmplY3QsIHR5cGljYWxseSB1c2VkIGZvciBhbiBhc3NvY2lhdGlvbgorICAgICAgICAgKiBjb250YWluaW5nIGltYWdlcyB0YWtlbiBpbiBzZXF1ZW5jZS4KKyAgICAgICAgICogPFA+VHlwZTogSU5URUdFUjwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIFNFUVVFTkNFX05VTUJFUiA9ICJzZXF1ZW5jZV9udW1iZXIiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgbmFtZSBvZiB0aGUgb2JqZWN0LgorICAgICAgICAgKiA8UD5UeXBlOiBURVhUPC9QPgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgTkFNRSA9ICJuYW1lIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGRhdGUgdGhlIG9iamVjdCB3YXMgY3JlYXRlZCwgaW4gc2Vjb25kcyBzaW5jZSBKYW51YXJ5IDEsIDE5NzAuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBEQVRFX0NSRUFURUQgPSAiZGF0ZV9jcmVhdGVkIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlIGRhdGUgdGhlIG9iamVjdCB3YXMgbGFzdCBtb2RpZmllZCwgaW4gc2Vjb25kcyBzaW5jZSBKYW51YXJ5IDEsIDE5NzAuCisgICAgICAgICAqIDxQPlR5cGU6IElOVEVHRVI8L1A+CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIFN0cmluZyBEQVRFX01PRElGSUVEID0gImRhdGVfbW9kaWZpZWQiOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBBIGxpc3Qgb2Yga2V5d29yZHMgYXNzb2NpYXRlZCB3aXRoIGFuIG9iamVjdCwgc2VwYXJhdGVkIGJ5IHNwYWNlcy4KKyAgICAgICAgICogPFA+VHlwZTogVEVYVDwvUD4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEtFWVdPUkRTID0gImtleXdvcmRzIjsKKworICAgICAgICAvKioKKyAgICAgICAgICogQ29udGFudHMgZm9yIHtAbGluayAjRk9STUFUfSBhbmQge0BsaW5rICNUSFVNQl9GT1JNQVR9CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVU5ERUZJTkVEID0gMHgzMDAwOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQVNTT0NJQVRJT04gPSAweDMwMDE7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9TQ1JJUFQgPSAweDMwMDI7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9FWEVDVVRBQkxFID0gMHgzMDAzOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVEVYVCA9IDB4MzAwNDsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0hUTUwgPSAweDMwMDU7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9EUE9GID0gMHgzMDA2OworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQUlGRiA9IDB4MzAwNzsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1dBViA9IDB4MzAwODsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX01QMyA9IDB4MzAwOTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0FWSSA9IDB4MzAwQTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX01QRUcgPSAweDMwMEI7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9BU0YgPSAweDMwMEM7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9ERUZJTkVEID0gMHgzODAwOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfRVhJRl9KUEVHID0gMHgzODAxOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVElGRl9FUCA9IDB4MzgwMjsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0ZMQVNIUElYID0gMHgzODAzOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQk1QID0gMHgzODA0OworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQ0lGRiA9IDB4MzgwNTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0dJRiA9IDB4MzgwNzsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0pGSUYgPSAweDM4MDg7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9DRCA9IDB4MzgwOTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1BJQ1QgPSAweDM4MEE7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9QTkcgPSAweDM4MEI7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9USUZGID0gMHgzODBEOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVElGRl9JVCA9IDB4MzgwRTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0pQMiA9IDB4MzgwRjsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0pQWCA9IDB4MzgxMDsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1VOREVGSU5FRF9GSVJNV0FSRSA9IDB4QjgwMjsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1dJTkRPV1NfSU1BR0VfRk9STUFUID0gMHhCODgxOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVU5ERUZJTkVEX0FVRElPID0gMHhCOTAwOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfV01BID0gMHhCOTAxOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfT0dHID0gMHhCOTAyOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQUFDID0gMHhCOTAzOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQVVESUJMRSA9IDB4QjkwNDsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0ZMQUMgPSAweEI5MDY7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9VTkRFRklORURfVklERU8gPSAweEI5ODA7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9XTVYgPSAweEI5ODE7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9NUDRfQ09OVEFJTkVSID0gMHhCOTgyOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfTVAyID0gMHhCOTgzOworICAgICAgICBwdWJsaWMgc3RhdG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X1BMQVlMSVNUID0gMHhCQTBBOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQUJTVFJBQ1RfTUVESUFDQVNUID0gMHhCQTBCOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfV1BMX1BMQVlMSVNUID0gMHhCQTEwOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfTTNVX1BMQVlMSVNUID0gMHhCQTExOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfTVBMX1BMQVlMSVNUID0gMHhCQTEyOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQVNYX1BMQVlMSVNUID0gMHhCQTEzOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfUExTX1BMQVlMSVNUID0gMHhCQTE0OworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVU5ERUZJTkVEX0RPQ1VNRU5UID0gMHhCQTgwOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQUJTVFJBQ1RfRE9DVU1FTlQgPSAweEJBODE7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9YTUxfRE9DVU1FTlQgPSAweEJBODI7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9NU19XT1JEX0RPQ1VNRU5UID0gMHhCQTgzOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfTUhUX0NPTVBJTEVEX0hUTUxfRE9DVU1FTlQgPSAweEJBODQ7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9NU19FWENFTF9TUFJFQURTSEVFVCA9IDB4QkE4NTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX01TX1BPV0VSUE9JTlRfUFJFU0VOVEFUSU9OID0gMHhCQTg2OworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfVU5ERUZJTkVEX01FU1NBR0UgPSAweEJCMDA7CisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZPUk1BVF9BQlNUUkFDVF9NRVNTU0FHRSA9IDB4QkIwMTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1VOREVGSU5FRF9DT05UQUNUID0gMHhCQjgwOworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBGT1JNQVRfQUJTVFJBQ1RfQ09OVEFDVCA9IDB4QkI4MTsKKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX1ZDQVJEXzIgPSAweEJCODI7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIE9iamVjdCBpcyBub3QgcHJvdGVjdGVkLiBJdCBtYXkgYmUgbW9kaWZpZWQgYW5kIGRlbGV0ZWQsIGFuZCBpdHMgcHJvcGVydGllcworICAgICAgICAgKiBtYXkgYmUgbW9kaWZpZWQuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBQUk9URUNUSU9OX1NUQVRVU19OT05FID0gMDsKKworICAgICAgICAvKioKKyAgICAgICAgICogT2JqZWN0IGNhbiBub3QgYmUgbW9kaWZpZWQgb3IgZGVsZXRlZCBhbmQgaXRzIHByb3BlcnRpZXMgY2FuIG5vdCBiZSBtb2RpZmllZC4KKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFBST1RFQ1RJT05fU1RBVFVTX1JFQURfT05MWSA9IDB4ODAwMTsKKworICAgICAgICAvKioKKyAgICAgICAgICogT2JqZWN0IGNhbiBub3QgYmUgbW9kaWZpZWQgb3IgZGVsZXRlZCBidXQgaXRzIHByb3Bl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C0xMDA5LDcgKzEwMDEsNyBAQAogICAgICAgICBwdWJsaWMgc3RhdGljIGJvb2xlYW4gaGFzSW50ZXJlc3RpbmdDb25maWd1cmF0aW9uQ2hhbmdlcyhpbnQgY2hhbmdlcykgewogICAgICAgICAgICAgcmV0dXJuIChjaGFuZ2VzJkFjdGl2aXR5SW5mby5DT05GSUdfRk9OVF9TQ0FMRSkgIT0gMDsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBwdWJsaWMgc3RhdGljIGJvb2xlYW4gZ2V0U2hvd0dUYWxrU2VydmljZVN0YXR1cyhDb250ZW50UmVzb2x2ZXIgY3IpIHsKICAgICAgICAgICAgIHJldHVybiBnZXRJbnQoY3IsIFNIT1dfR1RBTEtfU0VSVklDRV9TVEFUVVMsIDApICE9IDA7CiAgICAgICAgIH0KQEAgLTEyMTYsNyArMTIwOCw3IEBACiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIExPQ0tfUEFUVEVSTl9WSVNJQkxFID0gImxvY2tfcGF0dGVybl92aXNpYmxlX3BhdHRlcm4iOwogCiAgICAgICAgIC8qKgotICAgICAgICAgKiBAZGVwcmVjYXRlZCBVc2UgCisgICAgICAgICAqIEBkZXByZWNhdGVkIFVzZQogICAgICAgICAgKiB7QGxpbmsgYW5kcm9pZC5wcm92aWRlci5TZXR0aW5ncy5TZWN1cmUjTE9DS19QQVRURVJOX1RBQ1RJTEVfRkVFREJBQ0tfRU5BQkxFRH0KICAgICAgICAgICogaW5zdGVhZAogICAgICAgICAgKi8KQEAgLTIyOTAsNiArMjI4MiwxNCBAQAogICAgICAgICB9CiAKICAgICAgICAgLyoqCisgICAgICAgICAqIEdldCB0aGUga2V5IHRoYXQgcmV0cmlldmVzIGEgYmx1ZXRvb3RoIElucHV0IERldmljZSdzIHByaW9yaXR5LgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgZ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EFwcGxpY2F0aW9ucy4gIE5lZWRlZCBiZWNhdXNlIG9mIHVzZXIgdGVzdGluZyBiZXR3ZWVuIHRoZSBvbGQKICAgICAgICAgICogYW5kIG5ldyBTZXR0aW5ncyBhcHBzLgpAQCAtMzU3MywyMCArMzU4MSw4IEBACiAgICAgICAgICAgICAvLyBJZiBhIHNob3J0Y3V0IGlzIHN1cHBsaWVkLCBhbmQgaXQgaXMgYWxyZWFkeSBkZWZpbmVkIGZvcgogICAgICAgICAgICAgLy8gYW5vdGhlciBib29rbWFyaywgdGhlbiByZW1vdmUgdGhlIG9sZCBkZWZpbml0aW9uLgogICAgICAgICAgICAgaWYgKHNob3J0Y3V0ICE9IDApIHsKLSAgICAgICAgICAgICAgICBDdXJzb3IgYyA9IGNyLnF1ZXJ5KENPTlRFTlRfVVJJLAotICAgICAgICAgICAgICAgICAgICAgICAgc1Nob3J0Y3V0UHJvamVjdGlvbiwgc1Nob3J0Y3V0U2VsZWN0aW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tdIHsgU3RyaW5nLnZhbHVlT2YoKGludCkgc2hvcnRjdXQpIH0sIG51bGwpOwotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjLm1vdmVUb0ZpcnN0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChjLmdldENvdW50KCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjLmRlbGV0ZVJvdygpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkNvdWxkIG5vdCBkZWxldGUgZXhpc3Rpbmcgc2hvcnRjdXQgcm93Iik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICA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mlzQXZyY3BUYXJnZXQodXVpZCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHx8IEJsdWV0b290aFV1aWQuaXNBZHZBdWRpb0Rpc3QodXVpZCkpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAhaXNPdGhlclNpbmtJbk5vbkRpc2Nvbm5lY3RpbmdTdGF0ZShhZGRyZXNzKSkgewotICAgICAgICAgICAgQmx1ZXRvb3RoRGV2aWNlIGRldmljZSA9IG1BZGFwdGVyLmdldFJlbW90ZURldmljZShhZGRyZXNzKTsKKyAgICAgICAgaWYgKChCbHVldG9vdGhVdWlkLmlzQXVkaW9Tb3VyY2UodXVpZCkgfHwgQmx1ZXRvb3RoVXVpZC5pc0F2cmNwVGFyZ2V0KHV1aWQpCisgICAgICAgICAgICAgIHx8IEJsdWV0b290aFV1aWQuaXNBZHZBdWRpb0Rpc3QodXVpZCkpICYmCisgICAgICAgICAgICAgICFpc090aGVyU2lua0luTm9uRGlzY29ubmVjdGluZ1N0YXRlKGFkZHJlc3MpKSB7CisgICAgICAgICAgICBCbHVldG9vdGhBMmRwIGEyZHAgPSBuZXcgQmx1ZXRvb3RoQTJkcChtQ29udGV4dCk7CisKICAgICAgICAgICAgIGF1dGhvcml6ZWQgPSBhMmRwLmdldFNpbmtQcmlvcml0eShkZXZpY2UpID4gQmx1ZXRvb3RoQTJkcC5QUklPUklUWV9PRkY7CiAgICAgICAgICAgICBpZiAoYXV0aG9yaXplZCkgewogICAgICAgICAgICAgICAgIExvZy5pKFRBRywgIkFsbG93aW5nIGluY29taW5nIEEyRFAgLyBBVlJDUCBjb25uZWN0aW9uIGZyb20gIiArIGFkZHJlc3MpOwpAQCAtNTk3LDYgKzYxNCwxNSBAQAogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJSZWplY3RpbmcgaW5jb21pbmcgQTJEUCAvIEFWUkNQIGNvbm5lY3Rpb24gZnJvbSAiICsgYWRkcmVzcyk7CiAgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAoQmx1ZXRvb3RoVXVpZC5pc0lucHV0RGV2aWNlKHV1aWQpICYmICFpc090aGVySW5wdXREZXZpY2VDb25uZWN0ZWQoYWRkcmVzcykpIHsKKyAgICAgICAgICAgIEJsdWV0b290aElucHV0RGV2aWNlIGlucHV0RGV2aWNlID0gbmV3IEJsdWV0b290aElucHV0RGV2aWNlKG1Db250ZXh0KTsKKyAgICAgICAgICAgIGF1dGhvcml6ZWQgPSBpbnB1dERldmljZS5nZXRJbnB1dERldmljZVByaW9yaXR5KGRldmljZSkgPgorICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aElucHV0RGV2aWNlLlBSSU9SSVRZX09GRjsKKyAgICAgICAgICAgICBpZiAoYXV0aG9yaXplZCkgeworICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJBbGxvd2luZyBpbmNvbWluZyBISUQgY29ubmVjdGlvbiBmcm9tICIgKyBhZGRyZXNzKTsKKyAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICBMb2cuaShUQUcsICJSZWplY3RpbmcgaW5jb21pbmcgSElEIGNvbm5lY3Rpb24gZnJvbSAiICsgYWRkcmVzcyk7CisgICAgICAgICAgICAgfQogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgTG9nLmkoVEFHLCAiUmVqZWN0aW5nIGluY29taW5nICIgKyBkZXZpY2VVdWlkICsgIiBjb25uZWN0aW9uIGZyb20gIiArIGFkZHJlc3MpOwogICAgICAgICB9CkBAIC02MDQsNyArNjMwLDE5IEBACiAgICAgICAgIHJldHVybiBhdXRob3JpemVkOwogICAgIH0KIAotICAgIGJvb2xlYW4gaXNPdGhlclNpbmtJbk5vbkRpc2Nvbm5lY3RpbmdTdGF0ZShTdHJpbmcgYWRkcmVzcykgeworICAgIHByaXZhdGUgYm9vbGVhbiBpc090aGVySW5wdXREZXZpY2VDb25uZWN0ZWQoU3RyaW5nIGFkZHJlc3MpIHsKKyAgICAgICAgU2V0PEJsdWV0b290aERldmljZT4gZGV2aWNlcyA9CisgICAgICAgICAgICBtQmx1ZXRvb3RoU2VydmljZS5sb29rdXBJbnB1dERldmljZXNNYXRjaGluZ1N0YXRlcyhuZXcgaW50W10geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmx1ZXRvb3RoSW5wdXREZXZpY2UuU1RBVEVfQ09OTkVDVElORywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0NPTk5FQ1RFRH0pOworCisgICAgICAgIGZvciAoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSA6IGRldmljZXMpIHsKKyAgICAgICAgICAgIGlmICghZGV2aWNlLmdldEFkZHJlc3MoKS5lcXVhbHMoYWRkcmVzcykpIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gaXNPdGhlclNpbmtJbk5vbkRpc2Nvbm5lY3RpbmdTdGF0ZShTdHJpbmcgYWRkcmVzcykgewogICAgICAgICBCbHVldG9vdGhBMmRwIGEyZHAgPSBuZXcgQmx1ZXRvb3RoQTJkcChtQ29udGV4dCk7CiAgICAgICAgIFNldDxCbHVldG9vdGhEZXZpY2U+IGRldmljZXMgPSBhMmRwLmdldE5vbkRpc2Nvbm5lY3RlZFNpbmtzKCk7CiAgICAgICAgIGlmIChkZXZpY2VzLnNpemUoKSA9PSAwKSByZXR1cm4gZmFsc2U7CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC9zZXJ2ZXIvQmx1ZXRvb3RoU2VydmljZS5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvc2VydmVyL0JsdWV0b290aFNlcnZpY2UuamF2YQppbmRleCAzMWU1YTdiLi5lYzk5YjBkIDEwMDY0NAotLS0gYS9jb3J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dlcj4oKTsKICAgICB9CiAKICAgICBwdWJsaWMgc3RhdGljIHN5bmNocm9uaXplZCBTdHJpbmcgcmVhZERvY2tCbHVldG9vdGhBZGRyZXNzKCkgewpAQCAtMTIyMCw2ICsxMjI4LDEyNyBAQAogICAgICAgICByZXR1cm4gc3AuY29udGFpbnMoU0hBUkVEX1BSRUZFUkVOQ0VfRE9DS19BRERSRVNTICsgYWRkcmVzcyk7CiAgICAgfQogCisgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGNvbm5lY3RJbnB1dERldmljZShCbHVldG9vdGhEZXZpY2UgZGV2aWNlKSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbihCTFVFVE9PVEhfQURNSU5fUEVSTSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJOZWVkIEJMVUVUT09USF9BRE1JTiBwZXJtaXNzaW9uIik7CisKKyAgICAgICAgU3RyaW5nIG9iamVjdFBhdGggPSBnZXRPYmplY3RQYXRoRnJvbUFkZHJlc3MoZGV2aWNlLmdldEFkZHJlc3MoKSk7CisgICAgICAgIGlmIChvYmplY3RQYXRoID09IG51bGwgfHwgZ2V0Q29ubmVjdGVkSW5wdXREZXZpY2VzKCkubGVuZ3RoICE9IDAgfHwKKyAgICAgICAgICAgIGdldElucHV0RGV2aWNlUHJpb3JpdHkoZGV2aWNlKSA9PSBCbHVldG9vdGhJbnB1dERldmljZS5QUklPUklUWV9PRkYpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgICAgICBpZihjb25uZWN0SW5wdXREZXZpY2VOYXRpdmUob2JqZWN0UGF0aCkpIHsKKyAgICAgICAgICAgIGhhbmRsZUlucHV0RGV2aWNlU3RhdGVDaGFuZ2UoZGV2aWNlLCBCbHVldG9vdGhJbnB1dERldmljZS5TVEFURV9DT05ORUNUSU5HKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGJvb2xlYW4gZGlzY29ubmVjdElucHV0RGV2aWNlKEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9BRE1JTl9QRVJNLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5lZWQgQkxVRVRPT1RIX0FETUlOIHBlcm1pc3Npb24iKTsKKworICAgICAgICBTdHJpbmcgb2JqZWN0UGF0aCA9IGdldE9iamVjdFBhdGhGcm9tQWRkcmVzcyhkZXZpY2UuZ2V0QWRkcmVzcygpKTsKKyAgICAgICAgaWYgKG9iamVjdFBhdGggPT0gbnVsbCB8fCBnZXRDb25uZWN0ZWRJbnB1dERldmljZXMoKS5sZW5ndGggPT0gMCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIGlmKGRpc2Nvbm5lY3RJbnB1dERldmljZU5hdGl2ZShvYmplY3RQYXRoKSkgeworICAgICAgICAgICAgaGFuZGxlSW5wdXREZXZpY2VTdGF0ZUNoYW5nZShkZXZpY2UsIEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0RJU0NPTk5FQ1RJTkcpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgaW50IGdldElucHV0RGV2aWNlU3RhdGUoQmx1ZXRvb3RoRGV2aWNlIGRldmljZSkgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX1BFUk0sICJOZWVkIEJMVUVUT09USCBwZXJtaXNzaW9uIik7CisKKyAgICAgICAgaWYgKG1JbnB1dERldmljZXMuZ2V0KGRldmljZSkgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIEJsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0RJU0NPTk5FQ1RFRDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbUlucHV0RGV2aWNlcy5nZXQoZGV2aWNlKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIEJsdWV0b290aERldmljZVtdIGdldENvbm5lY3RlZElucHV0RGV2aWNlcygpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9QRVJNLCAiTmVlZCBCTFVFVE9PVEggcGVybWlzc2lvbiIpOworICAgICAgICBTZXQ8Qmx1ZXRvb3RoRGV2aWNlPiBkZXZpY2VzID0gbG9va3VwSW5wdXREZXZpY2VzTWF0Y2hpbmdTdGF0ZXMoCisgICAgICAgICAgICBuZXcgaW50W10ge0JsdWV0b290aElucHV0RGV2aWNlLlNUQVRFX0NPTk5FQ1RFRH0pOworICAgICAgICByZXR1cm4gZGV2aWNlcy50b0FycmF5KG5ldyBCbHVldG9vdGhEZXZpY2VbZGV2aWNlcy5zaXplKCldKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRJbnB1dERldmljZVByaW9yaXR5KEJsdWV0b290aERldmljZSBkZXZpY2UpIHsKKyAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKEJMVUVUT09USF9QRVJNLCAiTmVlZCBCTFVFVE9PVEggcGVybWlzc2lvbiIpOworICAgICAgICByZXR1cm4gU2V0dGluZ3MuU2VjdXJlLmdldEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKKyAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuZ2V0Qmx1ZXRvb3RoSW5wdXREZXZpY2VQcmlvcml0eUtleShkZXZpY2UuZ2V0QWRkcmVzcygpKSwKKyAgICAgICAgICAgICAgICBCbHVldG9vdGhJbnB1dERldmljZS5QUklPUklUWV9VTkRFRklORUQpOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgYm9vbGVhbiBzZXRJbnB1dERldmljZVByaW9yaXR5KEJsdWV0b290aERldmljZSBkZXZpY2UsIGludCBwcmlvcml0eSkgeworICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oQkxVRVRPT1RIX0FETUlOX1BFUk0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTmVlZCBCTFVFVE9PVEhfQURNSU4gcGVybWlzc2lvbiIpOworICAgICAgICBpZiAoIUJsdWV0b290aEFkYXB0ZXIuY2hlY2tCbHVldG9vdGhBZGRyZXNzKGRldmljZS5nZXRBZGRyZXNzKCkpKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIFNldHRpbmdzLlNlY3VyZS5wdXRJbnQobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCisgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLmdldEJsdWV0b290aElucHV0RGV2aWNlUHJpb3JpdHlLZXkoZGV2aWNlLmdldEFkZHJlc3MoKSksCisgICAgICAgICAgICAgICAgcHJpb3JpdHkpOworICAgIH0KKworICAgIC8qcGFja2FnZSovc3luY2hyb25pemVkIFNldDxCbHVldG9vdGhEZXZpY2U+IGxvb2t1cElucHV0RGV2aWNlc01hdGNoaW5nU3RhdGVzKGludFtdIHN0YXRlcykgeworICAgICAgICBTZXQ8Qmx1ZXRvb3RoRGV2aWNlPiBpbnB1dERldmljZXMgPSBuZXcgSGFzaFNldDxCbHVldG9vdGhEZXZpY2U+KCk7CisgICAgICAgIGlmIChtSW5wdXREZXZpY2VzLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgcmV0dXJuIGlucHV0RGV2aWNlczsKKyAgICAgICAgfQorICAgICAgICBmb3IgKEJsdWV0b290aERldmljZSBkZXZpY2U6IG1JbnB1dERldmljZXMua2V5U2V0KCkpIHsKKyAgICAgICAgICAgIGludCBpbnB1dERldmljZVN0YXRlID0gZ2V0SW5wdXREZXZpY2VTdGF0ZShkZXZpY2UpOworICAgICAgICAgICAgZm9yIChpbnQgc3RhdGUgOiBzdGF0ZXMpIHsKKyAgICAgICAgICAgICAgICBpZiAoc3RhdGUgPT0gaW5wdXREZXZpY2VTdGF0ZSkgeworICAgICAgICAgICAgICAgICAgICBpbnB1dERldmljZXMuYWRkKGRldmljZSk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gaW5wdXREZXZpY2VzOworICAgIH0KKworICAgIHByaXZhdGUgc3luY2hyb25pemVkIHZvaWQgaGFuZGxlSW5wdXREZXZpY2VTdGF0ZUNoYW5nZShCbHVldG9vdGhEZXZpY2UgZGV2aWNlLCBpbnQgc3RhdGUpIHsKKyAgICAgICAgaW50IHByZXZTdGF0ZTsKKyAgICAgICAgaWYgKG1JbnB1dERldmljZXMuZ2V0KGRldmljZSkgPT0gbnVsbCkgeworICAgICAgICAgICAgcHJldlN0YXRlID0gQmx1ZXRvb3RoSW5wdXREZXZpY2UuU1RBVEVfRElTQ09OTkVDVEVEOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcHJldlN0YXRlID0gbUlucHV0RGV2aWNlcy5nZXQoZGV2aWNlKTsKKyAgICAgICAgfQorICAgICAgICBpZiAocHJldlN0YXRlID09IHN0YXRlKSByZXR1cm47CisKKyAgICAgICAgbUlucHV0RGV2aWNlcy5wdXQoZGV2aWNlLCBzdGF0ZSk7CisKKyAgICAgICAgaWYgKGdldElucHV0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gICogQHBhcmFtIGxzdGFydCBzdGFydCBvZiB0aGUgbGluZSBpbiB0aGUgbGV2ZWxzIGFycmF5CisgICAgICogQHBhcmFtIGNoYXJzIHRoZSBjaGFyYWN0ZXIgYXJyYXkgKHVzZWQgdG8gZGV0ZXJtaW5lIHdoaXRlc3BhY2UpCisgICAgICogQHBhcmFtIGNzdGFydCB0aGUgc3RhcnQgb2YgdGhlIGxpbmUgaW4gdGhlIGNoYXJzIGFycmF5CisgICAgICogQHBhcmFtIGxlbiB0aGUgbGVuZ3RoIG9mIHRoZSBsaW5lCisgICAgICogQHJldHVybiB0aGUgZGlyZWN0aW9ucworICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgRGlyZWN0aW9ucyBkaXJlY3Rpb25zKGludCBkaXIsIGJ5dGVbXSBsZXZlbHMsIGludCBsc3RhcnQsCisgICAgICAgICAgICBjaGFyW10gY2hhcnMsIGludCBjc3RhcnQsIGludCBsZW4pIHsKKworICAgICAgICBpbnQgYmFzZUxldmVsID0gZGlyID09IExheW91dC5ESVJfTEVGVF9UT19SSUdIVCA/IDAgOiAxOworICAgICAgICBpbnQgY3VyTGV2ZWwgPSBsZXZlbHNbbHN0YXJ0XTsKKyAgICAgICAgaW50IG1pbkxldmVsID0gY3VyTGV2ZWw7CisgICAgICAgIGludCBydW5Db3VudCA9IDE7CisgICAgICAgIGZvciAoaW50IGkgPSBsc3RhcnQgKyAxLCBlID0gbHN0YXJ0ICsgbGVuOyBpIDwgZTsgKytpKSB7CisgICAgICAgICAgICBpbnQgbGV2ZWwgPSBsZXZlbHNbaV07CisgICAgICAgICAgICBpZiAobGV2ZWwgIT0gY3VyTGV2ZWwpIHsKKyAgICAgICAgICAgICAgICBjdXJMZXZlbCA9IGxldmVsOworICAgICAgICAgICAgICAgICsrcnVuQ291bnQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBhZGQgZmluYWwgcnVuIGZvciB0cmFpbGluZyBjb3VudGVyLWRpcmVjdGlvbmFsIHdoaXRlc3BhY2UKKyAgICAgICAgaW50IHZpc0xlbiA9IGxlbjsKKyAgICAgICAgaWYgKChjdXJMZXZlbCAmIDEpICE9IChiYXNlTGV2ZWwgJiAxKSkgeworICAgICAgICAgICAgLy8gbG9vayBmb3IgdmlzaWJsZSBlbmQKKyAgICAgICAgICAgIHdoaWxlICgtLXZpc0xlbiA+PSAwKSB7CisgICAgICAgICAgICAgICAgY2hhciBjaCA9IGNoYXJzW2NzdGFydCArIHZpc0xlbl07CisKKyAgICAgICAgICAgICAgICBpZiAoY2ggPT0gJ1xuJykgeworICAgICAgICAgICAgICAgICAgICAtLXZpc0xlbjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGNoICE9ICcgJyAmJiBjaCAhPSAnXHQnKSB7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgICsrdmlzTGVuOworICAgICAgICAgICAgaWYgKHZpc0xlbiAhPSBsZW4pIHsKKyAgICAgICAgICAgICAgICArK3J1bkNvdW50OworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKHJ1bkNvdW50ID09IDEgJiYgbWluTGV2ZWwgPT0gYmFzZUxldmVsKSB7CisgICAgICAgICAgICAvLyB3ZSdyZSBkb25lLCBvbmx5IG9uZSBydW4gb24gdGhpcyBsaW5lCisgICAgICAgICAgICBpZiAoKG1pbkxldmVsICYgMSkgIT0gMCkgeworICAgICAgICAgICAgICAgIHJldHVybiBMYXlvdXQuRElSU19BTExfUklHSFRfVE9fTEVGVDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBMYXlvdXQuRElSU19BTExfTEVGVF9UT19SSUdIVDsKKyAgICAgICAgfQorCisgICAgICAgIGludFtdIGxkID0gbmV3IGludFtydW5Db3VudCAqIDJdOworICAgICAgICBpbnQgbWF4TGV2ZWwgPSBtaW5MZXZlbDsKKyAgICAgICAgaW50IGxldmVsQml0cyA9IG1pbkxldmVsIDw8IExheW91dC5SVU5fTEVWRUxfU0hJRlQ7CisgICAgICAgIHsKKyAgICAgICAgICAgIC8vIFN0YXJ0IG9mIGZpcnN0IHBhaXIgaXMgYWx3YXlzIDAsIHdlIHdyaXRlCisgICAgICAgICAgICAvLyBsZW5ndGggdGhlbiBzdGFydCBhdCBlYWNoIG5ldyBydW4sIGFuZCB0aGUKKyAgICAgICAgICAgIC8vIGxhc3QgcnVuIGxlbmd0aCBhZnRlciB3ZSdyZSBkb25lLgorICAgICAgICAgICAgaW50IG4gPSAxOworICAgICAgICAgICAgaW50IHByZXYgPSBsc3RhcnQ7CisgICAgICAgICAgICBjdXJMZXZlbCA9IG1pbkxldmVsOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IGxzdGFydCwgZSA9IGxzdGFydCArIHZpc0xlbjsgaSA8IGU7ICsraSkgeworICAgICAgICAgICAgICAgIGludCBsZXZlbCA9IGxldmVsc1tpXTsKKyAgICAgICAgICAgICAgICBpZiAobGV2ZWwgIT0gY3VyTGV2ZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgY3VyTGV2ZWwgPSBsZXZlbDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxldmVsID4gbWF4TGV2ZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1heExldmVsID0gbGV2ZWw7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGV2ZWwgPCBtaW5MZXZlbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbWluTGV2ZWwgPSBsZXZlbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBYWFggaWdub3JlIHJ1biBsZW5ndGggbGltaXQgb2YgMl5SVU5fTEVWRUxfU0hJRlQKKyAgICAgICAgICAgICAgICAgICAgbGRbbisrXSA9IChpIC0gcHJldikgfCBsZXZlbEJpdHM7CisgICAgICAgICAgICAgICAgICAgIGxkW24rK10gPSBpIC0gbHN0YXJ0OworICAgICAgICAgICAgICAgICAgICBsZXZlbEJpdHMgPSBjdXJMZXZlbCA8PCBMYXlvdXQuUlVOX0xFVkVMX1NISUZUOworICAgICAgICAgICAgICAgICAgICBwcmV2ID0gaTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBsZFtuXSA9IChsc3RhcnQgKyB2aXNMZW4gLSBwcmV2KSB8IGxldmVsQml0czsKKyAgICAgICAgICAgIGlmICh2aXNMZW4gPCBsZW4pIHsKKyAgICAgICAgICAgICAgICBsZFsrK25dID0gdmlzTGVuOworICAgICAgICAgICAgICAgIGxkWysrbl0gPSAobGVuIC0gdmlzTGVuKSB8IChiYXNlTGV2ZWwgPDwgTGF5b3V0LlJVTl9MRVZFTF9TSElGVCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBTZWUgaWYgd2UgbmVlZCB0byBzd2FwIGFueSBydW5zLgorICAgICAgICAvLyBJZiB0aGUgbWluIGxldmVsIHJ1biBkaXJlY3Rpb24gZG9lc24ndCBtYXRjaCB0aGUgYmFzZQorICAgICAgICAvLyBkaXJlY3Rpb24sIHdlIGFsd2F5cyBuZWVkIHRvIHN3YXAgKGF0IHRoaXMgcG9pbnQKKyAgICAgICAgLy8gd2UgaGF2ZSBtb3JlIHRoYW4gb25lIHJ1bikuCisgICAgICAgIC8vIE90aGVyd2lzZSwgd2UgZG9uJ3QgbmVlZCB0byBzd2FwIHRoZSBsb3dlc3QgbGV2ZWwuCisgICAgICAgIC8vIFNpbmNlIHRoZXJlIGFyZSBubyBsb2dpY2FsbHkgYWRqYWNlbnQgcnVucyBhdCB0aGUgc2FtZQorICAgICAgICAvLyBsZXZlbCwgaWYgdGhlIG1heCBsZXZlbCBpcyB0aGUgc2FtZSBhcyB0aGUgKG5ldykgbWluCisgICAgICAgIC8vIGxldmVsLCB3ZSBoYXZlIGEgc2VyaWVzIG9mIGFsdGVybmF0aW5nIGxldmVscyB0aGF0CisgICAgICAgIC8vIGlzIGFscmVhZHkgaW4gb3JkZXIsIHNvIHRoZXJlJ3Mgbm8gbW9yZSB0byBkby4KKyAgICAgICAgLy8KKyAgICAgICAgYm9vbGVhbiBzd2FwOworICAgICAgICBpZiAoKG1pbkxldmVsICYgMSkgPT0gYmFzZUxldmVsKSB7CisgICAgICAgICAgICBtaW5MZXZlbCArPSAxOworICAgICAgICAgICAgc3dhcCA9IG1heExldmVsID4gbWluTGV2ZWw7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzd2FwID0gcnVuQ291bnQgPiAxOworICAgICAgICB9CisgICAgICAgIGlmIChzd2FwKSB7CisgICAgICAgICAgICBmb3IgKGludCBsZXZlbCA9IG1heExldmVsIC0gMTsgbGV2ZWwgPj0gbWluTGV2ZWw7IC0tbGV2ZWwpIHsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxkLmxlbmd0aDsgaSArPSAyKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChsZXZlbHNbbGRbaV1dID49IGxldmVsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZSA9IGkgKyAyOworICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGUgPCBsZC5sZW5ndGggJiYgbGV2ZWxzW2xkW2VdXSA+PSBsZXZlbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgKz0gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGxvdyA9IGksIGhpID0gZSAtIDI7IGxvdyA8IGhpOyBsb3cgKz0gMiwgaGkgLT0gMikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4ID0gbGRbbG93XTsgbGRbbG93XSA9IGxkW2hpXTsgbGRbaGldID0geDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gbGRbbG93KzFdOyBsZFtsb3crMV0gPSBsZFtoaSsxXTsgbGRbaGkrMV0gPSB4OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGUgKyAyOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBuZXcgRGlyZWN0aW9ucyhsZCk7CisgICAgfQorCiAgICAgcHJpdmF0ZSBuYXRpdmUgc3RhdGljIGludCBydW5CaWRpKGludCBkaXIsIGNoYXJbXSBjaHMsIGJ5dGVbXSBjaEluZm8sIGludCBuLCBib29sZWFuIGhhdmVJbmZvKTsKIH0KXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlCmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC90ZXh0L0JvcmluZ0xheW91dC5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9Cb3JpbmdMYXlvdXQuamF2YQppbmRleCA5NDRmNzM1Li45MzA5YjA1IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC90ZXh0L0JvcmluZ0xheW91dC5qYXZhCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL3RleHQvQm9yaW5nTGF5b3V0LmphdmEKQEAgLTIwOCwxMSArMjA4LDExIEBACiAgICAgICAgICAgICAgKiB3aWR0aCBiZWNhdXNlIHRoZSB3aWR0aCB0aGF0IHdhcyBwYXNzZWQgaW4gd2FzIGZvciB0aGUKICAgICAgICAgICAgICAqIGZ1bGwgdGV4dCwgbm90IHRoZSBlbGxpcHNpemVkIGZvcm0uCiAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHN5bmNocm9uaXplZCAoc1RlbXApIHsKLSAgICAgICAgICAgICAgICBtTWF4ID0gKGludCkgKEZsb2F0TWF0aC5jZWlsKFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgc1RlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2UsIDAsIHNvdXJjZS5sZW5ndGgoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpKSk7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBUZXh0TGluZSBsaW5lID0gVGV4dExpbmUub2J0YWluKCk7CisgICAgICAgICAgICBsaW5lLnNldChwYWludCwgc291cmNlLCAwLCBzb3VyY2UubGVuZ3RoKCksIExheW91dC5ESVJfTEVGVF9UT19SSUdIVCwKKyAgICAgICAgICAgICAgICAgICAgTGF5b3V0LkRJUlNfQUxMX0xFRlRfVE9fUklHSFQsIGZhbHNlLCBudWxsKTsKKyAgICAgICAgICAgIG1NYXggPSAoaW50KSBGbG9hdE1hdGguY2VpbChsaW5lLm1ldHJpY3MobnVsbCkpOworICAgICAgICAgICAgVGV4dExpbmUucmVjeWNsZShsaW5lKTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChpbmNsdWRlcGFkKSB7CkBAIC0yNzYsMTQgKzI3NiwxMyBAQAogICAgICAgICAgICAgaWYgKGZtID09IG51bGwpIHsKICAgICAgICAgICAgICAgICBmbSA9IG5ldyBNZXRyaWNzKCk7CiAgICAgICAgICAgICB9Ci0gICAgCi0gICAgICAgICAgICBpbnQgd2lkOwogCi0gICAgICAgICAgICBzeW5jaHJvbml6ZWQgKHNUZW1wKSB7Ci0gICAgICAgICAgICAgICAgd2lkID0gKGludCkgKEZsb2F0TWF0aC5jZWlsKFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgc1RlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LCAwLCB0ZXh0Lmxlbmd0aCgpLCBmbSkpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZtLndpZHRoID0gd2lkOworICAgICAgICAgICAgVGV4dExpbmUgbGluZSA9IFRleHRMaW5lLm9idGFpbigpOworICAgICAgICAgICAgbGluZS5zZXQocGFpbnQsIHRleHQsIDAsIHRleHQubGVuZ3RoKCksIExheW91dC5ESVJfTEVGVF9UT19SSUdIVCwKKyAgICAgICAgICAgICAgICAgICAgTGF5b3V0LkRJUlNfQUxMX0xFRlRfVE9fUklHSFQsIGZhbHNlLCBudWxsKTsKKyAgICAgICAgICAgIGZtLndpZHRoID0gKGludCkgRmxvYXRNYXRoLmNlaWwobGluZS5tZXRyaWNzKGZtKSk7CisgICAgICAgICAgICBUZXh0TGluZS5yZWN5Y2xlKGxpbmUpOworCiAgICAgICAgICAgICByZXR1cm4gZm07CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKQEAgLTM4OSw3ICszODgsNyBAQAogCiAgICAgcHVibGljIHN0YXRpYyBjbGFzcyBNZXRyaWNzIGV4dGVuZHMgUGFpbnQuRm9udE1ldHJpY3NJbnQgewogICAgICAgICBwdWJsaWMgaW50IHdpZHRoOwotICAgICAgICAKKwogICAgICAgICBAT3ZlcnJpZGUgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKICAgICAgICAgICAgIHJldHVybiBzdXBlci50b1N0cmluZygpICsgIiB3aWR0aD0iICsgd2lkdGg7CiAgICAgICAgIH0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3RleHQvRHluYW1pY0xheW91dC5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9EeW5hbWljTGF5b3V0LmphdmEKaW5kZXggMTRlNTY1NS4uYjZhYTAzYSAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9EeW5hbWljTGF5b3V0LmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9EeW5hbWljTGF5b3V0LmphdmEKQEAgLTMxMCw3ICszMTAsNiBAQAogCiAgICAgICAgIERpcmVjdGlvbnNbXSBvYmplY3RzID0g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YXNzKTsKIApAQCAtNTQsOSArNTgsNyBAQAogICAgICAgICAgICAgTUlOX0VNT0pJID0gLTE7CiAgICAgICAgICAgICBNQVhfRU1PSkkgPSAtMTsKICAgICAgICAgfQotICAgIH07Ci0KLSAgICBwcml2YXRlIFJlY3RGIG1FbW9qaVJlY3Q7CisgICAgfQogCiAgICAgLyoqCiAgICAgICogUmV0dXJuIGhvdyB3aWRlIGEgbGF5b3V0IG11c3QgYmUgaW4gb3JkZXIgdG8gZGlzcGxheSB0aGUKQEAgLTY2LDcgKzY4LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgcGFpbnQpIHsKICAgICAgICAgcmV0dXJuIGdldERlc2lyZWRXaWR0aChzb3VyY2UsIDAsIHNvdXJjZS5sZW5ndGgoKSwgcGFpbnQpOwogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIFJldHVybiBob3cgd2lkZSBhIGxheW91dCBtdXN0IGJlIGluIG9yZGVyIHRvIGRpc3BsYXkgdGhlCiAgICAgICogc3BlY2lmaWVkIHRleHQgc2xpY2Ugd2l0aCBvbmUgbGluZSBwZXIgcGFyYWdyYXBoLgpAQCAtODUsOCArODcsNyBAQAogICAgICAgICAgICAgICAgIG5leHQgPSBlbmQ7CiAKICAgICAgICAgICAgIC8vIG5vdGUsIG9taXRzIHRyYWlsaW5nIHBhcmFncmFwaCBjaGFyCi0gICAgICAgICAgICBmbG9hdCB3ID0gbWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2UsIGksIG5leHQsIG51bGwsIHRydWUsIG51bGwpOworICAgICAgICAgICAgZmxvYXQgdyA9IG1lYXN1cmVQYXJhKHBhaW50LCB3b3JrUGFpbnQsIHNvdXJjZSwgaSwgbmV4dCk7CiAKICAgICAgICAgICAgIGlmICh3ID4gbmVlZCkKICAgICAgICAgICAgICAgICBuZWVkID0gdzsKQEAgLTExNiw2ICsxMTcsMTUgQEAKICAgICAgICAgaWYgKHdpZHRoIDwgMCkKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkxheW91dDogIiArIHdpZHRoICsgIiA8IDAiKTsKIAorICAgICAgICAvLyBFbnN1cmUgcGFpbnQgZG9lc24ndCBoYXZlIGJhc2VsaW5lU2hpZnQgc2V0LgorICAgICAgICAvLyBXaGlsZSBub3JtYWxseSB3ZSBkb24ndCBtb2RpZnkgdGhlIHBhaW50IHRoZSB1c2VyIHBhc3NlZCBpbiwKKyAgICAgICAgLy8gd2Ugd2VyZSBhbHJlYWR5IGRvaW5nIHRoaXMgaW4gU3R5bGVkLmRyYXdVbmlmb3JtUnVuIHdpdGggYm90aAorICAgICAgICAvLyBiYXNlbGluZVNoaWZ0IGFuZCBiZ0NvbG9yLiAgV2UgcHJvYmFibHkgc2hvdWxkIHJlZXZhbHVhdGUgYmdDb2xvci4KKyAgICAgICAgaWYgKHBhaW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHBhaW50LmJnQ29sb3IgPSAwOworICAgICAgICAgICAgcGFpbnQuYmFzZWxpbmVTaGlmdCA9IDA7CisgICAgICAgIH0KKwogICAgICAgICBtVGV4dCA9IHRleHQ7CiAgICAgICAgIG1QYWludCA9IHBhaW50OwogICAgICAgICBtV29ya1BhaW50ID0gbmV3IFRleHRQYWludCgpOwpAQCAtMTc1LDcgKzE4NSw2IEBACiAgICAgICAgICAgICBkYm90dG9tID0gc1RlbXBSZWN0LmJvdHRvbTsKICAgICAgICAgfQogCi0KICAgICAgICAgaW50IHRvcCA9IDA7CiAgICAgICAgIGludCBib3R0b20gPSBnZXRMaW5lVG9wKGdldExpbmVDb3VudCgpKTsKIApAQCAtMTg1LDI2ICsxOTQsMjggQEAKICAgICAgICAgaWYgKGRib3R0b20gPCBib3R0b20pIHsKICAgICAgICAgICAgIGJvdHRvbSA9IGRib3R0b207CiAgICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIGludCBmaXJzdCA9IGdldExpbmVGb3JWZXJ0aWNhbCh0b3ApOyAKKworICAgICAgICBpbnQgZmlyc3QgPSBnZXRMaW5lRm9yVmVydGljYWwodG9wKTsKICAgICAgICAgaW50IGxhc3QgPSBnZXRMaW5lRm9yVmVydGljYWwoYm90dG9tKTsKLSAgICAgICAgCisKICAgICAgICAgaW50IHByZXZpb3VzTGluZUJvdHRvbSA9IGdldExpbmVUb3AoZmlyc3QpOwogICAgICAgICBpbnQgcHJldmlvdXNMaW5lRW5kID0gZ2V0TGluZVN0YXJ0KGZpcnN0KTsKLSAgICAgICAgCisKICAgICAgICAgVGV4dFBhaW50IHBhaW50ID0gbVBhaW50OwogICAgICAgICBDaGFyU2VxdWVuY2UgYnVmID0gbVRleHQ7CiAgICAgICAgIGludCB3aWR0aCA9IG1XaWR0aDsKICAgICAgICAgYm9vbGVhbiBzcGFubmVkVGV4dCA9IG1TcGFubmVkVGV4dDsKIAogICAgICAgICBQYXJhZ3JhcGhTdHlsZVtdIHNwYW5zID0gTk9fUEFSQV9TUEFOUzsKLSAgICAgICAgaW50IHNwYW5lbmQgPSAwOworICAgICAgICBpbnQgc3BhbkVuZCA9IDA7CiAgICAgICAgIGludCB0ZXh0TGVuZ3RoID0gMDsKIAogICAgICAgICAvLyBGaXJzdCwgZHJhdyBMaW5lQmFja2dyb3VuZFNwYW5zLgotICAgICAgICAvLyBMaW5lQmFja2dyb3VuZFNwYW5zIGtub3cgbm90aGluZyBhYm91dCB0aGUgYWxpZ25tZW50IG9yIGRpcmVjdGlvbiBvZgotICAgICAgICAvLyB0aGUgbGF5b3V0IG9yIGxpbmUuICBYWFg6IFNob3VsZCB0aGV5PworICAgICAgICAvLyBMaW5lQmFja2dyb3VuZFNwYW5zIGtub3cgbm90aGluZyBhYm91dCB0aGUgYWxpZ25tZW50LCBtYXJnaW5zLCBvcgorICAgICAgICAvLyBkaXJlY3Rpb24gb2YgdGhlIGxheW91dCBvciBsaW5lLiAgWFhYOiBTaG91bGQgdGhleT8KKyAgICAgICAgLy8gVGhleSBhcmUgZXZhbHVhdGVkIGF0IGVhY2ggbGluZS4KICAgICAgICAgaWYgKHNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICBTcGFubmVkIHNwID0gKFNwYW5uZWQpIGJ1ZjsKICAgICAgICAgICAgIHRleHRMZW5ndGggPSBidWYubGVuZ3RoKCk7CiAgICAgICAgICAgICBmb3IgKGludCBpID0gZmlyc3Q7IGkgPD0gbGFzdDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgaW50IHN0YXJ0ID0gcHJldmlvdXNMaW5lRW5kOwpAQCAtMjE2LDEyICsyMjcsMTQgQEAKICAgICAgICAgICAgICAgICBwcmV2aW91c0xpbmVCb3R0b20gPSBsYm90dG9tOwogICAgICAgICAgICAgICAgIGludCBsYmFzZWxpbmUgPSBsYm90dG9tIC0gZ2V0TGluZURlc2NlbnQoaSk7CiAKLSAgICAgICAgICAgICAgICBpZiAoc3RhcnQgPj0gc3BhbmVuZCkgewotICAgICAgICAgICAgICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgYnVmOwotICAgICAgICAgICAgICAgICAgIHNwYW5lbmQgPSBzcC5uZXh0U3BhblRyYW5zaXRpb24oc3RhcnQsIHRleHRMZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaW5lQmFja2dyb3VuZFNwYW4uY2xhc3MpOwotICAgICAgICAgICAgICAgICAgIHNwYW5zID0gc3AuZ2V0U3BhbnMoc3RhcnQsIHNwYW5lbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaW5lQmFja2dyb3VuZFNwYW4uY2xhc3MpOworICAgICAgICAgICAgICAgIGlmIChzdGFydCA+PSBzcGFuRW5kKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRoZXNlIHNob3VsZCBiZSBpbmZyZXF1ZW50LCBzbyB3ZSdsbCB1c2UgdGhpcyBzbyB0aGF0CisgICAgICAgICAgICAgICAgICAgIC8vIHdlIGRvbid0IGhhdmUgdG8gY2hlY2sgYXMgb2Z0ZW4uCisgICAgICAgICAgICAgICAgICAgIHNwYW5FbmQgPSBzcC5uZXh0U3BhblRyYW5zaXRpb24oc3RhcnQsIHRleHRMZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGluZUJhY2tncm91bmRTcGFuLmNsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gQWxsIExpbmVCYWNrZ3JvdW5kU3BhbnMgb24gYSBsaW5lIGNvbnRyaWJ1dGUgdG8gaXRzCisgICAgICAgICAgICAgICAgICAgIC8vIGJhY2tncm91bmQuCisgICAgICAgICAgICAgICAgICAgc3BhbnMgPSBzcC5nZXRTcGFucyhzdGFydCwgZW5kLCBMaW5lQmFja2dyb3VuZFNwYW4uY2xhc3MpOwogICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgIGZvciAoaW50IG4gPSAwOyBuIDwgc3BhbnMubGVuZ3RoOyBuKyspIHsKQEAgLTIzNCwxMSArMjQ3LDExIEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgLy8gcmVzZXQgdG8gdGhlaXIgb3JpZ2luYWwgdmFsdWVzCi0gICAgICAgICAgICBzcGFuZW5kID0gMDsKKyAgICAgICAgICAgIHNwYW5FbmQgPSAwOwogICAgICAgICAgICAgcHJldmlvdXNMaW5lQm90dG9tID0gZ2V0TGluZVRvcChmaXJzdCk7CiAgICAgICAgICAgICBwcmV2aW91c0xpbmVFbmQgPSBnZXRMaW5lU3RhcnQoZmlyc3QpOwogICAgICAgICAgICAgc3BhbnMgPSBOT19QQVJBX1NQQU5TOwotICAgICAgICB9IAorICAgICAgICB9CiAKICAgICAgICAgLy8gVGhlcmUgY2FuIGJlIGEgaGlnaGxpZ2h0IGV2ZW4gd2l0aG91dCBzcGFucy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XMsIGNvbXB1dGUgdGhlIGFsaWdubWVudC4KLSAgICAgICAgICAgICAgICAvLyBMYXN0IGFsaWdubWVudCBzdHlsZSB3aW5zLgotICAgICAgICAgICAgICAgIGlmIChzdGFydCA+PSBzcGFuZW5kKSB7Ci0gICAgICAgICAgICAgICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgYnVmOwotICAgICAgICAgICAgICAgICAgICBzcGFuZW5kID0gc3AubmV4dFNwYW5UcmFuc2l0aW9uKHN0YXJ0LCB0ZXh0TGVuZ3RoLAorICAgICAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihpKTsKKyAgICAgICAgICAgIGludCBsZWZ0ID0gMDsKKyAgICAgICAgICAgIGludCByaWdodCA9IG1XaWR0aDsKKworICAgICAgICAgICAgaWYgKHNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICAgICAgU3Bhbm5lZCBzcCA9IChTcGFubmVkKSBidWY7CisgICAgICAgICAgICAgICAgYm9vbGVhbiBpc0ZpcnN0UGFyYUxpbmUgPSAoc3RhcnQgPT0gMCB8fAorICAgICAgICAgICAgICAgICAgICAgICAgYnVmLmNoYXJBdChzdGFydCAtIDEpID09ICdcbicpOworCisgICAgICAgICAgICAgICAgLy8gTmV3IGJhdGNoIG9mIHBhcmFncmFwaCBzdHlsZXMsIGNvbGxlY3QgaW50byBzcGFucyBhcnJheS4KKyAgICAgICAgICAgICAgICAvLyBDb21wdXRlIHRoZSBhbGlnbm1lbnQsIGxhc3QgYWxpZ25tZW50IHN0eWxlIHdpbnMuCisgICAgICAgICAgICAgICAgLy8gUmVzZXQgdGFiU3RvcHMsIHdlJ2xsIHJlYnVpbGQgaWYgd2UgZW5jb3VudGVyIGEgbGluZSB3aXRoCisgICAgICAgICAgICAgICAgLy8gdGFicy4KKyAgICAgICAgICAgICAgICAvLyBXZSBleHBlY3QgcGFyYWdyYXBoIHNwYW5zIHRvIGJlIHJlbGF0aXZlbHkgaW5mcmVxdWVudCwgdXNlCisgICAgICAgICAgICAgICAgLy8gc3BhbkVuZCBzbyB0aGF0IHdlIGNhbiBjaGVjayBsZXNzIGZyZXF1ZW50bHkuICBTaW5jZQorICAgICAgICAgICAgICAgIC8vIHBhcmFncmFwaCBzdHlsZXMgb3VnaHQgdG8gYXBwbHkgdG8gZW50aXJlIHBhcmFncmFwaHMsIHdlIGNhbgorICAgICAgICAgICAgICAgIC8vIGp1c3QgY29sbGVjdCB0aGUgb25lcyBwcmVzZW50IGF0IHRoZSBzdGFydCBvZiB0aGUgcGFyYWdyYXBoLgorICAgICAgICAgICAgICAgIC8vIElmIHNwYW5FbmQgaXMgYmVmb3JlIHRoZSBlbmQgb2YgdGhlIHBhcmFncmFwaCwgdGhhdCdzIG5vdAorICAgICAgICAgICAgICAgIC8vIG91ciBwcm9ibGVtLgorICAgICAgICAgICAgICAgIGlmIChzdGFydCA+PSBzcGFuRW5kICYmIChpID09IGZpcnN0IHx8IGlzRmlyc3RQYXJhTGluZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc3BhbkVuZCA9IHNwLm5leHRTcGFuVHJhbnNpdGlvbihzdGFydCwgdGV4dExlbmd0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJhZ3JhcGhTdHlsZS5jbGFzcyk7Ci0gICAgICAgICAgICAgICAgICAgIHNwYW5zID0gc3AuZ2V0U3BhbnMoc3RhcnQsIHNwYW5lbmQsIFBhcmFncmFwaFN0eWxlLmNsYXNzKTsKLSAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIHNwYW5zID0gc3AuZ2V0U3BhbnMoc3RhcnQsIHNwYW5FbmQsIFBhcmFncmFwaFN0eWxlLmNsYXNzKTsKKwogICAgICAgICAgICAgICAgICAgICBhbGlnbiA9IG1BbGlnbm1lbnQ7CiAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IG4gPSBzcGFucy5sZW5ndGgtMTsgbiA+PSAwOyBuLS0pIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcGFuc1tuXSBpbnN0YW5jZW9mIEFsaWdubWVudFNwYW4pIHsKQEAgLTI5MCw0NSArMzE4LDQ5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIGludCBkaXIgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24oaSk7Ci0gICAgICAgICAgICBpbnQgbGVmdCA9IDA7Ci0gICAgICAgICAgICBpbnQgcmlnaHQgPSBtV2lkdGg7CiAKLSAgICAgICAgICAgIC8vIERyYXcgYWxsIGxlYWRpbmcgbWFyZ2luIHNwYW5zLiAgQWRqdXN0IGxlZnQgb3IgcmlnaHQgYWNjb3JkaW5nCi0gICAgICAgICAgICAvLyB0byB0aGUgcGFyYWdyYXBoIGRpcmVjdGlvbiBvZiB0aGUgbGluZS4KLSAgICAgICAgICAgIGlmIChzcGFubmVkVGV4dCkgeworICAgICAgICAgICAgICAgICAgICB0YWJTdG9wc0lzSW5pdGlhbGl6ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBEcmF3IGFsbCBsZWFkaW5nIG1hcmdpbiBzcGFucy4gIEFkanVzdCBsZWZ0IG9yIHJpZ2h0IGFjY29yZGluZworICAgICAgICAgICAgICAgIC8vIHRvIHRoZSBwYXJhZ3JhcGggZGlyZWN0aW9uIG9mIHRoZSBsaW5lLgogICAgICAgICAgICAgICAgIGZpbmFsIGludCBsZW5ndGggPSBzcGFucy5sZW5ndGg7CiAgICAgICAgICAgICAgICAgZm9yIChpbnQgbiA9IDA7IG4gPCBsZW5ndGg7IG4rKykgewogICAgICAgICAgICAgICAgICAgICBpZiAoc3BhbnNbbl0gaW5zdGFuY2VvZiBMZWFkaW5nTWFyZ2luU3BhbikgewogICAgICAgICAgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW4gbWFyZ2luID0gKExlYWRpbmdNYXJnaW5TcGFuKSBzcGFuc1tuXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gdXNlRmlyc3RMaW5lTWFyZ2luID0gaXNGaXJzdFBhcmFMaW5lOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1hcmdpbiBpbnN0YW5jZW9mIExlYWRpbmdNYXJnaW5TcGFuMikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb3VudCA9ICgoTGVhZGluZ01hcmdpblNwYW4yKSBtYXJnaW4pLmdldExlYWRpbmdNYXJnaW5MaW5lQ291bnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3RhcnRMaW5lID0gZ2V0TGluZUZvck9mZnNldChzcC5nZXRTcGFuU3RhcnQobWFyZ2luKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlRmlyc3RMaW5lTWFyZ2luID0gaSA8IHN0YXJ0TGluZSArIGNvdW50OworICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9SSUdIVF9UT19MRUZUKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luLmRyYXdMZWFkaW5nTWFyZ2luKGMsIHBhaW50LCByaWdodCwgZGlyLCBsdG9wLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYmFzZWxpbmUsIGxib3R0b20sIGJ1ZiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQsIGVuZCwgaXNGaXJzdFBhcmFMaW5lLCB0aGlzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHQgLT0gbWFyZ2luLmdldExlYWRpbmdNYXJnaW4oaXNGaXJzdFBhcmFMaW5lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByaWdodCAtPSBtYXJnaW4uZ2V0TGVhZGluZ01hcmdpbih1c2VGaXJzdExpbmVNYXJnaW4pOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW4uZHJhd0xlYWRpbmdNYXJnaW4oYywgcGFpbnQsIGxlZnQsIGRpciwgbHRvcCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGJhc2VsaW5lLCBsYm90dG9tLCBidWYsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0LCBlbmQsIGlzRmlyc3RQYXJhTGluZSwgdGhpcyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIHVzZU1hcmdpbiA9IGlzRmlyc3RQYXJhTGluZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWFyZ2luIGluc3RhbmNlb2YgTGVhZGluZ01hcmdpblNwYW4uTGVhZGluZ01hcmdpblNwYW4yKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb3VudCA9ICgoTGVhZGluZ01hcmdpblNwYW4uTGVhZGluZ01hcmdpblNwYW4yKW1hcmdpbikuZ2V0TGVhZGluZ01hcmdpbkxpbmVDb3VudCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VNYXJnaW4gPSBjb3VudCA+IGk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQgKz0gbWFyZ2luLmdldExlYWRpbmdNYXJnaW4odXNlTWFyZ2luKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0ICs9IG1hcmdpbi5nZXRMZWFkaW5nTWFyZ2luKHVzZUZpcnN0TGluZU1hcmdpbik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIC8vIEFkanVzdCB0aGUgcG9pbnQgYXQgd2hpY2ggdG8gc3RhcnQgcmVuZGVyaW5nIGRlcGVuZGluZyBvbiB0aGUKLSAgICAgICAgICAgIC8vIGFsaWdubWVudCBvZiB0aGUgcGFyYWdyYXBoLgorICAgICAgICAgICAgYm9vbGVhbiBoYXNUYWJPckVtb2ppID0gZ2V0TGluZUNvbnRhaW5zVGFiKGkpOworICAgICAgICAgICAgLy8gQ2FuJ3QgdGVsbCBpZiB3ZSBoYXZlIHRhYnMgZm9yIHN1cmUsIGN1cnJlbnRseQorICAgICAgICAgICAgaWYgKGhhc1RhYk9yRW1vamkgJiYgIXRhYlN0b3BzSXNJbml0aWFsaXplZCkgeworICAgICAgICAgICAgICAgIGlmICh0YWJTdG9wcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHRhYlN0b3BzID0gbmV3IFRhYlN0b3BzKFRBQl9JTkNSRU1FTlQsIHNwYW5zKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB0YWJTdG9wcy5yZXNldChUQUJfSU5DUkVNRU5ULCBzcGFucyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRhYlN0b3BzSXNJbml0aWFsaXplZCA9IHRydWU7CisgICAgICAgICAgICB9CisKICAgICAgICAgICAgIGludCB4OwogICAgICAgICAgICAgaWYgKGFsaWduID09IEFsaWdubWVudC5BTElHTl9OT1JNQUwpIHsKICAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9MRUZUX1RPX1JJR0hUKSB7CkBAIC0zMzcsNDEgKzM2OSw4MCBAQAogICAgICAgICAgICAgICAgICAgICB4ID0gcmlnaHQ7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpbnQgbWF4ID0gKGludClnZXRMaW5lTWF4KGksIHNwYW5zLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgaW50IG1heCA9IChpbnQpZ2V0TGluZUV4dGVudChpLCB0YWJTdG9wcywgZmFsc2UpOwogICAgICAgICAgICAgICAgIGlmIChhbGlnbiA9PSBBbGlnbm1lbnQuQUxJR05fT1BQT1NJVEUpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICAgICAgeCA9IGxlZnQgKyBtYXg7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChkaXIgPT0gRElSX0xFRlRfVE9fUklHSFQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHggPSByaWdodCAtIG1heDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIEFsaWdubWVudC5BTElHTl9DRU5URVIKLSAgICAgICAgICAgICAgICAgICAgbWF4ID0gbWF4ICYgfjE7Ci0gICAgICAgICAgICAgICAgICAgIGludCBoYWxmID0gKHJpZ2h0IC0gbGVmdCAtIG1heCkgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICAgICAgeCA9IHJpZ2h0IC0gaGFsZjsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHggPSBsZWZ0ICsgaGFsZjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHggPSBsZWZ0IC0gbWF4OwogICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gQWxpZ25tZW50LkFMSUdOX0NFTlRFUgorICAgICAgICAgICAgICAgICAgICBtYXggPSBtYXggJiB+MTsKKyAgICAgICAgICAgICAgICAgICAgeCA9IChyaWdodCArIGxlZnQgLSBtYXgpID4+IDE7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICBEaXJlY3Rpb25zIGRpcmVjdGlvbnMgPSBnZXRMaW5lRGlyZWN0aW9ucyhpKTsKLSAgICAgICAgICAgIGJvb2xlYW4gaGFzVGFiID0gZ2V0TGluZUNvbnRhaW5zVGFiKGkpOwogICAgICAgICAgICAgaWYgKGRpcmVjdGlvbnMgPT0gRElSU19BTExfTEVGVF9UT19SSUdIVCAmJgotICAgICAgICAgICAgICAgICAgICAhc3Bhbm5lZFRleHQgJiYgIWhhc1RhYikgewotICAgICAgICAgICAgICAgIGlmIChERUJVRykgewotICAgICAgICAgICAgICAgICAgICBBc3NlcnQuYXNzZXJ0VHJ1ZShkaXIgPT0gRElSX0xFRlRfVE9fUklHSFQpOwotICAgICAgICAgICAgICAgICAgICBBc3NlcnQuYXNzZXJ0Tm90TnVsbChjKTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICFzcGFubmVkVGV4dCAmJiAhaGFzVGFiT3JFbW9qaSkgewogICAgICAgICAgICAgICAgIC8vIFhYWDogYXNzdW1lcyB0aGVyZSdzIG5vdGhpbmcgYWRkaXRpb25hbCB0byBiZSBkb25lCiAgICAgICAgICAgICAgICAgYy5kcmF3VGV4dChidWYsIHN0YXJ0LCBlbmQsIHgsIGxiYXNlbGluZSwgcGFpbnQpOwogICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBkcmF3VGV4dChjLCBidWYsIHN0YXJ0LCBlbmQsIGRpciwgZGlyZWN0aW9ucywKLSAgICAgICAgICAgICAgICAgICAgeCwgbHRvcCwgbGJhc2VsaW5lLCBsYm90dG9tLCBwYWludCwgbVdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgaGFzVGFiLCBzcGFucyk7CisgICAgICAgICAgICAgICAgdGwuc2V0KHBhaW50LCBidWYsIHN0YXJ0LCBlbmQsIGRpciwgZGlyZWN0aW9ucywgaGFzVGFiT3JFbW9qaSwgdGFiU3RvcHMpOworICAgICAgICAgICAgICAgIHRsLmRyYXcoYywgeCwgbHRvcCwgbGJhc2VsaW5lLCBsYm90dG9tKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQorCisgICAgICAgIFRleHRMaW5lLnJlY3ljbGUodGwpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybiB0aGUgc3RhcnQgcG9zaXRpb24gb2YgdGhlIGxpbmUsIGdpdmVuIHRoZSBsZWZ0IGFuZCByaWdodCBib3VuZHMKKyAgICAgKiBvZiB0aGUgbWFyZ2lucy4KKyAgICAgKgorICAgICAqIEBwYXJhbSBsaW5lIHRoZSBsaW5lIGluZGV4CisgICAgICogQHBhcmFtIGxlZnQgdGhlIGxlZnQgYm91bmRzICgwLCBvciBsZWFkaW5nIG1hcmdpbiBpZiBsdHIgcGFyYSkKKyAgICAgKiBAcGFyYW0gcmlnaHQgdGhlIHJpZ2h0IGJvdW5kcyAod2lkdGgsIG1pbnVzIGxlYWRpbmcgbWFyZ2luIGlmIHJ0bCBwYXJhKQorICAgICAqIEByZXR1cm4gdGhlIHN0YXJ0IHBvc2l0aW9uIG9mIHRoZSBsaW5lICh0byByaWdodCBvZiBsaW5lIGlmIHJ0bCBwYXJhKQorICAgICAqLworICAgIHByaXZhdGUgaW50IGdldExpbmVTdGFydFBvcyhpbnQgbGluZSwgaW50IGxlZnQsIGludCByaWdodCkgeworICAgICAgICAvLyBBZGp1c3QgdGhlIHBvaW50IGF0IHdoaWNoIHRvIHN0YXJ0IHJlbmRlcmluZyBkZXBlbmRpbmcgb24gdGhlCisgICAgICAgIC8vIGFsaWdubWVudCBvZiB0aGUgcGFyYWdyYXBoLgorICAgICAgICBBbGlnbm1lbnQgYWxpZ24gPSBnZXRQYXJhZ3JhcGhBbGlnbm1lbnQobGluZSk7CisgICAgICAgIGludCBkaXIgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSk7CisKKyAgICAgICAgaW50IHg7CisgICAgICAgIGlmIChhbGlnbiA9PSBBbGlnbm1lbnQuQUxJR05fTk9STUFMKSB7CisgICAgICAgICAgICBpZiAoZGlyID09IERJUl9MRUZUX1RPX1JJR0hUKSB7CisgICAgICAgICAgICAgICAgeCA9IGxlZnQ7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHggPSByaWdodDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIFRhYlN0b3BzIHRhYlN0b3BzID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChtU3Bhbm5lZFRleHQgJiYgZ2V0TGluZUNvbnRhaW5zVGFiKGxpbmUpKSB7CisgICAgICAgICAgICAgICAgU3Bhbm5lZCBzcGFubmVkID0gKFNwYW5uZWQpIG1UZXh0OworICAgICAgICAgICAgICAgIGludCBzdGFydCA9IGdldExpbmVTdGFydChsaW5lKTsKKyAgICAgICAgICAgICAgICBpbnQgc3BhbkVuZCA9IHNwYW5uZWQubmV4dFNwYW5UcmFuc2l0aW9uKHN0YXJ0LCBzcGFubmVkLmxlbmd0aCgpLAorICAgICAgICAgICAgICAgICAgICAgICAgVGFiU3RvcFNwYW4uY2xhc3MpOworICAgICAgICAgICAgICAgIFRhYlN0b3BTcGFuW10gdGFiU3BhbnMgPSBzcGFubmVkLmdldFNwYW5zKHN0YXJ0LCBzcGFuRW5kLCBUYWJTdG9wU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgaWYgKHRhYlNwYW5zLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgdGFiU3RvcHMgPSBuZXcgVGFiU3RvcHMoVEFCX0lOQ1JFTUVOVCwgdGFiU3BhbnMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGludCBtYXggPSAoaW50KWdldExpbmVFeHRlbnQobGluZSwgdGFiU3RvcHMsIGZhbHNlKTsKKyAgICAgICAgICAgIGlmIChhbGlnbiA9PSBBbGlnbm1lbnQuQUxJR05fT1BQT1NJVEUpIHsKKyAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9MRUZUX1RPX1JJR0hUKSB7CisgICAgICAgICAgICAgICAgICAgIHggPSByaWdodCAtIG1heDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB4ID0gbGVmdCAtIG1heDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeyAvLyBBbGlnbm1lbnQuQUxJR05fQ0VOVEVSCisgICAgICAgICAgICAgICAgbWF4ID0gbWF4ICYgfjE7CisgICAgICAgICAgICAgICAgeCA9IChsZWZ0ICsgcmlnaHQgLSBtYXgpID4+IDE7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHg7CiAgICAgfQogCiAgICAgLyoqCkBAIC00MTcsNyArNDg4LDcgQEAKIAogICAgICAgICBtV2lkdGggPSB3aWQ7CiAgICAgfQotICAgIAorCiAgICAgLyoqCiAgICAgICogUmV0dXJuIHRoZSB0b3RhbCBoZWlnaHQgb2YgdGhpcyBsYXlvdXQuCiAgICAgICovCkBAIC00NTAsNyArNTIxLDcgQEAKICAgICAgKiBSZXR1cm4gdGhlIG51bWJlciBvZiBsaW5lcyBvZiB0ZXh0IGluIHRoaXMgbGF5b3V0LgogICAgICAqLwogICAgIHB1YmxpYyBhYnN0cmFjdCBpbnQgZ2V0TGluZUNvdW50KCk7Ci0gICAgCisKICAgICAvKioKICAgICAgKiBSZXR1cm4gdGhlIGJhc2VsaW5lIGZvciB0aGUgc3BlY2lmaWVkIGxpbmUgKDAmaGVsbGlwO2dldExpbmVDb3VudCgpIC0gMSkKICAgICAgKiBJZiBib3VuZHMgaXMgbm90IG51bGwsIHJldHVybiB0aGUgdG9wLCBsZWZ0LCByaWdodCwgYm90dG9tIGV4dGVudHMKQEAgLTUyNCwxMyArNTk1LDk1IEBACiAgICAgICovCiAgICAgcHVibGljIGFic3RyYWN0IGludCBnZXRCb3R0b21QYWRkaW5nKCk7CiAKKworICAgIC8qKgorICAgICAqIFJldHVybnMgdHJ1ZSBpZiB0aGUgY2hhcmFjdGVyIGF0IG9mZnNldCBhbmQgdGhlIHByZWNlZGluZyBjaGFyYWN0ZXIKKyAgICAgKiBhcmUgYXQgZGlmZmVyZW50IHJ1biBsZXZlbHMgKGFuZCB0aHVzIHRoZXJlJ3MgYSBzcGxpdCBjYXJldCkuCisgICAgICogQHBhcmFtIG9mZnNldCB0aGUgb2Zmc2V0CisgICAgICogQHJldHVybiB0cnVlIGlmIGF0IGEgbGV2ZWwgYm91bmRhcnkKKyAgICAgKi8KKyAgICBwcml2YXRlIGJvb2xlYW4gaXNMZXZlbEJvdW5kYXJ5KGludCBvZmZzZXQpIHsKKyAgICAgICAgaW50IGxpbmUgPSBnZXRMaW5lRm9yT2Zmc2V0KG9mZnNldCk7CisgICAgICAgIERpcmVjdGlvbnMgZGlycyA9IGdldExpbmVEaXJlY3Rpb25zKGxpbmUpOworICAgICAgICBpZiAoZGlycyA9PSBESVJTX0FMTF9MRUZUX1RPX1JJR0hUIHx8IGRpcnMgPT0gRElSU19BTExfUklHSFRfVE9fTEVGVCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgaW50W10gcnVucyA9IGRpcnMubURpcmVjdGlvbnM7CisgICAgICAgIGludCBsaW5lU3RhcnQgPSBnZXRMaW5lU3RhcnQobGluZSk7CisgICAgICAgIGludCBsaW5lRW5kID0gZ2V0TGluZUVuZChsaW5lKTsKKyAgICAgICAgaWYgKG9mZnNldCA9PSBsaW5lU3RhcnQgfHwgb2Zmc2V0ID09IGxpbmVFbmQpIHsKKyAgICAgICAgICAgIGludCBwYXJhTGV2ZWwgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSkgPT0gMSA/IDAgOiAxOworICAgICAgICAgICAgaW50IHJ1bkluZGV4ID0gb2Zmc2V0ID09IGxpbmVTdGFydCA/IDAgOiBydW5zLmxlbmd0aCAtIDI7CisgICAgICAgICAgICByZXR1cm4gKChydW5zW3J1bkluZGV4ICsgMV0gPj4+IFJVTl9MRVZFTF9TSElGVCkgJiBSVU5fTEVWRUxfTUFTSykgIT0gcGFyYUxldmVsOworICAgICAgICB9CisKKyAgICAgICAgb2Zmc2V0IC09IGxpbmVTdGFydDsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBydW5zLmxlbmd0aDsgaSArPSAyKSB7CisgICAgICAgICAgICBpZiAob2Zmc2V0ID09IHJ1bnNbaV0pIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIHByaW1hcnlJc1RyYWlsaW5nUHJldmlvdXMoaW50IG9mZnNldCkgeworICAgICAgICBpbnQgbGluZSA9IGdldExpbmVGb3JPZmZzZXQob2Zmc2V0KTsKKyAgICAgICAgaW50IGxpbmVTdGFydCA9IGdldExpbmVTdGFydChsaW5lKTsKKyAgICAgICAgaW50IGxpbmVFbmQgPSBnZXRMaW5lRW5kKGxpbmUpOworICAgICAgICBpbnRbXSBydW5zID0gZ2V0TGluZURpcmVjdGlvbnMobGluZSkubURpcmVjdGlvbnM7CisKKyAgICAgICAgaW50IGxldmVsQXQgPSAtMTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBydW5zLmxlbmd0aDsgaSArPSAyKSB7CisgICAgICAgICAgICBpbnQgc3RhcnQgPSBsaW5lU3RhcnQgKyBydW5zW2ldOworICAgICAgICAgICAgaW50IGxpbWl0ID0gc3RhcnQgKyAocnVuc1tpKzFdICYgUlVOX0xFTkdUSF9NQVNLKTsKKyAgICAgICAgICAgIGlmIChsaW1pdCA+IGxpbmVFbmQpIHsKKyAgICAgICAgICAgICAgICBsaW1pdCA9IGxpbmVFbmQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAob2Zmc2V0ID49IHN0YXJ0ICYmIG9mZnNldCA8IGxpbWl0KSB7CisgICAgICAgICAgICAgICAgaWYgKG9mZnNldCA+IHN0YXJ0KSB7CisgICAgICAgICAgICAgICAgICAgIC8vIFByZXZpb3VzIGNoYXJhY3RlciBpcyBhdCBzYW1lIGxldmVsLCBzbyBkb24ndCB1c2UgdHJhaWxpbmcuCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbGV2ZWxBdCA9IChydW5zW2krMV0gPj4+IFJVTl9MRVZFTF9TSElGVCkgJiBSVU5fTEVWRUxfTUFTSzsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAobGV2ZWxBdCA9PSAtMSkgeworICAgICAgICAgICAgLy8gT2Zmc2V0IHdhcyBsaW1pdCBvZiBsaW5lLgorICAgICAgICAgICAgbGV2ZWxBdCA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKSA9PSAxID8gMCA6IDE7CisgICAgICAgIH0KKworICAgICAgICAvLyBBdCBsZXZlbCBib3VuZGFyeSwgY2hlY2sgcHJldmlvdXMgbGV2ZWwuCisgICAgICAgIGludCBsZXZlbEJlZm9yZSA9IC0xOworICAgICAgICBpZiAob2Zmc2V0ID09IGxpbmVTdGFydCkgeworICAgICAgICAgICAgbGV2ZWxCZWZvcmUgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSkgPT0gMSA/IDAgOiAxOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgb2Zmc2V0IC09IDE7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHJ1bnMubGVuZ3RoOyBpICs9IDIpIHsKKyAgICAgICAgICAgICAgICBpbnQgc3RhcnQgPSBsaW5lU3RhcnQgKyBydW5zW2ldOworICAgICAgICAgICAgICAgIGludCBsaW1pdCA9IHN0YXJ0ICsgKHJ1bnNbaSsxXSAmIFJVTl9MRU5HVEhfTUFTSyk7CisgICAgICAgICAgICAgICAgaWYgKGxpbWl0ID4gbGluZUVuZCkgeworICAgICAgICAgICAgICAgICAgICBsaW1pdCA9IGxpbmVFbmQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChvZmZzZXQgPj0gc3RhcnQgJiYgb2Zmc2V0IDwgbGltaXQpIHsKKyAgICAgICAgICAgICAgICAgICAgbGV2ZWxCZWZvcmUgPSAocnVuc1tpKzFdID4+PiBSVU5fTEVWRUxfU0hJRlQpICYgUlVOX0xFVkVMX01BU0s7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBsZXZlbEJlZm9yZSA8IGxldmVsQXQ7CisgICAgfQorCiAgICAgLyoqCiAgICAgICogR2V0IHRoZSBwcmltYXJ5IGhvcml6b250YWwgcG9zaXRpb24gZm9yIHRoZSBzcGVjaWZpZWQgdGV4dCBvZmZzZXQuCiAgICAgICogVGhpcyBpcyB0aGUgbG9jYXRpb24gd2hlcmUgYSBuZXcgY2hhcmFjdGVyIHdvdWxkIGJlIGluc2VydGVkIGluCiAgICAgICogdGhlIHBhcmFncmFwaCdzIHByaW1hcnkgZGlyZWN0aW9uLgogICAgICAqLwogICAgIHB1YmxpYyBmbG9hdCBnZXRQcmltYXJ5SG9yaXpvbnRhbChpbnQgb2Zmc2V0KSB7Ci0gICAgICAgIHJldHVybiBnZX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ICAgICAvLyBjb25zaXN0ZW50IGFjcm9zcyBhbGwgbGluZXMgaW4gYSBwYXJhZ3JhcGguCisgICAgICAgICAgICBUYWJTdG9wU3BhbltdIHRhYnMgPSAoKFNwYW5uZWQpIG1UZXh0KS5nZXRTcGFucyhzdGFydCwgZW5kLCBUYWJTdG9wU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICBpZiAodGFicy5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgdGFiU3RvcHMgPSBuZXcgVGFiU3RvcHMoVEFCX0lOQ1JFTUVOVCwgdGFicyk7IC8vIFhYWCBzaG91bGQgcmV1c2UKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogCi0gICAgICAgIGZsb2F0IHdpZCA9IG1lYXN1cmVUZXh0KG1QYWludCwgbVdvcmtQYWludCwgbVRleHQsIHN0YXJ0LCBvZmZzZXQsIGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyLCBkaXJlY3Rpb25zLCB0cmFpbGluZywgYWx0LCB0YWIsIHRhYnMpOworICAgICAgICBUZXh0TGluZSB0bCA9IFRleHRMaW5lLm9idGFpbigpOworICAgICAgICB0bC5zZXQobVBhaW50LCBtVGV4dCwgc3RhcnQsIGVuZCwgZGlyLCBkaXJlY3Rpb25zLCBoYXNUYWJPckVtb2ppLCB0YWJTdG9wcyk7CisgICAgICAgIGZsb2F0IHdpZCA9IHRsLm1lYXN1cmUob2Zmc2V0IC0gc3RhcnQsIHRyYWlsaW5nLCBudWxsKTsKKyAgICAgICAgVGV4dExpbmUucmVjeWNsZSh0bCk7CiAKLSAgICAgICAgaWYgKG9mZnNldCA+IGVuZCkgewotICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICB3aWQgLT0gbWVhc3VyZVRleHQobVBhaW50LCBtV29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGV4dCwgZW5kLCBvZmZzZXQsIG51bGwsIHRhYiwgdGFicyk7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgd2lkICs9IG1lYXN1cmVUZXh0KG1QYWludCwgbVdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRleHQsIGVuZCwgb2Zmc2V0LCBudWxsLCB0YWIsIHRhYnMpOwotICAgICAgICB9Ci0KLSAgICAgICAgQWxpZ25tZW50IGFsaWduID0gZ2V0UGFyYWdyYXBoQWxpZ25tZW50KGxpbmUpOwogICAgICAgICBpbnQgbGVmdCA9IGdldFBhcmFncmFwaExlZnQobGluZSk7CiAgICAgICAgIGludCByaWdodCA9IGdldFBhcmFncmFwaFJpZ2h0KGxpbmUpOwogCi0gICAgICAgIGlmIChhbGlnbiA9PSBBbGlnbm1lbnQuQUxJR05fTk9STUFMKSB7Ci0gICAgICAgICAgICBpZiAoZGlyID09IERJUl9SSUdIVF9UT19MRUZUKQotICAgICAgICAgICAgICAgIHJldHVybiByaWdodCArIHdpZDsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCArIHdpZDsKLSAgICAgICAgfQotCi0gICAgICAgIGZsb2F0IG1heCA9IGdldExpbmVNYXgobGluZSk7Ci0KLSAgICAgICAgaWYgKGFsaWduID09IEFsaWdubWVudC5BTElHTl9PUFBPU0lURSkgewotICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCArIG1heCArIHdpZDsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICByZXR1cm4gcmlnaHQgLSBtYXggKyB3aWQ7Ci0gICAgICAgIH0gZWxzZSB7IC8qIGFsaWduID09IEFsaWdubWVudC5BTElHTl9DRU5URVIgKi8KLSAgICAgICAgICAgIGludCBpbWF4ID0gKChpbnQpIG1heCkgJiB+MTsKLQotICAgICAgICAgICAga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GluZyB3aGl0ZXNwYWNlCisgICAgICogQHJldHVybiB0aGUgZXh0ZW50IG9mIHRoZSBsaW5lCisgICAgICovCisgICAgcHJpdmF0ZSBmbG9hdCBnZXRMaW5lRXh0ZW50KGludCBsaW5lLCBib29sZWFuIGZ1bGwpIHsKICAgICAgICAgaW50IHN0YXJ0ID0gZ2V0TGluZVN0YXJ0KGxpbmUpOwotICAgICAgICBpbnQgZW5kOworICAgICAgICBpbnQgZW5kID0gZnVsbCA/IGdldExpbmVFbmQobGluZSkgOiBnZXRMaW5lVmlzaWJsZUVuZChsaW5lKTsKIAotICAgICAgICBpZiAoZnVsbCkgewotICAgICAgICAgICAgZW5kID0gZ2V0TGluZUVuZChsaW5lKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGVuZCA9IGdldExpbmVWaXNpYmxlRW5kKGxpbmUpOwotICAgICAgICB9IAotICAgICAgICBib29sZWFuIHRhYiA9IGdldExpbmVDb250YWluc1RhYihsaW5lKTsKLQotICAgICAgICBpZiAodGFicyA9PSBudWxsICYmIHRhYiAmJiBtVGV4dCBpbnN0YW5jZW9mIFNwYW5uZWQpIHsKLSAgICAgICAgICAgIHRhYnMgPSAoKFNwYW5uZWQpIG1UZXh0KS5nZXRTcGFucyhzdGFydCwgZW5kLCBUYWJTdG9wU3Bhbi5jbGFzcyk7CisgICAgICAgIGJvb2xlYW4gaGFzVGFic09yRW1vamkgPSBnZXRMaW5lQ29udGFpbnNUYWIobGluZSk7CisgICAgICAgIFRhYlN0b3BzIHRhYlN0b3BzID0gbnVsbDsKKyAgICAgICAgaWYgKGhhc1RhYnNPckVtb2ppICYmIG1UZXh0IGluc3RhbmNlb2YgU3Bhbm5lZCkgeworICAgICAgICAgICAgLy8gSnVzdCBjaGVja2luZyB0aGlzIGxpbmUgc2hvdWxkIGJlIGdvb2QgZW5vdWdoLCB0YWJzIHNob3VsZCBiZQorICAgICAgICAgICAgLy8gY29uc2lzdGVudCBhY3Jvc3MgYWxsIGxpbmVzIGluIGEgcGFyYWdyYXBoLgorICAgICAgICAgICAgVGFiU3RvcFNwYW5bXSB0YWJzID0gKChTcGFubmVkKSBtVGV4dCkuZ2V0U3BhbnMoc3RhcnQsIGVuZCwgVGFiU3RvcFNwYW4uY2xhc3MpOworICAgICAgICAgICAgaWYgKHRhYnMubGVuZ3RoID4gMCkgeworICAgICAgICAgICAgICAgIHRhYlN0b3BzID0gbmV3IFRhYlN0b3BzKFRBQl9JTkNSRU1FTlQsIHRhYnMpOyAvLyBYWFggc2hvdWxkIHJldXNlCisgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgRGlyZWN0aW9ucyBkaXJlY3Rpb25zID0gZ2V0TGluZURpcmVjdGlvbnMobGluZSk7CisgICAgICAgIGludCBkaXIgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSk7CiAKLSAgICAgICAgcmV0dXJuIG1lYXN1cmVUZXh0KG1QYWludCwgbVdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UZXh0LCBzdGFydCwgZW5kLCBudWxsLCB0YWIsIHRhYnMpOworICAgICAgICBUZXh0TGluZSB0bCA9IFRleHRMaW5lLm9idGFpbigpOworICAgICAgICB0bC5zZXQobVBhaW50LCBtVGV4dCwgc3RhcnQsIGVuZCwgZGlyLCBkaXJlY3Rpb25zLCBoYXNUYWJzT3JFbW9qaSwgdGFiU3RvcHMpOworICAgICAgICBmbG9hdCB3aWR0aCA9IHRsLm1ldHJpY3MobnVsbCk7CisgICAgICAgIFRleHRMaW5lLnJlY3ljbGUodGwpOworICAgICAgICByZXR1cm4gd2lkdGg7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgc2lnbmVkIGhvcml6b250YWwgZXh0ZW50IG9mIHRoZSBzcGVjaWZpZWQgbGluZSwgZXhjbHVkaW5nCisgICAgICogbGVhZGluZyBtYXJnaW4uICBJZiBmdWxsIGlzIGZhbHNlLCBleGNsdWRlcyB0c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KICAgICB9CiAKICAgICAvKioKQEAgLTczOCw3ICs5MDUsNyBAQAogICAgIH0KIAogICAgIC8qKgotICAgICAqIEdldCB0aGUgY2hhcmFjdGVyIG9mZnNldCBvbiB0aGUgc3BlY2ZpZWQgbGluZSB3aG9zZSBwb3NpdGlvbiBpcworICAgICAqIEdldCB0aGUgY2hhcmFjdGVyIG9mZnNldCBvbiB0aGUgc3BlY2lmaWVkIGxpbmUgd2hvc2UgcG9zaXRpb24gaXMKICAgICAgKiBjbG9zZXN0IHRvIHRoZSBzcGVjaWZpZWQgaG9yaXpvbnRhbCBwb3NpdGlvbi4KICAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldE9mZnNldEZvckhvcml6b250YWwoaW50IGxpbmUsIGZsb2F0IGhvcml6KSB7CkBAIC03NTIsMTQgKzkxOSwxMyBAQAogICAgICAgICBpbnQgYmVzdCA9IG1pbjsKICAgICAgICAgZmxvYXQgYmVzdGRpc3QgPSBNYXRoLmFicyhnZXRQcmltYXJ5SG9yaXpvbnRhbChiZXN0KSAtIGhvcml6KTsKIAotICAgICAgICBpbnQgaGVyZSA9IG1pbjsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBkaXJzLm1EaXJlY3Rpb25zLmxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICBpbnQgdGhlcmUgPSBoZXJlICsgZGlycy5tRGlyZWN0aW9uc1tpXTsKLSAgICAgICAgICAgIGludCBzd2FwID0gKChpICYgMSkgPT0gMCkgPyAxIDogLTE7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZGlycy5tRGlyZWN0aW9ucy5sZW5ndGg7IGkgKz0gMikgeworICAgICAgICAgICAgaW50IGhlcmUgPSBtaW4gKyBkaXJzLm1EaXJlY3Rpb25zW2ldOworICAgICAgICAgICAgaW50IHRoZXJlID0gaGVyZSArIChkaXJzLm1EaXJlY3Rpb25zW2krMV0gJiBSVU5fTEVOR1RIX01BU0spOworICAgICAgICAgICAgaW50IHN3YXAgPSAoZGlycy5tRGlyZWN0aW9uc1tpKzFdICYgUlVOX1JUTF9GTEFHKSAhPSAwID8gLTEgOiAxOwogCiAgICAgICAgICAgICBpZiAodGhlcmUgPiBtYXgpCiAgICAgICAgICAgICAgICAgdGhlcmUgPSBtYXg7Ci0KICAgICAgICAgICAgIGludCBoaWdoID0gdGhlcmUgLSAxICsgMSwgbG93ID0gaGVyZSArIDEgLSAxLCBndWVzczsKIAogICAgICAgICAgICAgd2hpbGUgKGhpZ2ggLSBsb3cgPiAxKSB7CkBAIC03OTIsNyArOTU4LDcgQEAKIAogICAgICAgICAgICAgICAgIGlmIChkaXN0IDwgYmVzdGRpc3QpIHsKICAgICAgICAgICAgICAgICAgICAgYmVzdGRpc3QgPSBkaXN0OwotICAgICAgICAgICAgICAgICAgICBiZXN0ID0gbG93OyAgIAorICAgICAgICAgICAgICAgICAgICBiZXN0ID0gbG93OwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KIApAQCAtODAyLDggKzk2OCw2IEBACiAgICAgICAgICAgICAgICAgYmVzdGRpc3QgPSBkaXN0OwogICAgICAgICAgICAgICAgIGJlc3QgPSBoZXJlOwogICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBoZXJlID0gdGhlcmU7CiAgICAgICAgIH0KIAogICAgICAgICBmbG9hdCBkaXN0ID0gTWF0aC5hYnMoZ2V0UHJpbWFyeUhvcml6b250YWwobWF4KSAtIGhvcml6KTsKQEAgLTgyMywxOSArOTg3LDE1IEBACiAgICAgICAgIHJldHVybiBnZXRMaW5lU3RhcnQobGluZSArIDEpOwogICAgIH0KIAotICAgIC8qKiAKKyAgICAvKioKICAgICAgKiBSZXR1cm4gdGhlIHRleHQgb2Zmc2V0IGFmdGVyIHRoZSBsYXN0IHZpc2libGUgY2hhcmFjdGVyIChzbyB3aGl0ZXNwYWNlCiAgICAgICogaXMgbm90IGNvdW50ZWQpIG9uIHRoZSBzcGVjaWZpZWQgbGluZS4KICAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldExpbmVWaXNpYmxlRW5kKGludCBsaW5lKSB7CiAgICAgICAgIHJldHVybiBnZXRMaW5lVmlzaWJsZUVuZChsaW5lLCBnZXRMaW5lU3RhcnQobGluZSksIGdldExpbmVTdGFydChsaW5lKzEpKTsKICAgICB9Ci0gICAgCi0gICAgcHJpdmF0ZSBpbnQgZ2V0TGluZVZpc2libGVFbmQoaW50IGxpbmUsIGludCBzdGFydCwgaW50IGVuZCkgewotICAgICAgICBpZiAoREVCVUcpIHsKLSAgICAgICAgICAgIEFzc2VydC5hc3NlcnRUcnVlKGdldExpbmVTdGFydChsaW5lKSA9PSBzdGFydCAmJiBnZXRMaW5lU3RhcnQobGluZSsxKSA9PSBlbmQpOwotICAgICAgICB9CiAKKyAgICBwcml2YXRlIGludCBnZXRMaW5lVmlzaWJsZUVuZChpbnQgbGluZSwgaW50IHN0YXJ0LCBpbnQgZW5kKSB7CiAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0ID0gbVRleHQ7CiAgICAgICAgIGNoYXIgY2g7CiAgICAgICAgIGlmIChsaW5lID09IGdldExpbmVDb3VudCgpIC0gMSkgewpAQCAtODgyLDIwNyArMTA0Miw2MiBAQAogICAgICAgICByZXR1cm4gZ2V0TGluZVRvcChsaW5lKSAtIChnZXRMaW5lVG9wKGxpbmUrMSkgLSBnZXRMaW5lRGVzY2VudChsaW5lKSk7CiAgICAgfQogCi0gICAgLyoqCi0gICAgICogUmV0dXJuIHRoZSB0ZXh0IG9mZnNldCB0aGF0IHdvdWxkIGJlIHJlYWNoZWQgYnkgbW92aW5nIGxlZnQKLSAgICAgKiAocG9zc2libHkgb250byBhbm90aGVyIGxpbmUpIGZyb20gdGhlIHNwZWNpZmllZCBvZmZzZXQuCi0gICAgICovCiAgICAgcHVibGljIGludCBnZXRPZmZzZXRUb0xlZnRPZihpbnQgb2Zmc2V0KSB7Ci0gICAgICAgIGludCBsaW5lID0gZ2V0TGluZUZvck9mZnNldChvZmZz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QotICAgICAgICAgICAgaWYgKGggPCBob3JpeiAmJiBoID4gYmVzdGgpIHsKLSAgICAgICAgICAgICAgICBiZXN0ID0gY2FuZGlkYXRlOwotICAgICAgICAgICAgICAgIGJlc3RoID0gaDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGludCBoZXJlID0gc3RhcnQ7Ci0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZGlycy5tRGlyZWN0aW9ucy5sZW5ndGg7IGkrKykgewotICAgICAgICAgICAgaW50IHRoZXJlID0gaGVyZSArIGRpcnMubURpcmVjdGlvbnNbaV07Ci0gICAgICAgICAgICBpZiAodGhlcmUgPiBlbmQpCi0gICAgICAgICAgICAgICAgdGhlcmUgPSBlbmQ7Ci0KLSAgICAgICAgICAgIGZsb2F0IGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChoZXJlKTsKLQotICAgICAgICAgICAgaWYgKGggPCBob3JpeiAmJiBoID4gYmVzdGgpIHsKLSAgICAgICAgICAgICAgICBiZXN0ID0gaGVyZTsKLSAgICAgICAgICAgICAgICBiZXN0aCA9IGg7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhbmRpZGF0ZSA9IFRleHRVdGlscy5nZXRPZmZzZXRBZnRlcihtVGV4dCwgaGVyZSk7Ci0gICAgICAgICAgICBpZiAoY2FuZGlkYXRlID49IHN0YXJ0ICYmIGNhbmRpZGF0ZSA8PSBlbmQpIHsKLSAgICAgICAgICAgICAgICBoID0gZ2V0UHJpbWFyeUhvcml6b250YWwoY2FuZGlkYXRlKTsKLQotICAgICAgICAgICAgICAgIGlmIChoIDwgaG9yaXogJiYgaCA+IGJlc3RoKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJlc3QgPSBjYW5kaWRhdGU7Ci0gICAgICAgICAgICAgICAgICAgIGJlc3RoID0gaDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhbmRpZGF0ZSA9IFRleHRVdGlscy5nZXRPZmZzZXRCZWZvcmUobVRleHQsIHRoZXJlKTsKLSAgICAgICAgICAgIGlmIChjYW5kaWRhdGUgPj0gc3RhcnQgJiYgY2FuZGlkYXRlIDw9IGVuZCkgewotICAgICAgICAgICAgICAgIGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChjYW5kaWRhdGUpOwotCi0gICAgICAgICAgICAgICAgaWYgKGggPCBob3JpeiAmJiBoID4gYmVzdGgpIHsKLSAgICAgICAgICAgICAgICAgICAgYmVzdCA9IGNhbmRpZGF0ZTsKLSAgICAgICAgICAgICAgICAgICAgYmVzdGggPSBoOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaGVyZSA9IHRoZXJlOwotICAgICAgICB9Ci0KLSAgICAgICAgZmxvYXQgaCA9IGdldFByaW1hcnlIb3Jpem9udGFsKGVuZCk7Ci0KLSAgICAgICAgaWYgKGggPCBob3JpeiAmJiBoID4gYmVzdGgpIHsKLSAgICAgICAgICAgIGJlc3QgPSBlbmQ7Ci0gICAgICAgICAgICBiZXN0aCA9IGg7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoYmVzdCAhPSBvZmZzZXQpCi0gICAgICAgICAgICByZXR1cm4gYmVzdDsKLQotICAgICAgICBpbnQgZGlyID0gZ2V0UGFyYWdyYXBoRGlyZWN0aW9uKGxpbmUpOwotCi0gICAgICAgIGlmIChkaXIgPiAwKSB7Ci0gICAgICAgICAgICBpZiAobGluZSA9PSAwKQotICAgICAgICAgICAgICAgIHJldHVybiBiZXN0OwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHJldHVybiBnZXRPZmZzZXRGb3JIb3Jpem9udGFsKGxpbmUgLSAxLCAxMDAwMCk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAobGluZSA9PSBnZXRMaW5lQ291bnQoKSAtIDEpCi0gICAgICAgICAgICAgICAgcmV0dXJuIGJlc3Q7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgcmV0dXJuIGdldE9mZnNldEZvckhvcml6b250YWwobGluZSArIDEsIDEwMDAwKTsKLSAgICAgICAgfQorICAgICAgICByZXR1cm4gZ2V0T2Zmc2V0VG9MZWZ0UmlnaHRPZihvZmZzZXQsIHRydWUpOwogICAgIH0KIAotICAgIC8qKgotICAgICAqIFJldHVybiB0aGUgdGV4dCBvZmZzZXQgdGhhdCB3b3VsZCBiZSByZWFjaGVkIGJ5IG1vdmluZyByaWdodAotICAgICAqIChwb3NzaWJseSBvbnRvIGFub3RoZXIgbGluZSkgZnJvbSB0aGUgc3BlY2lmaWVkIG9mZnNldC4KLSAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldE9mZnNldFRvUmlnaHRPZihpbnQgb2Zmc2V0KSB7Ci0gICAgICAgIGludCBsaW5lID0gZ2V0TGluZUZvck9mZnNldChvZmZzZXQpOwotICAgICAgICBpbnQgc3RhcnQgPSBnZXRMaW5lU3RhcnQobGluZSk7Ci0gICAgICAgIGludCBlbmQgPSBnZXRMaW5lRW5kKGxpbmUpOwotICAgICAgICBEaXJlY3Rpb25zIGRpcnMgPSBnZXRMaW5lRGlyZWN0aW9ucyhsaW5lKTsKKyAgICAgICAgcmV0dXJuIGdldE9mZnNldFRvTGVmdFJpZ2h0T2Yob2Zmc2V0LCBmYWxzZSk7CisgICAgfQogCi0gICAgICAgIGlmIChsaW5lICE9IGdldExpbmVDb3VudCgpIC0gMSkKLSAgICAgICAgICAgIGVuZC0tOworICAgIHByaXZhdGUgaW50IGdldE9mZnNldFRvTGVmdFJpZ2h0T2YoaW50IGNhcmV0LCBib29sZWFuIHRvTGVmdCkgeworICAgICAgICBpbnQgbGluZSA9IGdldExpbmVGb3JPZmZzZXQoY2FyZXQpOworICAgICAgICBpbnQgbGluZVN0YXJ0ID0gZ2V0TGluZVN0YXJ0KGxpbmUpOworICAgICAgICBpbnQgbGluZUVuZCA9IGdldExpbmVFbmQobGluZSk7CisgICAgICAgIGludCBsaW5lRGlyID0gZ2V0UGFyYWdyYXBoRGlyZWN0aW9uKGxpbmUpOwogCi0gICAgICAgIGZsb2F0IGhvcml6ID0gZ2V0UHJpbWFyeUhvcml6b250YWwob2Zmc2V0KTsKLQotICAgICAgICBpbnQgYmVzdCA9IG9mZnNldDsKLSAgICAgICAgZmxvYXQgYmVzdGggPSBJbnRlZ2VyLk1BWF9WQUxVRTsKLSAgICAgICAgaW50IGNhbmRpZGF0ZTsKLQotICAgICAgICBjYW5kaWRhdGUgPSBUZXh0VXRpbHMuZ2V0T2Zmc2V0QmVmb3JlKG1UZXh0LCBvZmZzZXQpOwotICAgICAgICBpZiAoY2FuZGlkYXRlID49IHN0YXJ0ICYmIGNhbmRpZGF0ZSA8PSBlbmQpIHsKLSAgICAgICAgICAgIGZsb2F0IGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChjYW5kaWRhdGUpOwotCi0gICAgICAgICAgICBpZiAoaCA+IGhvcml6ICYmIGggPCBiZXN0aCkgewotICAgICAgICAgICAgICAgIGJlc3QgPSBjYW5kaWRhdGU7Ci0gICAgICAgICAgICAgICAgYmVzdGggPSBoOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgY2FuZGlkYXRlID0gVGV4dFV0aWxzLmdldE9mZnNldEFmdGVyKG1UZXh0LCBvZmZzZXQpOwotICAgICAgICBpZiAoY2FuZGlkYXRlID49IHN0YXJ0ICYmIGNhbmRpZGF0ZSA8PSBlbmQpIHsKLSAgICAgICAgICAgIGZsb2F0IGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChjYW5kaWRhdGUpOwotCi0gICAgICAgICAgICBpZiAoaCA+IGhvcml6ICYmIGggPCBiZXN0aCkgewotICAgICAgICAgICAgICAgIGJlc3QgPSBjYW5kaWRhdGU7Ci0gICAgICAgICAgICAgICAgYmVzdGggPSBoOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaW50IGhlcmUgPSBzdGFydDsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBkaXJzLm1EaXJlY3Rpb25zLmxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICBpbnQgdGhlcmUgPSBoZXJlICsgZGlycy5tRGlyZWN0aW9uc1tpXTsKLSAgICAgICAgICAgIGlmICh0aGVyZSA+IGVuZCkKLSAgICAgICAgICAgICAgICB0aGVyZSA9IGVuZDsKLQotICAgICAgICAgICAgZmxvYXQgaCA9IGdldFByaW1hcnlIb3Jpem9udGFsKGhlcmUpOwotCi0gICAgICAgICAgICBpZiAoaCA+IGhvcml6ICYmIGggPCBiZXN0aCkgewotICAgICAgICAgICAgICAgIGJlc3QgPSBoZXJlOwotICAgICAgICAgICAgICAgIGJlc3RoID0gaDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FuZGlkYXRlID0gVGV4dFV0aWxzLmdldE9mZnNldEFmdGVyKG1UZXh0LCBoZXJlKTsKLSAgICAgICAgICAgIGlmIChjYW5kaWRhdGUgPj0gc3RhcnQgJiYgY2FuZGlkYXRlIDw9IGVuZCkgewotICAgICAgICAgICAgICAgIGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChjYW5kaWRhdGUpOwotCi0gICAgICAgICAgICAgICAgaWYgKGggPiBob3JpeiAmJiBoIDwgYmVzdGgpIHsKLSAgICAgICAgICAgICAgICAgICAgYmVzdCA9IGNhbmRpZGF0ZTsKLSAgICAgICAgICAgICAgICAgICAgYmVzdGggPSBoOworICAgICAgICBib29sZWFuIGFkdmFuY2UgPSB0b0xlZnQgPT0gKGxpbmVEaXIgPT0gRElSX1JJR0hUX1RPX0xFRlQpOworICAgICAgICBpZiAoY2FyZXQgPT0gKGFkdmFuY2UgPyBsaW5lRW5kIDogbGluZVN0YXJ0KSkgeworICAgICAgICAgICAgLy8gd2Fsa2luZyBvZmYgbGluZSwgc28gbG9vayBhdCB0aGUgbGluZSB3ZSdyZSBoZWFkZWQgdG8KKyAgICAgICAgICAgIGlmIChjYXJldCA9PSBsaW5lU3RhcnQpIHsKKyAgICAgICAgICAgICAgICBpZiAobGluZSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgLS1saW5lOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYXJldDsgLy8gYXQgdmVyeSBzdGFydCwgZG9uJ3QgbW92ZQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKGxpbmUgPCBnZXRMaW5lQ291bnQoKSAtIDEpIHsKKyAgICAgICAgICAgICAgICAgICAgKytsaW5lOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYXJldDsgLy8gYXQgdmVyeSBlbmQsIGRvbid0IG1vdmUKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGNhbmRpZGF0ZSA9IFRleHRVdGlscy5nZXRPZmZzZXRCZWZvcmUobVRleHQsIHRoZXJlKTsKLSAgICAgICAgICAgIGlmIChjYW5kaWRhdGUgPj0gc3RhcnQgJiYgY2FuZGlkYXRlIDw9IGVuZCkgewotICAgICAgICAgICAgICAgIGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChjYW5kaWRhdGUpOwotCi0gICAgICAgICAgICAgICAgaWYgKGggPiBob3JpeiAmJiBoIDwgYmVzdGgpIHsKLSAgICAgICAgICAgICAgICAgICAgYmVzdCA9IGNhbmRpZGF0ZTsKLSAgICAgICAgICAgICAgICAgICAgYmVzdGggPSBoOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGxpbmVTdGFydCA9IGdldExpbmVTdGFydChsaW5lKTsKKyAgICAgICAgICAgIGxpbmVFbmQgPSBnZXRMaW5lRW5kKGxpbmUpOworICAgICAgICAgICAgaW50IG5ld0RpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKKyAgICAgICAgICAgIGlmIChuZXdEaXIgIT0gbGluZURpcikgeworICAgICAgICAgICAgICAgIC8vIHVudXN1YWwgY2FzZS4gIHdlIHdhbnQgdG8gd2FsayBvbnRvIHRoZSBsaW5lLCBidXQgaXQgcnVucworICAgICAgICAgICAgICAgIC8vIGluIGEgZGlmZmVyZW50IGRpcmVjdGlvbiB0aGFuIHRoaXMgb25lLCBzbyB3ZSBmYWtlIG1vdmVtZW50CisgICAgICAgICAgICAgICAgLy8gaW4gdGhlIG9wcG9zaXRlIGRpcmVjdGlvbi4KKyAgICAgICAgICAgICAgICB0b0xlZnQgPSAhdG9MZWZ0OworICAgICAgICAgICAgICAgIGxpbmVEaXIgPSBuZXdEaXI7CiAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGhlcmUgPSB0aGVyZTsKICAgICAgICAgfQogCi0gICAgICAgIGZsb2F0IGggPSBnZXRQcmltYXJ5SG9yaXpvbnRhbChlbmQpOworICAgICAgICBEaXJlY3Rpb25zIGRpcmVjdGlvbnMgPSBnZXRMaW5lRGlyZWN0aW9ucyhsaW5lKTsKIAotICAgICAgICBpZiAoaCA+IGhvcml6ICYmIGggPCBiZXN0aCkgewotICAgICAgICAgICAgYmVzdCA9IGVuZDsKLSAgICAgICAgICAgIGJlc3RoID0gaDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChiZXN0ICE9IG9mZnNldCkKLSAgICAgICAgICAgIHJldHVybiBiZXN0OwotCi0gICAgICAgIGludCBkaXIgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSk7Ci0KLSAgICAgICAgaWYgKGRpciA+IDApIHsKLSAgICAgICAgICAgIGlmIChsaW5lID09IGdldExpbmVDb3VudCgpIC0gMSkKLSAgICAgICAgICAgICAgICByZXR1cm4gYmVzdDsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICByZXR1cm4gZ2V0T2Zmc2V0Rm9ySG9yaXpvbnRhbChsaW5lICsgMSwgLTEwMDAwKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGlmIChsaW5lID09IDApCi0gICAgICAgICAgICAgICAgcmV0dXJuIGJlc3Q7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgcmV0dXJuIGdldE9mZnNldEZvckhvcml6b250YWwobGluZSAtIDEsIC0xMDAwMCk7Ci0gICAgICAgIH0KKyAgICAgICAgVGV4dExpbmUgdGwgPSBUZXh0TGluZS5vYnRhaW4oKTsKKyAgICAgICAgLy8gWFhYOiB3ZSBkb24ndCBjYXJlIGFib3V0IHRhYnMKKyAgICAgICAgdGwuc2V0KG1QYWludCwgbVRleHQsIGxpbmVTdGFydCwgbGluZUVuZCwgbGluZURpciwgZGlyZWN0aW9ucywgZmFsc2UsIG51bGwpOworICAgICAgICBjYXJldCA9IGxpbmVTdGFydCArIHRsLmdldE9mZnNldFRvTGVmdFJpZ2h0T2YoY2FyZXQgLSBsaW5lU3RhcnQsIHRvTGVmdCk7CisgICAgICAgIHRsID0gVGV4dExpbmUucmVjeWNsZSh0bCk7CisgICAgICAgIHJldHVybiBjYXJldDsKICAgICB9CiAKICAgICBwcml2YXRlIGludCBnZXRPZmZzZXRBdFN0YXJ0T2YoaW50IG9mZnNldCkgeworICAgICAgICAvLyBYWFggdGhpcyBwcm9iYWJseSBzaG91bGQgc2tpcCBsb2NhbCByZW9yZGVyaW5ncyBhbmQKKyAgICAgICAgLy8gemVyby13aWR0aCBjaGFyYWN0ZXJzLCBsb29rIGF0IGNhbGxlcnMKICAgICAgICAgaWYgKG9mZnNldCA9PSAwKQogICAgICAgICAgICAgcmV0dXJuIDA7CiAKQEAgLTExMTUsNyArMTEzMCw3IEBACiAgICAgLyoqCiAgICAgICogRmlsbHMgaW4gdGhlIHNwZWNpZmllZCBQYXRoIHdpdGggYSByZXByZXNlbnRhdGlvbiBvZiBhIGN1cnNvcgogICAgICAqIGF0IHRoZSBzcGVjaWZpZWQgb2Zmc2V0LiAgVGhpcyB3aWxsIG9mdGVuIGJlIGEgdmVydGljYWwgbGluZQotICAgICAqIGJ1dCBjYW4gYmUgbXVsdGlwbGUgZGlzY29udGlub3VzIGxpbmVzIGluIHRleHQgd2l0aCBtdWx0aXBsZQorICAgICAqIGJ1dCBjYW4gYmUgbXVsdGlwbGUgZGlzY29udGludW91cyBsaW5lcyBpbiB0ZXh0IHdpdGggbXVsdGlwbGUKICAgICAgKiBkaXJlY3Rpb25hbGl0aWVzLgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIGdldEN1cnNvclBhdGgoaW50IHBvaW50LCBQYXRoIGRlc3QsCkBAIC0xMTI3LDcgKzExNDIsOCBAQAogICAgICAgICBpbnQgYm90dG9tID0gZ2V0TGluZVRvcChsaW5lKzEpOwogCiAgICAgICAgIGZsb2F0IGgxID0gZ2V0UHJpbWFyeUhvcml6b250YWwocG9pbnQpIC0gMC41ZjsKLSAgICAgICAgZmxvYXQgaDIgPSBnZXRTZWNvbmRhcnlIb3Jpem9udGFsKHBvaW50KSAtIDAuNWY7CisgICAgICAgIGZsb2F0IGgyID0gaXNMZXZlbEJvdW5kYXJ5KHBvaW50KSA/CisgICAgICAgICAgICAgICAgICAgIGdldFNlY29uZGFyeUhvcml6b250YWwocG9pbnQpIC0gMC41ZiA6IGgxOwogCiAgICAgICAgIGludCBjYXBzID0gVGV4dEtleUxpc3RlbmVyLmdldE1ldGFTdGF0ZShlZGl0aW5nQnVmZmVyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgS2V5RXZlbnQuTUVUQV9TSElGVF9PTikgfApAQCAtMTIwNCw5ICsxMjIwLDEwIEBACiAgICAgICAgIGlmIChsaW5lZW5kID4gbGluZXN0YXJ0ICYmIG1UZXh0LmNoYXJBdChsaW5lZW5kIC0gMSkgPT0gJ1xuJykKICAgICAgICAgICAgIGxpbmVlbmQtLTsKIAotICAgICAgICBpbnQgaGVyZSA9IGxpbmVzdGFydDsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBkaXJzLm1EaXJlY3Rpb25zLmxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICBpbnQgdGhlcmUgPSBoZXJlICsgZGlycy5tRGlyZWN0aW9uc1tpXTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBkaXJzLm1EaXJlY3Rpb25zLmxlbmd0aDsgaSArPSAyKSB7CisgICAgICAgICAgICBpbnQgaGVyZSA9IGxpbmVzdGFydCArIGRpcnMubURpcmVjdGlvbnNbaV07CisgICAgICAgICAgICBpbnQgdGhlcmUgPSBoZXJlICsgKGRpcnMubURpcmVjdGlvbnNbaSsxXSAmIFJVTl9MRU5HVEhfTUFTSyk7CisKICAgICAgICAgICAgIGlmICh0aGVyZSA+IGxpbmVlbmQpCiAgICAgICAgICAgICAgICAgdGhlcmUgPSBsaW5lZW5kOwogCkBAIC0xMjE1LDE0ICsxMjMyLDEyIEBACiAgICAgICAgICAgICAgICAgaW50IGVuID0gTWF0aC5taW4oZW5kLCB0aGVyZSk7CiAKICAgICAgICAgICAgICAgICBpZiAoc3QgIT0gZW4pIHsKLSAgICAgICAgICAgICAgICAgICAgZmxvYXQgaDEgPSBnZXRIb3Jpem9udGFsKHN0LCBmYWxzZSwgZmFsc2UsIGxpbmUpOwotICAgICAgICAgICAgICAgICAgICBmbG9hdCBoMiA9IGdldEhvcml6b250YWwoZW4sIHRydWUsIGZhbHNlLCBsaW5lKTsKKyAgICAgICAgICAgICAgICAgICAgZmxvYXQgaDEgPSBnZXRIb3Jpem9udGFsKHN0LCBmYWxzZSwgbGluZSk7CisgICAgICAgICAgICAgICAgICAgIGZsb2F0IGgyID0gZ2V0SG9yaXpvbnRhbChlbiwgdHJ1ZSwgbGluZSk7CiAKICAgICAgICAgICAgICAgICAgICAgZGVzdC5hZGRSZWN0KGgxLCB0b3AsIGgyLCBib3R0b20sIFBhdGguRGlyZWN0aW9uLkNXKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGhlcmUgPSB0aGVyZTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMTI1Nyw3ICsxMjcyLDcgQEAKIAogICAgICAgICAgICAgYWRkU2VsZWN0aW9uKHN0YXJ0bGluZSwgc3RhcnQsIGdldExpbmVFbmQoc3RhcnRsaW5lKSwKICAgICAgICAgICAgICAgICAgICAgICAgICB0b3AsIGdldExpbmVCb3R0b20oc3RhcnRsaW5lKSwgZGVzdCk7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKGdldFBhcmFncmFwaERpcmVjdGlvbihzdGFydGxpbmUpID09IERJUl9SSUdIVF9UT19MRUZUKQogICAgICAgICAgICAgICAgIGRlc3QuYWRkUmVjdChnZXRMaW5lTGVmdChzdGFydGxpbmUpLCB0b3AsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCBnZXRMaW5lQm90dG9tKHN0YXJ0bGluZSksIFBhdGguRGlyZWN0aW9uLkNXKTsKQEAgLTEzMTAsNDIyICsxMzI1LDE3MyBAQAogICAgICAqIEdldCB0aGUgbGVmdCBlZGdlIG9mIHRoZSBzcGVjaWZpZWQgcGFyYWdyYXBoLCBpbnNldCBieSBsZWZ0IG1hcmdpbnMuCiAgICAgICovCiAgICAgcHVibGljIGZpbmFsIGludCBnZXRQYXJhZ3JhcGhMZWZ0KGludCBsaW5lKSB7Ci0gICAgICAgIGludCBkaXIgPSBnZXRQYXJhZ3JhcGhEaXJlY3Rpb24obGluZSk7Ci0KICAgICAgICAgaW50IGxlZnQgPSAwOwotCi0gICAgICAgIGJvb2xlYW4gcGFyID0gZmFsc2U7Ci0gICAgICAgIGludCBvZmYgPSBnZXRMaW5lU3RhcnQobGluZSk7Ci0gICAgICAgIGlmIChvZmYgPT0gMCB8fCBtVGV4dC5jaGFyQXQob2ZmIC0gMSkgPT0gJ1xuJykKLSAgICAgICAgICAgIHBhciA9IHRydWU7Ci0KLSAgICAgICAgaWYgKGRpciA9PSBESVJfTEVGVF9UT19SSUdIVCkgewotICAgICAgICAgICAgaWYgKG1TcGFubmVkVGV4dCkgewotICAgICAgICAgICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgbVRleHQ7Ci0gICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW5bXSBzcGFucyA9IHNwLmdldFNwYW5zKGdldExpbmVTdGFydChsaW5lKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0TGluZUVuZChsaW5lKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW4uY2xhc3MpOwotCi0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzcGFucy5sZW5ndGg7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBib29sZWFuIG1hcmdpbiA9IHBhcjsKLSAgICAgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW4gc3BhbiA9IHNwYW5zW2ldOwotICAgICAgICAgICAgICAgICAgICBpZiAoc3BhbiBpbnN0YW5jZW9mIExlYWRpbmdNYXJnaW5TcGFuLkxlYWRpbmdNYXJnaW5TcGFuMikgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50ID0gKChMZWFkaW5nTWFyZ2luU3Bhbi5MZWFkaW5nTWFyZ2luU3BhbjIpc3BhbikuZ2V0TGVhZGluZ01hcmdpbkxpbmVDb3VudCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luID0gY291bnQgPj0gbGluZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBsZWZ0ICs9IHNwYW4uZ2V0TGVhZGluZ01hcmdpbihtYXJnaW4pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KKyAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKKyAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCB8fCAhbVNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICByZXR1cm4gbGVmdDsgLy8gbGVhZGluZyBtYXJnaW4gaGFzIG5vIGltcGFjdCwgb3Igbm8gc3R5bGVzCiAgICAgICAgIH0KLQotICAgICAgICByZXR1cm4gbGVmdDsKKyAgICAgICAgcmV0dXJuIGdldFBhcmFncmFwaExlYWRpbmdNYXJnaW4obGluZSk7CiAgICAgfQogCiAgICAgLyoqCiAgICAgICogR2V0IHRoZSByaWdodCBlZGdlIG9mIHRoZSBzcGVjaWZpZWQgcGFyYWdyYXBoLCBpbnNldCBieSByaWdodCBtYXJnaW5zLgogICAgICAqLwogICAgIHB1YmxpYyBmaW5hbCBpbnQgZ2V0UGFyYWdyYXBoUmlnaHQoaW50IGxpbmUpIHsKLSAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKLQogICAgICAgICBpbnQgcmlnaHQgPSBtV2lkdGg7Ci0KLSAgICAgICAgYm9vbGVhbiBwYXIgPSBmYWxzZTsKLSAgICAgICAgaW50IG9mZiA9IGdldExpbmVTdGFydChsaW5lKTsKLSAgICAgICAgaWYgKG9mZiA9PSAwIHx8IG1UZXh0LmNoYXJBdChvZmYgLSAxKSA9PSAnXG4nKQotICAgICAgICAgICAgcGFyID0gdHJ1ZTsKLQotCi0gICAgICAgIGlmIChkaXIgPT0gRElSX1JJR0hUX1RPX0xFRlQpIHsKLSAgICAgICAgICAgIGlmIChtU3Bhbm5lZFRleHQpIHsKLSAgICAgICAgICAgICAgICBTcGFubmVkIHNwID0gKFNwYW5uZWQpIG1UZXh0OwotICAgICAgICAgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuW10gc3BhbnMgPSBzcC5nZXRTcGFucyhnZXRMaW5lU3RhcnQobGluZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldExpbmVFbmQobGluZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuLmNsYXNzKTsKLQotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc3BhbnMubGVuZ3RoOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgcmlnaHQgLT0gc3BhbnNbaV0uZ2V0TGVhZGluZ01hcmdpbihwYXIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KKyAgICAgICAgaW50IGRpciA9IGdldFBhcmFncmFwaERpcmVjdGlvbihsaW5lKTsKKyAgICAgICAgaWYgKGRpciA9PSBESVJfTEVGVF9UT19SSUdIVCB8fCAhbVNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICByZXR1cm4gcmlnaHQ7IC8vIGxlYWRpbmcgbWFyZ2luIGhhcyBubyBpbXBhY3QsIG9yIG5vIHN0eWxlcwogICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHJpZ2h0OwotICAgIH0KLQotICAgIHByaXZhdGUgdm9pZCBkcmF3VGV4dChDYW52YXMgY2FudmFzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkaXIsIERpcmVjdGlvbnMgZGlyZWN0aW9ucywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgsIGludCB0b3AsIGludCB5LCBpbnQgYm90dG9tLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHBhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaGFzVGFicywgT2JqZWN0W10gcGFyc3BhbnMpIHsKLSAgICAgICAgY2hhcltdIGJ1ZjsKLSAgICAgICAgaWYgKCFoYXNUYWJzKSB7Ci0gICAgICAgICAgICBpZiAoZGlyZWN0aW9ucyA9PSBESVJTX0FMTF9MRUZUX1RPX1JJR0hUKSB7Ci0gICAgICAgICAgICAgICAgaWYgKERFQlVHKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFzc2VydC5hc3NlcnRUcnVlKERJUl9MRUZUX1RPX1JJR0hUID09IGRpcik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFN0eWxlZC5kcmF3VGV4dChjYW52YXMsIHRleHQsIHN0YXJ0LCBlbmQsIGRpciwgZmFsc2UsIHgsIHRvcCwgeSwgYm90dG9tLCBwYWludCwgd29ya1BhaW50LCBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnVmID0gbnVsbDsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGJ1ZiA9IFRleHRVdGlscy5vYnRhaW4oZW5kIC0gc3RhcnQpOwotICAgICAgICAgICAgVGV4dFV0aWxzLmdldENoYXJzKHRleHQsIHN0YXJ0LCBlbmQsIGJ1ZiwgMCk7Ci0gICAgICAgIH0KLQotICAgICAgICBmbG9hdCBoID0gMDsKLQotICAgICAgICBpbnQgaGVyZSA9IDA7Ci0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZGlyZWN0aW9ucy5tRGlyZWN0aW9ucy5sZW5ndGg7IGkrKykgewotICAgICAgICAgICAgaW50IHRoZXJlID0gaGVyZSArIGRpcmVjdGlvbnMubURpcmVjdGlvbnNbaV07Ci0gICAgICAgICAgICBpZiAodGhlcmUgPiBlbmQgLSBzdGFydCkKLSAgICAgICAgICAgICAgICB0aGVyZSA9IGVuZCAtIHN0YXJ0OwotCi0gICAgICAgICAgICBpbnQgc2Vnc3RhcnQgPSBoZXJlOwotICAgICAgICAgICAgZm9yIChpbnQgaiA9IGhhc1RhYnMgPyBoZXJlIDogdGhlcmU7IGogPD0gdGhlcmU7IGorKykgewotICAgICAgICAgICAgICAgIGlmIChqID09IHRoZXJlIHx8IGJ1ZltqXSA9PSAnXHQnKSB7Ci0gICAgICAgICAgICAgICAgICAgIGggKz0gU3R5bGVkLmRyYXdUZXh0KGNhbnZhcywgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBzZWdzdGFydCwgc3RhcnQgKyBqLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXIsIChpICYgMSkgIT0gMCwgeCArIGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcCwgeSwgYm90dG9tLCBwYWludCwgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCArIGogIT0gZW5kKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoaiAhPSB0aGVyZSAmJiBidWZbal0gPT0gJ1x0JykKLSAgICAgICAgICAgICAgICAgICAgICAgIGggPSBkaXIgKiBuZXh0VGFiKHRleHQsIHN0YXJ0LCBlbmQsIGggKiBkaXIsIHBhcnNwYW5zKTsKLQotICAgICAgICAgICAgICAgICAgICBzZWdzdGFydCA9IGogKyAxOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaGFzVGFicyAmJiBidWZbal0gPj0gMHhEODAwICYmIGJ1ZltqXSA8PSAweERGRkYgJiYgaiArIDEgPCB0aGVyZSkgewotICAgICAgICAgICAgICAgICAgICBpbnQgZW1vamkgPSBDaGFyYWN0ZXIuY29kZVBvaW50QXQoYnVmLCBqKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoZW1vamkgPj0gTUlOX0VNT0pJICYmIGVtb2ppIDw9IE1BWF9FTU9KSSkgewotICAgICAgICAgICAgICAgICAgICAgICAgQml0bWFwIGJtID0gRU1PSklfRkFDVE9SWS4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRCaXRtYXBGcm9tQW5kcm9pZFB1YShlbW9qaSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChibSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCArPSBTdHlsZWQuZHJhd1RleHQoY2FudmFzLCB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0ICsgc2Vnc3RhcnQsIHN0YXJ0ICsgaiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXIsIChpICYgMSkgIT0gMCwgeCArIGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wLCB5LCBib3R0b20sIHBhaW50LCB3b3JrUGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBqICE9IGVuZCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUVtb2ppUmVjdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1FbW9qaVJlY3QgPSBuZXcgUmVjdEYoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3b3JrUGFpbnQuc2V0KHBhaW50KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHlsZWQubWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBqLCBzdGFydCArIGogKyAxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBiaXRtYXBIZWlnaHQgPSBibS5nZXRIZWlnaHQoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB0ZXh0SGVpZ2h0ID0gLXdvcmtQYWludC5hc2NlbnQoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBzY2FsZSA9IHRleHRIZWlnaHQgLyBiaXRtYXBIZWlnaHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgd2lkdGggPSBibS5nZXRXaWR0aCgpICogc2NhbGU7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRW1vamlSZWN0LnNldCh4ICsgaCwgeSAtIHRleHRIZWlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCArIGggKyB3aWR0aCwgeSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMuZHJhd0JpdG1hcChibSwgbnVsbCwgbUVtb2ppUmVjdCwgcGFpbnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggKz0gd2lkdGg7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBqKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vnc3RhcnQgPSBqICsgMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaGVyZSA9IHRoZXJlOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGhhc1RhYnMpCi0gICAgICAgICAgICBUZXh0VXRpbHMucmVjeWNsZShidWYpOwotICAgIH0KLQotICAgIHByaXZhdGUgc3RhdGljIGZsb2F0IG1lYXN1cmVUZXh0KFRleHRQYWludCBwYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCwgaW50IG9mZnNldCwgaW50IGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGlyLCBEaXJlY3Rpb25zIGRpcmVjdGlvbnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiB0cmFpbGluZywgYm9vbGVhbiBhbHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBoYXNUYWJzLCBPYmplY3RbXSB0YWJzKSB7Ci0gICAgICAgIGNoYXJbXSBidWYgPSBudWxsOwotCi0gICAgICAgIGlmIChoYXNUYWJzKSB7Ci0gICAgICAgICAgICBidWYgPSBUZXh0VXRpbHMub2J0YWluKGVuZCAtIHN0YXJ0KTsKLSAgICAgICAgICAgIFRleHRVdGlscy5nZXRDaGFycyh0ZXh0LCBzdGFydCwgZW5kLCBidWYsIDApOwotICAgICAgICB9Ci0KLSAgICAgICAgZmxvYXQgaCA9IDA7Ci0KLSAgICAgICAgaWYgKGFsdCkgewotICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICB0cmFpbGluZyA9ICF0cmFpbGluZzsKLSAgICAgICAgfQotCi0gICAgICAgIGludCBoZXJlID0gMDsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBkaXJlY3Rpb25zLm1EaXJlY3Rpb25zLmxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICBpZiAoYWx0KQotICAgICAgICAgICAgICAgIHRyYWlsaW5nID0gIXRyYWlsaW5nOwotCi0gICAgICAgICAgICBpbnQgdGhlcmUgPSBoZXJlICsgZGlyZWN0aW9ucy5tRGlyZWN0aW9uc1tpXTsKLSAgICAgICAgICAgIGlmICh0aGVyZSA+IGVuZCAtIHN0YXJ0KQotICAgICAgICAgICAgICAgIHRoZXJlID0gZW5kIC0gc3RhcnQ7Ci0KLSAgICAgICAgICAgIGludCBzZWdzdGFydCA9IGhlcmU7Ci0gICAgICAgICAgICBmb3IgKGludCBqID0gaGFzVGFicyA/IGhlcmUgOiB0aGVyZTsgaiA8PSB0aGVyZTsgaisrKSB7Ci0gICAgICAgICAgICAgICAgaW50IGNvZGVwdCA9IDA7Ci0gICAgICAgICAgICAgICAgQml0bWFwIGJtID0gbnVsbDsKLQotICAgICAgICAgICAgICAgIGlmIChoYXNUYWJzICYmIGogPCB0aGVyZSkgewotICAgICAgICAgICAgICAgICAgICBjb2RlcHQgPSBidWZbal07Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGNvZGVwdCA+PSAweEQ4MDAgJiYgY29kZXB0IDw9IDB4REZGRiAmJiBqICsgMSA8IHRoZXJlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvZGVwdCA9IENoYXJhY3Rlci5jb2RlUG9pbnRBdChidWYsIGopOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlcHQgPj0gTUlOX0VNT0pJICYmIGNvZGVwdCA8PSBNQVhfRU1PSkkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJtID0gRU1PSklfRkFDVE9SWS5nZXRCaXRtYXBGcm9tQW5kcm9pZFB1YShjb2RlcHQpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGogPT0gdGhlcmUgfHwgY29kZXB0ID09ICdcdCcgfHwgYm0gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBmbG9hdCBzZWd3OwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChvZmZzZXQgPCBzdGFydCArIGogfHwKLSAgICAgICAgICAgICAgICAgICAgICAgKHRyYWlsaW5nICYmIG9mZnNldCA8PSBzdGFydCArIGopKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9MRUZUX1RPX1JJR0hUICYmIChpICYgMSkgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggKz0gU3R5bGVkLm1lYXN1cmVUZXh0KHBhaW50LCB3b3JrUGFpbnQsIHRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBzZWdzdGFydCwgb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBoOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlyID09IERJUl9SSUdIVF9UT19MRUZUICYmIChpICYgMSkgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggLT0gU3R5bGVkLm1lYXN1cmVUZXh0KHBhaW50LCB3b3JrUGFpbnQsIHRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBzZWdzdGFydCwgb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBoOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgc2VndyA9IFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgd29ya1BhaW50LCB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0ICsgc2Vnc3RhcnQsIHN0YXJ0ICsgaiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAob2Zmc2V0IDwgc3RhcnQgKyBqIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAodHJhaWxpbmcgJiYgb2Zmc2V0IDw9IHN0YXJ0ICsgaikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaXIgPT0gRElSX0xFRlRfVE9fUklHSFQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBoICs9IHNlZ3cgLSBTdHlsZWQubWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBzZWdzdGFydCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0LCBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGggLT0gc2VndyAtIFN0eWxlZC5tZWFzdXJlVGV4dChwYWludCwgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCArIHNlZ3N0YXJ0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQsIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBoOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICAgICAgICAgIGggLT0gc2VndzsKLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgaCArPSBzZWd3OwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChqICE9IHRoZXJlICYmIGJ1ZltqXSA9PSAnXHQnKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAob2Zmc2V0ID09IHN0YXJ0ICsgaikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaCA9IGRpciAqIG5leHRUYWIodGV4dCwgc3RhcnQsIGVuZCwgaCAqIGRpciwgdGFicyk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoYm0gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgd29ya1BhaW50LnNldChwYWludCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBTdHlsZWQubWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqLCBqICsgMiwgbnVsbCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHdpZCA9IChmbG9hdCkgYm0uZ2V0V2lkdGgoKSAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtd29ya1BhaW50LmFzY2VudCgpIC8gYm0uZ2V0SGVpZ2h0KCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaXIgPT0gRElSX1JJR0hUX1RPX0xFRlQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBoIC09IHdpZDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaCArPSB3aWQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGorKzsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHNlZ3N0YXJ0ID0gaiArIDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBoZXJlID0gdGhlcmU7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoaGFzVGFicykKLSAgICAgICAgICAgIFRleHRVdGlscy5yZWN5Y2xlKGJ1Zik7Ci0KLSAgICAgICAgcmV0dXJuIGg7CisgICAgICAgIHJldHVybiByaWdodCAtIGdldFBhcmFncmFwaExlYWRpbmdNYXJnaW4obGluZSk7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogTWVhc3VyZSB3aWR0aCBvZiBhIHJ1biBvZiB0ZXh0IG9uIGEgc2luZ2xlIGxpbmUgdGhhdCBpcyBrbm93biB0byBhbGwgYmUKLSAgICAgKiBpbiB0aGUgc2FtZSBkaXJlY3Rpb24gYXMgdGhlIHBhcmFncmFwaCBiYXNlIGRpcmVjdGlvbi4gUmV0dXJucyB0aGUgd2lkdGgsCi0gICAgICogYW5kIHRoZSBsaW5lIG1ldHJpY3MgaW4gZm0gaWYgZm0gaXMgbm90IG51bGwuCi0gICAgICoKLSAgICAgKiBAcGFyYW0gcGFpbnQgdGhlIHBhaW50IGZvciB0aGUgdGV4dDsgd2lsbCBub3QgYmUgbW9kaWZpZWQKLSAgICAgKiBAcGFyYW0gd29ya1BhaW50IHBhaW50IGF2YWlsYWJsZSBmb3IgbW9kaWZpY2F0aW9uCi0gICAgICogQHBhcmFtIHRleHQgdGV4dAotICAgICAqIEBwYXJhbSBzdGFydCBzdGFydCBvZiB0aGUgbGluZQotICAgICAqIEBwYXJhbSBlbmQgbGltaXQgb2YgdGhlIGxpbmUKLSAgICAgKiBAcGFyYW0gZm0gb2JqZWN0IHRvIHJldHVybiBpbnRlZ2VyIG1ldHJpY3MgaW4sIGNhbiBiZSBudWxsCi0gICAgICogQHBhcmFtIGhhc1RhYnMgdHJ1ZSBpZiBpdCBpcyBrbm93biB0aGF0IHRoZSBsaW5lIGhhcyB0YWJzCi0gICAgICogQHBhcmFtIHRhYnMgdGFiIHBvc2l0aW9uIGluZm9ybWF0aW9uCi0gICAgICogQHJldHVybiB0aGUgd2lkdGggb2YgdGhlIHRleHQgZnJvbSBzdGFydCB0byBlbmQKKyAgICAgKiBSZXR1cm5zIHRoZSBlZmZlY3RpdmUgbGVhZGluZyBtYXJnaW4gKHVuc2lnbmVkKSBmb3IgdGhpcyBsaW5lLAorICAgICAqIHRha2luZyBpbnRvIGFjY291bnQgTGVhZGluZ01hcmdpblNwYW4gYW5kIExlYWRpbmdNYXJnaW5TcGFuMi4KKyAgICAgKiBAcGFyYW0gbGluZSB0aGUgbGluZSBpbmRleAorICAgICAqIEByZXR1cm4gdGhlIGxlYWRpbmcgbWFyZ2luIG9mIHRoaXMgbGluZQogICAgICAqLwotICAgIC8qIHBhY2thZ2UgKi8gc3RhdGljIGZsb2F0IG1lYXN1cmVUZXh0KFRleHRQYWludCBwYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGFydCwgaW50IGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYWludC5Gb250TWV0cmljc0ludCBmbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIGhhc1RhYnMsIE9iamVjdFtdIHRhYnMpIHsKLSAgICAgICAgY2hhcltdIGJ1ZiA9IG51bGw7Ci0gIAotICAgICAgICBpZiAoaGFzVGFicykgewotICAgICAgICAgICAgYnVmID0gVGV4dFV0aWxzLm9idGFpbihlbmQgLSBzdGFydCk7Ci0gICAgICAgICAgICBUZXh0VXRpbHMuZ2V0Q2hhcnModGV4dCwgc3RhcnQsIGVuZCwgYnVmLCAwKTsKKyAgICBwcml2YXRlIGludCBnZXRQYXJhZ3JhcGhMZWFkaW5nTWFyZ2luKGludCBsaW5lKSB7CisgICAgICAgIGlmICghbVNwYW5uZWRUZXh0KSB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgICAgICBTcGFubmVkIHNwYW5uZWQgPSAoU3Bhbm5lZCkgbVRleHQ7CisKKyAgICAgICAgaW50IGxpbmVTdGFydCA9IGdldExpbmVTdGFydChsaW5lKTsKKyAgICAgICAgaW50IGxpbmVFbmQgPSBnZXRMaW5lRW5kKGxpbmUpOworICAgICAgICBpbnQgc3BhbkVuZCA9IHNwYW5uZWQubmV4dFNwYW5UcmFuc2l0aW9uKGxpbmVTdGFydCwgbGluZUVuZCwKKyAgICAgICAgICAgICAgICBMZWFkaW5nTWFyZ2luU3Bhbi5jbGFzcyk7CisgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuW10gc3BhbnMgPSBzcGFubmVkLmdldFNwYW5zKGxpbmVTdGFydCwgc3BhbkVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExlYWRpbmdNYXJnaW5TcGFuLmNsYXNzKTsKKyAgICAgICAgaWYgKHNwYW5zLmxlbmd0aCA9PSAwKSB7CisgICAgICAgICAgICByZXR1cm4gMDsgLy8gbm8gbGVhZGluZyBtYXJnaW4gc3BhbjsKICAgICAgICAgfQogCi0gICAgICAgIGludCBsZW4gPSBlbmQgLSBzdGFydDsKKyAgICAgICAgaW50IG1hcmdpbiA9IDA7CiAKLSAgICAgICAgaW50IGxhc3RQb3MgPSAwOwotICAgICAgICBmbG9hdCB3aWR0aCA9IDA7Ci0gICAgICAgIGludCBhc2NlbnQgPSAwLCBkZXNjZW50ID0gMCwgdG9wID0gMCwgYm90dG9tID0gMDsKKyAgICAgICAgYm9vbGVhbiBpc0ZpcnN0UGFyYUxpbmUgPSBsaW5lU3RhcnQgPT0gMCB8fAorICAgICAgICAgICAgc3Bhbm5lZC5jaGFyQXQobGluZVN0YXJ0IC0gMSkgPT0gJ1xuJzsKIAotICAgICAgICBpZiAoZm0gIT0gbnVsbCkgewotICAgICAgICAgICAgZm0uYXNjZW50ID0gMDsKLSAgICAgICAgICAgIGZtLmRlc2NlbnQgPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpbnQgcG9zID0gaGFzVGFicyA/IDAgOiBsZW47IHBvcyA8PSBsZW47IHBvcysrKSB7Ci0gICAgICAgICAgICBpbnQgY29kZXB0ID0gMDsKLSAgICAgICAgICAgIEJpdG1hcCBibSA9IG51bGw7Ci0KLSAgICAgICAgICAgIGlmIChoYXNUYWJzICYmIHBvcyA8IGxlbikgewotICAgICAgICAgICAgICAgIGNvZGVwdCA9IGJ1Zltwb3NdOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNwYW5zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBMZWFkaW5nTWFyZ2luU3BhbiBzcGFuID0gc3BhbnNbaV07CisgICAgICAgICAgICBib29sZWFuIHVzZUZpcnN0TGluZU1hcmdpbiA9IGlzRmlyc3RQYXJhTGluZTsKKyAgICAgICAgICAgIGlmIChzcGFuIGluc3RhbmNlb2YgTGVhZGluZ01hcmdpblNwYW4yKSB7CisgICAgICAgICAgICAgICAgaW50IHNwU3RhcnQgPSBzcGFubmVkLmdldFNwYW5TdGFydChzcGFuKTsKKyAgICAgICAgICAgICAgICBpbnQgc3BhbkxpbmUgPSBnZXRMaW5lRm9yT2Zmc2V0KHNwU3RhcnQpOworICAgICAgICAgICAgICAgIGludCBjb3VudCA9ICgoTGVhZGluZ01hcmdpblNwYW4yKXNwYW4pLmdldExlYWRpbmdNYXJnaW5MaW5lQ291bnQoKTsKKyAgICAgICAgICAgICAgICB1c2VGaXJzdExpbmVNYXJnaW4gPSBsaW5lIDwgc3BhbkxpbmUgKyBjb3VudDsKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1hcmdpbiArPSBzcGFuLmdldExlYWRpbmdNYXJnaW4odXNlRmlyc3RMaW5lTWFyZ2luKTsKKyAgICAgICAgfQogCi0gICAgICAgICAgICBpZiAoY29kZXB0ID49IDB4RDgwMCAmJiBjb2RlcHQgPD0gMHhERkZGICYmIHBvcyA8IGxlbikgewotICAgICAgICAgICAgICAgIGNvZGVwdCA9IENoYXJhY3Rlci5jb2RlUG9pbnRBdChidWYsIHBvcyk7CisgICAgICAgIHJldHVybiBtYXJnaW47CisgICAgfQogCi0gICAgICAgICAgICAgICAgaWYgKGNvZGVwdCA+PSBNSU5fRU1PSkkgJiYgY29kZXB0IDw9IE1BWF9FTU9KSSkgewotICAgICAgICAgICAgICAgICAgICBibSA9IEVNT0pJX0ZBQ1RPUlkuZ2V0Qml0bWFwRnJvbUFuZHJvaWRQdWEoY29kZXB0KTsKKyAgICAvKiBwYWNrYWdlICovCisgICAgc3RhdGljIGZsb2F0IG1lYXN1cmVQYXJhKFRleHRQYWludCBwYWludCwgVGV4dFBhaW50IHdvcmtQYWludCwKKyAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQpIHsKKworICAgICAgICBNZWFzdXJlZFRleHQgbXQgPSBNZWFzdXJlZFRleHQub2J0YWluKCk7CisgICAgICAgIFRleHRMaW5lIHRsID0gVGV4dExpbmUub2J0YWluKCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtdC5zZXRQYXJhKHRleHQsIHN0YXJ0LCBlbmQsIERJUl9SRVFVRVNUX0xUUik7CisgICAgICAgICAgICBEaXJlY3Rpb25zIGRpcmVjdGlvbnM7CisgICAgICAgICAgICBpbnQgZGlyOworICAgICAgICAgICAgaWYgKG10Lm1FYXN5KSB7CisgICAgICAgICAgICAgICAgZGlyZWN0aW9ucyA9IERJUlNfQUxMX0xFRlRfVE9fUklHSFQ7CisgICAgICAgICAgICAgICAgZGlyID0gTGF5b3V0LkRJUl9MRUZUX1RPX1JJR0hUOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBkaXJlY3Rpb25zID0gQW5kcm9pZEJpZGkuZGlyZWN0aW9ucyhtdC5tRGlyLCBtdC5tTGV2ZWxzLAorICAgICAgICAgICAgICAgICAgICAwLCBtdC5tQ2hhcnMsIDAsIG10Lm1MZW4pOworICAgICAgICAgICAgICAgIGRpciA9IG10Lm1EaXI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjaGFyW10gY2hhcnMgPSBtdC5tQ2hhcnM7CisgICAgICAgICAgICBpbnQgbGVuID0gbXQubUxlbjsKKyAgICAgICAgICAgIGJvb2xlYW4gaGFzVGFicyA9IGZhbHNlOworICAgICAgICAgICAgVGFiU3RvcHMgdGFiU3RvcHMgPSBudWxsOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47ICsraSkgeworICAgICAgICAgICAgICAgIGlmIChjaGFyc1tpXSA9PSAnXHQnKSB7CisgICAgICAgICAgICAgICAgICAgIGhhc1RhYnMgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBpZiAodGV4dCBpbnN0YW5jZW9mIFNwYW5uZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFNwYW5uZWQgc3Bhbm5lZCA9IChTcGFubmVkKSB0ZXh0OworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNwYW5FbmQgPSBzcGFubmVkLm5leHRTcGFuVHJhbnNpdGlvbihzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUYWJTdG9wU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBUYWJTdG9wU3BhbltdIHNwYW5zID0gc3Bhbm5lZC5nZXRTcGFucyhzdGFydCwgc3BhbkVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGFiU3RvcFNwYW4uY2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNwYW5zLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWJTdG9wcyA9IG5ldyBUYWJTdG9wcyhUQUJfSU5DUkVNRU5ULCBzcGFucyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgdGwuc2V0KHBhaW50LCB0ZXh0LCBzdGFydCwgZW5kLCBkaXIsIGRpcmVjdGlvbnMsIGhhc1RhYnMsIHRhYlN0b3BzKTsKKyAgICAgICAgICAgIHJldHVybiB0bC5tZXRyaWNzKG51bGwpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgVGV4dExpbmUucmVjeWNsZSh0bCk7CisgICAgICAgICAgICBNZWFzdXJlZFRleHQucmVjeWNsZShtdCk7CisgICAgICAgIH0KKyAgICB9CiAKLSAgICAgICAgICAgIGlmIChwb3MgPT0gbGVuIHx8IGNvZGVwdCA9PSAnXHQnIHx8IGJtICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICB3b3JrUGFpbnQuYmFzZWxpbmVTaGlmdCA9IDA7CisgICAgLyoqCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICAvKiBwYWNrYWdlICovIHN0YXRpYyBjbGFzcyBUYWJTdG9wcyB7CisgICAgICAgIHByaXZhdGUgaW50W10gbVN0b3BzOworICAgICAgICBwcml2YXRlIGludCBtTnVtU3RvcHM7CisgICAgICAgIHByaXZhdGUgaW50IG1JbmNyZW1lbnQ7CiAKLSAgICAgICAgICAgICAgICB3aWR0aCArPSBTdHlsZWQubWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCArIGxhc3RQb3MsIHN0YXJ0ICsgcG9zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZtKTsKKyAgICAgICAgVGFiU3RvcHMoaW50IGluY3JlbWVudCwgT2JqZWN0W10gc3BhbnMpIHsKKyAgICAgICAgICAgIHJlc2V0KGluY3JlbWVudCwgc3BhbnMpOworICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICBpZiAoZm0gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBpZiAod29ya1BhaW50LmJhc2VsaW5lU2hpZnQgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmbS5hc2NlbnQgKz0gd29ya1BhaW50LmJhc2VsaW5lU2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmbS50b3AgKz0gd29ya1BhaW50LmJhc2VsaW5lU2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmbS5kZXNjZW50ICs9IHdvcmtQYWludC5iYXNlbGluZVNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgZm0uYm90dG9tICs9IHdvcmtQYWludC5iYXNlbGluZVNoaWZ0OworICAgICAgICB2b2lkIHJlc2V0KGludCBpbmNyZW1lbnQsIE9iamVjdFtdIHNwYW5zKSB7CisgICAgICAgICAgICB0aGlzLm1JbmNyZW1lbnQgPSBpbmNyZW1lbnQ7CisKKyAgICAgICAgICAgIGludCBucyA9IDA7CisgICAgICAgICAgICBpZiAoc3BhbnMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGludFtdIHN0b3BzID0gdGhpcy5tU3RvcHM7CisgICAgICAgICAgICAgICAgZm9yIChPYmplY3QgbyA6IHNwYW5zKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChvIGluc3RhbmNlb2YgVGFiU3RvcFNwYW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdG9wcyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcHMgPSBuZXcgaW50WzEwXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobnMgPT0gc3RvcHMubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50W10gbnN0b3BzID0gbmV3IGludFtucyAqIDJdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnM7ICsraSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuc3RvcHNbaV0gPSBzdG9wc1tpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcHMgPSBuc3RvcHM7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzdG9wc1tucysrXSA9ICgoVGFiU3RvcFNwYW4pIG8pLmdldFRhYlN0b3AoKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChwb3MgIT0gbGVuKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChibSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBubyBlbW9qaSwgbXVzdCBoYXZlIGhpdCBhIHRhYgotICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGggPSBuZXh0VGFiKHRleHQsIHN0YXJ0LCBlbmQsIHdpZHRoLCB0YWJzKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgc2V0cyB1cCB3b3JrUGFpbnQgd2l0aCB0aGUgZm9udCBvbiB0aGUgZW1vamkKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRleHQsIHNvIHRoYXQgd2UgY2FuIGV4dHJhY3QgdGhlIGFzY2VudCBhbmQgc2NhbGUuCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIGNhbid0IHVzZSB0aGUgcmVzdWx0IG9mIHRoZSBwcmV2aW91cyBjYWxsIHRvCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBtZWFzdXJlVGV4dCBiZWNhdXNlIHRoZSBlbW9qaSBtaWdodCBoYXZlIGl0cyBvd24gc3R5bGUuCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBoYXZlIHRvIGluaXRpYWxpemUgd29ya1BhaW50IGhlcmUgYmVjYXVzZSBpZiB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRleHQgaXMgdW5zdHlsZWQgbWVhc3VyZVRleHQgbWlnaHQgbm90IHVzZSB3b3JrUGFpbnQKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGF0IGFsbC4KLSAgICAgICAgICAgICAgICAgICAgICAgIHdvcmtQYWludC5zZXQocGFpbnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgU3R5bGVkLm1lYXN1cmVUZXh0KHBhaW50LCB3b3JrUGFpbnQsIHRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKyBwb3MsIHN0YXJ0ICsgcG9zICsgMSwgbnVsbCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoICs9IChmbG9hdCkgYm0uZ2V0V2lkdGgoKSAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtd29ya1BhaW50LmFzY2VudCgpIC8gYm0uZ2V0SGVpZ2h0KCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNpbmNlIHdlIGhhZCBhbiBlbW9qaSwgd2UgYnVtcCBwYXN0IHRoZSBzZWNvbmQgaGFsZgotICAgICAgICAgICAgICAgICAgICAgICAgLy8gb2YgdGhlIHN1cnJvZ2F0ZSBwYWlyLgotICAgICAgICAgICAgICAgICAgICAgICAgcG9zKys7Ci0gICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobnMgPiAxKSB7CisgICAgICAgICAgICAgICAgICAgIEFycmF5cy5zb3J0KHN0b3BzLCAwLCBucyk7CiAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGZtICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGZtLmFzY2VudCA8IGFzY2VudCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYXNjZW50ID0gZm0uYXNjZW50OwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmIChmbS5kZXNjZW50ID4gZGVzY2VudCkgewotICAgICAgICAgICAgICAgICAgICAgICAgZGVzY2VudCA9IGZtLmRlc2NlbnQ7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoZm0udG9wIDwgdG9wKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0b3AgPSBmbS50b3A7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGZtLmJvdHRvbSA+IGJvdHRvbSkgewotICAgICAgICAgICAgICAgICAgICAgICAgYm90dG9tID0gZm0uYm90dG9tOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gTm8gbmVlZCB0byB0YWtlIGJpdG1hcCBoZWlnaHQgaW50byBhY2NvdW50IGhlcmUsCi0gICAgICAgICAgICAgICAgICAgIC8vIHNpbmNlIGl0IGlzIHNjYWxlZCB0byBtYXRjaCB0aGUgdGV4dCBoZWlnaHQuCisgICAgICAgICAgICAgICAgaWYgKHN0b3BzICE9IHRoaXMubVN0b3BzKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMubVN0b3BzID0gc3RvcHM7CiAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbGFzdFBvcyA9IHBvcyArIDE7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICB0aGlzLm1OdW1TdG9wcyA9IG5zOwogICAgICAgICB9CiAKLSAgICAgICAgaWYgKGZtICE9IG51bGwpIHsKLSAgICAgICAgICAgIGZtLmFzY2VudCA9IGFzY2VudDsKLSAgICAgICAgICAgIGZtLmRlc2NlbnQgPSBkZXNjZW50OwotICAgICAgICAgICAgZm0udG9wID0gdG9wOwotICAgICAgICAgICAgZm0uYm90dG9tID0gYm90dG9tOworICAgICAgICBmbG9hdCBuZXh0VGFiKGZsb2F0IGgpIHsKKyAgICAgICAgICAgIGludCBucyA9IHRoaXMubU51bVN0b3BzOworICAgICAgICAgICAgaWYgKG5zID4gMCkgeworICAgICAgICAgICAgICAgIGludFtdIHN0b3BzID0gdGhpcy5tU3RvcHM7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuczsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgIGludCBzdG9wID0gc3RvcHNbaV07CisgICAgICAgICAgICAgICAgICAgIGlmIChzdG9wID4gaCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0b3A7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbmV4dERlZmF1bHRTdG9wKGgsIG1JbmNyZW1lbnQpOwogICAgICAgICB9CiAKLSAgICAgICAgaWYgKGhhc1RhYnMpCi0gICAgICAgICAgICBUZXh0VXRpbHMucmVjeWNsZ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XMgemVybyBsZW5ndGguCi0gICAgICAgIC8vCi0gICAgICAgIC8vIFRoZSBjb2RlIGN1cnJlbnRseSBhc3N1bWVzIHRoYXQgZWFjaCBydW4gaXMgYWRqYWNlbnQgdG8gdGhlIHByZXZpb3VzCi0gICAgICAgIC8vIG9uZSwgcHJvZ3Jlc3NpbmcgaW4gdGhlIGJhc2UgbGluZSBkaXJlY3Rpb24uICBUaGlzIGlzbid0IHN1ZmZpY2llbnQKLSAgICAgICAgLy8gdG8gaGFuZGxlIG5lc3RlZCBydW5zLCBmb3IgZXhhbXBsZSBudW1lcmljIHRleHQgaW4gYW4gcnRsIGNvbnRleHQKLSAgICAgICAgLy8gaW4gYW4gbHRyIHBhcmFncmFwaC4KLSAgICAgICAgLyogcGFja2FnZSAqLyBEaXJlY3Rpb25zKHNob3J0W10gZGlycykgeworICAgICAgICAvKiBwYWNrYWdlICovIGludFtdIG1EaXJlY3Rpb25zOworICAgICAgICAvKiBwYWNrYWdlICovIERpcmVjdGlvbnMoaW50W10gZGlycykgewogICAgICAgICAgICAgbURpcmVjdGlvbnMgPSBkaXJzOwogICAgICAgICB9CiAgICAgfQpAQCAtMTgzMSw2ICsxNTk2LDcgQEAKICAgICAgKiBsaW5lIGlzIGVsbGlwc2l6ZWQsIG5vdCBnZXRMaW5lU3RhcnQoKS4pCiAgICAgICovCiAgICAgcHVibGljIGFic3RyYWN0IGludCBnZXRFbGxpcHNpc1N0YXJ0KGludCBsaW5lKTsKKwogICAgIC8qKgogICAgICAqIFJldHVybnMgdGhlIG51bWJlciBvZiBjaGFyYWN0ZXJzIHRvIGJlIGVsbGlwc2l6ZWQgYXdheSwgb3IgMCBpZgogICAgICAqIG5vIGVsbGlwc2lzIGlzIHRvIHRha2UgcGxhY2UuCkBAIC0xODcwLDcgKzE2MzYsNyBAQAogICAgICAgICBwdWJsaWMgaW50IGxlbmd0aCgpIHsKICAgICAgICAgICAgIHJldHVybiBtVGV4dC5sZW5ndGgoKTsKICAgICAgICAgfQot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jsKK2ltcG9ydCBhbmRyb2lkLnV0aWwuTG9nOworCisvKioKKyAqIEBoaWRlCisgKi8KK2NsYXNzIE1lYXN1cmVkVGV4dCB7CisgICAgLyogcGFja2FnZSAqLyBDaGFyU2VxdWVuY2UgbVRleHQ7CisgICAgLyogcGFja2FnZSAqLyBpbnQgbVRleHRTdGFydDsKKyAgICAvKiBwYWNrYWdlICovIGZsb2F0W10gbVdpZHRoczsKKyAgICAvKiBwYWNrYWdlICovIGNoYXJbXSBtQ2hhcnM7CisgICAgLyogcGFja2FnZSAqLyBieXRlW10gbUxldmVsczsKKyAgICAvKiBwYWNrYWdlICovIGludCBtRGlyOworICAgIC8qIHBhY2thZ2UgKi8gYm9vbGVhbiBtRWFzeTsKKyAgICAvKiBwYWNrYWdlICovIGludCBtTGVuOworICAgIHByaXZhdGUgaW50IG1Qb3M7CisgICAgcHJpdmF0ZSBUZXh0UGFpbnQgbVdvcmtQYWludDsKKworICAgIHByaXZhdGUgTWVhc3VyZWRUZXh0KCkgeworICAgICAgICBtV29ya1BhaW50ID0gbmV3IFRleHRQYWludCgpOworICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIE1lYXN1cmVkVGV4dFtdIGNhY2hlZCA9IG5ldyBNZWFzdXJlZFRleHRbM107CisKKyAgICAvKiBwYWNrYWdlICovCisgICAgc3RhdGljIE1lYXN1cmVkVGV4dCBvYnRhaW4oKSB7CisgICAgICAgIE1lYXN1cmVkVGV4dCBtdDsKKyAgICAgICAgc3luY2hyb25pemVkIChjYWNoZWQpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSBjYWNoZWQubGVuZ3RoOyAtLWkgPj0gMDspIHsKKyAgICAgICAgICAgICAgICBpZiAoY2FjaGVkW2ldICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbXQgPSBjYWNoZWRbaV07CisgICAgICAgICAgICAgICAgICAgIGNhY2hlZFtpXSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBtdDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbXQgPSBuZXcgTWVhc3VyZWRUZXh0KCk7CisgICAgICAgIExvZy5lKCJNRUFTIiwgIm5ldzogIiArIG10KTsKKyAgICAgICAgcmV0dXJuIG10OworICAgIH0KKworICAgIC8qIHBhY2thZ2UgKi8KKyAgICBzdGF0aWMgTWVhc3VyZWRUZXh0IHJlY3ljbGUoTWVhc3VyZWRUZXh0IG10KSB7CisgICAgICAgIG10Lm1UZXh0ID0gbnVsbDsKKyAgICAgICAgaWYgKG10Lm1MZW4gPCAxMDAwKSB7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQoY2FjaGVkKSB7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjYWNoZWQubGVuZ3RoOyArK2kpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNhY2hlZFtpXSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjYWNoZWRbaV0gPSBtdDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIC8qKgorICAgICAqIEFuYWx5emVzIHRleHQgZm9yIGJpZGlyZWN0aW9uYWwgcnVucy4gIEFsbG9jYXRlcyB3b3JraW5nIGJ1ZmZlcnMuCisgICAgICovCisgICAgLyogcGFja2FnZSAqLworICAgIHZvaWQgc2V0UGFyYShDaGFyU2VxdWVuY2UgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLCBpbnQgYmlkaVJlcXVlc3QpIHsKKyAgICAgICAgbVRleHQgPSB0ZXh0OworICAgICAgICBtVGV4dFN0YXJ0ID0gc3RhcnQ7CisKKyAgICAgICAgaW50IGxlbiA9IGVuZCAtIHN0YXJ0OworICAgICAgICBtTGVuID0gbGVuOworICAgICAgICBtUG9zID0gMDsKKworICAgICAgICBpZiAobVdpZHRocyA9PSBudWxsIHx8IG1XaWR0aHMubGVuZ3RoIDwgbGVuKSB7CisgICAgICAgICAgICBtV2lkdGhzID0gbmV3IGZsb2F0W0FycmF5VXRpbHMuaWRlYWxGbG9hdEFycmF5U2l6ZShsZW4pXTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUNoYXJzID09IG51bGwgfHwgbUNoYXJzLmxlbmd0aCA8IGxlbikgeworICAgICAgICAgICAgbUNoYXJzID0gbmV3IGNoYXJbQXJyYXlVdGlscy5pZGVhbENoYXJBcnJheVNpemUobGVuKV07CisgICAgICAgIH0KKyAgICAgICAgVGV4dFV0aWxzLmdldENoYXJzKHRleHQsIHN0YXJ0LCBlbmQsIG1DaGFycywgMCk7CisKKyAgICAgICAgaWYgKHRleHQgaW5zdGFuY2VvZiBTcGFubmVkKSB7CisgICAgICAgICAgICBTcGFubmVkIHNwYW5uZWQgPSAoU3Bhbm5lZCkgdGV4dDsKKyAgICAgICAgICAgIFJlcGxhY2VtZW50U3BhbltdIHNwYW5zID0gc3Bhbm5lZC5nZXRTcGFucyhzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICBSZXBsYWNlbWVudFNwYW4uY2xhc3MpOworCisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNwYW5zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgaW50IHN0YXJ0SW5QYXJhID0gc3Bhbm5lZC5nZXRTcGFuU3RhcnQoc3BhbnNbaV0pIC0gc3RhcnQ7CisgICAgICAgICAgICAgICAgaW50IGVuZEluUGFyYSA9IHNwYW5uZWQuZ2V0U3BhbkVuZChzcGFuc1tpXSkgLSBzdGFydDsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBqID0gc3RhcnRJblBhcmE7IGogPCBlbmRJblBhcmE7IGorKykgeworICAgICAgICAgICAgICAgICAgICBtQ2hhcnNbal0gPSAnXHVGRkZDJzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoVGV4dFV0aWxzLmRvZXNOb3ROZWVkQmlkaShtQ2hhcnMsIDAsIGxlbikpIHsKKyAgICAgICAgICAgIG1EaXIgPSBMYXlvdXQuRElSX0xFRlRfVE9fUklHSFQ7CisgICAgICAgICAgICBtRWFzeSA9IHRydWU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAobUxldmVscyA9PSBudWxsIHx8IG1MZXZlbHMubGVuZ3RoIDwgbGVuKSB7CisgICAgICAgICAgICAgICAgbUxldmVscyA9IG5ldyBieXRlW0FycmF5VXRpbHMuaWRlYWxCeXRlQXJyYXlTaXplKGxlbildOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbURpciA9IEFuZHJvaWRCaWRpLmJpZGkoYmlkaVJlcXVlc3QsIG1DaGFycywgbUxldmVscywgbGVuLCBmYWxzZSk7CisgICAgICAgICAgICBtRWFzeSA9IGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgZmxvYXQgYWRkU3R5bGVSdW4oVGV4dFBhaW50IHBhaW50LCBpbnQgbGVuLCBQYWludC5Gb250TWV0cmljc0ludCBmbSkgeworICAgICAgICBpZiAoZm0gIT0gbnVsbCkgeworICAgICAgICAgICAgcGFpbnQuZ2V0Rm9udE1ldHJpY3NJbnQoZm0pOworICAgICAgICB9CisKKyAgICAgICAgaW50IHAgPSBtUG9zOworICAgICAgICBtUG9zID0gcCArIGxlbjsKKworICAgICAgICBpZiAobUVhc3kpIHsKKyAgICAgICAgICAgIGludCBmbGFncyA9IG1EaXIgPT0gTGF5b3V0LkRJUl9MRUZUX1RPX1JJR0hUCisgICAgICAgICAgICAgICAgPyBDYW52YXMuRElSRUNUSU9OX0xUUiA6IENhbnZhcy5ESVJFQ1RJT05fUlRMOworICAgICAgICAgICAgcmV0dXJuIHBhaW50LmdldFRleHRSdW5BZHZhbmNlcyhtQ2hhcnMsIHAsIGxlbiwgcCwgbGVuLCBmbGFncywgbVdpZHRocywgcCk7CisgICAgICAgIH0KKworICAgICAgICBmbG9hdCB0b3RhbEFkdmFuY2UgPSAwOworICAgICAgICBpbnQgbGV2ZWwgPSBtTGV2ZWxzW3BdOworICAgICAgICBmb3IgKGludCBxID0gcCwgaSA9IHAgKyAxLCBlID0gcCArIGxlbjs7ICsraSkgeworICAgICAgICAgICAgaWYgKGkgPT0gZSB8fCBtTGV2ZWxzW2ldICE9IGxldmVsKSB7CisgICAgICAgICAgICAgICAgaW50IGZsYWdzID0gKGxldmVsICYgMHgxKSA9PSAwID8gQ2FudmFzLkRJUkVDVElPTl9MVFIgOiBDYW52YXMuRElSRUNUSU9OX1JUTDsKKyAgICAgICAgICAgICAgICB0b3RhbEFkdmFuY2UgKz0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50LmdldFRleHRSdW5BZHZhbmNlcyhtQ2hhcnMsIHEsIGkgLSBxLCBxLCBpIC0gcSwgZmxhZ3MsIG1XaWR0aHMsIHEpOworICAgICAgICAgICAgICAgIGlmIChpID09IGUpIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHEgPSBpOworICAgICAgICAgICAgICAgIGxldmVsID0gbUxldmVsc1tpXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdG90YWxBZHZhbmNlOworICAgIH0KKworICAgIGZsb2F0IGFkZFN0eWxlUnVuKFRleHRQYWludCBwYWludCwgTWV0cmljQWZmZWN0aW5nU3BhbltdIHNwYW5zLCBpbnQgbGVuLAorICAgICAgICAgICAgUGFpbnQuRm9udE1ldHJpY3NJbnQgZm0pIHsKKworICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50ID0gbVdvcmtQYWludDsKKyAgICAgICAgd29ya1BhaW50LnNldChwYWludCk7CisgICAgICAgIC8vIFhYWCBwYWludCBzaG91bGQgbm90IGhhdmUgYSBiYXNlbGluZSBzaGlmdCwgYnV0Li4uCisgICAgICAgIHdvcmtQYWludC5iYXNlbGluZVNoaWZ0ID0gMDsKKworICAgICAgICBSZXBsYWNlbWVudFNwYW4gcmVwbGFjZW1lbnQgPSBudWxsOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHNwYW5zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuIHNwYW4gPSBzcGFuc1tpXTsKKyAgICAgICAgICAgIGlmIChzcGFuIGluc3RhbmNlb2YgUmVwbGFjZW1lbnRTcGFuKSB7CisgICAgICAgICAgICAgICAgcmVwbGFjZW1lbnQgPSAoUmVwbGFjZW1lbnRTcGFuKXNwYW47CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNwYW4udXBkYXRlTWVhc3VyZVN0YXRlKHdvcmtQYWludCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmbG9hdCB3aWQ7CisgICAgICAgIGlmIChyZXBsYWNlbWVudCA9PSBudWxsKSB7CisgICAgICAgICAgICB3aWQgPSBhZGRTdHlsZVJ1bih3b3JrUGFpbnQsIGxlbiwgZm0pOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gVXNlIG9yaWdpbmFsIHRleHQuICBTaG91bGRuJ3QgbWF0dGVyLgorICAgICAgICAgICAgd2lkID0gcmVwbGFjZW1lbnQuZ2V0U2l6ZSh3b3JrUGFpbnQsIG1UZXh0LCBtVGV4dFN0YXJ0ICsgbVBvcywKKyAgICAgICAgICAgICAgICAgICAgbVRleHRTdGFydCArIG1Qb3MgKyBsZW4sIGZtKTsKKyAgICAgICAgICAgIGZsb2F0W10gdyA9IG1XaWR0aHM7CisgICAgICAgICAgICB3W21Qb3NdID0gd2lkOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IG1Qb3MgKyAxLCBlID0gbVBvcyArIGxlbjsgaSA8IGU7IGkrKykKKyAgICAgICAgICAgICAgICB3W2ldID0gMDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChmbSAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAod29ya1BhaW50LmJhc2VsaW5lU2hpZnQgPCAwKSB7CisgICAgICAgICAgICAgICAgZm0uYXNjZW50ICs9IHdvcmtQYWludC5iYXNlbGluZVNoaWZ0OworICAgICAgICAgICAgICAgIGZtLnRvcCArPSB3b3JrUGFpbnQuYmFzZWxpbmVTaGlmdDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZm0uZGVzY2VudCArPSB3b3JrUGFpbnQuYmFzZWxpbmVTaGlmdDsKKyAgICAgICAgICAgICAgICBmbS5ib3R0b20gKz0gd29ya1BhaW50LmJhc2VsaW5lU2hpZnQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gd2lkOworICAgIH0KKworICAgIGludCBicmVha1RleHQoaW50IHN0YXJ0LCBpbnQgbGltaXQsIGJvb2xlYW4gZm9yd2FyZHMsIGZsb2F0IHdpZHRoKSB7CisgICAgICAgIGZsb2F0W10gdyA9IG1XaWR0aHM7CisgICAgICAgIGlmIChmb3J3YXJkcykgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0OyBpIDwgbGltaXQ7ICsraSkgeworICAgICAgICAgICAgICAgIGlmICgod2lkdGggLT0gd1tpXSkgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBpIC0gc3RhcnQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IGxpbWl0OyAtLWkgPj0gc3RhcnQ7KSB7CisgICAgICAgICAgICAgICAgaWYgKCh3aWR0aCAtPSB3W2ldKSA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpbWl0IC0gaSAtMTsKKyAgICAgICAgICAgICAgICB9Cis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B9CiAKICAgICAgICAgaWYgKGNvdW50ID09IDApIHsKLSAgICAgICAgICAgIHJldHVybiAoVFtdKSBBcnJheVV0aWxzLmVtcHR5QXJyYXkoa2luZCk7CisgICAgICAgICAgICByZXR1cm4gQXJyYXlVdGlscy5lbXB0eUFycmF5KGtpbmQpOwogICAgICAgICB9CiAgICAgICAgIGlmIChjb3VudCA9PSAxKSB7CiAgICAgICAgICAgICByZXQgPSAoT2JqZWN0W10pIEFycmF5Lm5ld0luc3RhbmNlKGtpbmQsIDEpOwpAQCAtMTA1NCw3ICsxMDU1LDMyIEBACiAgICAgICAgIH0KICAgICB9CiAKKwogICAgIC8qKgorICAgICAqIERvbid0IGNhbGwgdGhpcyB5b3Vyc2VsZiAtLSBleGlzdHMgZm9yIENhbnZhcyB0byB1c2UgaW50ZXJuYWxseS4KKyAgICAgKiB7QGhpZGV9CisgICAgICovCisgICAgcHVibGljIHZvaWQgZHJhd1RleHRSdW4oQ2FudmFzIGMsIGludCBzdGFydCwgaW50IGVuZCwKKyAgICAgICAgICAgIGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0RW5kLAorICAgICAgICAgICAgZmxvYXQgeCwgZmxvYXQgeSwgaW50IGZsYWdzLCBQYWludCBwKSB7CisgICAgICAgIGNoZWNrUmFuZ2UoImRyYXdUZXh0UnVuIiwgc3RhcnQsIGVuZCk7CisKKyAgICAgICAgaW50IGNvbnRleHRMZW4gPSBjb250ZXh0RW5kIC0gY29udGV4dFN0YXJ0OworICAgICAgICBpbnQgbGVuID0gZW5kIC0gc3RhcnQ7CisgICAgICAgIGlmIChjb250ZXh0RW5kIDw9IG1HYXBTdGFydCkgeworICAgICAgICAgICAgYy5kcmF3VGV4dFJ1bihtVGV4dCwgc3RhcnQsIGxlbiwgY29udGV4dFN0YXJ0LCBjb250ZXh0TGVuLCB4LCB5LCBmbGFncywgcCk7CisgICAgICAgIH0gZWxzZSBpZiAoY29udGV4dFN0YXJ0ID49IG1HYXBTdGFydCkgeworICAgICAgICAgICAgYy5kcmF3VGV4dFJ1bihtVGV4dCwgc3RhcnQgKyBtR2FwTGVuZ3RoLCBsZW4sIGNvbnRleHRTdGFydCArIG1HYXBMZW5ndGgsCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHRMZW4sIHgsIHksIGZsYWdzLCBwKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGNoYXJbXSBidWYgPSBUZXh0VXRpbHMub2J0YWluKGNvbnRleHRMZW4pOworICAgICAgICAgICAgZ2V0Q2hhcnMoY29udGV4dFN0YXJ0LCBjb250ZXh0RW5kLCBidWYsIDApOworICAgICAgICAgICAgYy5kcmF3VGV4dFJ1bihidWYsIHN0YXJ0IC0gY29udGV4dFN0YXJ0LCBsZW4sIDAsIGNvbnRleHRMZW4sIHgsIHksIGZsYWdzLCBwKTsKKyAgICAgICAgICAgIFRleHRVdGlscy5yZWN5Y2xlKGJ1Zik7CisgICAgICAgIH0KKyAgICB9CisKKyAgIC8qKgogICAgICAqIERvbid0IGNhbGwgdGhpcyB5b3Vyc2VsZiAtLSBleGlzdHMgZm9yIFBhaW50IHRvIHVzZSBpbnRlcm5hbGx5LgogICAgICAqIHtAaGlkZX0KICAgICAgKi8KQEAgLTExMDMsNiArMTEyOSw1OCBAQAogICAgICAgICByZXR1cm4gcmV0OwogICAgIH0KIAorICAgIC8qKgorICAgICAqIERvbid0IGNhbGwgdGhpcyB5b3Vyc2VsZiAtLSBleGlzdHMgZm9yIFBhaW50IHRvIHVzZSBpbnRlcm5hbGx5LgorICAgICAqIHtAaGlkZX0KKyAgICAgKi8KKyAgICBwdWJsaWMgZmxvYXQgZ2V0VGV4dFJ1bkFkdmFuY2VzKGludCBzdGFydCwgaW50IGVuZCwgaW50IGNvbnRleHRTdGFydCwgaW50IGNvbnRleHRFbmQsIGludCBmbGFncywKKyAgICAgICAgICAgIGZsb2F0W10gYWR2YW5jZXMsIGludCBhZHZhbmNlc1BvcywgUGFpbnQgcCkgeworCisgICAgICAgIGZsb2F0IHJldDsKKworICAgICAgICBpbnQgY29udGV4dExlbiA9IGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQ7CisgICAgICAgIGludCBsZW4gPSBlbmQgLSBzdGFydDsKKworICAgICAgICBpZiAoZW5kIDw9IG1HYXBTdGFydCkgeworICAgICAgICAgICAgcmV0ID0gcC5nZXRUZXh0UnVuQWR2YW5jZXMobVRleHQsIHN0YXJ0LCBsZW4sIGNvbnRleHRTdGFydCwgY29udGV4dExlbiwKKyAgICAgICAgICAgICAgICAgICAgZmxhZ3MsIGFkdmFuY2VzLCBhZHZhbmNlc1Bvcyk7CisgICAgICAgIH0gZWxzZSBpZiAoc3RhcnQgPj0gbUdhcFN0YXJ0KSB7CisgICAgICAgICAgICByZXQgPSBwLmdldFRleHRSdW5BZHZhbmNlcyhtVGV4dCwgc3RhcnQgKyBtR2FwTGVuZ3RoLCBsZW4sCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHRTdGFydCArIG1HYXBMZW5ndGgsIGNvbnRleHRMZW4sIGZsYWdzLCBhZHZhbmNlcywgYWR2YW5jZXNQb3MpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgY2hhcltdIGJ1ZiA9IFRleHRVdGlscy5vYnRhaW4oY29udGV4dExlbik7CisgICAgICAgICAgICBnZXRDaGFycyhjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIGJ1ZiwgMCk7CisgICAgICAgICAgICByZXQgPSBwLmdldFRleHRSdW5BZHZhbmNlcyhidWYsIHN0YXJ0IC0gY29udGV4dFN0YXJ0LCBsZW4sCisgICAgICAgICAgICAgICAgICAgIDAsIGNvbnRleHRMZW4sIGZsYWdzLCBhZHZhbmNlcywgYWR2YW5jZXNQb3MpOworICAgICAgICAgICAgVGV4dFV0aWxzLnJlY3ljbGUoYnVmKTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiByZXQ7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRUZXh0UnVuQ3Vyc29yKGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0RW5kLCBpbnQgZmxhZ3MsIGludCBvZmZzZXQsCisgICAgICAgICAgICBpbnQgY3Vyc29yT3B0LCBQYWludCBwKSB7CisKKyAgICAgICAgaW50IHJldDsKKworICAgICAgICBpbnQgY29udGV4dExlbiA9IGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQ7CisgICAgICAgIGlmIChjb250ZXh0RW5kIDw9IG1HYXBTdGFydCkgeworICAgICAgICAgICAgcmV0ID0gcC5nZXRUZXh0UnVuQ3Vyc29yKG1UZXh0LCBjb250ZXh0U3RhcnQsIGNvbnRleHRMZW4sCisgICAgICAgICAgICAgICAgICAgIGZsYWdzLCBvZmZzZXQsIGN1cnNvck9wdCk7CisgICAgICAgIH0gZWxzZSBpZiAoY29udGV4dFN0YXJ0ID49IG1HYXBTdGFydCkgeworICAgICAgICAgICAgcmV0ID0gcC5nZXRUZXh0UnVuQ3Vyc29yKG1UZXh0LCBjb250ZXh0U3RhcnQgKyBtR2FwTGVuZ3RoLCBjb250ZXh0TGVuLAorICAgICAgICAgICAgICAgICAgICBmbGFncywgb2Zmc2V0ICsgbUdhcExlbmd0aCwgY3Vyc29yT3B0KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGNoYXJbXSBidWYgPSBUZXh0VXRpbHMub2J0YWluKGNvbnRleHRMZW4pOworICAgICAgICAgICAgZ2V0Q2hhcnMoY29udGV4dFN0YXJ0LCBjb250ZXh0RW5kLCBidWYsIDApOworICAgICAgICAgICAgcmV0ID0gcC5nZXRUZXh0UnVuQ3Vyc29yKGJ1ZiwgMCwgY29udGV4dExlbiwKKyAgICAgICAgICAgICAgICAgICAgZmxhZ3MsIG9mZnNldCAtIGNvbnRleHRTdGFydCwgY3Vyc29yT3B0KSArIGNvbnRleHRTdGFydDsKKyAgICAgICAgICAgIFRleHRVdGlscy5yZWN5Y2xlKGJ1Zik7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm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AgICAgICAgIDogbmV3IEVsbGlwc2l6ZXIoc291cmNlKSwKQEAgLTcyLDcgKzc0LDcgQEAKICAgICAgICAgICogVGhpcyBpcyBhbm5veWluZywgYnV0IHdlIGNhbid0IHJlZmVyIHRvIHRoZSBsYXlvdXQgdW50aWwKICAgICAgICAgICogc3VwZXJjbGFzcyBjb25zdHJ1Y3Rpb24gaXMgZmluaXNoZWQsIGFuZCB0aGUgc3VwZXJjbGFzcwogICAgICAgICAgKiBjb25zdHJ1Y3RvciB3YW50cyB0aGUgcmVmZXJlbmNlIHRvIHRoZSBkaXNwbGF5IHRleHQuCi0gICAgICAgICAqIAorICAgICAgICAgKgogICAgICAgICAgKiBUaGlzIHdpbGwgYnJlYWsgaWYgdGhlIHN1cGVyY2xhc3MgY29uc3RydWN0b3IgZXZlciBhY3R1YWxseQogICAgICAgICAgKiBjYXJlcyBhYm91dCB0aGUgY29udGVudCBpbnN0ZWFkIG9mIGp1c3QgaG9sZGluZyB0aGUgcmVmZXJlbmNlLgogICAgICAgICAgKi8KQEAgLTk0LDEzICs5NiwxMyBAQAogICAgICAgICBtTGluZURpcmVjdGlvbnMgPSBuZXcgRGlyZWN0aW9uc1sKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlVdGlscy5pZGVhbEludEFycmF5U2l6ZSgyICogbUNvbHVtbnMpXTsKIAorICAgICAgICBtTWVhc3VyZWQgPSBNZWFzdXJlZFRleHQub2J0YWluKCk7CisKICAgICAgICAgZ2VuZXJhdGUoc291cmNlLCBidWZzdGFydCwgYnVmZW5kLCBwYWludCwgb3V0ZXJ3aWR0aCwgYWxpZ24sCiAgICAgICAgICAgICAgICAgIHNwYWNpbmdtdWx0LCBzcGFjaW5nYWRkLCBpbmNsdWRlcGFkLCBpbmNsdWRlcGFkLAogICAgICAgICAgICAgICAgICBlbGxpcHNpemUgIT0gbnVsbCwgZWxsaXBzaXplZFdpZHRoLCBlbGxpcHNpemUpOwogCi0gICAgICAgIG1DaGRpcnMgPSBudWxsOwotICAgICAgICBtQ2hzID0gbnVsbDsKLSAgICAgICAgbVdpZHRocyA9IG51bGw7CisgICAgICAgIG1NZWFzdXJlZCA9IE1lYXN1cmVkVGV4dC5yZWN5Y2xlKG1NZWFzdXJlZCk7CiAgICAgICAgIG1Gb250TWV0cmljc0ludCA9IG51bGw7CiAgICAgfQogCkBAIC0xMTEsNiArMTEzLDcgQEAKICAgICAgICAgbUxpbmVzID0gbmV3IGludFtBcnJheVV0aWxzLmlkZWFsSW50QXJyYXlTaXplKDIgKiBtQ29sdW1ucyldOwogICAgICAgICBtTGluZURpcmVjdGlvbnMgPSBuZXcgRGlyZWN0aW9uc1sKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlVdGlscy5pZGVhbEludEFycmF5U2l6ZSgyICogbUNvbHVtbnMpXTsKKyAgICAgICAgbU1lYXN1cmVkID0gTWVhc3VyZWRUZXh0Lm9idGFpbigpOwogICAgIH0KIAogICAgIC8qIHBhY2thZ2UgKi8gdm9pZCBnZW5lcmF0ZShDaGFyU2VxdWVuY2Ugc291cmNlLCBpbnQgYnVmc3RhcnQsIGludCBidWZlbmQsCkBAIC0xMjgsNTkgKzEzMSw1MCBAQAogICAgICAgICBQYWludC5Gb250TWV0cmljc0ludCBmbSA9IG1Gb250TWV0cmljc0ludDsKICAgICAgICAgaW50W10gY2hvb3NlaHR2ID0gbnVsbDsKIAotICAgICAgICBpbnQgZW5kID0gVGV4dFV0aWxzLmluZGV4T2Yoc291cmNlLCAnXG4nLCBidWZzdGFydCwgYnVmZW5kKTsKLSAgICAgICAgaW50IGJ1ZnNpeiA9IGVuZCA+PSAwID8gZW5kIC0gYnVmc3RhcnQgOiBidWZlbmQgLSBidWZzdGFydDsKLSAgICAgICAgYm9vbGVhbiBmaXJzdCA9IHRydWU7CisgICAgICAgIE1lYXN1cmVkVGV4dCBtZWFzdXJlZCA9IG1NZWFzdXJlZDsKIAotICAgICAgICBpZiAobUNoZGlycyA9PSBudWxsKSB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291cmNlLCAnXG4nLCBwYXJhU3RhcnQsIGJ1ZmVuZCk7CisgICAgICAgICAgICBpZiAocGFyYUVuZCA8IDApCisgICAgICAgICAgICAgICAgcGFyYUVuZCA9IGJ1ZmVuZDsKICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBlbmQgPSBUZXh0VXRpbHMuaW5kZXhPZihzb3VyY2UsICdcbicsIHN0YXJ0LCBidWZlbmQpOworICAgICAgICAgICAgICAgIHBhcmFFbmQrKzsKKyAgICAgICAgICAgIGludCBwYXJhTGVuID0gcGFyYUVuZCAtIHBhcmFTdGFydDsKIAotICAgICAgICAgICAgaWYgKGVuZCA8IDApCi0gICAgICAgICAgICAgICAgZW5kID0gYnVmZW5kOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIGVuZCsrOwotCi0gICAgICAgICAgICBpbnQgZmlyc3RXaWR0aExpbmVDb3VudCA9IDE7CisgICAgICAgICAgICBpbnQgZmlyc3RXaWR0aExpbmVMaW1pdCA9IG1MaW5lQ291bnQgKyAxOwogICAgICAgICAgICAgaW50IGZpcnN0d2lkdGggPSBvdXRlcndpZHRoOwogICAgICAgICAgICAgaW50IHJlc3R3aWR0aCA9IG91dGVyd2lkdGg7CiAKICAgICAgICAgICAgIExpbmVIZWlnaHRTcGFuW10gY2hvb3NlaHQgPSBudWxsOwogCiAgICAgICAgICAgICBpZiAoc3Bhbm5lZCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW5bXSBzcDsKLQotICAgICAgICAgICAgICAgIHNwID0gc3Bhbm5lZC5nZXRTcGFucyhzdGFydCwgZW5kLCBMZWFkaW5nTWFyZ2luU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW5bXSBzcCA9IHNwYW5uZWQuZ2V0U3BhbnMocGFyYVN0YXJ0LCBwYXJhRW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW4uY2xhc3MpOwogICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc3AubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgTGVhZGluZ01hcmdpblNwYW4gbG1zID0gc3BbaV07CiAgICAgICAgICAgICAgICAgICAgIGZpcnN0d2lkdGggLT0gc3BbaV0uZ2V0TGVhZGluZ01hcmdpbih0cnVlKTsKICAgICAgICAgICAgICAgICAgICAgcmVzdHdpZHRoIC09IHNwW2ldLmdldExlYWRpbmdNYXJnaW4oZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICBpZiAobG1zIGluc3RhbmNlb2YgTGVhZGluZ01hcmdpblNwYW4uTGVhZGluZ01hcmdpblNwYW4yKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmaXJzdFdpZHRoTGluZUNvdW50ID0gKChMZWFkaW5nTWFyZ2luU3Bhbi5MZWFkaW5nTWFyZ2luU3BhbjIpbG1zKS5nZXRMZWFkaW5nTWFyZ2luTGluZUNvdW50KCk7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAvLyBMZWFkaW5nTWFyZ2luU3BhbjIgaXMgb2RkLiAgVGhlIGNvdW50IGFmZmVjdHMgYWxsCisgICAgICAgICAgICAgICAgICAgIC8vIGxlYWRpbmcgbWFyZ2luIHNwYW5zLCBub3QganVzdCB0aGlzIHBhcnRpY3VsYXIgb25lLAorICAgICAgICAgICAgICAgICAgICAvLyBhbmQgc3RhcnQgZnJvbSB0aGUgdG9wIG9mIHRoZSBzcGFuLCBub3QgdGhlIHRvcCBvZiB0aGUKKyAgICAgICAgICAgICAgICAgICAgLy8gcGFyYWdyYXBoLgorICAgICAgICAgICAgICAgICAgICBpZiAobG1zIGluc3RhbmNlb2YgTGVhZGluZ01hcmdpblNwYW4yKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMZWFkaW5nTWFyZ2luU3BhbjIgbG1zMiA9IChMZWFkaW5nTWFyZ2luU3BhbjIpIGxtczsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBsbXNGaXJzdExpbmUgPSBnZXRMaW5lRm9yT2Zmc2V0KHNwYW5uZWQuZ2V0U3BhblN0YXJ0KGxtczIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0V2lkdGhMaW5lTGltaXQgPSBsbXNGaXJzdExpbmUgKyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsbXMyLmdldExlYWRpbmdNYXJnaW5MaW5lQ291bnQoKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIGNob29zZWh0ID0gc3Bhbm5lZC5nZXRTcGFucyhzdGFydCwgZW5kLCBMaW5lSGVpZ2h0U3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgY2hvb3NlaHQgPSBzcGFubmVkLmdldFNwYW5zKHBhcmFTdGFydCwgcGFyYUVuZCwgTGluZUhlaWdodFNwYW4uY2xhc3MpOwogCiAgICAgICAgICAgICAgICAgaWYgKGNob29zZWh0Lmxlbmd0aCAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChjaG9vc2VodHYgPT0gbnVsbCB8fApAQCAtMTkyLDExICsxODYsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjaG9vc2VodC5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICAgaW50IG8gPSBzcGFubmVkLmdldFNwYW5TdGFydChjaG9vc2VodFtpXSk7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvIDwgc3RhcnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvIDwgcGFyYVN0YXJ0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3RhcnRzIGluIHRoaXMgbGF5b3V0LCBiZWZvcmUgdGhlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY3VycmVudCBwYXJhZ3JhcGgKIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0dltpXSA9IGdldExpbmVUb3AoZ2V0TGluZUZvck9mZnNldChvKSk7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0dltpXSA9IGdldExpbmVUb3AoZ2V0TGluZUZvck9mZnNldChvKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0YXJ0cyBpbiB0aGlzIHBhcmFncmFwaAogCkBAIC0yMDYsMTYyICsyMDAsODcgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGlmIChlbmQgLSBzdGFydCA+IGNoZGlycy5sZW5ndGgpIHsKLSAgICAgICAgICAgICAgICBjaGRpcnMgPSBuZXcgYnl0ZVtBcnJheVV0aWxzLmlkZWFsQnl0ZUFycmF5U2l6ZShlbmQgLSBzdGFydCldOwotICAgICAgICAgICAgICAgIG1DaGRpcnMgPSBjaGRpcnM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoZW5kIC0gc3RhcnQgPiBjaHMubGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgY2hzID0gbmV3IGNoYXJbQXJyYXlVdGlscy5pZGVhbENoYXJBcnJheVNpemUoZW5kIC0gc3RhcnQpXTsKLSAgICAgICAgICAgICAgICBtQ2hzID0gY2hzOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKChlbmQgLSBzdGFydCkgKiAyID4gd2lkdGhzLmxlbmd0aCkgewotICAgICAgICAgICAgICAgIHdpZHRocyA9IG5ldyBmbG9hdFtBcnJheVV0aWxzLmlkZWFsSW50QXJyYXlTaXplKChlbmQgLSBzdGFydCkgKiAyKV07Ci0gICAgICAgICAgICAgICAgbVdpZHRocyA9IHdpZHRoczsKLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1lYXN1cmVkLnNldFBhcmEoc291cmNlLCBwYXJhU3RhcnQsIHBhcmFFbmQsIERJUl9SRVFVRVNUX0RFRkFVTFRfTFRSKTsKKyAgICAgICAgICAgIGNoYXJbXSBjaHMgPSBtZWFzdXJlZC5tQ2hhcnM7CisgICAgICAgICAgICBmbG9hdFtdIHdpZHRocyA9IG1lYXN1cmVkLm1XaWR0aHM7CisgICAgICAgICAgICBieXRlW10gY2hkaXJzID0gbWVhc3VyZWQubUxldmVsczsKKyAgICAgICAgICAgIGludCBkaXIgPSBtZWFzdXJlZC5tRGlyOworICAgICAgICAgICAgYm9vbGVhbiBlYXN5ID0gbWVhc3VyZWQubUVhc3k7CiAKLSAgICAgICAgICAgIFRleHRVdGlscy5nZXRDaGFycyhzb3VyY2UsIHN0YXJ0LCBlbmQsIGNocywgMCk7Ci0gICAgICAgICAgICBmaW5hbCBpbnQgbiA9IGVuZCAtIHN0YXJ0OwotCi0gICAgICAgICAgICBib29sZWFuIGVhc3kgPSB0cnVlOwotICAgICAgICAgICAgYm9vbGVhbiBhbHRlcmVkID0gZmFsc2U7Ci0gICAgICAgICAgICBpbnQgZGlyID0gREVGQVVMVF9ESVI7IC8vIFhYWAotCi0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewotICAgICAgICAgICAgICAgIGlmIChjaHNbaV0gPj0gRklSU1RfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICBlYXN5ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gRW5zdXJlIHRoYXQgbm9uZSBvZiB0aGUgdW5kZXJseWluZyBjaGFyYWN0ZXJzIGFyZSB0cmVhdGVkCi0gICAgICAgICAgICAvLyBhcyB2aWFibGUgYnJlYWtwb2ludHMsIGFuZCB0aGF0IHRoZSBlbnRpcmUgcnVuIGdldHMgdGhlCi0gICAgICAgICAgICAvLyBzYW1lIGJpZGkgZGlyZWN0aW9uLgotCi0gICAgICAgICAgICBpZiAoc291cmNlIGluc3RhbmNlb2YgU3Bhbm5lZCkgewotICAgICAgICAgICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgc291cmNlOwotICAgICAgICAgICAgICAgIFJlcGxhY2VtZW50U3BhbltdIHNwYW5zID0gc3AuZ2V0U3BhbnMoc3RhcnQsIGVuZCwgUmVwbGFjZW1lbnRTcGFuLmNsYXNzKTsKLQotICAgICAgICAgICAgICAgIGZvciAoaW50IHkgPSAwOyB5IDwgc3BhbnMubGVuZ3RoOyB5KyspIHsKLSAgICAgICAgICAgICAgICAgICAgaW50IGEgPSBzcC5nZXRTcGFuU3RhcnQoc3BhbnNbeV0pOwotICAgICAgICAgICAgICAgICAgICBpbnQgYiA9IHNwLmdldFNwYW5FbmQoc3BhbnNbeV0pOwotCi0gICAgICAgICAgICAgICAgICAgIGZvciAoaW50IHggPSBhOyB4IDwgYjsgeCsrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjaHNbeCAtIHN0YXJ0XSA9ICdcdUZGRkMnOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIWVhc3kpIHsKLSAgICAgICAgICAgICAgICAvLyBYWFggcHV0IG92ZXJyaWRlIGZsYWdzLCBldGMuIGludG8gY2hkaXJzCi0gICAgICAgICAgICAgICAgZGlyID0gYmlkaShkaXIsIGNocywgY2hkaXJzLCBuLCBmYWxzZSk7Ci0KLSAgICAgICAgICAgICAgICAvLyBEbyBtaXJyb3JpbmcgZm9yIHJpZ2h0LXRvLWxlZnQgc2VnbWVudHMKLQotICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjaGRpcnNbaV0gPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBqOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSBpOyBqIDwgbjsgaisrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoZGlyc1tqXSAhPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBbmRyb2lkQ2hhcmFjdGVyLm1pcnJvcihjaHMsIGksIGogLSBpKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHRlcmVkID0gdHJ1ZTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGogLSAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBDaGFyU2VxdWVuY2Ugc3ViOwotCi0gICAgICAgICAgICBpZiAoYWx0ZXJlZCkgewotICAgICAgICAgICAgICAgIGlmIChhbHRlciA9PSBudWxsKQotICAgICAgICAgICAgICAgICAgICBhbHRlciA9IEFsdGVyZWRDaGFyU2VxdWVuY2UubWFrZShzb3VyY2UsIGNocywgc3RhcnQsIGVuZCk7Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICBhbHRlci51cGRhdGUoY2hzLCBzdGFydCwgZW5kKTsKLQotICAgICAgICAgICAgICAgIHN1YiA9IGFsdGVyOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBzdWIgPSBzb3VyY2U7Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBDaGFyU2VxdWVuY2Ugc3ViID0gc291cmNlOwogCiAgICAgICAgICAgICBpbnQgd2lkdGggPSBmaXJzdHdpZHRoOwogCiAgICAgICAgICAgICBmbG9hdCB3ID0gMDsKLSAgICAgICAgICAgIGludCBoZXJlID0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgaGVyZSA9IHBhcmFTdGFydDsKIAotICAgICAgICAgICAgaW50IG9rID0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgb2sgPSBwYXJhU3RhcnQ7CiAgICAgICAgICAgICBmbG9hdCBva3dpZHRoID0gdzsKICAgICAgICAgICAgIGludCBva2FzY2VudCA9IDAsIG9rZGVzY2VudCA9IDAsIG9rdG9wID0gMCwgb2tib3R0b20gPSAwOwogCi0gICAgICAgICAgICBpbnQgZml0ID0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgZml0ID0gcGFyYVN0YXJ0OwogICAgICAgICAgICAgZmxvYXQgZml0d2lkdGggPSB3OwogICAgICAgICAgICAgaW50IGZpdGFzY2VudCA9IDAsIGZpdGRlc2NlbnQgPSAwLCBmaXR0b3AgPSAwLCBmaXRib3R0b20gPSAwOwogCi0gICAgICAgICAgICBib29sZWFuIHRhYiA9IGZhbHNlOworICAgICAgICAgICAgYm9vbGVhbiBoYXNUYWJPckVtb2ppID0gZmFsc2U7CisgICAgICAgICAgICBib29sZWFuIGhhc1RhYiA9IGZhbHNlOworICAgICAgICAgICAgVGFiU3RvcHMgdGFiU3RvcHMgPSBudWxsOwogCi0gICAgICAgICAgICBpbnQgbmV4dDsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSBzdGFydDsgaSA8IGVuZDsgaSA9IG5leHQpIHsKLSAgICAgICAgICAgICAgICBpZiAoc3Bhbm5lZCA9PSBudWxsKQotICAgICAgICAgICAgICAgICAgICBuZXh0ID0gZW5kOwotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgbmV4dCA9IHNwYW5uZWQubmV4dFNwYW5UcmFuc2l0aW9uKGksIGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ldHJpY0FmZmVjdGluZ1NwYW4uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzcyk7CisgICAgICAgICAgICBmb3IgKGludCBzcGFuU3RhcnQgPSBwYXJhU3RhcnQsIHNwYW5FbmQgPSBzcGFuU3RhcnQsIG5leHRTcGFuU3RhcnQ7CisgICAgICAgICAgICAgICAgICAgIHNwYW5TdGFydCA8IHBhcmFFbmQ7IHNwYW5TdGFydCA9IG5leHRTcGFuU3RhcnQpIHsKIAotICAgICAgICAgICAgICAgIGlmIChzcGFubmVkID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgcGFpbnQuZ2V0VGV4dFdpZHRocyhzdWIsIGksIG5leHQsIHdpZHRocyk7Ci0gICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkod2lkdGhzLCAwLCB3aWR0aHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5kIC0gc3RhcnQgKyAoaSAtIHN0YXJ0KSwgbmV4dCAtIGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICBwYWludC5nZXRGb250TWV0cmljc0ludChmbSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVdvcmtQYWludC5iYXNlbGluZVNoaWZ0ID0gMDsKKyAgICAgICAgICAgICAgICBpZiAoc3BhblN0YXJ0ID09IHNwYW5FbmQpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNwYW5uZWQgPT0gbnVsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwYW5FbmQgPSBwYXJhRW5kOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICBzcGFuRW5kID0gc3Bhbm5lZC5uZXh0U3BhblRyYW5zaXRpb24oc3BhblN0YXJ0LCBwYXJhRW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuLmNsYXNzKTsKIAotICAgICAgICAgICAgICAgICAgICBTdHlsZWQuZ2V0VGV4dFdpZHRocyhwYWludCwgbVdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Bhbm5lZCwgaSwgbmV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGhzLCBmbSk7Ci0gICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkod2lkdGhzLCAwLCB3aWR0aHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5kIC0gc3RhcnQgKyAoaSAtIHN0YXJ0KSwgbmV4dCAtIGkpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChtV29ya1BhaW50LmJhc2VsaW5lU2hpZnQgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmbS5hc2NlbnQgKz0gbVdvcmtQYWludC5iYXNlbGluZVNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgZm0udG9wICs9IG1Xb3JrUGFpbnQuYmFzZWxpbmVTaGlmdDsKKyAgICAgICAgICAgICAgICAgICAgaW50IHNwYW5MZW4gPSBzcGFuRW5kIC0gc3BhblN0YXJ0OworICAgICAgICAgICAgICAgICAgICBpZiAoc3Bhbm5lZCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtZWFzdXJlZC5hZGRTdHlsZVJ1bihwYWludCwgc3BhbkxlbiwgZm0pOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgZm0uZGVzY2VudCArPSBtV29ya1BhaW50LmJhc2VsaW5lU2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmbS5ib3R0b20gKz0gbVdvcmtQYWludC5iYXNlbGluZVNoaWZ0OworICAgICAgICAgICAgICAgICAgICAgICAgTWV0cmljQWZmZWN0aW5nU3BhbltdIHNwYW5zID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGFubmVkLmdldFNwYW5zKHNwYW5TdGFydCwgc3BhbkVuZCwgTWV0cmljQWZmZWN0aW5nU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBtZWFzdXJlZC5hZGRTdHlsZVJ1bihwYWludCwgc3BhbnMsIHNwYW5MZW4sIGZtKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgICAgIG5leHRTcGFuU3RhcnQgPSBzcGFuRW5kOworICAgICAgICAgICAgICAgIGludCBzdGFydEluUGFyYSA9IHNwYW5TdGFydCAtIHBhcmFTdGFydDsKKyAgICAgICAgICAgICAgICBpbnQgZW5kSW5QYXJhID0gc3BhbkVuZCAtIHBhcmFTdGFydDsKKwogICAgICAgICAgICAgICAgIGludCBmbXRvcCA9IGZtLnRvcDsKICAgICAgICAgICAgICAgICBpbnQgZm1ib3R0b20gPSBmbS5ib3R0b207CiAgICAgICAgICAgICAgICAgaW50IGZtYXNjZW50ID0gZm0uYXNjZW50OwogICAgICAgICAgICAgICAgIGludCBmbWRlc2NlbnQgPSBmbS5kZXNjZW50OwogCi0gICAgICAgICAgICAgICAgaWYgKGZhbHNlKSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgc2IgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBqID0gaTsgaiA8IG5leHQ7IGorKykgewotICAgICAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKHdpZHRoc1tqIC0gc3RhcnQgKyAoZW5kIC0gc3RhcnQpXSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJyAnKTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIExvZy5lKCJ0ZXh0Iiwgc2IudG9TdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IGk7IGogPCBuZXh0OyBqKyspIHsKLSAgICAgICAgICAgICAgICAgICAgY2hhciBjID0gY2hzW2ogLSBzdGFydF07CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IHNwYW5TdGFydDsgaiA8IHNwYW5FbmQ7IGorKykgeworICAgICAgICAgICAgICAgICAgICBjaGFyIGMgPSBjaHNbaiAtIHBhcmFTdGFydF07CiAgICAgICAgICAgICAgICAgICAgIGZsb2F0IGJlZm9yZSA9IHc7CiAKICAgICAgICAgICAgICAgICAgICAgaWYgKGMgPT0gJ1xuJykgewogICAgICAgICAgICAgICAgICAgICAgICAgOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGMgPT0gJ1x0JykgewotICAgICAgICAgICAgICAgICAgICAgICAgdyA9IExheW91dC5uZXh0VGFiKHN1Yiwgc3RhcnQsIGVuZCwgdywgbnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0YWIgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGMgPj0gMHhEODAwICYmIGMgPD0gMHhERkZGICYmIGogKyAxIDwgbmV4dCkgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50IGVtb2ppID0gQ2hhcmFjdGVyLmNvZGVQb2ludEF0KGNocywgaiAtIHN0YXJ0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoYXNUYWIgPT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNUYWIgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc1RhYk9yRW1vamkgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcGFubmVkICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRmlyc3QgdGFiIHRoaXMgcGFyYSwgY2hlY2sgZm9yIHRhYnN0b3BzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRhYlN0b3BTcGFuW10gc3BhbnMgPSBzcGFubmVkLmdldFNwYW5zKHBhcmFTdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhRW5kLCBUYWJTdG9wU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcGFucy5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWJTdG9wcyA9IG5ldyBUYWJTdG9wcyhUQUJfSU5DUkVNRU5ULCBzcGFucyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGFiU3RvcHMgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgPSB0YWJTdG9wcy5uZXh0VGFiKHcpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ID0gVGFiU3RvcHMubmV4dERlZmF1bHRTdG9wKHcsIFRBQl9JTkNSRU1FTlQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGMgPj0gMHhEODAwICYmIGMgPD0gMHhERkZGICYmIGogKyAxIDwgc3BhbkVuZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaW50IGVtb2ppID0gQ2hhcmFjdGVyLmNvZGVQb2ludEF0KGNocywgaiAtIHBhcmFTdGFydCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbW9qaSA+PSBNSU5fRU1PSkkgJiYgZW1vamkgPD0gTUFYX0VNT0pJKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQml0bWFwIGJtID0gRU1PSklfRkFDVE9SWS4KQEAgLTM3NiwyMSArMjk1LDIxIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGljaFBhaW50ID0gbVdvcmtQYWludDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHdpZCA9IChmbG9hdCkgYm0uZ2V0V2lkdGgoKSAqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHdpZCA9IGJtLmdldFdpZHRoKCkgKgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtd2hpY2hQYWludC5hc2NlbnQoKSAvCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJtLmdldEhlaWdodCgpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgKz0gd2lkOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWIgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNUYWJPckVtb2ppID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaisrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgKz0gd2lkdGhzW2ogLSBzdGFydCArIChlbmQgLSBzdGFydCldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ICs9IHdpZHRoc1tqIC0gcGFyYVN0YXJ0XTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgKz0gd2lkdGhzW2ogLSBzdGFydCArIChlbmQgLSBzdGFydCldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcgKz0gd2lkdGhzW2ogLSBwYXJhU3RhcnRdOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgdyArPSB3aWR0aHNbaiAtIHN0YXJ0ICsgKGVuZCAtIHN0YXJ0KV07CisgICAgICAgICAgICAgICAgICAgICAgICB3ICs9IHdpZHRoc1tqIC0gcGFyYVN0YXJ0XTsKICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgIC8vIExvZy5lKCJ0ZXh0IiwgIndhcyAiICsgYmVmb3JlICsgIiBub3cgIiArIHcgKyAiIGFmdGVyICIgKyBjICsgIiB3aXRoaW4gIiArIHdpZHRoKTsKQEAgLTQxMSw3ICszMzAsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgLyoKICAgICAgICAgICAgICAgICAgICAgICAgICAqIEZyb20gdGhlIFVuaWNvZGUgTGluZSBCcmVha2luZyBBbGdvcml0aG06CiAgICAgICAgICAgICAgICAgICAgICAgICAgKiAoYXQgbGVhc3QgYXBwcm94aW1hdGVseSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAqCiAgICAgICAgICAgICAgICAgICAgICAgICAgKiAuLDo7IGFyZSBjbGFzcyBJUzogYnJlYWtwb2ludHMKICAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgZXhjZXB0IHdoZW4gYWRqYWNlbnQgdG8gZGlnaXRzCiAgICAgICAgICAgICAgICAgICAgICAgICAgKiAvICAgIGlzIGNsYXNzIFNZOiBhIGJyZWFrcG9pbnQKQEAgLTQyNiwxMiArMzQ1LDEyIEBACiAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjID09ICcgJyB8fCBjID09ICdcdCcgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGMgPT0gJy4nICB8fCBjID09ICcsJyB8fCBjID09ICc6JyB8fCBjID09ICc7JykgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGogLSAxIDwgaGVyZSB8fCAhQ2hhcmFjdGVyLmlzRGlnaXQoY2hzW2ogLSAxIC0gc3RhcnRdKSkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGogKyAxID49IG5leHQgfHwgIUNoYXJhY3Rlci5pc0RpZ2l0KGNoc1tqICsgMSAtIHN0YXJ0XSkpKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaiAtIDEgPCBoZXJlIHx8ICFDaGFyYWN0ZXIuaXNEaWdpdChjaHNbaiAtIDEgLSBwYXJhU3RhcnRdKSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGogKyAxID49IHNwYW5FbmQgfHwgIUNoYXJhY3Rlci5pc0RpZ2l0KGNoc1tqICsgMSAtIHBhcmFTdGFydF0pKSkgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGMgPT0gJy8nIHx8IGMgPT0gJy0nKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaiArIDEgPj0gbmV4dCB8fCAhQ2hhcmFjdGVyLmlzRGlnaXQoY2hzW2ogKyAxIC0gc3RhcnRdKSkpIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChqICsgMSA+PSBzcGFuRW5kIHx8ICFDaGFyYWN0ZXIuaXNEaWdpdChjaHNbaiArIDEgLSBwYXJhU3RhcnRdKSkpIHx8CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGMgPj0gRklSU1RfQ0pLICYmIGlzSWRlb2dyYXBoaWMoYywgdHJ1ZSkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiArIDEgPCBuZXh0ICYmIGlzSWRlb2dyYXBoaWMoY2hzW2ogKyAxIC0gc3RhcnRdLCBmYWxzZSkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGogKyAxIDwgc3BhbkVuZCAmJiBpc0lkZW9ncmFwaGljKGNoc1tqICsgMSAtIHBhcmFTdGFydF0sIGZhbHNlKSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBva3dpZHRoID0gdzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvayA9IGogKyAxOwogCkBAIC00NDgsNyArMzY3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvayAhPSBoZXJlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTG9nLmUoInRleHQiLCAib3V0cHV0IG9rICIgKyBoZXJlICsgIiB0byAiICtvayk7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAob2sgPCBuZXh0ICYmIGNoc1tvayAtIHN0YXJ0XSA9PSAnICcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAob2sgPCBzcGFuRW5kICYmIGNoc1tvayAtIHBhcmFTdGFydF0gPT0gJyAnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9rKys7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCkBAIC00NTcsMTAgKzM3NiwxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2thc2NlbnQsIG9rZGVzY2VudCwgb2t0b3AsIG9rYm90dG9tLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNpbmdtdWx0LCBzcGFjaW5nYWRkLCBjaG9vc2VodCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIHRhYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgc3RhcnQsIGNoZGlycywgZGlyLCBlYXN5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hvb3NlaHR2LCBmbSwgaGFzVGFiT3JFbW9qaSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgcGFyYVN0YXJ0LCBjaGRpcnMsIGRpciwgZWFzeSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9rID09IGJ1ZmVuZCwgaW5jbHVkZXBhZCwgdHJhY2twYWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aHMsIHN0YXJ0LCBlbmQgLSBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNocywgd2lkdGhzLCBoZXJlIC0gcGFyYVN0YXJ0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hlcmUsIGVsbGlwc2l6ZWRXaWR0aCwgb2t3aWR0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50KTsKIApAQCAtNDg0LDcgKzQwMyw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob2sgIT0gaGVyZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIExvZy5lKCJ0ZXh0IiwgIm91dHB1dCBvayAiICsgaGVyZSArICIgdG8gIiArb2spOwogCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKG9rIDwgbmV4dCAmJiBjaHNbb2sgLSBzdGFydF0gPT0gJyAnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKG9rIDwgc3BhbkVuZCAmJiBjaHNbb2sgLSBwYXJhU3RhcnRdID09ICcgJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvaysrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIApAQCAtNDkzLDEwICs0MTIsMTAgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9rYXNjZW50LCBva2Rlc2NlbnQsIG9rdG9wLCBva2JvdHRvbSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGFjaW5nbXVsdCwgc3BhY2luZ2FkZCwgY2hvb3NlaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaG9vc2VodHYsIGZtLCB0YWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHN0YXJ0LCBjaGRpcnMsIGRpciwgZWFzeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIGhhc1RhYk9yRW1vamksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHBhcmFTdGFydCwgY2hkaXJzLCBkaXIsIGVhc3ksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvayA9PSBidWZlbmQsIGluY2x1ZGVwYWQsIHRyYWNrcGFkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGhzLCBzdGFydCwgZW5kIC0gc3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaHMsIHdpZHRocywgaGVyZSAtIHBhcmFTdGFydCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoZXJlLCBlbGxpcHNpemVkV2lkdGgsIG9rd2lkdGgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWludCk7CiAKQEAgLTUwOSwxOSArNDI4LDIwIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXR0b3AsIGZpdGJvdHRvbSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGFjaW5nbXVsdCwgc3BhY2luZ2FkZCwgY2hvb3NlaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaG9vc2VodHYsIGZtLCB0YWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHN0YXJ0LCBjaGRpcnMsIGRpciwgZWFzeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIGhhc1RhYk9yRW1vamksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHBhcmFTdGFydCwgY2hkaXJzLCBkaXIsIGVhc3ksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXQgPT0gYnVmZW5kLCBpbmNsdWRlcGFkLCB0cmFja3BhZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRocywgc3RhcnQsIGVuZCAtIHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hzLCB3aWR0aHMsIGhlcmUgLSBwYXJhU3RhcnQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGVyZSwgZWxsaXBzaXplZFdpZHRoLCBmaXR3aWR0aCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlcmUgPSBmaXQ7CiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIExvZy5lKCJ0ZXh0IiwgIm91dHB1dCBvbmUgIiArIGhlcmUgKyAiIHRvICIgKyhoZXJlICsgMSkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lYXN1cmVUZXh0KHBhaW50LCBtV29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZSwgaGVyZSwgaGVyZSArIDEsIGZtLCB0YWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gWFhYIG5vdCBzdXJlIHdoeSB0aGUgZXhpc3RpbmcgZm0gd2Fzbid0IG9rLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1lYXN1cmVUZXh0KHBhaW50LCBtV29ya1BhaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgIHNvdXJjZSwgaGVyZSwgaGVyZSArIDEsIGZtLCB0YWIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgbnVsbCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gb3V0KHNvdXJjZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlcmUsIGhlcmUrMSwKQEAgLTUyOSwxOSArNDQ5LDIyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbS50b3AsIGZtLmJvdHRvbSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGFjaW5nbXVsdCwgc3BhY2luZ2FkZCwgY2hvb3NlaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaG9vc2VodHYsIGZtLCB0YWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHN0YXJ0LCBjaGRpcnMsIGRpciwgZWFzeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIGhhc1RhYk9yRW1vamksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHBhcmFTdGFydCwgY2hkaXJzLCBkaXIsIGVhc3ksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZXJlICsgMSA9PSBidWZlbmQsIGluY2x1ZGVwYWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFja3BhZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRocywgc3RhcnQsIGVuZCAtIHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hzLCB3aWR0aHMsIGhlcmUgLSBwYXJhU3RhcnQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGVyZSwgZWxsaXBzaXplZFdpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGhzW2hlcmUgLSBzdGFydF0sIHBhaW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoc1toZXJlIC0gcGFyYVN0YXJ0XSwgcGFpbnQpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVyZSA9IGhlcmUgKyAxOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGVyZSA8IGkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gbmV4dCA9IGhlcmU7IC8vIG11c3QgcmVtZWFzdXJlCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGVyZSA8IHNwYW5TdGFydCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRpZG4ndCBvdXRwdXQgYWxsIHRoZSB0ZXh0IGZvciB0aGlzIHNwYW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSd2ZSBtZWFzdXJlZCB0aGUgcmF3IHdpZHRocywgdGhvdWdoLCBzbworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGp1c3QgcmVzZXQgdGhlIHN0YXJ0IHBvaW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaiA9IG5leHRTcGFuU3RhcnQgPSBoZXJlOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqID0gaGVyZSAtIDE7ICAgIC8vIGNvbnRpbnVlIGxvb3BpbmcKICAgICAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTU1MSwxNCArNDc0LDE0IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBmaXRhc2NlbnQgPSBmaXRkZXNjZW50ID0gZml0dG9wID0gZml0Ym90dG9tID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgIG9rYXNjZW50ID0gb2tkZXNjZW50ID0gb2t0b3AgPSBva2JvdHRvbSA9IDA7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICgtLWZpcnN0V2lkdGhMaW5lQ291bnQgPD0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC0tZmlyc3RXaWR0aExpbmVMaW1pdCA8PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGggPSByZXN0d2lkdGg7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgIGlmIChlbmQgIT0gaGVyZSkgeworICAgICAgICAgICAgaWYgKHBhcmFFbmQgIT0gaGVyZSkgewogICAgICAgICAgICAgICAgIGlmICgoZml0dG9wIHwgZml0Ym90dG9tIHwgZml0ZGVzY2VudCB8IGZpdGFzY2VudCkgPT0gMCkgewogICAgICAgICAgICAgICAgICAgICBwYWludC5nZXRGb250TWV0cmljc0ludChmbSk7CiAKQEAgLTU3MSwyMCArNDk0LDIwIEBACiAgICAgICAgICAgICAgICAgLy8gTG9nLmUoInRleHQiLCAib3V0cHV0IHJlc3QgIiArIGhlcmUgKyAiIHRvICIgKyBlbmQpOwogCiAgICAgICAgICAgICAgICAgdiA9IG91dChzb3VyY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICBoZXJlLCBlbmQsIGZpdGFzY2VudCwgZml0ZGVzY2VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGhlcmUsIHBhcmFFbmQsIGZpdGFzY2VudCwgZml0ZGVzY2VudCwKICAgICAgICAgICAgICAgICAgICAgICAgIGZpdHRvcCwgZml0Ym90dG9tLAogICAgICAgICAgICAgICAgICAgICAgICAgdiwKICAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNpbmdtdWx0LCBzcGFjaW5nYWRkLCBjaG9vc2VodCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIHRhYiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgc3RhcnQsIGNoZGlycywgZGlyLCBlYXN5LAotICAgICAgICAgICAgICAgICAgICAgICAgZW5kID09IGJ1ZmVuZCwgaW5jbHVkZXBhZCwgdHJhY2twYWQsCi0gICAgICAgICAgICAgICAgICAgICAgICB3aWR0aHMsIHN0YXJ0LCBlbmQgLSBzdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNob29zZWh0diwgZm0sIGhhc1RhYk9yRW1vamksCisgICAgICAgICAgICAgICAgICAgICAgICBuZWVkTXVsdGlwbHksIHBhcmFTdGFydCwgY2hkaXJzLCBkaXIsIGVhc3ksCisgICAgICAgICAgICAgICAgICAgICAgICBwYXJhRW5kID09IGJ1ZmVuZCwgaW5jbHVkZXBhZCwgdHJhY2twYWQsCisgICAgICAgICAgICAgICAgICAgICAgICBjaHMsIHdpZHRocywgaGVyZSAtIHBhcmFTdGFydCwKICAgICAgICAgICAgICAgICAgICAgICAgIHdoZXJlLCBlbGxpcHNpemVkV2lkdGgsIHcsIHBhaW50KTsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgc3RhcnQgPSBlbmQ7CisgICAgICAgICAgICBwYXJhU3RhcnQgPSBwYXJhRW5kOwogCi0gICAgICAgICAgICBpZiAoZW5kID09IGJ1ZmVuZCkKKyAgICAgICAgICAgIGlmIChwYXJhRW5kID09IGJ1ZmVuZCkKICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgfQogCkBAIC01OTksMjQ2ICs1MjIsMTMgQEAKICAgICAgICAgICAgICAgICAgICAgdiwKICAgICAgICAgICAgICAgICAgICAgc3BhY2luZ211bHQsIHNwYWNpbmdhZGQsIG51bGwsCiAgICAgICAgICAgICAgICAgICAgIG51bGwsIGZtLCBmYWxzZSwKLSAgICAgICAgICAgICAgICAgICAgbmVlZE11bHRpcGx5LCBidWZlbmQsIGNoZGlycywgREVGQVVMVF9ESVIsIHRydWUsCisgICAgICAgICAgICAgICAgICAgIG5lZWRNdWx0aXBseSwgYnVmZW5kLCBudWxsLCBERUZBVUxUX0RJUiwgdHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgdHJ1ZSwgaW5jbHVkZXBhZCwgdHJhY2twYWQsCi0gICAgICAgICAgICAgICAgICAgIHdpZHRocywgYnVmc3RhcnQsIDAsCisgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIGJ1ZnN0YXJ0LAogICAgICAgICAgICAgICAgICAgICB3aGVyZSwgZWxsaXBzaXplZFdpZHRoLCAwLCBwYWludCk7CiAgICAgICAgIH0KICAgICB9CiAKLSAgICAvKioKLSAgICAgKiBSdW5zIHRoZSB1bmljb2RlIGJpZGkgYWxnb3JpdGhtIG9uIHRoZSBmaXJzdCBuIGNoYXJzIGluIGNocywgcmV0dXJuaW5nCi0gICAgICogdGhlIGNoYXIgZGlycyBpbiBjaEluZm8gYW5kIHRoZSBiYXNlIGxpbmUgZGlyZWN0aW9uIG9mIHRoZSBmaXJzdAotICAgICAqIHBhcmFncmFwaC4KLSAgICAgKiAKLSAgICAgKiBYWFggY2hhbmdlIHJlc3VsdCBmcm9tIGRpcnMgdG8gbGV2ZWxzCi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AgIEFuZHJvaWRDaGFyYWN0ZXIuZ2V0RGlyZWN0aW9uYWxpdGllcyhjaHMsIGNoSW5mbywgbik7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogRGV0ZXJtaW5lIHByaW1hcnkgcGFyYWdyYXBoIGRpcmVjdGlvbiBpZiBub3Qgc3BlY2lmaWVkCi0gICAgICAgICAqLwotICAgICAgICBpZiAoZGlyICE9IERJUl9SRVFVRVNUX0xUUiAmJiBkaXIgIT0gRElSX1JFUVVFU1RfUlRMKSB7Ci0gICAgICAgICAgICAvLyBzZXQgdXAgZGVmYXVsdAotICAgICAgICAgICAgZGlyID0gZGlyID49IDAgPyBESVJfTEVGVF9UT19SSUdIVCA6IERJUl9SSUdIVF9UT19MRUZUOwotICAgICAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBuOyBqKyspIHsKLSAgICAgICAgICAgICAgICBpbnQgZCA9IGNoSW5mb1tqXTsKLQotICAgICAgICAgICAgICAgIGlmIChkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9MRUZUX1RPX1JJR0hUKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRpciA9IERJUl9MRUZUX1RPX1JJR0hUOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQpIHsKLSAgICAgICAgICAgICAgICAgICAgZGlyID0gRElSX1JJR0hUX1RPX0xFRlQ7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGZpbmFsIGJ5dGUgU09SID0gZGlyID09IERJUl9MRUZUX1RPX1JJR0hUID8KLSAgICAgICAgICAgICAgICBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfTEVGVF9UT19SSUdIVCA6Ci0gICAgICAgICAgICAgICAgQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQ7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogWFhYIEV4cGxpY2l0IG92ZXJyaWRlcyBzaG91bGQgZ28gaGVyZQotICAgICAgICAgKi8KLQotICAgICAgICAvKgotICAgICAgICAgKiBXZWFrIHR5cGUgcmVzb2x1dGlvbgotICAgICAgICAgKi8KLQotICAgICAgICAvLyBkdW1wKGNoZGlycywgbiwgImluaXRpYWwiKTsKLQotICAgICAgICAvLyBXMSBub24gc3BhY2luZyBtYXJrcwotICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IG47IGorKykgewotICAgICAgICAgICAgaWYgKGNoSW5mb1tqXSA9PSBDaGFyYWN0ZXIuTk9OX1NQQUNJTkdfTUFSSykgewotICAgICAgICAgICAgICAgIGlmIChqID09IDApCi0gICAgICAgICAgICAgICAgICAgIGNoSW5mb1tqXSA9IFNPUjsKLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIGNoSW5mb1tqXSA9IGNoSW5mb1tqIC0gMV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBkdW1wKGNoZGlycywgbiwgIlcxIik7Ci0KLSAgICAgICAgLy8gVzIgZXVyb3BlYW4gbnVtYmVycwotICAgICAgICBieXRlIGN1ciA9IFNPUjsKLSAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBuOyBqKyspIHsKLSAgICAgICAgICAgIGJ5dGUgZCA9IGNoSW5mb1tqXTsKLQotICAgICAgICAgICAgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0xFRlRfVE9fUklHSFQgfHwKLSAgICAgICAgICAgICAgICBkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9SSUdIVF9UT19MRUZUIHx8Ci0gICAgICAgICAgICAgICAgZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUklHSFRfVE9fTEVGVF9BUkFCSUMpCi0gICAgICAgICAgICAgICAgY3VyID0gZDsKLSAgICAgICAgICAgIGVsc2UgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUikgewotICAgICAgICAgICAgICAgICBpZiAoY3VyID09Ci0gICAgICAgICAgICAgICAgICAgIENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9SSUdIVF9UT19MRUZUX0FSQUJJQykKLSAgICAgICAgICAgICAgICAgICAgY2hJbmZvW2pdID0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0FSQUJJQ19OVU1CRVI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBkdW1wKGNoZGlycywgbiwgIlcyIik7Ci0KLSAgICAgICAgLy8gVzMgYXJhYmljIGxldHRlcnMKLSAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBuOyBqKyspIHsKLSAgICAgICAgICAgIGlmIChjaEluZm9bal0gPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlRfQVJBQklDKQotICAgICAgICAgICAgICAgIGNoSW5mb1tqXSA9IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9SSUdIVF9UT19MRUZUOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gZHVtcChjaGRpcnMsIG4sICJXMyIpOwotCi0gICAgICAgIC8vIFc0IHNpbmdsZSBzZXBhcmF0b3IgYmV0d2VlbiBudW1iZXJzCi0gICAgICAgIGZvciAoaW50IGogPSAxOyBqIDwgbiAtIDE7IGorKykgewotICAgICAgICAgICAgYnl0ZSBkID0gY2hJbmZvW2pdOwotICAgICAgICAgICAgYnl0ZSBwcmV2ID0gY2hJbmZvW2ogLSAxXTsKLSAgICAgICAgICAgIGJ5dGUgbmV4dCA9IGNoSW5mb1tqICsgMV07Ci0KLSAgICAgICAg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gICAvLyBkdW1wKGNoZGlycywgbiwgIlc0Iik7Ci0KLSAgICAgICAgLy8gVzUgZXVyb3BlYW4gbnVtYmVyIHRlcm1pbmF0b3JzCi0gICAgICAgIGJvb2xlYW4gYWRqYWNlbnQgPSBmYWxzZTsKLSAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBuOyBqKyspIHsKLSAgICAgICAgICAgIGJ5dGUgZCA9IGNoSW5mb1tqXTsKLQotICAgICAgICAgICAgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUikKLSAgICAgICAgICAgICAgICBhZGphY2VudCA9IHRydWU7Ci0gICAgICAgICAgICBlbHNlIGlmIChkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9FVVJPUEVBTl9OVU1CRVJfVEVSTUlOQVRPUiAmJiBhZGphY2VudCkKLSAgICAgICAgICAgICAgICBjaEluZm9bal0gPSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfRVVST1BFQU5fTlVNQkVSOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIGFkamFjZW50ID0gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICAvL2R1bXAoY2hkaXJzLCBuLCAiVzUiKTsKLQotICAgICAgICAvLyBXNSBldXJvcGVhbiBudW1iZXIgdGVybWluYXRvcnMgcGFydCAyLAotICAgICAgICAvLyBXNiBzZXBhcmF0b3JzIGFuZCB0ZXJtaW5hdG9ycwotICAgICAgICBhZGphY2VudCA9IGZhbHNlOwotICAgICAgICBmb3IgKGludCBqID0gbiAtIDE7IGogPj0gMDsgai0tKSB7Ci0gICAgICAgICAgICBieXRlIGQgPSBjaEluZm9bal07Ci0KLSAgICAgICAgICAgIGlmIChkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9FVVJPUEVBTl9OVU1CRVIpCi0gICAgICAgICAgICAgICAgYWRqYWNlbnQgPSB0cnVlOwotICAgICAgICAgICAgZWxzZSBpZiAoZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfRVVST1BFQU5fTlVNQkVSX1RFUk1JTkFUT1IpIHsKLSAgICAgICAgICAgICAgICBpZiAoYWRqYWNlbnQpCi0gICAgICAgICAgICAgICAgICAgIGNoSW5mb1tqXSA9IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9FVVJPUEVBTl9OVU1CRVI7Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICBjaEluZm9bal0gPSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfT1RIRVJfTkVVVFJBTFM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICBhZGphY2VudCA9IGZhbHNlOwotCi0gICAgICAgICAgICAgICAgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUl9TRVBBUkFUT1IgfHwKLSAgICAgICAgICAgICAgICAgICAgZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfQ09NTU9OX05VTUJFUl9TRVBBUkFUT1IgfHwKLSAgICAgICAgICAgICAgICAgICAgZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUEFSQUdSQVBIX1NFUEFSQVRPUiB8fAotICAgICAgICAgICAgICAgICAgICBkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9TRUdNRU5UX1NFUEFSQVRPUikKLSAgICAgICAgICAgICAgICAgICAgY2hJbmZvW2pdID0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX09USEVSX05FVVRSQUxTOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLy8gZHVtcChjaGRpcnMsIG4sICJXNiIpOwotCi0gICAgICAgIC8vIFc3IHN0cm9uZyBkaXJlY3Rpb24gb2YgZXVyb3BlYW4gbnVtYmVycwotICAgICAgICBjdXIgPSBTT1I7Ci0gICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgbjsgaisrKSB7Ci0gICAgICAgICAgICBieXRlIGQgPSBjaEluZm9bal07Ci0KLSAgICAgICAgICAgIGlmIChkID09IFNPUiB8fAotICAgICAgICAgICAgICAgIGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0xFRlRfVE9fUklHSFQgfHwKLSAgICAgICAgICAgICAgICBkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9SSUdIVF9UT19MRUZUKQotICAgICAgICAgICAgICAgIGN1ciA9IGQ7Ci0KLSAgICAgICAgICAgIGlmIChkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9FVVJPUEVBTl9OVU1CRVIpCi0gICAgICAgICAgICAgICAgY2hJbmZvW2pdID0gY3VyOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gZHVtcChjaGRpcnMsIG4sICJXNyIpOwotCi0gICAgICAgIC8vIE4xLCBOMiBuZXV0cmFscwotICAgICAgICBjdXIgPSBTT1I7Ci0gICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgbjsgaisrKSB7Ci0gICAgICAgICAgICBieXRlIGQgPSBjaEluZm9bal07Ci0KLSAgICAgICAgICAgIGlmIChkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9MRUZUX1RPX1JJR0hUIHx8Ci0gICAgICAgICAgICAgICAgZCA9PSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgIGN1ciA9IGQ7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUiB8fAotICAgICAgICAgICAgICAgICAgICAgICBkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9BUkFCSUNfTlVNQkVSKSB7Ci0gICAgICAgICAgICAgICAgY3VyID0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQ7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGJ5dGUgZGQgPSBTT1I7Ci0gICAgICAgICAgICAgICAgaW50IGs7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGsgPSBqICsgMTsgayA8IG47IGsrKykgewotICAgICAgICAgICAgICAgICAgICBkZCA9IGNoSW5mb1trXTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoZGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0xFRlRfVE9fUklHSFQgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgIGRkID09IENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9SSUdIVF9UT19MRUZUKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoZGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0VVUk9QRUFOX05VTUJFUiB8fAotICAgICAgICAgICAgICAgICAgICAgICAgZGQgPT0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0FSQUJJQ19OVU1CRVIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRkID0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGZvciAoaW50IHkgPSBqOyB5IDwgazsgeSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChkZCA9PSBjdXIpCi0gICAgICAgICAgICAgICAgICAgICAgICBjaEluZm9beV0gPSBjdXI7Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoSW5mb1t5XSA9IFNPUjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBqID0gayAtIDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBkdW1wKGNoZGlycywgbiwgImZpbmFsIik7Ci0KLSAgICAgICAgLy8gZXh0cmE6IGVuZm9yY2UgdGhhdCBhbGwgdGFicyBhbmQgc3Vycm9nYXRlIGNoYXJhY3RlcnMgZ28gdGhlCi0gICAgICAgIC8vIHByaW1hcnkgZGlyZWN0aW9uCi0gICAgICAgIC8vIFRPRE86IGFjdHVhbGx5IGRvIGRpcmVjdGlvbnMgcmlnaHQgZm9yIHN1cnJvZ2F0ZXMKLQotICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IG47IGorKykgewotICAgICAgICAgICAgY2hhciBjID0gY2hzW2pdOwotCi0gICAgICAgICAgICBpZiAoYyA9PSAnXHQnIHx8IChjID49IDB4RDgwMCAmJiBjIDw9IDB4REZGRikpIHsKLSAgICAgICAgICAgICAgICBjaEluZm9bal0gPSBTT1I7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIHJldHVybiBkaXI7Ci0gICAgfQotCiAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgY2hhciBGSVJTVF9DSksgPSAnXHUyRTgwJzsKICAgICAvKioKICAgICAgKiBSZXR1cm5zIHRydWUgaWYgdGhlIHNwZWNpZmllZCBjaGFyYWN0ZXIgaXMgb25lIG9mIHRob3NlIHNwZWNpZmllZApAQCAtOTQ0LDM3ICs2MzQsMTUgQEAKICAgICB9CiAqLwogCi0gICAgcHJpdmF0ZSBzdGF0aWMgaW50IGdldEZpdChUZXh0UGFpbnQgcGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICBDaGFyU2VxdWVuY2UgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLAotICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB3aWQpIHsKLSAgICAgICAgaW50IGhpZ2ggPSBlbmQgKyAxLCBsb3cgPSBzdGFydCAtIDEsIGd1ZXNzOwotCi0gICAgICAgIHdoaWxlIChoaWdoIC0gbG93ID4gMSkgewotICAgICAgICAgICAgZ3Vlc3MgPSAoaGlnaCArIGxvdykgLyAyOwotCi0gICAgICAgICAgICBpZiAobWVhc3VyZVRleHQocGFpbnQsIHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LCBzdGFydCwgZ3Vlc3MsIG51bGwsIHRydWUsIG51bGwpID4gd2lkKQotICAgICAgICAgICAgICAgIGhpZ2ggPSBndWVzczsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBsb3cgPSBndWVzczsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChsb3cgPCBzdGFydCkKLSAgICAgICAgICAgIHJldHVybiBzdGFydDsKLSAgICAgICAgZWxzZQotICAgICAgICAgICAgcmV0dXJuIGxvdzsKLSAgICB9Ci0KICAgICBwcml2YXRlIGludCBvdXQoQ2hhclNlcXVlbmNlIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwKICAgICAgICAgICAgICAgICAgICAgICBpbnQgYWJvdmUsIGludCBiZWxvdywgaW50IHRvcCwgaW50IGJvdHRvbSwgaW50IHYsCiAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgc3BhY2luZ211bHQsIGZsb2F0IHNwYWNpbmdhZGQsCiAgICAgICAgICAgICAgICAgICAgICAgTGluZUhlaWdodFNwYW5bXSBjaG9vc2VodCwgaW50W10gY2hvb3NlaHR2LAotICAgICAgICAgICAgICAgICAgICAgIFBhaW50LkZvbnRNZXRyaWNzSW50IGZtLCBib29sZWFuIHRhYiwKKyAgICAgICAgICAgICAgICAgICAgICBQYWludC5Gb250TWV0cmljc0ludCBmbSwgYm9vbGVhbiBoYXNUYWJPckVtb2ppLAogICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gbmVlZE11bHRpcGx5LCBpbnQgcHN0YXJ0LCBieXRlW10gY2hkaXJzLAogICAgICAgICAgICAgICAgICAgICAgIGludCBkaXIsIGJvb2xlYW4gZWFzeSwgYm9vbGVhbiBsYXN0LAogICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaW5jbHVkZXBhZCwgYm9vbGVhbiB0cmFja3BhZCwKLSAgICAgICAgICAgICAgICAgICAgICBmbG9hdFtdIHdpZHRocywgaW50IHdpZHN0YXJ0LCBpbnQgd2lkb2ZmLAorICAgICAgICAgICAgICAgICAgICAgIGNoYXJbXSBjaHMsIGZsb2F0W10gd2lkdGhzLCBpbnQgd2lkc3RhcnQsCiAgICAgICAgICAgICAgICAgICAgICAgVGV4dFV0aWxzLlRydW5jYXRlQXQgZWxsaXBzaXplLCBmbG9hdCBlbGxpcHNpc3dpZHRoLAogICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHRleHR3aWR0aCwgVGV4dFBhaW50IHBhaW50KSB7CiAgICAgICAgIGludCBqID0gbUxpbmVDb3VudDsKQEAgLTk4Miw4ICs2NTAsNiBAQAogICAgICAgICBpbnQgd2FudCA9IG9mZiArIG1Db2x1bW5zICsgVE9QOwogICAgICAgICBpbnRbXSBsaW5lcyA9IG1MaW5lczsKIAotICAgICAgICAvLyBMb2cuZSgidGV4dCIsICJsaW5lICIgKyBzdGFydCArICIgdG8gIiArIGVuZCArIChsYXN0ID8gIj09PSIgOiAiIikpOwotCiAgICAgICAgIGlmICh3YW50ID49IGxpbmVzLmxlbmd0aCkgewogICAgICAgICAgICAgaW50IG5sZW4gPSBBcnJheVV0aWxzLmlkZWFsSW50QXJyYXlTaXplKHdhbnQgKyAxKTsKICAgICAgICAgICAgIGludFtdIGdyb3cgPSBuZXcgaW50W25sZW5dOwpAQCAtMTA1OSw1OSArNzI1LDIzIEBACiAgICAgICAgIGxpbmVzW29mZiArIG1Db2x1bW5zICsgU1RBUlRdID0gZW5kOwogICAgICAgICBsaW5lc1tvZmYgKyBtQ29sdW1ucyArIFRPUF0gPSB2OwogCi0gICAgICAgIGlmICh0YWIpCisgICAgICAgIGlmIChoYXNUYWJPckVtb2ppKQogICAgICAgICAgICAgbGluZXNbb2ZmICsgVEFCXSB8PSBUQUJfTUFTSzsKIAotICAgICAgICB7Ci0gICAgICAgICAgICBsaW5lc1tvZmYgKyBESVJdIHw9IGRpciA8PCBESVJfU0hJRlQ7Ci0KLSAgICAgICAgICAgIGludCBjdXIgPSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfTEVGVF9UT19SSUdIVDsKLSAgICAgICAgICAgIGludCBjb3VudCA9IDA7Ci0KLSAgICAgICAgICAgIGlmICghZWFzeSkgewotICAgICAgICAgICAgICAgIGZvciAoaW50IGsgPSBzdGFydDsgayA8IGVuZDsgaysrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjaGRpcnNbayAtIHBzdGFydF0gIT0gY3VyKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb3VudCsrOwotICAgICAgICAgICAgICAgICAgICAgICAgY3VyID0gY2hkaXJzW2sgLSBwc3RhcnRdOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBEaXJlY3Rpb25zIGxpbmVkaXJzOwotCi0gICAgICAgICAgICBpZiAoY291bnQgPT0gMCkgewotICAgICAgICAgICAgICAgIGxpbmVkaXJzID0gRElSU19BTExfTEVGVF9UT19SSUdIVDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc2hvcnRbXSBsZCA9IG5ldyBzaG9ydFtjb3VudCArIDFdOwotCi0gICAgICAgICAgICAgICAgY3VyID0gQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX0xFRlRfVE9fUklHSFQ7Ci0gICAgICAgICAgICAgICAgY291bnQgPSAwOwotICAgICAgICAgICAgICAgIGludCBoZXJlID0gc3RhcnQ7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGludCBrID0gc3RhcnQ7IGsgPCBlbmQ7IGsrKykgewotICAgICAgICAgICAgICAgICAgICBpZiAoY2hkaXJzW2sgLSBwc3RhcnRdICE9IGN1cikgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gWFhYIGNoZWNrIHRvIG1ha2Ugc3VyZSB3ZSBkb24ndAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgIG92ZXJmbG93IHNob3J0Ci0gICAgICAgICAgICAgICAgICAgICAgICBsZFtjb3VudCsrXSA9IChzaG9ydCkgKGsgLSBoZXJlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGN1ciA9IGNoZGlyc1trIC0gcHN0YXJ0XTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGhlcmUgPSBrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbGRbY291bnRdID0gKHNob3J0KSAoZW5kIC0gaGVyZSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoY291bnQgPT0gMSAmJiBsZFswXSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxpbmVkaXJzID0gRElSU19BTExfUklHSFRfVE9fTEVGVDsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBsaW5lZGlycyA9IG5ldyBEaXJlY3Rpb25zKGxkKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KKyAgICAgICAgbGluZXNbb2ZmICsgRElSXSB8PSBkaXIgPDwgRElSX1NISUZUOworICAgICAgICBEaXJlY3Rpb25zIGxpbmVkaXJzID0gRElSU19BTExfTEVGVF9UT19SSUdIVDsKKyAgICAgICAgLy8gZWFzeSBtZWFucyBhbGwgY2hhcnMgPCB0aGUgZmlyc3QgUlRMLCBzbyBubyBlbW9qaSwgbm8gbm90aGluZworIC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TIsNyBAQAogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCBjYWxjdWxhdGVFbGxpcHNpcyhpbnQgbGluZXN0YXJ0LCBpbnQgbGluZWVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXRbXSB3aWR0aHMsIGludCB3aWRzdGFydCwgaW50IHdpZG9mZiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXRbXSB3aWR0aHMsIGludCB3aWRzdGFydCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgYXZhaWwsIFRleHRVdGlscy5UcnVuY2F0ZUF0IHdoZXJlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbGluZSwgZmxvYXQgdGV4dHdpZHRoLCBUZXh0UGFpbnQgcGFpbnQpIHsKICAgICAgICAgaW50IGxlbiA9IGxpbmVlbmQgLSBsaW5lc3RhcnQ7CkBAIC0xMTQyLDcgKzc3Miw3IEBACiAgICAgICAgICAgICBpbnQgaTsKIAogICAgICAgICAgICAgZm9yIChpID0gbGVuOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgICAgIGZsb2F0IHcgPSB3aWR0aHNbaSAtIDEgKyBsaW5lc3RhcnQgLSB3aWRzdGFydCArIHdpZG9mZl07CisgICAgICAgICAgICAgICAgZmxvYXQgdyA9IHdpZHRoc1tpIC0gMSArIGxpbmVzdGFydCAtIHdpZHN0YXJ0XTsKIAogICAgICAgICAgICAgICAgIGlmICh3ICsgc3VtICsgZWxsaXBzaXN3aWQgPiBhdmFpbCkgewogICAgICAgICAgICAgICAgICAgICBicmVhazsKQEAgLTExNTgsNyArNzg4LDcgQEAKICAgICAgICAgICAgIGludCBpOwogCiAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVuOyBpKyspIHsKLSAgICAgICAgICAgICAgICBmbG9hdCB3ID0gd2lkdGhzW2kgKyBsaW5lc3RhcnQgLSB3aWRzdGFydCArIHdpZG9mZl07CisgICAgICAgICAgICAgICAgZmxvYXQgdyA9IHdpZHRoc1tpICsgbGluZXN0YXJ0IC0gd2lkc3RhcnRdOwogCiAgICAgICAgICAgICAgICAgaWYgKHcgKyBzdW0gKyBlbGxpcHNpc3dpZCA+IGF2YWlsKSB7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtMTE3NSw3ICs4MDUsNyBAQAogCiAgICAgICAgICAgICBmbG9hdCByYXZhaWwgPSAoYXZhaWwgLSBlbGxpcHNpc3dpZCkgLyAyOwogICAgICAgICAgICAgZm9yIChyaWdodCA9IGxlbjsgcmlnaHQgPj0gMDsgcmlnaHQtLSkgewotICAgICAgICAgICAgICAgIGZsb2F0IHcgPSB3aWR0aHNbcmlnaHQgLSAxICsgbGluZXN0YXJ0IC0gd2lkc3RhcnQgKyB3aWRvZmZdOworICAgICAgICAgICAgICAgIGZsb2F0IHcgPSB3aWR0aHNbcmlnaHQgLSAxICsgbGluZXN0YXJ0IC0gd2lkc3RhcnRdOwogCiAgICAgICAgICAgICAgICAgaWYgKHcgKyByc3VtID4gcmF2YWlsKSB7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtMTE4Niw3ICs4MTYsNyBAQAogCiAgICAgICAgICAgICBmbG9hdCBsYXZhaWwgPSBhdmFpbCAtIGVsbGlwc2lzd2lkIC0gcnN1bTsKICAgICAgICAgICAgIGZvciAobGVmdCA9IDA7IGxlZnQgPCByaWdodDsgbGVmdCsrKSB7Ci0gICAgICAgICAgICAgICAgZmxvYXQgdyA9IHdpZHRoc1tsZWZ0ICsgbGluZXN0YXJ0IC0gd2lkc3RhcnQgKyB3aWRvZmZdOworICAgICAgICAgICAgICAgIGZsb2F0IHcgPSB3aWR0aHNbbGVmdCArIGxpbmVzdGFydCAtIHdpZHN0YXJ0XTsKIAogICAgICAgICAgICAgICAgIGlmICh3ICsgbHN1bSA+IGxhdmFpbCkgewogICAgICAgICAgICAgICAgICAgICBicm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RoYW4gTEVGVCBvciBwb3NpdGlvbmluZyB3aWxsIGdldAotICAgICAqIGNvbmZ1c2VkLgotICAgICAqCi0gICAgICogPHA+T24gcmV0dXJuLCB3b3JrUGFpbnQgd2lsbCByZWZsZWN0IHRoZSBvcmlnaW5hbCBwYWludCBwbHVzIGFueQotICAgICAqIG1vZGlmaWNhdGlvbnMgbWFkZSBieSBjaGFyYWN0ZXIgc3R5bGVzIG9uIHRoZSBydW4uCi0gICAgICoKLSAgICAgKiA8cD5UaGUgcmV0dXJuZWQgd2lkdGggaXMgc2lnbmVkIGFuZCB3aWxsIGJlIDwgMCBpZiB0aGUgcGFyYWdyYXBoCi0gICAgICogZGlyZWN0aW9uIGlzIHJpZ2h0LXRvLWxlZnQuCi0gICAgICovCi0gICAgcHJpdmF0ZSBzdGF0aWMgZmxvYXQgZHJhd1VuaWZvcm1SdW4oQ2FudmFzIGNhbnZhcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNwYW5uZWQgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRpciwgYm9vbGVhbiBydW5Jc1J0bCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgsIGludCB0b3AsIGludCB5LCBpbnQgYm90dG9tLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFpbnQuRm9udE1ldHJpY3NJbnQgZm1pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHBhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gbmVlZFdpZHRoKSB7Ci0KLSAgICAgICAgYm9vbGVhbiBoYXZlV2lkdGggPSBmYWxzZTsKLSAgICAgICAgZmxvYXQgcmV0ID0gMDsKLSAgICAgICAgQ2hhcmFjdGVyU3R5b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AgICAgIGlmIChydW5Jc1J0bCkgewotICAgICAgICAgICAgICAgIHRtcCA9IFRleHRVdGlscy5nZXRSZXZlcnNlKHRleHQsIHN0YXJ0LCBlbmQpOwotICAgICAgICAgICAgICAgIHRtcHN0YXJ0ID0gMDsKLSAgICAgICAgICAgICAgICAvLyBYWFg6IGFzc3VtZXMgZ2V0UmV2ZXJzZSBkb2Vzbid0IGNoYW5nZSB0aGUgbGVuZ3RoIG9mIHRoZSB0ZXh0Ci0gICAgICAgICAgICAgICAgdG1wZW5kID0gZW5kIC0gc3RhcnQ7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHRtcCA9IHRleHQ7Ci0gICAgICAgICAgICAgICAgdG1wc3RhcnQgPSBzdGFydDsKLSAgICAgICAgICAgICAgICB0bXBlbmQgPSBlbmQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChmbWkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHdvcmtQYWludC5nZXRGb250TWV0cmljc0ludChmbWkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoY2FudmFzICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBpZiAod29ya1BhaW50LmJnQ29sb3IgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBpbnQgYyA9IHdvcmtQYWludC5nZXRDb2xvcigpOwotICAgICAgICAgICAgICAgICAgICBQYWludC5TdHlsZSBzID0gd29ya1BhaW50LmdldFN0eWxlKCk7Ci0gICAgICAgICAgICAgICAgICAgIHdvcmtQYWludC5zZXRDb2xvcih3b3JrUGFpbnQuYmdDb2xvcik7Ci0gICAgICAgICAgICAgICAgICAgIHdvcmtQYWludC5zZXRTdHlsZShQYWludC5TdHlsZS5GSUxMKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoIWhhdmVXaWR0aCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0ID0gd29ya1BhaW50Lm1lYXN1cmVUZXh0KHRtcCwgdG1wc3RhcnQsIHRtcGVuZCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoYXZlV2lkdGggPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGRpciA9PSBMYXlvdXQuRElSX1JJR0hUX1RPX0xFRlQpCi0gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoeCAtIHJldCwgdG9wLCB4LCBib3R0b20sIHdvcmtQYWludCk7Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCh4LCB0b3AsIHggKyByZXQsIGJvdHRvbSwgd29ya1BhaW50KTsKLQotICAgICAgICAgICAgICAgICAgICB3b3JrUGFpbnQuc2V0U3R5bGUocyk7Ci0gICAgICAgICAgICAgICAgICAgIHdvcmtQYWludC5zZXRDb2xvcihjKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoZGlyID09IExheW91dC5ESVJfUklHSFRfVE9fTEVGVCkgewotICAgICAgICAgICAgICAgICAgICBpZiAoIWhhdmVXaWR0aCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0ID0gd29ya1BhaW50Lm1lYXN1cmVUZXh0KHRtcCwgdG1wc3RhcnQsIHRtcGVuZCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoYXZlV2lkdGggPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgY2FudmFzLmRyYXdUZXh0KHRtcCwgdG1wc3RhcnQsIHRtcGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggLSByZXQsIHkgKyB3b3JrUGFpbnQuYmFzZWxpbmVTaGlmdCwgd29ya1BhaW50KTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBpZiAobmVlZFdpZHRoKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWhhdmVXaWR0aCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldCA9IHdvcmtQYWludC5tZWFzdXJlVGV4dCh0bXAsIHRtcHN0YXJ0LCB0bXBlbmQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhdmVXaWR0aCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBjYW52YXMuZHJhd1RleHQodG1wLCB0bXBzdGFydCwgdG1wZW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCwgeSArIHdvcmtQYWludC5iYXNlbGluZVNoaWZ0LCB3b3JrUGFpbnQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKG5lZWRXaWR0aCAmJiAhaGF2ZVdpZHRoKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldCA9IHdvcmtQYWludC5tZWFzdXJlVGV4dCh0bXAsIHRtcHN0YXJ0LCB0bXBlbmQpOwotICAgICAgICAgICAgICAgICAgICBoYXZlV2lkdGggPSB0cnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldCA9IHJlcGxhY2VtZW50LmdldFNpemUod29ya1BhaW50LCB0ZXh0LCBzdGFydCwgZW5kLCBmbWkpOwotCi0gICAgICAgICAgICBpZiAoY2FudmFzICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBpZiAoZGlyID09IExheW91dC5ESVJfUklHSFRfVE9fTEVGVCkKLSAgICAgICAgICAgICAgICAgICAgcmVwbGFjZW1lbnQuZHJhdyhjYW52YXMsIHRleHQsIHN0YXJ0LCBlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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ZmxvYXQgeCwgaW50IHRvcCwgaW50IHksIGludCBib3R0b20sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYWludC5Gb250TWV0cmljc0ludCBmbWksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgcGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBuZWVkV2lkdGgpIHsKLQotICAgICAgICAvLyBYWFg6IEl0IGxvb2tzIGxpa2UgYWxsIGNhbGxzIHRvIHRoaXMgQVBJIG1hdGNoIGRpciBhbmQgcnVuSXNSdGwsIHNvCi0gICAgICAgIC8vIGhhdmluZyBib3RoIHBhcmFtZXRlcnMgaXMgcmVkdW5kYW50IGFuZCBjb25mdXNpbmcuCi0KLSAgICAgICAgLy8gZmFzdCBwYXRoIGZvciB1bnN0eWxlZCB0ZXh0Ci0gICAgICAgIGlmICghKHRleHQgaW5zdGFuY2VvZiBTcGFubmVkKSkgewotICAgICAgICAgICAgZmxvYXQgcmV0ID0gMDsKLQotICAgICAgICAgICAgaWYgKHJ1bklzUnRsKSB7Ci0gICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRtcCA9IFRleHRVdGlscy5nZXRSZXZlcnNlKHRleHQsIHN0YXJ0LCBlbmQpOwotICAgICAgICAgICAgICAgIC8vIFhYWDogdGhpcyBhc3N1bWVzIGdldFJldmVyc2UgZG9lc24ndCB0d2VhayB0aGUgbGVuZ3RoIG9mCi0gICAgICAgICAgICAgICAgLy8gdGhlIHRleHQKLSAgICAgICAgICAgICAgICBpbnQgdG1wZW5kID0gZW5kIC0gc3RhcnQ7Ci0KLSAgICAgICAgICAgICAgICBpZiAoY2FudmFzICE9IG51bGwgfHwgbmVlZFdpZHRoKQotICAgICAgICAgICAgICAgICAgICByZXQgPSBwYWludC5tZWFzdXJlVGV4dCh0bXAsIDAsIHRtcGVuZCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoY2FudmFzICE9IG51bGwpCi0gICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3VGV4dCh0bXAsIDAsIHRtcGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggLSByZXQsIHksIHBhaW50KTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKG5lZWRXaWR0aCkKLSAgICAgICAgICAgICAgICAgICAgcmV0ID0gcGFpbnQubWVhc3VyZVRleHQodGV4dCwgc3RhcnQsIGVuZCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoY2FudmFzICE9IG51bGwpCi0gICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3VGV4dCh0ZXh0LCBzdGFydCwgZW5kLCB4LCB5LCBwYWludCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChmbWkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIHBhaW50LmdldEZvbnRNZXRyaWNzSW50KGZtaSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiByZXQgKiBkaXI7ICAgLy8gTGF5b3V0LkRJUl9SSUdIVF9UT19MRUZUID09IC0xCi0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIGZsb2F0IG94ID0geDsKLSAgICAgICAgaW50IG1pbkFzY2VudCA9IDAsIG1heERlc2NlbnQgPSAwLCBtaW5Ub3AgPSAwLCBtYXhCb3R0b20gPSAwOwotCi0gICAgICAgIFNwYW5uZWQgc3AgPSAoU3Bhbm5lZCkgdGV4dDsKLSAgICAgICAgQ2xhc3M8Pz4gZGl2aXNpb247Ci0KLSAgICAgICAgaWYgKGNhbnZhcyA9PSBudWxsKQotICAgICAgICAgICAgZGl2aXNpb24gPSBNZXRyaWNBZmZlY3RpbmdTcGFuLmNsYXNzOwotICAgICAgICBlbHNlCi0gICAgICAgICAgICBkaXZpc2lvbiA9IENoYXJhY3RlclN0eWxlLmNsYXNzOwotCi0gICAgICAgIGludCBuZXh0OwotICAgICAgICBmb3IgKGludCBpID0gc3RhcnQ7IGkgPCBlbmQ7IGkgPSBuZXh0KSB7Ci0gICAgICAgICAgICBuZXh0ID0gc3AubmV4dFNwYW5UcmFuc2l0aW9uKGksIGVuZCwgZGl2aXNpb24pOwotCi0gICAgICAgICAgICAvLyBYWFg6IGlmIGRpciBhbmQgcnVuSXNSdGwgd2VyZSBub3QgdGhlIHNhbWUsIHRoaXMgd291bGQgZHJhdwotICAgICAgICAgICAgLy8gc3BhbnMgaW4gdGhlIHdyb25nIG9yZGVyLCBidXQgbm8gb25lIGFwcGVhcnMgdG8gY2FsbCBpdCB0aGlzCi0gICAgICAgICAgICAvLyB3YXkuCi0gICAgICAgICAgICB4ICs9IGRyYXdVbmlmb3JtUnVuKGNhbnZhcywgc3AsIGksIG5leHQsIGRpciwgcnVuSXNSdGwsCi0gICAgICAgICAgICAgICAgICB4LCB0b3AsIHksIGJvdHRvbSwgZm1pLCBwYWludCwgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgbmVlZFdpZHRoIHx8IG5leHQgIT0gZW5kKTsKLQotICAgICAgICAgICAgaWYgKGZtaSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGZtaS5hc2NlbnQgPCBtaW5Bc2NlbnQpCi0gICAgICAgICAgICAgICAgICAgIG1pbkFzY2VudCA9IGZtaS5hc2NlbnQ7Ci0gICAgICAgICAgICAgICAgaWYgKGZtaS5kZXNjZW50ID4gbWF4RGVzY2VudCkKLSAgICAgICAgICAgICAgICAgICAgbWF4RGVzY2VudCA9IGZtaS5kZXNjZW50OwotCi0gICAgICAgICAgICAgICAgaWYgKGZtaS50b3AgPCBtaW5Ub3ApCi0gICAgICAgICAgICAgICAgICAgIG1pblRvcCA9IGZtaS50b3A7Ci0gICAgICAgICAgICAgICAgaWYgKGZtaS5ib3R0b20gPiBtYXhCb3R0b20pCi0gICAgICAgICAgICAgICAgICAgIG1heEJvdHRvbSA9IGZtaS5ib3R0b207Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoZm1pICE9IG51bGwpIHsKLSAgICAgICAgICAgIGlmIChzdGFydCA9PSBlbmQpIHsKLSAgICAgICAgICAgICAgICBwYWludC5nZXRGb250TWV0cmljc0ludChmbWkpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBmbWkuYXNjZW50ID0gbWluQXNjZW50OwotICAgICAgICAgICAgICAgIGZtaS5kZXNjZW50ID0gbWF4RGVzY2VudDsKLSAgICAgICAgICAgICAgICBmbWkudG9wID0gbWluVG9wOwotICAgICAgICAgICAgICAgIGZtaS5ib3R0b20gPSBtYXhCb3R0b207Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4geCAtIG94OwotICAgIH0KLQotICAgIC8qKgotICAgICAqIERyYXdzIGEgdW5pZGlyZWN0aW9uYWwgcnVuIG9mIHRleHQgb24gYSBzaW5nbGUgbGluZSwgYW5kIG9wdGlvbmFsbHkKLSAgICAgKiByZXR1cm5zIHRoZSBzaWduZWQgYWR2YW5jZS4gIFVubGlrZSBkcmF3RGlyZWN0aW9uYWxSdW4sIHRoZSBwYXJhZ3JhcGgKLSAgICAgKiBkaXJlY3Rpb24gYW5kIHJ1biBkaXJlY3Rpb24gY2FuIGJlIGRpZmZlcmVudC4KLSAgICAgKi8KLSAgICAvKiBwYWNrYWdlICovIHN0YXRpYyBmbG9hdCBkcmF3VGV4dChDYW52YXMgY2FudmFzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRleHQsIGludCBzdGFydCwgaW50IGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkaXIsIGJvb2xlYW4gcnVuSXNSdGwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4LCBpbnQgdG9wLCBpbnQgeSwgaW50IGJvdHRvbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCBwYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCB3b3JrUGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIG5lZWRXaWR0aCkgewotICAgICAgICAvLyBYWFggdGhpcyBsb2dpYyBpcyAoZGlyID09IERJUl9MRUZUX1RPX1JJR0hUKSA9PSBydW5Jc1J0bAotICAgICAgICBpZiAoKGRpciA9PSBMYXlvdXQuRElSX1JJR0hUX1RPX0xFRlQgJiYgIXJ1bklzUnRsKSB8fAotICAgICAgICAgICAgKHJ1bklzUnRsICYmIGRpciA9PSBMYXlvdXQuRElSX0xFRlRfVE9fUklHSFQpKSB7Ci0gICAgICAgICAgICAvLyBUT0RPOiB0aGlzIG5lZWRzIHRoZSByZWFsIGRpcmVjdGlvbgotICAgICAgICAgICAgZmxvYXQgY2ggPSBkcmF3RGlyZWN0aW9uYWxSdW4obnVsbCwgdGV4dCwgc3RhcnQsIGVuZCwKLSAgICAgICAgICAgICAgICAgICAgTGF5b3V0LkRJUl9MRUZUX1RPX1JJR0hULCBmYWxzZSwgMCwgMCwgMCwgMCwgbnVsbCwgcGFpbnQsCi0gICAgICAgICAgICAgICAgICAgIHdvcmtQYWludCwgdHJ1ZSk7Ci0KLSAgICAgICAgICAgIGNoICo9IGRpcjsgIC8vIERJUl9SSUdIVF9UT19MRUZUID09IC0xCi0gICAgICAgICAgICBkcmF3RGlyZWN0aW9uYWxSdW4oY2FudmFzLCB0ZXh0LCBzdGFydCwgZW5kLCAtZGlyLAotICAgICAgICAgICAgICAgICAgICBydW5Jc1J0bCwgeCArIGNoLCB0b3AsIHksIGJvdHRvbSwgbnVsbCwgcGFpbnQsCi0g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ZXh0UGFpbnR9IG9iamVjdCB1c2VkIGZvciB0ZW1wb3JhbAotICAgICAqICAgICAgICB3b3Jrc3BhY2UuCi0gICAgICogQHBhcmFtIG5lZWRXaWR0aCBJZiB0cnVlLCB0aGlzIG1ldGhvZCByZXR1cm5zIHRoZSB3aWR0aCBvZiBkcmF3biB0ZXh0Ci0gICAgICogQHJldHVybiBXaWR0aCBvZiB0aGUgZHJhd24gdGV4dCBpZiBuZWVkV2lkdGggaXMgdHJ1ZQotICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgZmxvYXQgZHJhd1RleHQoQ2FudmFzIGNhbnZhcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGlyZWN0aW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeCwgaW50IHRvcCwgaW50IHksIGludCBib3R0b20sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgcGFpbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUZXh0UGFpbnQgd29ya1BhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBuZWVkV2lkdGgpIHsKLSAgICAgICAgLy8gRm9yIHNhZmV0eS4KLSAgICAgICAgZGlyZWN0aW9uID0gZGlyZWN0aW9uID49IDAgPyBMYXlvdXQuRElSX0xFRlRfVE9fUklHSFQKLSAgICAgICAgICAgICAgICA6IExheW91dC5ESVJfUklHSFRfVE9fTEVGVDsKLQotICAgICAgICAvLyBIaWRlIHJ1bklzUnRsIHBhcmFtZXRlciBzaW5jZSBpdCBpcyBtZWFuaW5nbGVzcyBmb3IgZXh0ZXJuYWwKLSAgICAgICAgLy8gZGV2ZWxvcGVycy4KLSAgICAgICAgLy8gWFhYOiB0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c3QgY2hhcmFjdGVyIHRvIHN0YXJ0IG1lYXN1cmluZwotICAgICAqIEBwYXJhbSBlbmQgMSBiZXlvbmQgdGhlIGluZGV4IG9mIHRoZSBsYXN0IGNoYXJhY3RlciB0byBtZWFzdXJlCi0gICAgICogQHBhcmFtIGZtaSBGb250TWV0cmljcyBpbmZvcm1hdGlvbjsgY2FuIGJlIG51bGwKLSAgICAgKiBAcmV0dXJuIFRoZSB3aWR0aCBvZiB0aGUgdGV4dAotICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgZmxvYXQgbWVhc3VyZVRleHQoVGV4dFBhaW50IHBhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHdvcmtQYWludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYWludC5Gb250TWV0cmljc0ludCBmbWkpIHsKLSAgICAgICAgcmV0dXJuIGRyYXdEaXJlY3Rpb25hbFJ1bihudWxsLCB0ZXh0LCBzdGFydCwgZW5kLAotICAgICAgICAgICAgICAgICAgICAgICBMYXlvdXQuRElSX0xFRlRfVE9fUklHSFQsIGZhbHNlLAotICAgICAgICAgICAgICAgICAgICAgICAwLCAwLCAwLCAwLCBmbWksIHBhaW50LCB3b3JrUGFpbnQsIHRydWUpOwotICAgIH0KLX0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3RleHQvVGV4dExpbmUuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3RleHQvVGV4dExpbmUuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zM2M5NTU0Ci0tLSAvZGV2L251bGwKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvdGV4dC9UZXh0TGluZS5qYXZhCkBAIC0wLDAgK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mF0ZSBpbnQgbURpcjsKKyAgICBwcml2YXRlIERpcmVjdGlvbnMgbURpcmVjdGlvbnM7CisgICAgcHJpdmF0ZSBib29sZWFuIG1IYXNUYWJzOworICAgIHByaXZhdGUgVGFiU3RvcHMgbVRhYnM7CisgICAgcHJpdmF0ZSBjaGFyW10gbUNoYXJzOworICAgIHByaXZhdGUgYm9vbGVhbiBtQ2hhcnNWYWxpZDsKKyAgICBwcml2YXRlIFNwYW5uZWQgbVNwYW5uZWQ7CisgICAgcHJpdmF0ZSBmaW5hbCBUZXh0UGFpbnQgbVdvcmtQYWludCA9IG5ldyBUZXh0UGFpbnQoKTsKKworICAgIHByaXZhdGUgc3RhdGljIFRleHRMaW5lW10gY2FjaGVkID0gbmV3IFRleHRMaW5lWzNdOworCisgICAgLyoqCisgICAgICogUmV0dXJucyBhIG5ldyBUZXh0TGluZSBmcm9tIHRoZSBzaGFyZWQgcG9vbC4KKyAgICAgKgorICAgICAqIEByZXR1cm4gYW4gdW5pbml0aWFsaXplZCBUZXh0TGluZQorICAgICAqLworICAgIHN0YXRpYyBUZXh0TGluZSBvYnRhaW4oKSB7CisgICAgICAgIFRleHRMaW5lIHRsOworICAgICAgICBzeW5jaHJvbml6ZWQgKGNhY2hlZCkgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IGNhY2hlZC5sZW5ndGg7IC0taSA+PSAwOykgeworICAgICAgICAgICAgICAgIGlmIChjYWNoZWRbaV0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0bCA9IGNhY2hlZFtpXTsKKyAgICAgICAgICAgICAgICAgICAgY2FjaGVkW2ldID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICB0bCA9IG5ldyBUZXh0TGluZSgpOworICAgICAgICBMb2cuZSgiVExJTkUiLCAibmV3OiAiICsgdGwpOworICAgICAgICByZXR1cm4gdGw7CisgICAgfQorCisgICAgLyoqCisgICAgICogUHV0cyBhIFRleHRMaW5lIGJhY2sgaW50byB0aGUgc2hhcmVkIHBvb2wuIERvIG5vdCB1c2UgdGhpcyBUZXh0TGluZSBvbmNlCisgICAgICogaXQgaGFzIGJlZW4gcmV0dXJuZWQuCisgICAgICogQHBhcmFtIHRsIHRoZSB0ZXh0TGluZQorICAgICAqIEByZXR1cm4gbnVsbCwgYXMgYSBjb252ZW5pZW5jZSBmcm9tIGNsZWFyaW5nIHJlZmVyZW5jZXMgdG8gdGhlIHByb3ZpZGVkCisgICAgICogVGV4dExpbmUKKyAgICAgKi8KKyAgICBzdGF0aWMgVGV4dExpbmUgcmVjeWNsZShUZXh0TGluZSB0bCkgeworICAgICAgICB0bC5tVGV4dCA9IG51bGw7CisgICAgICAgIHRsLm1QYWludCA9IG51bGw7CisgICAgICAgIHRsLm1EaXJlY3Rpb25zID0gbnVsbDsKKyAgICAgICAgaWYgKHRsLm1MZW4gPCAyNTApIHsKKyAgICAgICAgICAgIHN5bmNocm9uaXplZChjYWNoZWQpIHsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNhY2hlZC5sZW5ndGg7ICsraSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoY2FjaGVkW2ldID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlZFtpXSA9IHRsOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgLyoqCisgICAgICogSW5pdGlhbGl6ZXMgYSBUZXh0TGluZSBhbmQgcHJlcGFyZXMgaXQgZm9yIHVzZS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBwYWludCB0aGUgYmFzZSBwYWludCBmb3IgdGhlIGxpbmUKKyAgICAgKiBAcGF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gICAgICAgICAvLyBub24tYnJlYWsgc3BhY2UgYWthIEJPTS4gIEN1cnNvciBtb3ZlbWVudCBjb2RlIHNraXBzIHRoZXNlCisgICAgICAgICAgICAgICAgLy8gemVyby13aWR0aCBjaGFyYWN0ZXJzLgorICAgICAgICAgICAgICAgIGNoYXJbXSBjaGFycyA9IG1DaGFyczsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gc3RhcnQsIGluZXh0OyBpIDwgbGltaXQ7IGkgPSBpbmV4dCkgeworICAgICAgICAgICAgICAgICAgICBpbmV4dCA9IG1TcGFubmVkLm5leHRTcGFuVHJhbnNpdGlvbihpLCBsaW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXBsYWNlbWVudFNwYW4uY2xhc3MpOworICAgICAgICAgICAgICAgICAgICBpZiAobVNwYW5uZWQuZ2V0U3BhbnMoaSwgaW5leHQsIFJlcGxhY2VtZW50U3Bhbi5jbGFzcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAubGVuZ3RoID4gMCkgeyAvLyB0cmFuc2l0aW9uIGludG8gYSBzcGFuCisgICAgICAgICAgICAgICAgICAgICAgICBjaGFyc1tpIC0gc3RhcnRdID0gJ1x1ZmZmYyc7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBqID0gaSAtIHN0YXJ0ICsgMSwgZSA9IGluZXh0IC0gc3RhcnQ7IGogPCBlOyArK2opIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyc1tqXSA9ICdcdWZlZmYnOyAvLyB1c2VkIGFzIFpXTkJTLCBtYXJrcyBwb3NpdGlvbnMgdG8gc2tpcAorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIG1UYWJzID0gdGFiU3RvcHM7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmVuZGVycyB0aGUgVGV4dExpbmUuCisgICAgICoKKyAgICAgKiBAcGFyYW0gYyB0aGUgY2FudmFzIHRvIHJlbmRlciBvbgorICAgICAqIEBwYXJhbSB4IHRoZSBsZWFkaW5nIG1hcmdpbiBwb3NpdGlvbgorICAgICAqIEBwYXJhbSB0b3AgdGhlIHRvcCBvZiB0aGUgbGluZQorICAgICAqIEBwYXJhbSB5IHRoZSBiYXNlbGluZQorICAgICAqIEBwYXJhbSBib3R0b20gdGhlIGJvdHRvbSBvZiB0aGUgbGluZQorICAgICAqLworICAgIHZvaWQgZHJhdyhDYW52YXMgYywgZmxvYXQgeCwgaW50IHRvcCwgaW50IHksIGludCBib3R0b20pIHsKKyAgICAgICAgaWYgKCFtSGFzVGFicykgeworICAgICAgICAgICAgaWYgKG1EaXJlY3Rpb25zID09IExheW91dC5ESVJTX0FMTF9MRUZUX1RPX1JJR0hUKSB7CisgICAgICAgICAgICAgICAgZHJhd1J1bihjLCAwLCAwLCBtTGVuLCBmYWxzZSwgeCwgdG9wLCB5LCBib3R0b20sIGZhbHNlKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobURpcmVjdGlvbnMgPT0gTGF5b3V0LkRJUlNfQUxMX1JJR0hUX1RPX0xFRlQpIHsKKyAgICAgICAgICAgICAgICBkcmF3UnVuKGMsIDAsIDAsIG1MZW4sIHRydWUsIHgsIHRvcCwgeSwgYm90dG9tLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZmxvYXQgaCA9IDA7CisgICAgICAgIGludFtdIHJ1bnMgPSBtRGlyZWN0aW9ucy5tRGlyZWN0aW9uczsKKyAgICAgICAgUmVjdEYgZW1vamlSZWN0ID0gbnVsbDsKKworICAgICAgICBpbnQgbGFzdFJ1bkluZGV4ID0gcnVucy5sZW5ndGggLSAyOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHJ1bnMubGVuZ3RoOyBpICs9IDIpIHsKKyAgICAgICAgICAgIGludCBydW5TdGFydCA9IHJ1bnNbaV07CisgICAgICAgICAgICBpbnQgcnVuTGltaXQgPSBydW5TdGFydCArIChydW5zW2krMV0gJiBMYXlvdXQuUlVOX0xFTkdUSF9NQVNLKTsKKyAgICAgICAgICAgIGlmIChydW5MaW1pdCA+IG1MZW4pIHsKKyAgICAgICAgICAgICAgICBydW5MaW1pdCA9IG1MZW47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBib29sZWFuIHJ1bklzUnRsID0gKHJ1bnNbaSsxXSAmIExheW91dC5SVU5fUlRMX0ZMQUcpICE9IDA7CisKKyAgICAgICAgICAgIGludCBzZWdzdGFydCA9IHJ1blN0YXJ0OworICAgICAgICAgICAgY2hhcltdIGNoYXJzID0gbUNoYXJzOworICAgICAgICAgICAgZm9yIChpbnQgaiA9IG1IYXNUYWJzID8gcnVuU3RhcnQgOiBydW5MaW1pdDsgaiA8PSBydW5MaW1pdDsgaisrKSB7CisgICAgICAgICAgICAgICAgaW50IGNvZGVwdCA9IDA7CisgICAgICAgICAgICAgICAgQml0bWFwIGJtID0gbnVsbDsKKworICAgICAgICAgICAgICAgIGlmIChtSGFzVGFicyAmJiBqIDwgcnVuTGltaXQpIHsKKyAgICAgICAgICAgICAgICAgICAgY29kZXB0ID0gbUNoYXJzW2pdOworICAgICAgICAgICAgICAgICAgICBpZiAoY29kZXB0ID49IDB4ZDgwMCAmJiBjb2RlcHQgPCAweGRjMDAgJiYgaiArIDEgPCBydW5MaW1pdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY29kZXB0ID0gQ2hhcmFjdGVyLmNvZGVQb2ludEF0KG1DaGFycywgaik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29kZXB0ID49IExheW91dC5NSU5fRU1PSkkgJiYgY29kZXB0IDw9IExheW91dC5NQVhfRU1PSkkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBibSA9IExheW91dC5FTU9KSV9GQUNUT1JZLmdldEJpdG1hcEZyb21BbmRyb2lkUHVhKGNvZGVwdCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNvZGVwdCA+IDB4ZmZmZikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChqID09IHJ1bkxpbWl0IHx8IGNvZGVwdCA9PSAnXHQnIHx8IGJtICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaCArPSBkcmF3UnVuKGMsIGksIHNlZ3N0YXJ0LCBqLCBydW5Jc1J0bCwgeCtoLCB0b3AsIHksIGJvdHRvbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpICE9IGxhc3RSdW5JbmRleCB8fCBqICE9IG1MZW4pOworCisgICAgICAgICAgICAgICAgICAgIGlmIChjb2RlcHQgPT0gJ1x0JykgeworICAgICAgICAgICAgICAgICAgICAgICAgaCA9IG1EaXIgKiBuZXh0VGFiKGggKiBtRGlyKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChibSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBibUFzY2VudCA9IGFzY2VudChqKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IGJpdG1hcEhlaWdodCA9IGJtLmdldEhlaWdodCgpOworICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgc2NhbGUgPSAtYm1Bc2NlbnQgLyBiaXRtYXBIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB3aWR0aCA9IGJtLmdldFdpZHRoKCkgKiBzY2FsZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVtb2ppUmVjdCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW1vamlSZWN0ID0gbmV3IFJlY3RGKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbW9qaVJlY3Quc2V0KHggKyBoLCB5ICsgYm1Bc2NlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggKyBoICsgd2lkdGgsIHkpOworICAgICAgICAgICAgICAgICAgICAgICAgYy5kcmF3Qml0bWFwKGJtLCBudWxsLCBlbW9qaVJlY3QsIG1QYWludCk7CisgICAgICAgICAgICAgICAgICAgICAgICBoICs9IHdpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgaisrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHNlZ3N0YXJ0ID0gaiArIDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyBtZXRyaWNzIGluZm9ybWF0aW9uIGZvciB0aGUgZW50aXJlIGxpbmUuCisgICAgICoKKyAgICAgKiBAcGFyYW0gZm1pIHJlY2VpdmVzIGZvbnQgbWV0cmljcyBpbmZvcm1hdGlvbiwgY2FuIGJlIG51bGwKKyAgICAgKiBAcmV0dXJuIHRoZSBzaWduZWQgd2lkdGggb2YgdGhlIGxpbmUKKyAgICAgKi8KKyAgICBmbG9hdCBtZXRyaWNzKEZvbnRNZXRyaWNzSW50IGZtaSkgeworICAgICAgICByZXR1cm4gbWVhc3VyZShtTGVuLCBmYWxzZSwgZm1pKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIGluZm9ybWF0aW9uIGFib3V0IGEgcG9zaXRpb24gb24gdGhlIGxpbmUuCisgICAgICoKKyAgICAgKiBAcGFyYW0gb2Zmc2V0IHRoZSBsaW5lLXJlbGF0aXZlIGNoYXJhY3RlciBvZmZzZXQsIGJldHdlZW4gMCBh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09IExheW91dC5ESVJTX0FMTF9SSUdIVF9UT19MRUZUKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1lYXN1cmVSdW4oMCwgMCwgb2Zmc2V0LCBtTGVuLCB0cnVlLCBmbWkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgY2hhcltdIGNoYXJzID0gbUNoYXJzOworICAgICAgICBpbnRbXSBydW5zID0gbURpcmVjdGlvbnMubURpcmVjdGlvbnM7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgcnVucy5sZW5ndGg7IGkgKz0gMikgeworICAgICAgICAgICAgaW50IHJ1blN0YXJ0ID0gcnVuc1tpXTsKKyAgICAgICAgICAgIGludCBydW5MaW1pdCA9IHJ1blN0YXJ0ICsgKHJ1bnNbaSsxXSAmIExheW91dC5SVU5fTEVOR1RIX01BU0spOworICAgICAgICAgICAgaWYgKHJ1bkxpbWl0ID4gbUxlbikgeworICAgICAgICAgICAgICAgIHJ1bkxpbWl0ID0gbUxlbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJvb2xlYW4gcnVuSXNSdGwgPSAocnVuc1tpKzFdICYgTGF5b3V0LlJVTl9SVExfRkxBRykgIT0gMDsKKworICAgICAgICAgICAgaW50IHNlZ3N0YXJ0ID0gcnVuU3RhcnQ7CisgICAgICAgICAgICBmb3IgKGludCBqID0gbUhhc1RhYnMgPyBydW5TdGFydCA6IHJ1bkxpbWl0OyBqIDw9IHJ1bkxpbWl0OyBqKyspIHsKKyAgICAgICAgICAgICAgICBpbnQgY29kZXB0ID0gMDsKKyAgICAgICAgICAgICAgICBCaXRtYXAgYm0gPSBudWxsOworCisgICAgICAgICAgICAgICAgaWYgKG1IYXNUYWJzICYmIGogPCBydW5MaW1pdCkgeworICAgICAgICAgICAgICAgICAgICBjb2RlcHQgPSBjaGFyc1tqXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGVwdCA+PSAweGQ4MDAgJiYgY29kZXB0IDwgMHhkYzAwICYmIGogKyAxIDwgcnVuTGltaXQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvZGVwdCA9IENoYXJhY3Rlci5jb2RlUG9pbnRBdChjaGFycywgaik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29kZXB0ID49IExheW91dC5NSU5fRU1PSkkgJiYgY29kZXB0IDw9IExheW91dC5NQVhfRU1PSkkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBibSA9IExheW91dC5FTU9KSV9GQUNUT1JZLmdldEJpdG1hcEZyb21BbmRyb2lkUHVhKGNvZGVwdCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNvZGVwdCA+IDB4ZmZmZikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChqID09IHJ1bkxpbWl0IHx8IGNvZGVwdCA9PSAnXHQnIHx8IGJtICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBpblNlZ21lbnQgPSB0YXJnZXQgPj0gc2Vnc3RhcnQgJiYgdGFyZ2V0IDwgajsKKworICAgICAgICAgICAgICAgICAgICBib29sZWFuIGFkdmFuY2UgPSAobURpciA9PSBMYXlvdXQuRElSX1JJR0hUX1RPX0xFRlQpID09IHJ1bklzUnRsOworICAgICAgICAgICAgICAgICAgICBpZiAoaW5TZWdtZW50ICYmIGFkdmFuY2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBoICs9IG1lYXN1cmVSdW4oaSwgc2Vnc3RhcnQsIG9mZnNldCwgaiwgcnVuSXNSdGwsIGZtaSk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBmbG9hdCB3ID0gbWVhc3VyZVJ1bihpLCBzZWdzdGFydCwgaiwgaiwgcnVuSXNSdGwsIGZtaSk7CisgICAgICAgICAgICAgICAgICAgIGggKz0gYWR2YW5jZSA/IHcgOiAtdzsKKworICAgICAgICAgICAgICAgICAgICBpZiAoaW5TZWdtZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaCArPSBtZWFzdXJlUnVuKGksIHNlZ3N0YXJ0LCBvZmZzZXQsIGosIHJ1bklzUnRsLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChjb2RlcHQgPT0gJ1x0JykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9mZnNldCA9PSBqKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGg7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBoID0gbURpciAqIG5leHRUYWIoaCAqIG1EaXIpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRhcmdldCA9PSBqKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGg7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoYm0gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgYm1Bc2NlbnQgPSBhc2NlbnQoaik7CisgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB3aWQgPSBibS5nZXRXaWR0aCgpICogLWJtQXNjZW50IC8gYm0uZ2V0SGVpZ2h0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBoICs9IG1EaXIgKiB3aWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBqKys7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBzZWdzdGFydCA9IGogKyAxOworICAgICAgICAgICAgICAgIH0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5JbmRleCwgcnVuTGV2ZWwgPSAwLCBydW5TdGFydCA9IGxpbmVTdGFydCwgcnVuTGltaXQgPSBsaW5lRW5kLCBuZXdDYXJldCA9IC0xOworICAgICAgICBib29sZWFuIHRyYWlsaW5nID0gZmFsc2U7CisKKyAgICAgICAgaWYgKGN1cnNvciA9PSBsaW5lU3RhcnQpIHsKKyAgICAgICAgICAgIHJ1bkluZGV4ID0gLTI7CisgICAgICAgIH0gZWxzZSBpZiAoY3Vyc29yID09IGxpbmVFbmQpIHsKKyAgICAgICAgICAgIHJ1bkluZGV4ID0gcnVucy5sZW5ndGg7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgLy8gRmlyc3QsIGdldCBpbmZvcm1hdGlvbiBhYm91dCB0aGUgcnVuIGNvbnRhaW5pbmcgdGhlIGNoYXJhY3RlciB3aXRoCisgICAgICAgICAgLy8gdGhlIGFjdGl2ZSBjYXJldC4KKyAgICAgICAgICBmb3IgKHJ1bkluZGV4ID0gMDsgcnVuSW5kZXggPCBydW5zLmxlbmd0aDsgcnVuSW5kZXggKz0gMikgeworICAgICAgICAgICAgcnVuU3RhcnQgPSBsaW5lU3RhcnQgKyBydW5zW3J1bkluZGV4XTsKKyAgICAgICAgICAgIGlmIChjdXJzb3IgPj0gcnVuU3RhcnQpIHsKKyAgICAgICAgICAgICAgcnVuTGltaXQgPSBydW5TdGFydCArIChydW5zW3J1bkluZGV4KzFdICYgTGF5b3V0LlJVTl9MRU5HVEhfTUFTSyk7CisgICAgICAgICAgICAgIGlmIChydW5MaW1pdCA+IGxpbmVFbmQpIHsKKyAgICAgICAgICAgICAgICAgIHJ1bkxpbWl0ID0gbGluZUVuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBpZiAoY3Vyc29yIDwgcnVuTGltaXQpIHsKKyAgICAgICAgICAgICAgICBydW5MZXZlbCA9IChydW5zW3J1bkluZGV4KzFdID4+PiBMYXlvdXQuUlVOX0xFVkVMX1NISUZUKSAmCisgICAgICAgICAgICAgICAgICAgIExheW91dC5SVU5fTEVWRUxfTUFTSzsKKyAgICAgICAgICAgICAgICBpZiAoY3Vyc29yID09IHJ1blN0YXJ0KSB7CisgICAgICAgICAgICAgICAgICAvLyBUaGUgY2FyZXQgaXMgb24gYSBydW4gYm91bmRhcnksIHNlZSBpZiB3ZSBzaG91bGQKKyAgICAgICAgICAgICAgICAgIC8vIHVzZSB0aGUgcG9zaXRpb24gb24gdGhlIHRyYWlsaW5nIGVkZ2Ugb2YgdGhlIHByZXZpb3VzCisgICAgICAgICAgICAgICAgICAvLyBsb2dpY2FsIGNoYXJhY3RlciBpbnN0ZWFkLgorICAgICAgICAgICAgICAgICAgaW50IHByZXZSdW5JbmRleCwgcHJldlJ1bkxldmVsLCBwcmV2UnVuU3RhcnQsIHByZXZSdW5MaW1pdDsKKyAgICAgICAgICAgICAgICAgIGludCBwb3MgPSBjdXJzb3IgLSAxOworICAgICAgICAgICAgICAgICAgZm9yIChwcmV2UnVuSW5kZXggPSAwOyBwcmV2UnVuSW5kZXggPCBydW5zLmxlbmd0aDsgcHJldlJ1bkluZGV4ICs9IDIpIHsKKyAgICAgICAgICAgICAgICAgICAgcHJldlJ1blN0YXJ0ID0gbGluZVN0YXJ0ICsgcnVuc1twcmV2UnVuSW5kZXhdOworICAgICAgICAgICAgICAgICAgICBpZiAocG9zID49IHByZXZSdW5TdGFydCkgeworICAgICAgICAgICAgICAgICAgICAgIHByZXZSdW5MaW1pdCA9IHByZXZSdW5TdGFydCArCisgICAgICAgICAgICAgICAgICAgICAgICAgIChydW5zW3ByZXZSdW5JbmRleCsxXSAmIExheW91dC5SVU5fTEVOR1RIX01BU0spOworICAgICAgICAgICAgICAgICAgICAgIGlmIChwcmV2UnVuTGltaXQgPiBsaW5lRW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXZSdW5MaW1pdCA9IGxpbmVFbmQ7CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIGlmIChwb3MgPCBwcmV2UnVuTGltaXQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByZXZSdW5MZXZlbCA9IChydW5zW3ByZXZSdW5JbmRleCsxXSA+Pj4gTGF5b3V0LlJVTl9MRVZFTF9TSElGVCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmIExheW91dC5SVU5fTEVWRUxfTUFTSzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwcmV2UnVuTGV2ZWwgPCBydW5MZXZlbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTdGFydCBmcm9tIGxvZ2ljYWxseSBwcmV2aW91cyBjaGFyYWN0ZXIuCisgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bkluZGV4ID0gcHJldlJ1bkluZGV4OworICAgICAgICAgICAgICAgICAgICAgICAgICBydW5MZXZlbCA9IHByZXZSdW5MZXZlbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcnVuU3RhcnQgPSBwcmV2UnVuU3RhcnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bkxpbWl0ID0gcHJldlJ1bkxpbWl0OworICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFpbGluZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIH0KKworICAgICAgICAgIC8vIGNhcmV0IG1pZ2h0IGJlID09IGxpbmVFbmQuICBUaGlzIGlzIGdlbmVyYWxseSBhIHNwYWNlIG9yIHBhcmFncmFwaAorICAgICAgICAgIC8vIHNlcGFyYXRvciBhbmQgaGFzIGFuIGFzc29jaWF0ZWQgcnVuL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RhcnQgKworICAgICAgICAgICAgKHJ1bnNbb3RoZXJSdW5JbmRleCsxXSAmIExheW91dC5SVU5fTEVOR1RIX01BU0spOworICAgICAgICAgICAgaWYgKG90aGVyUnVuTGltaXQgPiBsaW5lRW5kKSB7CisgICAgICAgICAgICAgICAgb3RoZXJSdW5MaW1pdCA9IGxpbmVFbmQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpbnQgb3RoZXJSdW5MZXZlbCA9IChydW5zW290aGVyUnVuSW5kZXgrMV0gPj4+IExheW91dC5SVU5fTEVWRUxfU0hJRlQpICYKKyAgICAgICAgICAgICAgICBMYXlvdXQuUlVOX0xFVkVMX01BU0s7CisgICAgICAgICAgICBib29sZWFuIG90aGVyUnVuSXNSdGwgPSAob3RoZXJSdW5MZXZlbCAmIDEpICE9IDA7CisKKyAgICAgICAgICAgIGFkdmFuY2UgPSB0b0xlZnQgPT0gb3RoZXJSdW5Jc1J0bDsKKyAgICAgICAgICAgIGlmIChuZXdDYXJldCA9PSAtMSkgeworICAgICAgICAgICAgICAgIG5ld0NhcmV0ID0gZ2V0T2Zmc2V0QmVmb3JlQWZ0ZXIob3RoZXJSdW5JbmRleCwgb3RoZXJSdW5TdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG90aGVyUnVuTGltaXQsIG90aGVyUnVuSXNSdGwsCisgICAgICAgICAgICAgICAgICAgICAgICBhZHZhbmNlID8gb3RoZXJSdW5TdGFydCA6IG90aGVyUnVuTGltaXQsIGFkdmFuY2UpOworICAgICAgICAgICAgICAgIGlmIChuZXdDYXJldCA9PSAoYWR2YW5jZSA/IG90aGVyUnVuTGltaXQgOiBvdGhlclJ1blN0YXJ0KSkgeworICAgICAgICAgICAgICAgICAgICAvLyBDcm9zc2VkIGFuZCBlbmRlZCB1cCBhdCBhIG5ldyBib3VuZGFyeSwKKyAgICAgICAgICAgICAgICAgICAgLy8gcmVwZWF0IGEgc2Vjb25kIGFuZCBmaW5hbCB0aW1lLgorICAgICAgICAgICAgICAgICAgICBydW5JbmRleCA9IG90aGVyUnVuSW5kZXg7CisgICAgICAgICAgICAgICAgICAgIHJ1bkxldmVsID0gb3RoZXJSdW5MZXZlbDsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBUaGUgbmV3IGNhcmV0IGlzIGF0IGEgYm91bmRhcnkuCisgICAgICAgICAgICBpZiAob3RoZXJSdW5MZXZlbCA8IHJ1bkxldmVsKSB7CisgICAgICAgICAgICAgIC8vIFRoZSBzdHJvbmcgY2hhcmFjdGVyIGlzIGluIHRoZSBvdGhlciBydW4uCisgICAgICAgICAgICAgIG5ld0NhcmV0ID0gYWR2YW5jZSA/IG90aGVyUnVuU3RhcnQgOiBvdGhlclJ1bkxpbWl0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgfQorCisgICAgICAgICAgaWYgKG5ld0NhcmV0ID09IC0xKSB7CisgICAgICAgICAgICAgIC8vIFdlJ3JlIHdhbGtpbmcgb2ZmIHRoZSBlbmQgb2YgdGhlIGxpbmUuICBUaGUgcGFyYWdyYXBoCisgICAgICAgICAgICAgIC8vIGxldmVsIGlzIGFsd2F5cyBlcXVhbCB0byBvciBsb3dlciB0aGFuIGFueSBpbnRlcm5hbCBsZXZlbCwgc28KKyAgICAgICAgICAgICAgLy8gdGhlIGJvdW5kYXJpZXMgZ2V0IHRoZSBzdHJvbmcgY2FyZXQuCisgICAgICAgICAgICAgIG5ld0NhcmV0ID0gYWR2YW5jZSA/IG1MZW4gKyAxIDogLTE7CisgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIH0KKworICAgICAgICAgIC8vIEVsc2Ugd2UndmUgYXJyaXZlZCBhdCB0aGUgZW5kIG9mIHRoZSBsaW5lLiAgVGhhdCdzIGEgc3Ryb25nIHBvc2l0aW9uLgorICAgICAgICAgIC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V0cmljQWZmZWN0aW5nU3Bhbi5jbGFzcykgLSBtU3RhcnQ7CisgICAgICAgICAgICAgICAgaWYgKHNwYW5MaW1pdCA+PSB0YXJnZXQpIHsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNwYW5TdGFydCA9IHNwYW5MaW1pdDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgTWV0cmljQWZmZWN0aW5nU3BhbltdIHNwYW5zID0gbVNwYW5uZWQuZ2V0U3BhbnMobVN0YXJ0ICsgc3BhblN0YXJ0LAorICAgICAgICAgICAgICAgICAgICBtU3RhcnQgKyBzcGFuTGltaXQsIE1ldHJpY0FmZmVjdGluZ1NwYW4uY2xhc3MpOworCisgICAgICAgICAgICBpZiAoc3BhbnMubGVuZ3RoID4gMCkgeworICAgICAgICAgICAgICAgIFJlcGxhY2VtZW50U3BhbiByZXBsYWNlbWVudCA9IG51bGw7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBzcGFucy5sZW5ndGg7IGorKykgeworICAgICAgICAgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuIHNwYW4gPSBzcGFuc1tqXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNwYW4gaW5zdGFuY2VvZiBSZXBsYWNlbWVudFNwYW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlcGxhY2VtZW50ID0gKFJlcGxhY2VtZW50U3BhbilzcGFuOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgc3Bhbi51cGRhdGVNZWFzdXJlU3RhdGUod3ApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHJlcGxhY2VtZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gSWYgd2UgaGF2ZSBhIHJlcGxhY2Vt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LAorICAgICAgICAgICAgRm9udE1ldHJpY3NJbnQgZm1pLCBib29sZWFuIG5lZWRXaWR0aCkgeworCisgICAgICAgIGZsb2F0IHJldCA9IDA7CisKKyAgICAgICAgaW50IHJ1bkxlbiA9IGVuZCAtIHN0YXJ0OworICAgICAgICBpbnQgY29udGV4dExlbiA9IGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQ7CisgICAgICAgIGlmIChuZWVkV2lkdGggfHwgKGMgIT0gbnVsbCAmJiAod3AuYmdDb2xvciAhPSAwIHx8IHJ1bklzUnRsKSkpIHsKKyAgICAgICAgICAgIGludCBmbGFncyA9IHJ1bklzUnRsID8gUGFpbnQuRElSRUNUSU9OX1JUTCA6IFBhaW50LkRJUkVDVElPTl9MVFI7CisgICAgICAgICAgICBpZiAobUNoYXJzVmFsaWQpIHsKKyAgICAgICAgICAgICAgICByZXQgPSB3cC5nZXRUZXh0UnVuQWR2YW5jZXMobUNoYXJzLCBzdGFydCwgcnVuTGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dFN0YXJ0LCBjb250ZXh0TGVuLCBmbGFncywgbnVsbCwgMCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGludCBkZWx0YSA9IG1TdGFydDsKKyAgICAgICAgICAgICAgICByZXQgPSB3cC5nZXRUZXh0UnVuQWR2YW5jZXMobVRleHQsIGRlbHRhICsgc3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YSArIGVuZCwgZGVsdGEgKyBjb250ZXh0U3RhcnQsIGRlbHRhICsgY29udGV4dEVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzLCBudWxsLCAwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChmbWkgIT0gbnVsbCkgeworICAgICAgICAgICAgd3AuZ2V0Rm9udE1ldHJpY3NJbnQoZm1pKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChjICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChydW5Jc1J0bCkgeworICAgICAgICAgICAgICAgIHggLT0gcmV0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAod3AuYmdDb2xvciAhPSAwKSB7CisgICAgICAgICAgICAgICAgaW50IGNvbG9yID0gd3AuZ2V0Q29sb3IoKTsKKyAgICAgICAgICAgICAgICBQYWludC5TdHlsZSBzID0gd3AuZ2V0U3R5bGUoKTsKKyAgICAgICAgICAgICAgICB3cC5zZXRDb2xvcih3cC5iZ0NvbG9yKTsKKyAgICAgICAgICAgICAgICB3cC5zZXRTdHlsZShQYWludC5TdHlsZS5GSUxMKTsKKworICAgICAgICAgICAgICAgIGMuZHJhd1JlY3QoeCwgdG9wLCB4ICsgcmV0LCBib3R0b20sIHdwKTsKKworICAgICAgICAgICAgICAgIHdwLnNldFN0eWxlKHMpOworICAgICAgICAgICAgICAgIHdwLnNldENvbG9yKGNvbG9yKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZHJhd1RleHRSdW4oYywgd3AsIHN0YXJ0LCBlbmQsIGNvbnRleHRTdGFydCwgY29udGV4dEVuZCwgcnVuSXNSdGwsCisgICAgICAgICAgICAgICAgICAgIHgsIHkgKyB3cC5iYXNlbGluZVNoaWZ0KTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBydW5Jc1J0bCA/IC1yZXQgOiByZXQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogVXRpbGl0eSBmdW5jdGlvbiBmb3IgbWVhc3VyaW5nIGFuZCByZW5kZXJpbmcgYSByZXBsYWNlbWVudC4KKyAgICAgKgorICAgICAqIEBwYXJhbSByZXBsYWNlbWVudCB0aGUgcmVwbGFjZW1lbnQKKyAgICAgKiBAcGFyYW0gd3AgdGhlIHdvcmsgcGFpbnQKKyAgICAgKiBAcGFyYW0gcnVuSW5kZXggdGhlIHJ1biBpbmRleAorICAgICAqIEBwYXJhbSBzdGFydCB0aGUgc3RhcnQgb2YgdGhlI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c0ludCBmbWksCisgICAgICAgICAgICBib29sZWFuIG5lZWRXaWR0aCkgeworCisgICAgICAgIGZsb2F0IHJldCA9IDA7CisKKyAgICAgICAgaW50IHRleHRTdGFydCA9IG1TdGFydCArIHN0YXJ0OworICAgICAgICBpbnQgdGV4dExpbWl0ID0gbVN0YXJ0ICsgbGltaXQ7CisKKyAgICAgICAgaWYgKG5lZWRXaWR0aCB8fCAoYyAhPSBudWxsICYmIHJ1bklzUnRsKSkgeworICAgICAgICAgICAgcmV0ID0gcmVwbGFjZW1lbnQuZ2V0U2l6ZSh3cCwgbVRleHQsIHRleHRTdGFydCwgdGV4dExpbWl0LCBmbWkpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGMgIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKHJ1bklzUnRsKSB7CisgICAgICAgICAgICAgICAgeCAtPSByZXQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXBsYWNlbWVudC5kcmF3KGMsIG1UZXh0LCB0ZXh0U3RhcnQsIHRleHRMaW1pdCwKKyAgICAgICAgICAgICAgICAgICAgeCwgdG9wLCB5LCBib3R0b20sIHdwKTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBydW5Jc1J0bCA/IC1yZXQgOiByZXQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogVXRpbGl0eSBmdW5jdGlvbiBmb3IgaGFuZGxpbmcgYSB1bmlkaXJlY3Rpb25hbCBydW4uICBUaGUgcnVuIG11c3Qgbm90CisgICAgICogY29udGFpbiB0YWJzIG9yIGVtb2ppIGJ1dCBjYW4gY29udGFpbiBzdHlsZXMuCisgICAgICoKKyAgICAgKiBAcGFyYW0gcnVuSW5kZXggdGhlIHJ1biBpbmRleAorICAgICAqIEBwYXJhbSBzdGFydCB0aGUgbGluZS1yZWxhdGl2ZSBzdGFydCBvZiB0aGUgcnVuCisgICAgICogQHBhcmFtIG1lYXN1cmVMaW1pdCB0aGUgb2Zmc2V0IHRvIG1lYXN1cmUgd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GFwaW5nIG5lZWRzIHRvIHRha2UgaW50byBhY2NvdW50IGNvbnRleHQgdXAgdG8gbWV0cmljIGJvdW5kYXJpZXMsCisgICAgICAgIC8vIGJ1dCByZW5kZXJpbmcgbmVlZHMgdG8gdGFrZSBpbnRvIGFjY291bnQgY2hhcmFjdGVyIHN0eWxlIGJvdW5kYXJpZXMuCisgICAgICAgIC8vIFNvIHdlIGl0ZXJhdGUgdGhyb3VnaCBtZXRyaWMgcnVucyB0byBnZXQgbWV0cmljIGJvdW5kcywKKyAgICAgICAgLy8gdGhlbiB3aXRoaW4gZWFjaCBtZXRyaWMgcnVuIGl0ZXJhdGUgdGhyb3VnaCBjaGFyYWN0ZXIgc3R5bGUgcnVucworICAgICAgICAvLyBmb3IgdGhlIHJ1biBib3VuZHMuCisgICAgICAgIGZsb2F0IG94ID0geDsKKyAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0LCBpbmV4dDsgaSA8IG1lYXN1cmVMaW1pdDsgaSA9IGluZXh0KSB7CisgICAgICAgICAgICBUZXh0UGFpbnQgd3AgPSBtV29ya1BhaW50OworICAgICAgICAgICAgd3Auc2V0KG1QYWludCk7CisKKyAgICAgICAgICAgIGludCBtbGltaXQ7CisgICAgICAgICAgICBpZiAobVNwYW5uZWQgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGluZXh0ID0gbGltaXQ7CisgICAgICAgICAgICAgICAgbWxpbWl0ID0gbWVhc3VyZUxpbWl0OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpbmV4dCA9IG1TcGFubmVkLm5leHRTcGFuVHJhbnNpdGlvbihtU3RhcnQgKyBpLCBtU3RhcnQgKyBsaW1pdCwKKyAgICAgICAgICAgICAgICAgICAgICAgIE1ldHJpY0FmZmVjdGluZ1NwYW4uY2xhc3MpIC0gbVN0YXJ0OworCisgICAgICAgICAgICAgICAgbWxpbWl0ID0gaW5leHQgPCBtZWFzdXJlTGltaXQgPyBpbmV4dCA6IG1lYXN1cmVMaW1pdDsKKyAgICAgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuW10gc3BhbnMgPSBtU3Bhbm5lZC5nZXRTcGFucyhtU3RhcnQgKyBpLAorICAgICAgICAgICAgICAgICAgICAgICAgbVN0YXJ0ICsgbWxpbWl0LCBNZXRyaWNBZmZlY3RpbmdTcGFuLmNsYXNzKTsKKworICAgICAgICAgICAgICAgIGlmIChzcGFucy5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIFJlcGxhY2VtZW50U3BhbiByZXBsYWNlbWVudCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgc3BhbnMubGVuZ3RoOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIE1ldHJpY0FmZmVjdGluZ1NwYW4gc3BhbiA9IHNwYW5zW2pdOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNwYW4gaW5zdGFuY2VvZiBSZXBsYWNlbWVudFNwYW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXBsYWNlbWVudCA9IChSZXBsYWNlbWVudFNwYW4pc3BhbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgbWlnaHQgaGF2ZSBhIHJlcGxhY2VtZW50IHRoYXQgdXNlcyB0aGUgZHJhdworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0YXRlLCBvdGhlcndpc2UgbWVhc3VyZSBzdGF0ZSB3b3VsZCBzdWZmaWNlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwYW4udXBkYXRlRHJhd1N0YXRlKHdwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChyZXBsYWNlbWVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB4ICs9IGhhbmRsZVJlcGxhY2VtZW50KHJlcGxhY2VtZW50LCB3cCwgcnVuSW5kZXgsIGksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1saW1pdCwgcnVuSXNSdGwsIGMsIHgsIHRvcCwgeSwgYm90dG9tLCBmbWksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRXaWR0aCB8fCBtbGltaXQgPCBtZWFzdXJlTGltaXQpOworICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChtU3Bhbm5lZCA9PSBudWxsIHx8IGMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHggKz0gaGFuZGxlVGV4dCh3cCwgaSwgbWxpbWl0LCBpLCBpbmV4dCwgcnVuSXNSdGwsIGMsIHgsIHRvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHksIGJvdHRvbSwgZm1pLCBuZWVkV2lkdGggfHwgbWxpbWl0IDwgbWVhc3VyZUxpbWl0KTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IGksIGpuZXh0OyBqIDwgbWxpbWl0OyBqID0gam5leHQpIHsKKyAgICAgICAgICAgICAgICAgICAgam5leHQgPSBtU3Bhbm5lZC5uZXh0U3BhblRyYW5zaXRpb24obVN0YXJ0ICsgaiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3RhcnQgKyBtbGltaXQsIENoYXJhY3RlclN0eWxlLmNsYXNzKSAtIG1TdGFydDsKKworICAgICAgICAgICAgICAgICAgICBDaGFyYWN0ZXJTdHlsZVtdIHNwYW5zID0gbVNwYW5uZWQuZ2V0U3BhbnMobVN0YXJ0ICsgaiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3RhcnQgKyBqbmV4dCwgQ2hhcmFjdGVyU3R5bGUuY2xhc3MpOworCisgICAgICAgICAgICAgICAgICAgIHdwLnNldChtUGFpbnQpOworICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBrID0gMDsgayA8IHNwYW5zLmxlbmd0aDsgaysrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBDaGFyYWN0ZXJTdHlsZSBzcGFuID0gc3BhbnNba107CisgICAgICAgICAgICAgICAgICAgICAgICBzcGFuLnVwZGF0ZURyYXdTdGF0ZSh3cCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB4ICs9IGhhbmRsZVRleHQod3AsIGosIGpuZXh0LCBpLCBpbmV4dCwgcnVuSXNSdGwsIGMsIHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wLCB5LCBib3R0b20sIGZtaSwgbmVlZFdpZHRoIHx8IGpuZXh0IDwgbWVhc3VyZUxpbWl0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4geCAtIG94OworICAgIH0KKworICAgIC8qKgorICAgICAqIFJlbmRlciBhIHRleHQgcnVuIHdpdGggdGhlIHNldC11cCBwYWludC4KKyAgICAgKgorICAgICAqIEBwYXJhbSBjIHRoZSBjYW52YXMKKyAgICAgKiBAcGFyYW0gd3AgdGhlIHBhaW50IHVzZWQgdG8gcmVuZGVyIHRoZSB0ZXh0CisgICAgICogQHBhcmFtIHN0YXJ0IHRoZSBzdGFydCBvZiB0aGUgcnVuCisgICAgICogQHBhcmFtIGVuZCB0aGUgZW5kIG9mIHRoZSBydW4KKyAgICAgKiBAcGFyYW0gY29udGV4dFN0YXJ0IHRoZSBzdGFydCBvZiBjb250ZXh0IGZvciB0aGUgcnVuCisgICAgICogQHBhcmFtIGNvbnRleHRFbmQgdGhlIGVuZCBvZiB0aGUgY29udGV4dCBmb3IgdGhlIHJ1bgorICAgICAqIEBwYXJhbSBydW5Jc1J0bCB0cnVlIGlmIHRoZSBydW4gaXMgcmlnaHQtdG8tbGVmdAorICAgICAqIEBwYXJhbSB4IHRoZSB4IHBvc2l0aW9uIG9mIHRoZSBsZWZ0IGVkZ2Ugb2YgdGhlIHJ1bgorICAgICAqIEBwYXJhbSB5IHRoZSBiYXNlbGluZSBvZiB0aGUgcnVuCisgICAgICovCisgICAgcHJpdmF0ZSB2b2lkIGRyYXdUZXh0UnVuKENhbnZhcyBjLCBUZXh0UGFpbnQgd3AsIGludCBzdGFydCwgaW50IGVuZCwKKyAgICAgICAgICAgIGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0RW5kLCBib29sZWFuIHJ1bklzUnRsLCBmbG9hdCB4LCBpbnQgeSkgeworCisgICAgICAgIGludCBmbGFncyA9IHJ1bklzUnRsID8gQ2FudmFzLkRJUkVDVElPTl9SVEwgOiBDYW52YXMuRElSRUNUSU9OX0xUUjsKKyAgICAgICAgaWYgKG1DaGFyc1ZhbGlkKSB7CisgICAgICAgICAgICBpbnQgY291bnQgPSBlbmQgLSBzdGFydDsKKyAgICAgICAgICAgIGludCBjb250ZXh0Q291bnQgPSBjb250ZXh0RW5kIC0gY29udGV4dFN0YXJ0OworICAgICAgICAgICAgYy5kcmF3VGV4dFJ1bihtQ2hhcnMsIHN0YXJ0LCBjb3VudCwgY29udGV4dFN0YXJ0LCBjb250ZXh0Q291bnQsCisgICAgICAgICAgICAgICAgICAgIHgsIHksIGZsYWdzLCB3cCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbnQgZGVsdGEgPSBtU3RhcnQ7CisgICAgICAgICAgICBjLmRyYXdUZXh0UnVuKG1UZXh0LCBkZWx0YSArIHN0YXJ0LCBkZWx0YSArIGVuZCwKKyAgICAgICAgICAgICAgICAgICAgZGVsdGEgKyBjb250ZXh0U3RhcnQsIGRlbHRhICsgY29udGV4dEVuZCwgeCwgeSwgZmxhZ3MsIHdwKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIGFzY2VudCBvZiB0aGUgdGV4dCBhdCBzdGFydC4gIFRoaXMgaXMgdXNlZCBmb3Igc2NhbGluZworICAgICAqIGVtb2ppLgorICAgICAqCisgICAgICogQHBhcmFtIHBvcyB0aGUgbGluZS1yZWxhdGl2ZSBwb3NpdGlvbgorICAgICAqIEByZXR1cm4gdGhlIGFzY2VudCBvZiB0aGUgdGV4dCBhdCBzdGFydAorICAgICAqLworICAgIGZsb2F0IGFzY2VudChpbnQgcG9zKSB7CisgICAgICAgIGlmIChtU3Bhbm5lZCA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gbVBhaW50LmFzY2VudCgpOworICAgICAgICB9CisKKyAgICAgICAgcG9zICs9IG1TdGFydDsKKyAgICAgICAgTWV0cmljQWZmZWN0aW5nU3BhbltdIHNwYW5zID0gbVNwYW5uZWQuZ2V0U3BhbnMocG9zLCBwb3MgKyAxLAorICAgICAgICAgICAgICAgIE1ldHJpY0FmZmVjdGluZ1NwYW4uY2xhc3MpOworICAgICAgICBpZiAoc3BhbnMubGVuZ3RoID09IDApIHsKKyAgICAgICAgICAgIHJldHVybiBtUGFpbnQuYXNjZW50KCk7CisgICAgICAgIH0KKworICAgICAgICBUZXh0UGFpbnQgd3AgPSBtV29ya1BhaW50OworICAgICAgICB3cC5zZXQobVBhaW50KTsKKyAgICAgICAgZm9yIChNZXRyaWNBZmZlY3RpbmdTcGFuIHNwYW4gOiBzcGFucykgeworICAgICAgICAgICAgc3Bhbi51cGRhdGVNZWFzdXJlU3RhdGUod3ApOworICAgICAgICB9CisgICAgICAgIHJldHVybiB3cC5hc2NlbnQoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBuZXh0IHRhYiBwb3NpdGlvbi4KKyAgICAgKgorICAgICAqIEBwYXJhbSBoIHRoZSAodW5zaWduZWQpIG9mZnNldCBmcm9tIHRoZSBsZWFkaW5nIG1hcmdpbgorICAgICAqIEByZXR1cm4gdGhlIC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NpZmllZCwgdGhlIHJldHVybmVkIGNvcHkKICAgICAgKiB3aWxsIGJlIHBhZGRlZCB3aXRoIHplcm8td2lkdGggc3BhY2VzIHRvIHByZXNlcnZlIHRoZSBvcmlnaW5hbApAQCAtOTkyLDcgKzk4OSw3IEBACiAgICAgICogcmVwb3J0IHRoZSBzdGFydCBhbmQgZW5kIG9mIHRoZSBlbGxpcHNpemVkIHJhbmdlLgogICAgICAqLwogICAgIHB1YmxpYyBzdGF0aWMgQ2hhclNlcXVlbmNlIGVsbGlwc2l6ZShDaGFyU2VxdWVuY2UgdGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGV4dFBhaW50IHAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCBwYWludCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgYXZhaWwsIFRydW5jYXRlQXQgd2hlcmUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gcHJlc2VydmVMZW5ndGgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsbGlwc2l6ZUNhbGxiYWNrIGNhbGxiYWNrKSB7CkBAIC0xMDAzLDEzICsxMDAwLDEyIEBACiAKICAgICAgICAgaW50IGxlbiA9IHRleHQubGVuZ3RoKCk7CiAKLSAgICAgICAgLy8gVXNlIFBhaW50LmJyZWFrVGV4dCgpIGZvciB0aGUgbm9uLVNwYW5uZWQgY2FzZSB0byBhdm9pZCBoYXZpbmcKLSAgICAgICAgLy8gdG8gYWxsb2NhdGUgbWVtb3J5IGFuZCBhY2N1bXVsYXRlIHRoZSBjaGFyYWN0ZXIgd2lkdGhzIG91cnNlbHZlcy4KKyAgICAgICAgTWVhc3VyZWRUZXh0IG10ID0gTWVhc3VyZWRUZXh0Lm9idGFpbigpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgZmxvYXQgd2lkdGggPSBzZXRQYXJhKG10LCBwYWludCwgdGV4dCwgMCwgdGV4dC5sZW5ndGgoKSwKKyAgICAgICAgICAgICAgICAgICAgTGF5b3V0LkRJUl9SRVFVRVNUX0RFRkFVTFRfTFRSKTsKIAotICAgICAgICBpZiAoISh0ZXh0IGluc3RhbmNlb2YgU3Bhbm5lZCkpIHsKLSAgICAgICAgICAgIGZsb2F0IHdpZCA9IHAubWVhc3VyZVRleHQodGV4dCwgMCwgbGVuKTsKLQotICAgICAgICAgICAgaWYgKHdpZCA8PSBhdmFpbCkgeworICAgICAgICAgICAgaWYgKHdpZHRoIDw9IGF2YWlsKSB7CiAgICAgICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2suZWxsaXBzaXplZCgwLCAwKTsKICAgICAgICAgICAgICAgICB9CkBAIC0xMDE3LDI1MCArMTAxMyw2OSBAQAogICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0OwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBmbG9hdCBlbGxpcHNpc3dpZCA9IHAubWVhc3VyZVRleHQoc0VsbGlwc2lzKTsKKyAgICAgICAgICAgIC8vIFhYWCBhc3N1bWVzIGVsbGlwc2lzIHN0cmluZyBkb2VzIG5vdCByZXF1aXJlIHNoYXBpbmcgYW5kCisgICAgICAgICAgICAvLyBpcyB1bmFmZmVjdGVkIGJ5IHN0eWxlCisgICAgICAgICAgICBmbG9hdCBlbGxpcHNpc3dpZCA9IHBhaW50Lm1lYXN1cmVUZXh0KHNFbGxpcHNpcyk7CisgICAgICAgICAgICBhdmFpbCAtPSBlbGxpcHNpc3dpZDsKIAotICAgICAgICAgICAgaWYgKGVsbGlwc2lzd2lkID4gYXZhaWwpIHsKLSAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2sgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjYWxsYmFjay5lbGxpcHNpemVkKDAsIGxlbik7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHByZXNlcnZlTGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNoYXJbXSBidWYgPSBvYnRhaW4obGVuKTsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47IGkrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgYnVmW2ldID0gJ1x1RkVGRic7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHJldCA9IG5ldyBTdHJpbmcoYnVmLCAwLCBsZW4pOwotICAgICAgICAgICAgICAgICAgICByZWN5Y2xlKGJ1Zik7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXQ7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuICIiOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHdoZXJlID09IFRydW5jYXRlQXQuU1RBUlQpIHsKLSAgICAgICAgICAgICAgICBpbnQgZml0ID0gcC5icmVha1RleHQodGV4dCwgMCwgbGVuLCBmYWxzZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXZhaWwgLSBlbGxpcHNpc3dpZCwgbnVsbCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2sgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjYWxsYmFjay5lbGxpcHNpemVkKDAsIGxlbiAtIGZpdCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHByZXNlcnZlTGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBibGFuayh0ZXh0LCAwLCBsZW4gLSBmaXQpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBzRWxsaXBzaXMgKyB0ZXh0LnRvU3RyaW5nKCkuc3Vic3RyaW5nKGxlbiAtIGZpdCwgbGVuKTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpbnQgbGVmdCA9IDA7CisgICAgICAgICAgICBpbnQgcmlnaHQgPSBsZW47CisgICAgICAgICAgICBpZiAoYXZhaWwgPCAwKSB7CisgICAgICAgICAgICAgICAgLy8gaXQgYWxsIGdvZXMKKyAgICAgICAgICAgIH0gZWxzZSBpZiAod2hlcmUgPT0gVHJ1bmNhdGVBdC5TVEFSVCkgeworICAgICAgICAgICAgICAgIHJpZ2h0ID0gbGVuIC0gbXQuYnJlYWtUZXh0KDAsIGxlbiwgZmFsc2UsIGF2YWlsKTsKICAgICAgICAgICAgIH0gZWxzZSBpZiAod2hlcmUgPT0gVHJ1bmNhdGVBdC5FTkQpIHsKLSAgICAgICAgICAgICAgICBpbnQgZml0ID0gcC5icmVha1RleHQodGV4dCwgMCwgbGVuLCB0cnVlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdmFpbCAtIGVsbGlwc2lzd2lkLCBudWxsKTsKLQotICAgICAgICAgICAgICAgIGlmIChjYWxsYmFjayAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrLmVsbGlwc2l6ZWQoZml0LCBsZW4pOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChwcmVzZXJ2ZUxlbmd0aCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmxhbmsodGV4dCwgZml0LCBsZW4pOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0LnRvU3RyaW5nKCkuc3Vic3RyaW5nKDAsIGZpdCkgKyBzRWxsaXBzaXM7Ci0gICAgICAgICAgICAgICAgfSAKLSAgICAgICAgICAgIH0gZWxzZSAvKiB3aGVyZSA9PSBUcnVuY2F0ZUF0Lk1JRERMRSAqLyB7Ci0gICAgICAgICAgICAgICAgaW50IHJpZ2h0ID0gcC5icmVha1RleHQodGV4dCwgMCwgbGVuLCBmYWxzZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXZhaWwgLSBlbGxpcHNpc3dpZCkgLyAyLCBudWxsKTsKLSAgICAgICAgICAgICAgICBmbG9hdCB1c2VkID0gcC5tZWFzdXJlVGV4dCh0ZXh0LCBsZW4gLSByaWdodCwgbGVuKTsKLSAgICAgICAgICAgICAgICBpbnQgbGVmdCA9IHAuYnJlYWtUZXh0KHRleHQsIDAsIGxlbiAtIHJpZ2h0LCB0cnVlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXZhaWwgLSBlbGxpcHNpc3dpZCAtIHVzZWQsIG51bGwpOwotCi0gICAgICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2suZWxsaXBzaXplZChsZWZ0LCBsZW4gLSByaWdodCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHByZXNlcnZlTGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBibGFuayh0ZXh0LCBsZWZ0LCBsZW4gLSByaWdodCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHMgPSB0ZXh0LnRvU3RyaW5nKCk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBzLnN1YnN0cmluZygwLCBsZWZ0KSArIHNFbGxpcHNpcyArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBzLnN1YnN0cmluZyhsZW4gLSByaWdodCwgbGVuKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBCdXQgZG8gdGhlI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gICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuOyBpKyspIHsKLSAgICAgICAgICAgIHN1bSArPSB3aWRbbGVuICsgaV07Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoc3VtIDw9IGF2YWlsKSB7Ci0gICAgICAgICAgICBpZiAoY2FsbGJhY2sgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGNhbGxiYWNrLmVsbGlwc2l6ZWQoMCwgMCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiB0ZXh0OwotICAgICAgICB9Ci0KLSAgICAgICAgZmxvYXQgZWxsaXBzaXN3aWQgPSBwLm1lYXN1cmVUZXh0KHNFbGxpcHNpcyk7Ci0KLSAgICAgICAgaWYgKGVsbGlwc2lzd2lkID4gYXZhaWwpIHsKLSAgICAgICAgICAgIGlmIChjYWxsYmFjayAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgY2FsbGJhY2suZWxsaXBzaXplZCgwLCBsZW4pOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAocHJlc2VydmVMZW5ndGgpIHsKLSAgICAgICAgICAgICAgICBjaGFyW10gYnVmID0gb2J0YWluKGxlbik7Ci0gICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47IGkrKykgewotICAgICAgICAgICAgICAgICAgICBidWZbaV0gPSAnXHVGRUZGJzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgU3Bhbm5hYmxlU3RyaW5nIHNzID0gbmV3IFNwYW5uYWJsZVN0cmluZyhuZXcgU3RyaW5nKGJ1ZiwgMCwgbGVuKSk7Ci0gICAgICAgICAgICAgICAgcmVjeWNsZShidWYpOwotICAgICAgICAgICAgICAgIGNvcHlTcGFuc0Zyb20oc3AsIDAsIGxlbiwgT2JqZWN0LmNsYXNzLCBzcywgMCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHNzOworICAgICAgICAgICAgICAgIGxlZnQgPSBtdC5icmVha1RleHQoMCwgbGVuLCB0cnVlLCBhdmFpbCk7CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJldHVybiAiIjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmICh3aGVyZSA9PSBUcnVuY2F0ZUF0LlNUQVJUKSB7Ci0gICAgICAgICAgICBzdW0gPSAwOwotICAgICAgICAgICAgaW50IGk7Ci0KLSAgICAgICAgICAgIGZvciAoaSA9IGxlbjsgaSA+PSAwOyBpLS0pIHsKLSAgICAgICAgICAgICAgICBmbG9hdCB3ID0gd2lkW2xlbiArIGkgLSAxXTsKLQotICAgICAgICAgICAgICAgIGlmICh3ICsgc3VtICsgZWxsaXBzaXN3aWQgPiBhdmFpbCkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzdW0gKz0gdzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBjYWxsYmFjay5lbGxpcHNpemVkKDAsIGkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAocHJlc2VydmVMZW5ndGgpIHsKLSAgICAgICAgICAgICAgICBTcGFubmFibGVTdHJpbmcgc3MgPSBuZXcgU3Bhbm5hYmxlU3RyaW5nKGJsYW5rKHRleHQsIDAsIGkpKTsKLSAgICAgICAgICAgICAgICBjb3B5U3BhbnNGcm9tKHNwLCAwLCBsZW4sIE9iamVjdC5jbGFzcywgc3MsIDApOwotICAgICAgICAgICAgICAgIHJldHVybiBzczsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgU3Bhbm5hYmxlU3RyaW5nQnVpbGRlciBvdXQgPSBuZXcgU3Bhbm5hYmxlU3RyaW5nQnVpbGRlcihzRWxsaXBzaXMpOwotICAgICAgICAgICAgICAgIG91dC5pbnNlcnQoMSwgdGV4dCwgaSwgbGVuKTsKLQotICAgICAgICAgICAgICAgIHJldHVybiBvdXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSBpZiAod2hlcmUgPT0gVHJ1bmNhdGVBdC5FTkQpIHsKLSAgICAgICAgICAgIHN1bSA9IDA7Ci0gICAgICAgICAgICBpbnQgaTsKLQotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGxlbjsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgZmxvYXQgdyA9IHdpZFtsZW4gKyBpXTsKLQotICAgICAgICAgICAgICAgIGlmICh3ICsgc3VtICsgZWxsaXBzaXN3aWQgPiBhdmFpbCkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzdW0gKz0gdzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBjYWxsYmFjay5lbGxpcHNpemVkKGksIGxlbik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChwcmVzZXJ2ZUxlbmd0aCkgewotICAgICAgICAgICAgICAgIFNwYW5uYWJsZVN0cmluZyBzcyA9IG5ldyBTcGFubmFibGVTdHJpbmcoYmxhbmsodGV4dCwgaSwgbGVuKSk7Ci0gICAgICAgICAgICAgICAgY29weVNwYW5zRnJvbShzcCwgMCwgbGVuLCBPYmplY3QuY2xhc3MsIHNzLCAwKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gc3M7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIgb3V0ID0gbmV3IFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIoc0VsbGlwc2lzKTsKLSAgICAgICAgICAgICAgICBvdXQuaW5zZXJ0KDAsIHRleHQsIDAsIGkpOwotCi0gICAgICAgICAgICAgICAgcmV0dXJuIG91dDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIC8qIHdoZXJlID0gVHJ1bmNhdGVBdC5NSURETEUgKi8gewotICAgICAgICAgICAgZmxvYXQgbHN1bSA9IDAsIHJzdW0gPSAwOwotICAgICAgICAgICAgaW50IGxlZnQgPSAwLCByaWdodCA9IGxlbjsKLQotICAgICAgICAgICAgZmxvYXQgcmF2YWlsID0gKGF2YWlsIC0gZWxsaXBzaXN3aWQpIC8gMjsKLSAgICAgICAgICAgIGZvciAocmlnaHQgPSBsZW47IHJpZ2h0ID49IDA7IHJpZ2h0LS0pIHsKLSAgICAgICAgICAgICAgICBmbG9hdCB3ID0gd2lkW2xlbiArIHJpZ2h0IC0gMV07Ci0KLSAgICAgICAgICAgICAgICBpZiAodyArIHJzdW0gPiByYXZhaWwpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgcnN1bSArPSB3OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBmbG9hdCBsYXZhaWwgPSBhdmFpbCAtIGVsbGlwc2lzd2lkIC0gcnN1bTsKLSAgICAgICAgICAgIGZvciAobGVmdCA9IDA7IGxlZnQgPCByaWdodDsgbGVmdCsrKSB7Ci0gICAgICAgICAgICAgICAgZmxvYXQgdyA9IHdpZFtsZW4gKyBsZWZ0XTsKLQotICAgICAgICAgICAgICAgIGlmICh3ICsgbHN1bSA+IGxhdmFpbCkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBsc3VtICs9IHc7CisgICAgICAgICAgICAgICAgcmlnaHQgPSBsZW4gLSBtdC5icmVha1RleHQoMCwgbGVuLCBmYWxzZSwgYXZhaWwgLyAyKTsKKyAgICAgICAgICAgICAgICBhdmFpbCAtPSBtdC5tZWFzdXJlKHJpZ2h0LCBsZW4pOworICAgICAgICAgICAgICAgIGxlZnQgPSBtdC5icmVha1RleHQoMCwgcmlnaHQsIHRydWUsIGF2YWlsKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgaWYgKGNhbGxiYWNrICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBjYWxsYmFjay5lbGxpcHNpemVkKGxlZnQsIHJpZ2h0KTsKICAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgY2hhcltdIGJ1ZiA9IG10Lm1DaGFyczsKKyAgICAgICAgICAgIFNwYW5uZWQgc3AgPSB0ZXh0IGluc3RhbmNlb2YgU3Bhbm5lZCA/IChTcGFubmVkKSB0ZXh0IDogbnVsbDsKKworICAgICAgICAgICAgaW50IHJlbWFpbmluZyA9IGxlbiAtIChyaWdodCAtIGxlZnQpOwogICAgICAgICAgICAgaWYgKHByZXNlcnZlTGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgU3Bhbm5hYmxlU3RyaW5nIHNzID0gbmV3IFNwYW5uYWJsZVN0cmluZyhibGFuayh0ZXh0LCBsZWZ0LCByaWdodCkpOworICAgICAgICAgICAgICAgIGlmIChyZW1haW5pbmcgPiAwKSB7IC8vIGVsc2UgZWxpbWluYXRlIHRoZSBlbGxpcHNpcyB0b28KKyAgICAgICAgICAgICAgICAgICAgYnVmW2xlZnQrK10gPSAnXHUyMDI2JzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IGxlZnQ7IGkgPCByaWdodDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGJ1ZltpXSA9ICdcdUZFRkYnOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBTdHJpbmcgcyA9IG5ldyBTdHJpbmcoYnVmLCAwLCBsZW4pOworICAgICAgICAgICAgICAgIGlmIChzcCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBzOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBTcGFubmFib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MTsgaSA8IGVuZDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgYnVmW2ldID0gJ1x1RkVGRic7CisgICAgICAgICAgICBpZiAocmVtYWluaW5nID09IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gIiI7CiAgICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAKLSAgICAgICAgU3RyaW5nIHJldCA9IG5ldyBTdHJpbmcoYnVmLCAwLCBsZW4pOwotICAgICAgICByZWN5Y2xlKGJ1Zik7CiAKLSAgICAgICAgcmV0dXJuIHJldDsKKyAgICAgICAgICAgIGlmIChzcCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBzYiA9IG5ldyBTdHJpbmdCdWlsZGVyKHJlbWFpbmluZyArIHNFbGxpcHNpcy5sZW5ndGgoKSk7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKGJ1ZiwgMCwgbGVmdCk7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKHNFbGxpcHNpcyk7CisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKGJ1ZiwgcmlnaHQsIGxlbiAtIHJpZ2h0KTsKKyAgICAgICAgICAgICAgICByZXR1cm4gc2IudG9TdHJpbmcoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgU3Bhbm5hYmxlU3RyaW5nQnVpbGRlciBzc2IgPSBuZXcgU3Bhbm5hYmxlU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgc3NiLmFwcGVuZCh0ZXh0LCAwLCBsZWZ0KTsKKyAgICAgICAgICAgIHNzYi5hcHBlbmQoc0VsbGlwc2lzKTsKKyAgICAgICAgICAgIHNzYi5hcHBlbmQodGV4dCwgcmlnaHQsIGxlbik7CisgICAgICAgICAgICByZXR1cm4gc3NiOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgTWVhc3VyZWRUZXh0LnJlY3ljbGUobXQpOworICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCkBAIC0xMjc4LDgwICsxMDkzLDEyMSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRleHRQYWludCBwLCBmbG9hdCBhdmFpbCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgb25lTW9yZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgbW9yZSkgewotICAgICAgICBpbnQgbGVuID0gdGV4dC5sZW5ndGgoKTsKLSAgICAgICAgY2hhcltdIGJ1ZiA9IG5ldyBjaGFyW2xlbl07Ci0gICAgICAgIFRleHRVdGlscy5nZXRDaGFycyh0ZXh0LCAwLCBsZW4sIGJ1ZiwgMCk7CiAKLSAgICAgICAgaW50IGNvbW1hQ291bnQgPSAwOwotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbjsgaSsrKSB7Ci0gICAgICAgICAgICBpZiAoYnVmW2ldID09ICcsJykgewotICAgICAgICAgICAgICAgIGNvbW1hQ291bnQrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGZsb2F0W10gd2lkOwotCi0gICAgICAgIGlmICh0ZXh0IGluc3RhbmNlb2YgU3Bhbm5lZCkgewotICAgICAgICAgICAgU3Bhbm5lZCBzcCA9IChTcGFubmVkKSB0ZXh0OwotICAgICAgICAgICAgVGV4dFBhaW50IHRlbXBwYWludCA9IG5ldyBUZXh0UGFpbnQoKTsKLSAgICAgICAgICAgIHdpZCA9IG5ldyBmbG9hdFtsZW4gKiAyXTsKLQotICAgICAgICAgICAgaW50IG5leHQ7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbjsgaSA9IG5leHQpIHsKLSAgICAgICAgICAgICAgICBuZXh0ID0gc3AubmV4dFNwYW5UcmFuc2l0aW9uKGksIGxlbiwgTWV0cmljQWZmZWN0aW5nU3Bhbi5jbGFzcyk7Ci0KLSAgICAgICAgICAgICAgICBTdHlsZWQuZ2V0VGV4dFdpZHRocyhwLCB0ZW1wcGFpbnQsIHNwLCBpLCBuZXh0LCB3aWQsIG51bGwpOwotICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkod2lkLCAwLCB3aWQsIGxlbiArIGksIG5leHQgLSBpKTsKKyAgICAgICAgTWVhc3VyZWRUZXh0IG10ID0gTWVhc3VyZWRUZXh0Lm9idGFpbigpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaW50IGxlbiA9IHRleHQubGVuZ3RoKCk7CisgICAgICAgICAgICBmbG9hdCB3aWR0aCA9IHNldFBhcmEobXQsIHAsIHRleHQsIDAsIGxlbiwgTGF5b3V0LkRJUl9SRVFVRVNUX0RFRkFVTFRfTFRSKTsKKyAgICAgICAgICAgIGlmICh3aWR0aCA8PSBhdmFpbCkgeworICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0OwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KHdpZCwgbGVuLCB3aWQsIDAsIGxlbik7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICB3aWQgPSBuZXcgZmxvYXRbbGVuXTsKLSAgICAgICAgICAgIHAuZ2V0VGV4dFdpZHRocyh0ZXh0LCAwLCBsZW4sIHdpZCk7Ci0gICAgICAgIH0KKyAgICAgICAgICAgIGNoYXJbXSBidWYgPSBtdC5tQ2hhcnM7CiAKLSAgICAgICAgaW50IG9rID0gMDsKLSAgICAgICAgaW50IG9rUmVtYWluaW5nID0gY29tbWFDb3VudCArIDE7Ci0gICAgICAgIFN0cmluZyBva0Zvcm1hdCA9ICIiOwotCi0gICAgICAgIGludCB3ID0gMDsKLSAgICAgICAgaW50IGNvdW50ID0gMDsKLQotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbjsgaSsrKSB7Ci0gICAgICAgICAgICB3ICs9IHdpZFtpXTsKLQotICAgICAgICAgICAgaWYgKGJ1ZltpXSA9PSAnLCcpIHsKLSAgICAgICAgICAgICAgICBjb3VudCsrOwotCi0gICAgICAgICAgICAgICAgaW50IHJlbWFpbmluZyA9IGNvbW1hQ291bnQgLSBjb3VudCArIDE7Ci0gICAgICAgICAgICAgICAgZmxvYXQgbW9yZVdpZDsKLSAgICAgICAgICAgICAgICBTdHJpbmcgZm9ybWF0OwotCi0gICAgICAgICAgICAgICAgaWYgKHJlbWFpbmluZyA9PSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZvcm1hdCA9ICIgIiArIG9uZU1vcmU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZm9ybWF0ID0gIiAiICsgU3RyaW5nLmZvcm1hdChtb3JlLCByZW1haW5pbmcpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1vcmVXaWQgPSBwLm1lYXN1cmVUZXh0KGZvcm1hdCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAodyArIG1vcmVXaWQgPD0gYXZhaWwpIHsKLSAgICAgICAgICAgICAgICAgICAgb2sgPSBpICsgMTsKLSAgICAgICAgICAgICAgICAgICAgb2tSZW1haW5pbmcgPSByZW1haW5pbmc7Ci0gICAgICAgICAgICAgICAgICAgIG9rRm9ybWF0ID0gZm9ybWF0OworICAgICAgICAgICAgaW50IGNvbW1hQ291bnQgPSAwOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47IGkrKykgeworICAgICAgICAgICAgICAgIGlmIChidWZbaV0gPT0gJywnKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbW1hQ291bnQrKzsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgIH0KIAotICAgICAgICBpZiAodyA8PSBhdmFpbCkgewotICAgICAgICAgICAgcmV0dXJuIHRleHQ7Ci0gICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbnQgcmVtYWluaW5nID0gY29tbWFDb3VudCArIDE7CisKKyAgICAgICAgICAgIGludCBvayA9IDA7CisgICAgICAgICAgICBpbnQgb2tSZW1haW5pbmcgPSByZW1haW5pbmc7CisgICAgICAgICAgICBTdHJpbmcgb2tGb3JtYXQgPSAiIjsKKworICAgICAgICAgICAgaW50IHcgPSAwOworICAgICAgICAgICAgaW50IGNvdW50ID0gMDsKKyAgICAgICAgICAgIGZsb2F0W10gd2lkdGhzID0gbXQubVdpZHRoczsKKworICAgICAgICAgICAgaW50IHJlcXVlc3QgPSBtdC5tRGlyID09IDEgPyBMYXlvdXQuRElSX1JFUVVFU1RfTFRSIDoKKyAgICAgICAgICAgICAgICBMYXlvdXQuRElSX1JFUVVFU1RfUlRMOworCisgICAgICAgICAgICBNZWFzdXJlZFRleHQgdGVtcE10ID0gTWVhc3VyZWRUZXh0Lm9idGFpbigpOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW47IGkrKykgeworICAgICAgICAgICAgICAgIHcgKz0gd2lkdGhzW2ldOworCisgICAgICAgICAgICAgICAgaWYgKGJ1ZltpXSA9PSAnLCcpIHsKKyAgICAgICAgICAgICAgICAgICAgY291bnQrKzsKKworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZm9ybWF0OworICAgICAgICAgICAgICAgICAgICAvLyBYWFggc2hvdWxkIG5vdCBpbnNlcnQgc3BhY2VzLCBzaG91bGQgYmUgcGFydCBvZiBzdHJpbmcKKyAgICAgICAgICAgICAgICAgICAgLy8gWFhYIHNob3VsZCB1c2UgcGx1cmFsIHJ1bGVzIGFuZCBub3QgYXNzdW1lIEVuZ2xpc2ggcGx1cmFscworICAgICAgICAgICAgICAgICAgICBpZiAoLS1yZW1haW5pbmcgPT0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0ID0gIiAiICsgb25lTW9yZTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvcm1hdCA9ICIgIiArIFN0cmluZy5mb3JtYXQobW9yZSwgcmVtYWluaW5nKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIFhYWCB0aGlzIGlzIHByb2JhYmx5IG9rLCBidXQgbmVlZCB0byBsb29rIGF0IGl0IG1vcmUKKyAgICAgICAgICAgICAgICAgICAgdGVtcE10LnNldFBhcmEoZm9ybWF0LCAwLCBmb3JtYXQubGVuZ3RoKCksIHJlcXVlc3QpOworICAgICAgICAgICAgICAgICAgICBmbG9hdCBtb3JlV2lkID0gbXQuYWRkU3R5bGVSdW4ocCwgbXQubUxlbiwgbnVsbCk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHcgKyBtb3JlV2lkIDw9IGF2YWlsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBvayA9IGkgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgb2tSZW1haW5pbmcgPSByZW1haW5pbmc7CisgICAgICAgICAgICAgICAgICAgICAgICBva0Zvcm1hdCA9IGZvcm1hdDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIE1lYXN1cmVkVGV4dC5yZWN5Y2xlKHRlbXBNdCk7CisKICAgICAgICAgICAgIFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIgb3V0ID0gbmV3IFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIob2tGb3JtYXQpOwogICAgICAgICAgICAgb3V0Lmluc2VydCgwLCB0ZXh0LCAwLCBvayk7CiAgICAgICAgICAgICByZXR1cm4gb3V0OworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgTWVhc3VyZWRUZXh0LnJlY3ljbGUobXQpOwogICAgICAgICB9CiAgICAgfQogCisgICAgcHJpdmF0ZSBzdGF0aWMgZmxvYXQgc2V0UGFyYShNZWFzdXJlZFRleHQgbXQsIFRleHRQYWludCBwYWludCwKKyAgICAgICAgICAgIENoYXJTZXF1ZW5jZSB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsIGludCBiaWRpUmVxdWVzdCkgeworCisgICAgICAgIG10LnNldFBhcmEodGV4dCwgc3RhcnQsIGVuZCwgYmlkaVJlcXVlc3QpOworCisgICAgICAgIGZsb2F0IHdpZHRoOworICAgICAgICBTcGFubmVkIHNwID0gdGV4dCBpbnN0YW5jZW9mIFNwYW5uZWQgPyAoU3Bhbm5lZCkgdGV4dCA6IG51bGw7CisgICAgICAgIGludCBsZW4gPSBlbmQgLSBzdGFydDsKKyAgICAgICAgaWYgKHNwID09IG51bGwpIHsKKyAgICAgICAgICAgIHdpZHRoID0gbXQuYWRkU3R5bGVSdW4ocGFpbnQsIGxlbiwgbnVsbCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB3aWR0aCA9IDA7CisgICAgICAgICAgICBpbnQgc3BhbkVuZDsKKyAgICAgICAgICAgIGZvciAoaW50IHNwYW5TdGFydCA9IDA7IHNwYW5TdGFydCA8IGxlbjsgc3BhblN0YXJ0ID0gc3BhbkVuZCkgeworICAgICAgICAgICAgICAgIHNwYW5FbmQgPSBzcC5uZXh0U3BhblRyYW5zaXRpb24oc3BhblN0YXJ0LCBsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuLmNsYXNzKTsKKyAgICAgICAgICAgICAgICBNZXRyaWNBZmZlY3RpbmdTcGFuW10gc3BhbnMgPSBzcC5nZXRTcGFucygKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwYW5TdGFydCwgc3BhbkVuZCwgTWV0cmljQWZmZWN0aW5nU3Bhbi5jbGFzcyk7CisgICAgICAgICAgICAgICAgd2lkdGggKz0gbXQuYWRkU3R5bGVSdW4ocGFpbnQsIHNwYW5zLCBzcGFuRW5kIC0gc3BhblN0YXJ0LCBudWxsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiB3aWR0aDsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBjaGFyIEZJUlNUX1JJR0hUX1RPX0xFRlQgPSAnXHUwNTkwJzsKKworICAgIC8qIHBhY2thZ2UgKi8KKyAgICBzdGF0aWMgYm9vbGVhbiBkb2VzTm90TmVlZEJpZGkoQ2hhclNlcXVlbmNlIHMsIGludCBzdGFydCwgaW50IGVuZCkgeworICAgICAgICBmb3IgKGludCBpID0gc3RhcnQ7IGkgPCBlbmQ7IGkrKykgeworICAgICAgICAgICAgaWYgKHMuY2hhckF0KGkpID49IEZJUlNUX1JJR0hUX1RPX0xFRlQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgLyogcGFja2FnZSAqLworICAgIHN0YXRpYyBib29sZWFuIGRvZXNOb3ROZWVkQmlkaShjaGFyW10gdGV4dCwgaW50IHN0YXJ0LCBpbnQgbGVuKSB7CisgICAgICAgIGZvciAoaW50IGkgPSBzdGFydCwgZSA9IGkgKyBsZW47IGkgPCBlOyBpKyspIHsKKyAgICAgICAgICAgIGlmICh0ZXh0W2ldID49IEZJUlNUX1JJR0hUX1RPX0xFRlQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCiAgICAgLyogcGFja2FnZSAqLyBzdGF0aWMgY2hhcltdIG9idGFpbihpbnQgbGVuKSB7CiAgICAgICAgIGNoYXJbXSBidWY7CiAKQEAgLTE1MjksNyArMTM4NSw3IEBACiAgICAgICovCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQ0FQX01PREVfQ0hBUkFDVEVSUwogICAgICAgICAgICAgPSBJbnB1dFR5cGUuVFlQRV9URVhUX0ZMQUdfQ0FQX0NIQVJBQ1RFUlM7Ci0gICAgCisKICAg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YmxlOwotaW1wb3J0IGFuZHJvaWQudXRpbC5Mb2c7CitpbXBvcnQgYW5kcm9pZC50ZXh0LkxheW91dC5BbGlnbm1lbnQ7CitpbXBvcnQgYW5kcm9pZC52aWV3LktleUV2ZW50OwogaW1wb3J0IGFuZHJvaWQudmlldy5Nb3Rpb25FdmVudDsKIGltcG9ydCBhbmRyb2lkLnZpZXcuVmlld0NvbmZpZ3VyYXRpb247CiBpbXBvcnQgYW5kcm9pZC53aWRnZXQuVGV4dFZpZXc7Ci1pbXBvcnQgYW5kcm9pZC52aWV3LktleUV2ZW50OwogCiBwdWJsaWMgY2xhc3MgVG91Y2ggewogICAgIHByaXZhdGUgVG91Y2goKSB7IH0KQEAgLTQ1LDYgKzQ0LDcgQEAKICAgICAgICAgaW50IGxlZnQgPSBJbnRlZ2VyLk1BWF9WQUxVRTsKICAgICAgICAgaW50IHJpZ2h0ID0gMDsKICAgICAgICAgQWxpZ25tZW50IGEgPSBudWxsOworICAgICAgICBib29sZWFuIGx0ciA9IHRydWU7CiAKICAgICAgICAgZm9yIChpbnQgaSA9IHRvcDsgaSA8PSBib3R0b207IGkrKykgewogICAgICAgICAgICAgbGVmdCA9IChpbnQpIE1hdGgubWluKGxlZnQsIGxheW91dC5nZXRMaW5lTGVmdChpKSk7CkBAIC01Miw2ICs1Miw3IEBACiAKICAgICAgICAgICAgIGlmIChhID09IG51bGwpIHsKICAgICAgICAgICAgICAgICBhID0gbGF5b3V0LmdldFBhcmFncmFwaEFsaWdubWVudChpKTsKKyAgICAgICAgICAgICAgICBsdHIgPSBsYXlvdXQuZ2V0UGFyYWdyYXBoRGlyZWN0aW9uKGkpID4gMDsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC01OSwxMCArNjAsMTIgQEAKICAgICAgICAgaW50IHdpZHRoID0gd2lkZ2V0LmdldFdpZHRoKCk7CiAgICAgICAgIGludCBkaWZmID0gMDsKIAorICAgICAgICAvLyBhbGlnbl9vcHBvc2l0ZSBkb2VzI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vLy8vCisgICAgCisgICAgR0xFUzIwQ2FudmFzKEdMIGdsLCBib29sZWFuIHRyYW5zbHVjZW50KSB7CisgICAgICAgIG1HbCA9IGdsOworICAgICAgICBtT3BhcXVlID0gIXRyYW5zbHVjZW50OworCisgICAgICAgIG1SZW5kZXJlciA9IG5DcmVhdGVSZW5kZXJlcigpOworICAgIH0KKworICAgIHByaXZhdGUgbmF0aXZlIGludCBuQ3JlYXRlUmVuZGVyZXIoKTsKKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIGZpbmFsaXplKCkgdGhyb3dzIFRocm93YWJsZSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBzdXBlci5maW5hbGl6ZSgpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgbkRlc3Ryb3lSZW5kZXJlcihtUmVuZGVyZXIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBuYXRpdmUgdm9pZCBuRGVzdHJveVJlbmRlcmVyKGludCByZW5kZXJlcik7CisKKyAgICAvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKyAgICAvLyBDYW52YXMgbWFuYWdlbWVudAorICAgIC8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLworICAgIAorICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIGlzSGFyZHdhcmVBY2NlbGVyYXRlZCgpIHsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEdMIGdldEdMKCkgeworICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICBAT3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wgaW50IG1vZGUpOworCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd0xpbmUoZmxvYXQgc3RhcnRYLCBmbG9hdCBzdGFydFksIGZsb2F0IHN0b3BYLCBmbG9hdCBzdG9wWSwgUGFpbnQgcGFpbnQpIHsKKyAgICAgICAgbUxpbmVbMF0gPSBzdGFydFg7CisgICAgICAgIG1MaW5lWzFdID0gc3RhcnRZOworICAgICAgICBtTGluZVsyXSA9IHN0b3BYOworICAgICAgICBtTGluZVszXSA9IHN0b3BZOworICAgICAgICBkcmF3TGluZXMobUxpbmUsIDAsIDEsIHBhaW50KTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBkcmF3TGluZXMoZmxvYXRbXSBwdHMsIGludCBvZmZzZXQsIGludCBjb3VudCwgUGFpbnQgcGFpbnQpIHsKKyAgICAgICAgLy8gVE9ETzogSW1wbGVtZW50CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd0xpbmVzKGZsb2F0W10gcHRzLCBQYWludCBwYWludCkgeworICAgICAgICBkcmF3TGluZXMocHRzLCAwLCBwdHMubGVuZ3RoIC8gNCwgcGFpbnQpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRyYXdPdmFsKFJlY3RGIG92YWwsIFBhaW50IHBhaW50KSB7CisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRyYXdQYWludChQYWludCBwYWludCkgeworICAgICAgICAvLyBUT0RPOiBJbXBsZW1lbnQKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBkcmF3UGF0aChQYXRoIHBhdGgsIFBhaW50IHBhaW50KSB7CisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRyYXdQaWN0dXJlKFBpY3R1cmUgcGljdHVyZSkgeworICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBkcmF3UGljdHVyZShQaWN0dXJlIHBpY3R1cmUsIFJlY3QgZHN0KSB7CisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRyYXdQaWN0dXJlKFBpY3R1cmUgcGljdHVyZSwgUmVjdEYgZHN0KSB7CisgICAgICAgIHRocm93IG5ldyBVbnN1cHBvcnRlZE9wZXJhdGlvbkV4Y2VwdGlvbigpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRyYXdQb2ludChmbG9hdCB4LCBmbG9hdCB5LCBQYWludCBwYWludCkgeworICAgICAgICBtUG9pbnRbMF0gPSB4OworICAgICAgICBtUG9pbnRbMV0gPSB5OworICAgICAgICBkcmF3UG9pbnRzKG1Qb2ludCwgMCwgMSwgcGFpbnQpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGRyYXdQb2ludHMoZmxvYXRbXSBwdHMsIGludCBvZmZzZXQsIGludCBjb3VudCwgUGFpbnQgcGFpbnQpIHsKKyAgICAgICAgLy8gVE9ETzogSW1wbGVtZW50CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZHJhd1BvaW50cyhmbG9hdFtdIHB0cywgUGFpbnQgcGFpbnQpIHsKKyAgICAgICAgZHJhd1BvaW50cyhwdHMsIDAsIHB0cy5sZW5ndGggLyAyL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3aXNlCisgICAgICogCisgICAgICogQHJldHVybiBBIGhhcmR3YXJlIHJlbmRlcmVyIGJhY2tlZCBieSBPcGVuR0wuCisgICAgICovCisgICAgc3RhdGljIEhhcmR3YXJlUmVuZGVyZXIgY3JlYXRlR2xSZW5kZXJlcihpbnQgZ2xWZXJzaW9uLCBib29sZWFuIHRyYW5zbHVjZW50KSB7CisgICAgICAgIHN3aXRjaCAoZ2xWZXJzaW9uKSB7CisgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBHbDEwUmVuZGVyZXIodHJhbnNsdWNlbnQpOworICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgIHJldHVybiBuZXcgR2wyMFJlbmRlcmVyKHRyYW5zbHVjZW50KTsKKyAgICAgICAgfQorICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmtub3duIEdMIHZlcnNpb246ICIgKyBnbFZlcnNpb24pOworICAgIH0KKworICAgIC8qKgorICAgICAqIEluZGljYXRlcyB3aGV0aGVyIGhhcmR3YXJlIGFjY2VsZXJhdGlvbiBpcyBjdXJyZW50bHkgZW5hYmxlZC4KKyAgICAgKiAKKyAgICAgKiBAcmV0dXJuIFRydWUgaWYgaGFyZHdhcmUgYWNjZWxlcmF0aW9uIGlzIGluIHVzZSwgZmFsc2Ugb3RoZXJ3aXNlLgorICAgICAqLworICAgIGJvb2xlYW4gaXNFbmFibGVkKCkgeworICAgICAgICByZXR1cm4gbUVuYWJsZWQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogSW5kaWNhdGVzIHdoZXRoZXIgaGFyZHdhcmUgYWNjZWxlcmF0aW9uIGlzIGN1cnJlbnRseSBlbmFibGVkLgorICAgICAqIAorICAgICAqIEBwYXJhbSBlbmFibGVkIFRydWUgaWYgdGhlIGhhcmR3YXJlIHJlbmRlcmVyIGlzIGluIHVzZSwgZmFsc2Ugb3RoZXJ3aXNlLgorIC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AgIEVHTERpc3BsYXkgbUVnbERpc3BsYXk7CisgICAgICAgIEVHTENvbnRleHQgbUVnbENvbnRleHQ7CisgICAgICAgIEVHTFN1cmZhY2UgbUVnbFN1cmZhY2U7CisgICAgICAgIEVHTENvbmZpZyBtRWdsQ29uZmlnOworCisgICAgICAgIEdMIG1HbDsKKyAgICAgICAgQ2FudmFzIG1DYW52YXM7CisKKyAgICAgICAgZmluYWwgaW50IG1HbFZlcnNpb247CisgICAgICAgIGZpbmFsIGJvb2xlYW4gbVRyYW5zbHVjZW50OworCisgICAgICAgIEdsUmVuZGVyZXIoaW50IGdsVmVyc2lvbiwgYm9vbGVhbiB0cmFuc2x1Y2VudCkgeworICAgICAgICAgICAgbUdsVmVyc2lvbiA9IGdsVmVyc2lvbjsKKyAgICAgICAgICAgIG1UcmFuc2x1Y2VudCA9IHRyYW5zbHVjZW50OworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENoZWNrcyBmb3IgT3BlbkdMIGVycm9ycy4gSWYgYW4gZXJyb3IgaGFzIG9jY3VyZWQsIHtAbGluayAjZGVzdHJveSgpfQorICAgICAgICAgKiBpcyBpbnZva2VkIGFuZCB0aGUgcmVxdWVzdGVkIGZsYWcgaXMgdHVybmVkIG9mZi4gVGhlIGVycm9yIGNvZGUgaXMKKyAgICAgICAgICogYWxzbyBsb2dnZWQgYXMgYSB3YXJuaW5nLgorICAgICAgICAgKi8KKyAgICAgICAgdm9pZCBjaGVja0Vycm9ycygpIHsKKyAgICAgICAgICAgIGlmIChpc0VuYWJsZWQoKSkgeworICAgICAgICAgICAgICAgIGludCBlcnJvciA9IG1FZ2wuZWdsR2V0RXJyb3IoKTsKKyAgICAgICAgICAgICAgICBpZiAoZXJyb3IgIT0gRUdMMTAuRUdMX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gc29tZXRoaW5nIGJhZCBoYXMgaGFwcGVuZWQgcmV2ZXJ0IHRvCisgICAgICAgICAgICAgICAgICAgIC8vIG5vcm1hbCByZW5kZXJpbmcuCisgICAgICAgICAgICAgICAgICAgIGRlc3Ryb3koKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yICE9IEVHTDExLkVHTF9DT05URVhUX0xPU1QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlJ2xsIHRyeSBhZ2FpbiBpZiBpdCB3YXMgY29udGV4dCBsb3N0CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXF1ZXN0ZWQoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJPcGVuR0wgZXJyb3I6ICIgKyBlcnJvcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgYm9vbGVhbiBpbml0aWFsaXplKFN1cmZhY2VIb2xkZXIgaG9sZGVyKSB7CisgICAgICAgICAgICBpZiAoaXNSZXF1ZXN0ZWQoKSAmJiAhaXNFbmFibGVkKCkpIHsKKyAgICAgICAgICAgICAgICBpbml0aWFsaXplRWdsKCk7CisgICAgICAgICAgICAgICAgbUdsID0gY3JlYXRlRWdsU3VyZmFjZShob2xkZXIpOworCisgICAgICAgICAgICAgICAgaWYgKG1HbCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGludCBlcnIgPSBtRWdsLmVnbEdldEVycm9yKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gRUdMMTAuRUdMX1NVQ0NFU1MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc3Ryb3koKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlcXVlc3RlZChmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtQ2FudmFzID0gY3JlYXRlQ2FudmFzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUNhbnZhcyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RW5hYmxlZCh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoTE9HX1RBRywgIkhhcmR3YXJlIGFjY2VsZXJhdGVkIENhbnZhcyBjb3VsZCBub3QgYmUgY3JlYXRlZCIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1DYW52YXMgIT0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBhYnN0cmFjdCBDYW52YXMgY3JlYXRlQ2FudmFzKCk7CisKKyAgICAgICAgdm9pZCBpbml0aWFsaXplRWdsKCkgeworICAgICAgICAgICAgbUVnbCA9IChFR0wxMCkgRUdMQ29udGV4dC5nZXRFR0woKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gR2V0IHRvIHRoZSBkZWZhdWx0IGRpc3BsYXkuCisgICAgICAgICAgICBtRWdsRGlzcGxheSA9IG1FZ2wuZWdsR2V0RGlzcGxheShFR0wxMC5FR0xfREVGQVVMVF9ESVNQTEFZKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKG1FZ2xEaXNwbGF5ID09IEVHTDEwLkVHTF9OT19ESVNQTEFZKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oImVnbEdldERpc3BsYXkgZmFpbGVkIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIFdlIGNhbiBub3cgaW5pdGlhbGl6ZSBFR0wgZm9yIHRoYXQgZGlzcGxheQorICAgICAgICAgICAgaW50W10gdmVyc2lvbiA9IG5ldyBpbnRbMl07CisgICAgICAgICAgICBpZiAoIW1FZ2wuZWdsSW5pdGlhbGl6ZShtRWdsRGlzcGxheSwgdmVyc2lvbikpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiZWdsSW5pdGlhbGl6ZSBmYWlsZWQiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1FZ2xDb25maWcgPSBnZXRDb25maWdDaG9vc2VyKG1HbFZlcnNpb24pLmNob29zZUNvbmZpZyhtRWdsLCBtRWdsRGlzcGxheSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAqIENyZWF0ZSBhbiBFR0wgY29udGV4dC4gV2Ugd2FudCB0byBkbyB0aGlzIGFzIHJhcmVseSBhcyB3ZSBjYW4sIGJlY2F1c2UgYW4KKyAgICAgICAgICAgICogRUdMIGNvbnRleHQgaXMgYSBzb21ld2hhdCBoZWF2eSBvYmplY3QuCisgICAgICAgICAgICAqLworICAgICAgICAgICAgbUVnbENvbnRleHQgPSBjcmVhdGVDb250ZXh0KG1FZ2wsIG1FZ2xEaXNwbGF5LCBtRWdsQ29uZmlnKTsKKyAgICAgICAgfQorCisgICAgICAgIEdMIGNyZWF0ZUVnbFN1cmZhY2UoU3VyZmFjZUhvbGRlciBob2xkZXIpIHsKKyAgICAgICAgICAgIC8vIENoZWNrIHByZWNvbmRpdGlvbnMuCisgICAgICAgICAgICBpZiAobUVnbCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oImVnbCBub3QgaW5pdGlhbGl6ZWQiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtRWdsRGlzcGxheSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oImVnbERpc3BsYXkgbm90IGluaXRpYWxpemVkIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUVnbENvbmZpZyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIm1FZ2xDb25maWcgbm90IGluaXRpYWxpemVkIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiAgVGhlIHdpbmRvdyBzaXplIGhhcyBjaGFuZ2VkLCBzbyB3ZSBuZWVkIHRvIGNyZWF0ZSBhIG5ldworICAgICAgICAgICAgICogIHN1cmZhY2UuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmIChtRWdsU3VyZmFjZSAhPSBudWxsICYmIG1FZ2xTdXJmYWNlICE9IEVHTDEwLkVHTF9OT19TVVJGQUNFKSB7CisKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIFVuYmluZCBhbmQgZGVzdHJveSB0aGUgb2xkIEVHTCBzdXJmYWNlLCBpZgorICAgICAgICAgICAgICAgICAqIHRoZXJlIGlzIG9uZS4KKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBtRWdsLmVnbE1ha2VDdXJyZW50KG1FZ2xEaXNwbGF5LCBFR0wxMC5FR0xfTk9fU1VSRkFDRSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9OT19TVVJGQUNFLCBFR0wxMC5FR0xfTk9fQ09OVEVYVCk7CisgICAgICAgICAgICAgICAgbUVnbC5lZ2xEZXN0cm95U3VyZmFjZShtRWdsRGlzcGxheSwgbUVnbFN1cmZhY2UpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBDcmVhdGUgYW4gRUdMIHN1cmZhY2Ugd2UgY2FuIHJlbmRlciBpbnRvLgorICAgICAgICAgICAgbUVnbFN1cmZhY2UgPSBtRWdsLmVnbENyZWF0ZVdpbmRvd1N1cmZhY2UobUVnbERpc3BsYXksIG1FZ2xDb25maWcsIGhvbGRlciwgbnVsbCk7CisKKyAgICAgICAgICAgIGlmIChtRWdsU3VyZmFjZSA9PSBudWxsIHx8IG1FZ2xTdXJmYWNlID09IEVHTDEwLkVHTF9OT19TVVJGQUNFKSB7CisgICAgICAgICAgICAgICAgaW50IGVycm9yID0gbUVnbC5lZ2xHZXRFcnJvcigpOworICAgICAgICAgICAgICAgIGlmIChlcnJvciA9PSBFR0wxMC5FR0xfQkFEX05BVElWRV9XSU5ET1cpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoIkVnbEhlbHBlciIsICJjcmVhdGVXaW5kb3dTdXJmYWNlIHJldHVybmVkIEVHTF9CQURfTkFUSVZFX1dJTkRPVy4iKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJjcmVhdGVXaW5kb3dTdXJmYWNlIGZhaWxlZCIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogQmVmb3JlIHdlIGNhbiBpc3N1ZSBHTCBjb21tYW5kcywgd2UgbmVlZCB0byBtYWtlIHN1cmUKKyAgICAgICAgICAgICAqIHRoZSBjb250ZXh0IGlzIGN1cnJlbnQgYW5kIGJvdW5kIHRvIGEgc3VyZmFjZS4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKCFtRWdsLmVnbE1ha2VDdXJyZW50KG1FZ2xEaXNwbGF5LCBtRWdsU3VyZmFjZSwgbUVnbFN1cmZhY2UsIG1FZ2xDb250ZXh0KSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJlZ2xNYWtlQ3VycmVudCBmYWlsZWQiKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIG1FZ2xDb250ZXh0LmdldEdMKCk7CisgICAgICAgIH0KKworICAgICAgICBFR0xDb250ZXh0IGNyZWF0ZUNvbnRleHQoRUdMMTAgZWdsLCBFR0xEaXNwbGF5IGVnbERpc3BsYXksIEVHTENvbmZpZyBlZ2xDb25maWcpIHsKKyAgICAgICAgICAgIGludFtdIGF0dHJpYl9saXN0ID0geyBFR0xfQ09OVEVYVF9DTElFTlRfVkVSU0lPTiwgbUdsVmVyc2lvbiwgRUdMMTAuRUdMX05PTkUgfTsKKworICAgICAgICAgICAgcmV0dXJuIGVnbC5lZ2xDcmVhdGVDb250ZXh0KGVnbERpc3BsYXksIGVnbENvbmZpZywgRUdMMTAuRUdMX05PX0NPTlRFWFQsCisgICAgICAgICAgICAgICAgICAgIG1HbFZlcnNpb24gIT0gMCA/IGF0dHJpYl9saXN0IDogbnVsbCk7ICAgICAgICAgICAgCisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgdm9pZCBpbml0aWFsaXplSWZOZWVkZWQoaW50IHdpZHRoLCBpbnQgaGVpZ2h0LCBWaWV3LkF0dGFjaEluZm8gYXR0YWNoSW5mbywKKyAgICAgICAgICAgICAgICBTdXJmYWNlSG9sZGVyIGhvbGRlcikgeworCisgICAgICAgICAgICBpZiAoaXNSZXF1ZXN0ZWQoKSkgeworICAgICAgICAgICAgICAgIGNoZWNrRXJyb3JzKCk7CisgICAgICAgICAgICAgICAgc3VwZXIuaW5pdGlhbGl6ZUlmTmVlZGVkKHdpZHRoLCBoZWlnaHQsIGF0dGFjaEluZm8sIGhvbGRlcik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICB2b2lkIGRlc3Ryb3koKSB7CisgICAgICAgICAgICBpZiAoIWlzRW5hYmxlZCgpKSByZXR1cm47CisKKyAgICAgICAgICAgIG1FZ2wuZWdsTWFrZUN1cnJlbnQobUVnbERpc3BsYXksIEVHTDEwLkVHTF9OT19TVVJGQUNFLAorICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfTk9fU1VSRkFDRSwgRUdMMTAuRUdMX05PX0NPTlRFWFQpOworICAgICAgICAgICAgbUVnbC5lZ2xEZXN0cm95Q29udGV4dChtRWdsRGlzcGxheSwgbUVnbENvbnRleHQpOworICAgICAgICAgICAgbUVnbC5lZ2xEZXN0cm95U3VyZmFjZShtRWdsRGlzcGxheSwgbUVnbFN1cmZhY2UpOworICAgICAgICAgICAgbUVnbC5lZ2xUZXJtaW5hdGUobUVnbERpc3BsYXkpOworCisgICAgICAgICAgICBtRWdsQ29udGV4dCA9IG51bGw7CisgICAgICAgICAgICBtRWdsU3VyZmFjZSA9IG51bGw7CisgICAgICAgICAgICBtRWdsRGlzcGxheSA9IG51bGw7CisgICAgICAgICAgICBtRWdsID0gbnVsbDsKKyAgICAgICAgICAgIG1HbCA9IG51bGw7CisgICAgICAgICAgICBtQ2FudmFzID0gbnVsbDsKKworICAgICAgICAgICAgc2V0RW5hYmxlZChmYWxzZSk7CisgICAgICAgIH0gICAgICAgIAorICAgICAgICAKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHZvaWQgc2V0dXAoaW50IHdpZHRoLCBpbnQgaGVpZ2h0LCBWaWV3LkF0dGFjaEluZm8gYXR0YWNoSW5mbykgeworICAgICAgICAgICAgZmluYWwgZmxvYXQgc2NhbGUgPSBhdHRhY2hJbmZvLm1BcHBsaWNhdGlvblNjYWxlOworICAgICAgICAgICAgbUNhbnZhcy5zZXRWaWV3cG9ydCgoaW50KSAod2lkdGggKiBzY2FsZSArIDAuNWYpLCAoaW50KSAoaGVpZ2h0ICogc2NhbGUgKyAwLjVmKSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGJvb2xlYW4gY2FuRHJhdygpIHsKKyAgICAgICAgICAgIHJldHVybiBtR2wgIT0gbnVsbCAmJiBtQ2FudmFzICE9IG51bGw7CisgICAgICAgIH0gICAgICAgIAorICAgICAgICAKKyAgICAgICAgdm9pZCBvblByZURyYXcoKSB7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogRGVmaW5lcyB0aGUgRUdMIGNvbmZpZ3VyYXRpb24gZm9yIHRoaXMgcmVuZGVyZXIuIFRoZSBkZWZhdWx0IGNvbmZpZ3VyYXRpb24KKyAgICAgICAgICogaXMgUkdCWCwgbm8gZGVwdGgsIG5vIHN0ZW5jaWwuCisgICAgICAgICAqIAorICAgICAgICAgKiBAcmV0dXJuIEFuIHtAbGluayBhbmRyb2lkLnZpZXcuSGFyZHdhcmVSZW5kZXJlci5HbFJlbmRlcmVyLkVnbENvbmZpZ0Nob29zZXJ9LgorICAgICAgICAgKiBAcGFyYW0gZ2xWZXJzaW9uCisgICAgICAgICAqLworICAgICAgICBFZ2xDb25maWdDaG9vc2VyIGdldENvbmZpZ0Nob29zZXIoaW50IGdsVmVyc2lvbikgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBDb21wb25lbnRTaXplQ2hvb3NlcihnbFZlcnNpb24sIDgsIDgsIDgsIG1UcmFuc2x1Y2VudCA/IDggOiAwLCAwLCAwKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICB2b2lkIGRyYXcoVmlldyB2aWV3LCBWaWV3LkF0dGFjaEluZm8gYXR0YWNoSW5mbywgQ29tcGF0aWJpbGl0eUluZm8uVHJhbnNsYXRvciB0cmFuc2xhdG9yLAorICAgICAgICAgICAgICAgIGludCB5b2ZmLCBpbnQgZGVuc2l0eSwgYm9vbGVhbiBzY2FsaW5nUmVxdWlyZWQpIHsKKworICAgICAgICAgICAgaWYgKGNhbkRyYXcoKSkgeworICAgICAgICAgICAgICAgIGF0dGFjaEluZm8ubURyYXdpbmdUaW1lID0gU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCk7CisgICAgICAgICAgICAgICAgYXR0YWNoSW5mby5tSWdub3JlRGlydHlTdGF0ZSA9IHRydWU7CisgICAgICAgICAgICAgICAgdmlldy5tUHJpdmF0ZUZsYWdzIHw9IFZpZXcuRFJBV047CisKKyAgICAgICAgICAgICAgICBvblByZURyYXcoKTsKKworICAgICAgICAgICAgICAgIENhbnZhcyBjYW52YXMgPSBtQ2FudmFzOworICAgICAgICAgICAgICAgIGludCBzYXZlQ291bnQgPSBjYW52YXMuc2F2ZShDYW52YXMuTUFUUklYX1NBVkVfRkxBRyk7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLCAteW9mZik7CisgICAgICAgICAgICAgICAgICAgIGlmICh0cmFuc2xhdG9yICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0b3IudHJhbnNsYXRlQ2FudmFzKGNhbnZhcyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgY2FudmFzLnNldERlbnNpdHkoZGVuc2l0eSk7CisgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5zZXRTY3JlZW5EZW5zaXR5KHNjYWxpbmdSZXF1aXJlZCA/IERpc3BsYXlNZXRyaWNzLkRFTlNJVFlfREVWSUNFIDogMCk7CisgICAgCisgICAgICAgICAgICAgICAgICAgIHZpZXcuZHJhdyhjYW52YXMpOworICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5yZXN0b3JlVG9Db3VudChzYXZlQ291bnQpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGF0dGFjaEluZm8ubUlnbm9yZURpcnR5U3RhdGUgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgIG1FZ2wuZWdsU3dhcEJ1ZmZlcnMobUVnbERpc3BsYXksIG1FZ2xTdXJmYWNlKTsKKyAgICAgICAgICAgICAgICBjaGVja0Vycm9ycygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgc3RhdGljIGFic3RyYWN0IGNsYXNzIEVnbENvbmZpZ0Nob29zZXIgeworICAgICAgICAgICAgZmluYWwgaW50W10gbUNvbmZpZ1NwZWM7CisgICAgICAgICAgICBwcml2YXRlIGZpbmFsIGludCBtR2xWZXJzaW9uOworCisgICAgICAgICAgICBFZ2xDb25maWdDaG9vc2VyKGludCBnbFZlcnNpb24sIGludFtdIGNvbmZpZ1NwZWMpIHsKKyAgICAgICAgICAgICAgICBtR2xWZXJzaW9uID0gZ2xWZXJzaW9uOworICAgICAgICAgICAgICAgIG1Db25maWdTcGVjID0gZmlsdGVyQ29uZmlnU3BlYyhjb25maWdTcGVjKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgRUdMQ29uZmlnIGNob29zZUNvbmZpZyhFR0wxMCBlZ2wsIEVHTERpc3BsYXkgZGlzcGxheSkgeworICAgICAgICAgICAgICAgIGludFtdIG51bV9jb25maWcgPSBuZXcgaW50WzFdOworICAgICAgICAgICAgICAgIGlmICghZWdsLmVnbENob29zZUNvbmZpZyhkaXNwbGF5LCBtQ29uZmlnU3BlYywgbnVsbCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bV9jb25maWcpKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImVnbENob29zZUNvbmZpZyBmYWlsZWQiKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpbnQgbnVtQ29uZmlncyA9IG51bV9jb25maWdbMF07CisKKyAgICAgICAgICAgICAgICBpZiAobnVtQ29uZmlncyA8PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5vIGNvbmZpZ3MgbWF0Y2ggY29uZmlnU3BlYyIpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIEVHTENvbmZpZ1tdIGNvbmZpZ3MgPSBuZXcgRUdMQ29uZmlnW251bUNvbmZpZ3NdOworICAgICAgICAgICAgICAgIGlmICghZWdsLmVnbENob29zZUNvbmZpZyhkaXNwbGF5LCBtQ29uZmlnU3BlYywgY29uZmlncywgbnVtQ29uZmlncywKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bV9jb25maWcpKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImVnbENob29zZUNvbmZpZyMyIGZhaWxlZCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBFR0xDb25maWcgY29uZmlnID0gY2hvb3NlQ29uZmlnKGVnbCwgZGlzcGxheSwgY29uZmlncyk7CisgICAgICAgICAgICAgICAgaWYgKGNvbmZpZyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIk5vIGNvbmZpZyBjaG9zZW4iKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIGNvbmZpZzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYWJzdHJhY3QgRUdMQ29uZmlnIGNob29zZUNvbmZpZyhFR0wxMCBlZ2wsIEVHTERpc3BsYXkgZGlzcGxheSwKKyAgICAgICAgICAgICAgICAgICAgRUdMQ29uZmlnW10gY29uZmlncyk7CisKKyAgICAgICAgICAgIHByaXZhdGUgaW50W10gZmlsdGVyQ29uZmlnU3BlYyhpbnRbXSBjb25maWdTcGVjKSB7CisgICAgICAgICAgICAgICAgaWYgKG1HbFZlcnNpb24gIT0gMikgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnU3BlYzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLyogV2Uga25vdyBub25lIG9mIHRoZSBzdWJjbGFzc2VzIGRlZmluZSBFR0xfUkVOREVSQUJMRV9UWVBFLgorICAgICAgICAgICAgICAgICAqIEFuZCB3ZSBrbm93IHRoZSBjb25maWdTcGVjIGlzIHdlbGwgZm9ybWVkLgorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGludCBsZW4gPSBjb25maWdTcGVjLmxlbmd0aDsKKyAgICAgICAgICAgICAgICBpbnRbXSBuZXdDb25maWdTcGVjID0gbmV3IGludFtsZW4gKyAyXTsKKyAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGNvbmZpZ1NwZWMsIDAsIG5ld0NvbmZpZ1NwZWMsIDAsIGxlbi0xKTsKKyAgICAgICAgICAgICAgICBuZXdDb25maWdTcGVjW2xlbi0xXSA9IEVHTDEwLkVHTF9SRU5ERVJBQkxFX1RZUEU7CisgICAgICAgICAgICAgICAgbmV3Q29uZmlnU3BlY1tsZW5dID0gNDsgLyogRUdMX09QRU5HTF9FUzJfQklUICovCisgICAgICAgICAgICAgICAgbmV3Q29uZmlnU3BlY1tsZW4rMV0gPSBFR0wxMC5FR0xfTk9ORTsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3Q29uZmlnU3BlYzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiBDaG9vc2UgYSBjb25maWd1cmF0aW9uIHdpdGggZXhhY3RseSB0aGUgc3BlY2lmaWVkIHIsZyxiLGEgc2l6ZXMsCisgICAgICAgICAqIGFuZCBhdCBsZWFzdCB0aGUgc3BlY2lmaWVkIGRlcHRoIGFuZCBzdGVuY2lsIHNpemVzLgorICAgICAgICAgKi8KKyAgICAgICAgc3RhdGljIGNsYXNzIENvbXBvbmVudFNpemVDaG9vc2VyIGV4dGVuZHMgRWdsQ29uZmlnQ2hvb3NlciB7CisgICAgICAgICAgICBwcml2YXRlIGludFtdIG1WYWx1ZTsKKworICAgICAgICAgICAgcHJpdmF0ZSBpbnQgbVJlZFNpemU7CisgICAgICAgICAgICBwcml2YXRlIGludCBtR3JlZW5TaXplOworICAgICAgICAgICAgcHJpdmF0ZSBpbnQgbUJsdWVTaXplOworICAgICAgICAgICAgcHJpdmF0ZSBpbnQgbUFscGhhU2l6ZTsKKyAgICAgICAgICAgIHByaXZhdGUgaW50IG1EZXB0aFNpemU7CisgICAgICAgICAgICBwcml2YXRlIGludCBtU3RlbmNpbFNpemU7CisKKyAgICAgICAgICAgIENvbXBvbmVudFNpemVDaG9vc2VyKGludCBnbFZlcnNpb24sIGludCByZWRTaXplLCBpbnQgZ3JlZW5TaXplLCBpbnQgYmx1ZVNpemUsCisgICAgICAgICAgICAgICAgICAgIGludCBhbHBoYVNpemUsIGludCBkZXB0aFNpemUsIGludCBzdGVuY2lsU2l6ZSkgeworICAgICAgICAgICAgICAgIHN1cGVyKGdsVmVyc2lvbiwgbmV3IGludFtdIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9SRURfU0laRSwgcmVkU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9HUkVFTl9TSVpFLCBncmVlblNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfQkxVRV9TSVpFLCBibHVlU2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIEVHTDEwLkVHTF9BTFBIQV9TSVpFLCBhbHBoYVNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfREVQVEhfU0laRSwgZGVwdGhTaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgRUdMMTAuRUdMX1NURU5DSUxfU0laRSwgc3RlbmNpbFNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICBFR0wxMC5FR0xfTk9ORSB9KTsKKyAgICAgICAgICAgICAgICBtVmFsdWUgPSBuZXcgaW50WzFdOworICAgICAgICAgICAgICAgIG1SZWRTaXplID0gcmVkU2l6ZTsKKyAgICAgICAgICAgICAgICBtR3JlZW5TaXplID0gZ3JlZW5TaXplOworICAgICAgICAgICAgICAgIG1CbHVlU2l6ZSA9IGJsdWVTaXplOworICAgICAgICAgICAgICAgIG1BbHBoYVNpemUgPSBhbHBoYVNpemU7CisgICAgICAgICAgICAgICAgbURlcHRoU2l6ZSA9IGRlcHRoU2l6ZTsKKyAgICAgICAgICAgICAgICBtU3RlbmNpbFNpemUgPSBzdGVuY2lsU2l6ZTsKKyAgICAgICAgICAgfQorCisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIEVHTENvbmZpZyBjaG9vc2VDb25maWcoRUdMMTAgZWdsLCBFR0xEaXNwbGF5IGRpc3BsYXksIEVHTENvbmZpZ1tdIGNvbmZpZ3MpIHsKKyAgICAgICAgICAgICAgICBmb3IgKEVHTENvbmZpZyBjb25maWcgOiBjb25maWdzKSB7CisgICAgICAgICAgICAgICAgICAgIGludCBkID0gZmluZENvbmZpZ0F0dHJpYihlZ2wsIGRpc3BsYXksIGNvbmZpZywgRUdMMTAuRUdMX0RFUFRIX1NJWkUsIDApOworICAgICAgICAgICAgICAgICAgICBpbnQgcyA9IGZpbmRDb25maWdBdHRyaWIoZWdsLCBkaXNwbGF5LCBjb25maWcsIEVHTDEwLkVHTF9TVEVOQ0lMX1NJWkUsIDApOworICAgICAgICAgICAgICAgICAgICBpZiAoKGQgPj0gbURlcHRoU2l6ZSkgJiYgKHMgPj0gbVN0ZW5jaWxTaXplKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHIgPSBmaW5kQ29uZmlnQXR0cmliKGVnbCwgZGlzcGxheSwgY29uZmlnLCBFR0wxMC5FR0xfUkVEX1NJWkUsIDApOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IGcgPSBmaW5kQ29uZmlnQXR0cmliKGVnbCwgZGlzcGxheSwgY29uZmlnLCBFR0wxMC5FR0xfR1JFRU5fU0laRSwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgYiA9IGZpbmRDb25maWdBdHRyaWIoZWdsLCBkaXNwbGF5LCBjb25maWcsIEVHTDEwLkVHTF9CTFVFX1NJWkUsIDApOworICAgICAgICAgICAgICAgICAgICAgICAgaW50IGEgPSBmaW5kQ29uZmlnQXR0cmliKGVnbCwgZGlzcGxheSwgY29uZmlnLCBFR0wxMC5FR0xfQUxQSEFfU0laRSwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHIgPT0gbVJlZFNpemUpICYmIChnID09IG1HcmVlblNpemUpICYmIChiID09IG1CbHVlU2l6ZSkgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGEgPT0gbUFscGhhU2l6ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwcml2YXRlIGludCBmaW5kQ29uZmlnQXR0cmliKEVHTDEwIGVnbCwgRUdMRGlzcGxheSBkaXNwbGF5LAorICAgICAgICAgICAgICAgICAgICBFR0xDb25maWcgY29uZmlnLCBpbnQgYXR0cmlidXRlLCBpbnQgZGVmYXVsdFZhbHVlKSB7CisKKyAgICAgICAgICAgICAgICBpZiAoZWdsLmVnbEdldENvbmZpZ0F0dHJpYihkaXNwbGF5LCBjb25maWcsIGF0dHJpYnV0ZSwgbVZhbHVlKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbVZhbHVlWzBdOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHJldHVybiBkZWZhdWx0VmFsdWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0gICAgICAgIAorICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBIYXJkd2FyZSByZW5kZXJlciB1c2luZyBPcGVuR0wgRVMgMi4wLgorICAgICAqLworICAgIHN0YXRpYyBjbGFzcyBHbDIwUmVuZGVyZXIgZXh0ZW5kcyBHbFJlbmRlcmVyIHsKKyAgICAgICAgcHJpdmF0ZSBHTEVTMjBDYW52YXMgbUdsQ2FudmFzOworCisgICAgICAgIEdsMjBSZW5kZXJlcihib29sZWFuIHRyYW5zbHVjZW50KSB7CisgICAgICAgICAgICBzdXBlcigyLCB0cmFuc2x1Y2VudCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgQ2FudmFzIGNyZWF0ZUNhbnZhcygpIHsKKyAgICAgICAgICAgIHJldHVybiBtR2xDYW52YXMgPSBuZXcgR0xFUzIwQ2FudmFzKG1HbCwgbVRyYW5zbHVjZW50KTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICB2b2lkIG9uUHJlRHJhdygpIHsKKyAgICAgICAgICAgIG1HbENhbnZhcy5vblByZURyYXcoKTsKKyAgICAgICAgfSAgICAgICAgCisgICAgfQorCisgICAgLyoqCisgICAgICogSGFyZHdhcmUgcmVuZGVyZXIgdXNpbmcgT3BlbkdMIEVTIDEuMC4KKyAgICAgKi8KKyAgICBAU3VwcHJlc3NXYXJuaW5ncyh7ImRlcHJlY2F0aW9uIn0pCisgICAgc3RhdGljIGNsYXNzIEdsMTBSZW5kZXJlciBleHRlbmRzIEdsUmVuZGVyZXIgeworICAgICAgICBHbDEwUmVuZGVyZXIoYm9vbGVhbiB0cmFuc2x1Y2VudCkgeworICAgICAgICAgICAgc3VwZXIoMSwgdHJhbnNsdWNlbnQpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIENhbnZhcyBjcmVhdGVDYW52YXMoKSB7CisgICAgICAgICAgICByZXR1cm4gbmV3IENhbnZhcyhtR2wpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHZvaWQgZGVzdHJveSgpIHsKKyAgICAgICAgICAgIGlmIChpc0VuYWJsZWQoKSkgeworICAgICAgICAgICAgICAgIG5hdGl2ZUFiYW5kb25HbENhY2hlcygpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzdXBl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DcgKzQwNSw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIi0tLS0tPiBzdGFydCBpbmZsYXRpbmcgY2hpbGRyZW4iKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAvLyBJbmZsYXRlIGFsbCBjaGlsZHJlbiB1bmRlciB0ZW1wCi0gICAgICAgICAgICAgICAgICAgIHJJbmZsYXRlKHBhcnNlciwgdGVtcCwgYXR0cnMpOworICAgICAgICAgICAgICAgICAgICBySW5mbGF0ZShwYXJzZXIsIHRlbXAsIGF0dHJzLCB0cnVlKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIi0tLS0tPiBkb25lIGluZmxhdGluZyBjaGlsZHJlbiIpOwogICAgICAgICAgICAgICAgICAgICB9CkBAIC00NTMsMTggKzQ1NCwxOCBAQAogICAgICAqIEBwYXJhbSBuYW1lIFRoZSBmdWxsIG5hbWUgb2YgdGhlIGNsYXNzIHRvIGJlIGluc3RhbnRpYXRlZC4KICAgICAgKiBAcGFyYW0gYXR0cnMgVGhlIFhNTCBhdHRyaWJ1dGVzIHN1cHBsaWVkIGZvciB0aGlzIGluc3RhbmNlLgogICAgICAqIAotICAgICAqIEByZXR1cm4gVmlldyBUaGUgbmV3bHkgaW5zdGFudGllZCB2aWV3LCBvciBudWxsLgorICAgICAqIEByZXR1cm4gVmlldyBUaGUgbmV3bHkgaW5zdGFudGlhdGVkIHZpZXcsIG9yIG51bGwuCiAgICAgICovCiAgICAgcHVibGljIGZpbmFsIFZpZXcgY3JlYXRlVmlldyhTdHJpbmcgbmFtZSwgU3RyaW5nIHByZWZpeCwgQXR0cmlidXRlU2V0IGF0dHJzKQogICAgICAgICAgICAgdGhyb3dzIENsYXNzTm90Rm91bmRFeGNlcHRpb24sIEluZmxhdGVFeGNlcHRpb24gewotICAgICAgICBDb25zdHJ1Y3RvciBjb25zdHJ1Y3RvciA9IHNDb25zdHJ1Y3Rvck1hcC5nZXQobmFtZSk7Ci0gICAgICAgIENsYXNzIGNsYXp6ID0gbnVsbDsKKyAgICAgICAgQ29uc3RydWN0b3I8PyBleHRlbmRzIFZpZXc+IGNvbnN0cnVjdG9yID0gc0NvbnN0cnVjdG9yTWFwLmdldChuYW1lKTsKKyAgICAgICAgQ2xhc3M8PyBleHRlbmRzIFZpZXc+IGNsYXp6ID0gbnVsbDsKIAogICAgICAgICB0cnkgewogICAgICAgICAgICAgaWYgKGNvbnN0cnVjdG9yID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAvLyBDbGFzcyBub3QgZm91bmQgaW4gdGhlIGNhY2hlLCBzZWUgaWYgaXQncyByZWFsLCBhbmQgdHJ5IHRvIGFkZCBpdAogICAgICAgICAgICAgICAgIGNsYXp6ID0gbUNvbnRleHQuZ2V0Q2xhc3NMb2FkZXIoKS5sb2FkQ2xhc3MoCi0gICAgICAgICAgICAgICAgICAgICAgICBwcmVmaXggIT0gbnVsbCA/IChwcmVmaXggKyBuYW1lKSA6IG5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgcHJlZml4ICE9IG51bGwgPyAocHJlZml4ICsgbmFtZSkgOiBuYW1lKS5hc1N1YmNsYXNzKFZpZXcuY2xhc3MpOwogICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgIGlmIChtRmlsdGVyICE9IG51bGwgJiYgY2xhenogIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICBib29sZWFuIGFsbG93ZWQgPSBtRmlsdGVyLm9uTG9hZENsYXNzKGNsYXp6KTsKQEAgLTQ4Miw3ICs0ODMsNyBAQAogICAgICAgICAgICAgICAgICAgICBpZiAoYWxsb3dlZFN0YXRlID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5ldyBjbGFzcyAtLSByZW1lbWJlciB3aGV0aGVyIGl0IGlzIGFsbG93ZWQKICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXp6ID0gbUNvbnRleHQuZ2V0Q2xhc3NMb2FkZXIoKS5sb2FkQ2xhc3MoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWZpeCAhPSBudWxsID8gKHByZWZpeCArIG5hbWUpIDogbmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWZpeCAhPSBudWxsID8gKHByZWZpeCArIG5hbWUpIDogbmFtZSkuYXNTdWJjbGFzcyhWaWV3LmNsYXNzKTsKICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBhbGxvd2VkID0gY2xhenogIT0gbnVsbCAmJiBtRmlsdGVyLm9uTG9hZENsYXNzKGNsYXp6KTsKICAgICAgICAgICAgICAgICAgICAgICAgIG1GaWx0ZXJNYXAucHV0KG5hbWUsIGFsbG93ZWQpOwpAQCAtNDk3LDcgKzQ5OCw3IEBACiAKICAgICAgICAgICAgIE9iamVjdFtdIGFyZ3MgPSBtQ29uc3RydWN0b3JBcmdzOwogICAgICAgICAgICAgYXJnc1sxXSA9IGF0dHJzOwotICAgICAgICAgICAgcmV0dXJuIChWaWV3KSBjb25zdHJ1Y3Rvci5uZXdJbnN0YW5jZShhcmdzKTsKKyAgICAgICAgICAgIHJldHVybiBjb25zdHJ1Y3Rvci5uZXdJbnN0YW5jZShhcmdzKTsKIAogICAgICAgICB9IGNhdGNoIChOb1N1Y2hNZXRob2RFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgSW5mbGF0ZUV4Y2VwdGlvbiBpZSA9IG5ldyBJbmZsYXRlRXhjZXB0aW9uKGF0dHJzLmdldFBvc2l0aW9uRGVzY3JpcHRpb24oKQpAQCAtNTA2LDYgKzUwNywxMyBAQAogICAgICAgICAgICAgaWUuaW5pdENhdXNlKGUpOwogICAgICAgICAgICAgdGhyb3cgaWU7CiAKKyAgICAgICAgfSBjYXRjaCAoQ2xh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R0cnMpOwotICAgICAgICAgICAgICAgIHJJbmZsYXRlKHBhcnNlciwgdmlldywgYXR0cnMpOworICAgICAgICAgICAgICAgIHJJbmZsYXRlKHBhcnNlciwgdmlldywgYXR0cnMsIHRydWUpOwogICAgICAgICAgICAgICAgIHZpZXdHcm91cC5hZGRWaWV3KHZpZXcsIHBhcmFtcyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAotICAgICAgICBwYXJlbnQub25GaW5pc2hJbmZsYXRlKCk7CisgICAgICAgIGlmIChmaW5pc2hJbmZsYXRlKSBwYXJlbnQub25GaW5pc2hJbmZsYXRlKCk7CiAgICAgfQogCiAgICAgcHJpdmF0ZSB2b2lkIHBhcnNlUmVxdWVzdEZvY3VzKFhtbFB1bGxQYXJzZXIgcGFyc2VyLCBWaWV3IHBhcmVudCkKQEAgLTY3NCw3ICs2ODIsNyBAQAogCiAgICAgICAgICAgICAgICAgICAgIGlmIChUQUdfTUVSR0UuZXF1YWxzKGNoaWxkTmFtZSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluZmxhdGUgYWxsIGNoaWxkcmVuLgotICAgICAgICAgICAgICAgICAgICAgICAgckluZmxhdGUoY2hpbGRQYXJzZXIsIHBhcmVudCwgY2hpbGRBdHRycyk7CisgICAgICAgICAgICAgICAgICAgICAgICBySW5mbGF0ZShjaGlsZFBhcnNlciwgcGFyZW50LCBjaGlsZEF0dHJzLCBmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBWaWV3IHZpZXcgPSBjcmVhdGVWaWV3RnJvbVRhZyhjaGlsZE5hbWUsIGNoaWxkQXR0cnMpOwogICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgVmlld0dyb3VwIGdyb3VwID0gKFZpZXdHcm91cCkgcGFyZW50OwpAQCAtNjk5LDcgKzcwNyw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICA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RXhjZXB0aW9uIGV4ID0gbmV3IEluZmxhdGVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICAgICAiQ291bGRuJ3QgcmVzb2x2ZSBtZW51IGl0ZW0gb25DbGljayBoYW5kbGVyICIgKyBtZXRob2ROYW1lICsKKyAgICAgICAgICAgICAgICAgICAgICAgICIgaW4gY2xhc3MgIiArIGMuZ2V0TmFtZSgpKTsKKyAgICAgICAgICAgICAgICBleC5pbml0Q2F1c2UoZSk7CisgICAgICAgICAgICAgICAgdGhyb3cgZXg7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyBib29sZWFuIG9uTWVudUl0ZW1DbGljayhNZW51SXRlbSBpdGVtKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGlmIChtTWV0aG9kLmdldFJldHVyblR5cGUoKSA9PSBCb29sZWFuLlRZUEUpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChCb29sZWFuKSBtTWV0aG9kLmludm9rZShtQ29udGV4dCwgaXRlbSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgbU1ldGhvZC5pbnZva2UobUNvbnRleHQsIGl0ZW0pOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIAogICAgIC8qKgogICAgICAqIFN0YXRlIGZvciB0aGUgY3VycmVudCBtZW51LgogICAgICAqIDxwPgpAQCAtMjA1LDYgKzI0MSwxNiBAQAogICAgICAgICBwcml2YXRlIGJvb2xlYW4gaXRlbVZpc2libGU7CiAgICAgICAgIHByaXZhdGUgYm9vbGVhbiBpdGVtRW5hYmx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GFpbmVyKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KIApAQCAtMTIwNyw3ICsxMjIzLDEwIEBACiAgICAgICAgIGZpbmFsIGludCBjb3VudCA9IG1DaGlsZHJlbkNvdW50OwogICAgICAgICBmaW5hbCBWaWV3W10gY2hpbGRyZW4gPSBtQ2hpbGRyZW47CiAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgewotICAgICAgICAgICAgY2hpbGRyZW5baV0uZGlzcGF0Y2hSZXN0b3JlSW5zdGFuY2VTdGF0ZShjb250YWluZXIpOworICAgICAgICAgICAgVmlldyBjID0gY2hpbGRyZW5baV07CisgICAgICAgICAgICBpZiAoKGMubVZpZXdGbGFncyAmIFBBUkVOVF9TQVZFX0RJU0FCTEVEX01BU0spICE9IFBBUkVOVF9TQVZFX0RJU0FCTEVEKSB7CisgICAgICAgICAgICAgICAgYy5kaXNwYXRjaFJlc3RvcmVJbnN0YW5jZVN0YXRlKGNvbnRhaW5lcik7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTE0NzcsMjEgKzE0OTYsMjUgQEAKICAgICAgICAgZmluYWwgaW50IGZsYWdzID0gbUdyb3VwRmxhZ3M7CiAKICAgICAgICAgaWYgKChmbGFncyAmIEZMQUdfQ0xFQVJfVFJBTlNGT1JNQVRJT04pID09IEZMQUdfQ0xFQVJfVFJBTlNGT1JNQVRJT04pIHsKLSAgICAgICAgICAgIGlmIChtQ2hpbGRUcmFuc2Zvcm1hdGlvbiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbUNoaWxkVHJhbnNmb3JtYXRpb24uY2xlYXIoKTsKLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1DaGlsZFRyYW5zZm9ybWF0aW9uLmNsZWFyKCk7CiAgICAgICAgICAgICBtR3JvdXBGbGFncyAmPSB+RkxBR19DTEVBUl9UUkFOU0ZPUk1BVElPTjsKICAgICAgICAgfQogC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mFsaWRhdGlvblRyYW5zZm9ybSA9IG1DaGlsZFRyYW5zZm9ybWF0aW9uOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgbW9yZSA9IGEuZ2V0VHJhbnNmb3JtYXRpb24oZHJhd2luZ1RpbWUsIG1DaGlsZFRyYW5zZm9ybWF0aW9uKTsKICAgICAgICAgICAgIHRyYW5zZm9ybVRvQXBwbHkgPSBtQ2hpbGRUcmFuc2Zvcm1hdGlvbjsKIAogICAgICAgICAgICAgY29uY2F0TWF0cml4ID0gYS53aWxsQ2hhbmdlVHJhbnNmb3JtYXRpb25NYXRyaXgoKTsKQEAgLTE1MjAsNyArMTU1MCwxMSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZShjbCwgY3QsIGNyLCBjYik7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBhLmdldEludmFsaWRhdGVSZWdpb24oMCwgMCwgY3IgLSBjbCwgY2IgLSBjdCwgcmVnaW9uLCB0cmFuc2Zvcm1Ub0FwcGx5KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1JbnZhbGlkYXRlUmVnaW9uID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1JbnZhbGlkYXRlUmVnaW9uID0gbmV3IFJlY3RGKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZmluYWwgUmVjdEYgcmVnaW9uID0gbUludmFsaWRhdGVSZWdpb247CisgICAgICAgICAgICAgICAgICAgIGEuZ2V0SW52YWxpZGF0ZVJlZ2lvbigwLCAwLCBjciAtIGNsLCBjYiAtIGN0LCByZWdpb24sIGludmFsaWRhdGlvblRyYW5zZm9ybSk7CiAKICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIGNoaWxkIG5lZWQgdG8gZHJhdyBhbiBhbmltYXRpb24sIHBvdGVudGlhbGx5IG9mZnNjcmVlbiw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QotICAgICAgICAvKgotICAgICAgICAgKiBHZXQgdG8gdGhlIGRlZmF1bHQgZGlzcGxheS4KLSAgICAgICAgICovCi0gICAgICAgIGZpbmFsIEVHTERpc3BsYXkgZWdsRGlzcGxheSA9IGVnbC5lZ2xHZXREaXNwbGF5KEVHTDEwLkVHTF9ERUZBVUxUX0RJU1BMQVkpOwotICAgICAgICBtRWdsRGlzcGxheSA9IGVnbERpc3BsYXk7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogV2UgY2FuIG5vdyBpbml0aWFsaXplIEVHTCBmb3IgdGhhdCBkaXNwbGF5Ci0gICAgICAgICAqLwotICAgICAgICBpbnRbXSB2ZXJzaW9uID0gbmV3IGludFsyXTsKLSAgICAgICAgZWdsLmVnbEluaXRpYWxpemUoZWdsRGlzcGxheSwgdmVyc2lvbik7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogU3BlY2lmeSBhIGNvbmZpZ3VyYXRpb24gZm9yIG91ciBvcGVuZ2wgc2Vzc2lvbgotICAgICAgICAgKiBhbmQgZ3JhYiB0aGUgZmlyc3QgY29uZmlndXJhdGlvbiB0aGF0IG1hdGNoZXMgaXMKLSAgICAgICAgICovCi0gICAgICAgIGZpbmFsIGludFtdIGNvbmZpZ1NwZWMgPSB7Ci0gICAgICAgICAgICAgICAgRUdMMTAuRUdMX1JFRF9TSVpFLCAgICAgIDUsCi0gICAgICAgICAgICAgICAgRUdMMTAuRUdMX0dSRUVOX1NJWkUsICAgIDYsCi0gICAgICAgICAgICAgICAgRUdMMTAuRUdMX0JMVUVfU0laRSwgICAgIDUsCi0gICAgICAgICAgICAgICAgRUdMMTAuRUdMX0RFUFRIX1NJWkUsICAgIDAsCi0gICAgICAgICAgICAgICAgRUdMMTAuRUdMX05PTkUKLSAgICAgICAgfTsKLSAgICAgICAgZmluYWwgRUdMQ29uZmlnW10gY29uZmlncyA9IG5ldyBFR0xDb25maWdbMV07Ci0gICAgICAgIGZpbmFsIGludFtdIG51bV9jb25maWcg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F5ID0gbnVsbDsKLSAgICAgICAgbUVnbCA9IG51bGw7Ci0gICAgICAgIG1HbENhbnZhcyA9IG51bGw7Ci0gICAgICAgIG1HTCA9IG51bGw7Ci0gICAgICAgIG1Vc2VHTCA9IGZhbHNlOwotICAgIH0KLQotICAgIHByaXZhdGUgdm9pZCBjaGVja0VnbEVycm9ycygpIHsKLSAgICAgICAgaWYgKG1Vc2VHTCkgewotICAgICAgICAgICAgaW50IGVyciA9IG1FZ2wuZWdsR2V0RXJyb3IoKTsKLSAgICAgICAgICAgIGlmIChlcnIgIT0gRUdMMTAuRUdMX1NVQ0NFU1MpIHsKLSAgICAgICAgICAgICAgICAvLyBzb21ldGhpbmcgYmFkIGhhcyBoYXBwZW5lZCByZXZlcnQgdG8KLSAgICAgICAgICAgICAgICAvLyBub3JtYWwgcmVuZGVyaW5nLgotICAgICAgICAgICAgICAgIGRlc3Ryb3lHTCgpOwotICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gRUdMMTEuRUdMX0NPTlRFWFRfTE9TVCkgewotICAgICAgICAgICAgICAgICAgICAvLyB3ZSdsbCB0cnkgYWdhaW4gaWYgaXQgd2FzIGNvbnRleHQgbG9zdAotICAgICAgICAgICAgICAgICAgICBtR2xXYW50ZWQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KICAgICAvKioKICAgICAgKiBXZSBoYXZlIG9uZSBjaGlsZAogICAgICAqLwotICAgIHB1YmxpYyB2b2lkIHNldFZpZXcoVmlldyB2aWV3LCBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcyBhdHRycywKLSAgICAgICAgICAgIFZpZXcgcGFuZWxQYXJlbnRWaWV3KSB7CisgICAgcHVibGljIHZvaWQgc2V0VmlldyhWaWV3IHZpZXcsIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zIGF0dHJzLCBWaWV3IHBhbmVsUGFyZW50VmlldykgewogICAgICA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VkID0gZmFsc2U7CkBAIC03ODIsOCArNjc4LDggQEAKICAgICAgICAgICAgIGF0dGFjaEluZm8ubVdpbmRvd1Zpc2liaWxpdHkgPSB2aWV3VmlzaWJpbGl0eTsKICAgICAgICAgICAgIGhvc3QuZGlzcGF0Y2hXaW5kb3dWaXNpYmlsaXR5Q2hhbmdlZCh2aWV3VmlzaWJpbGl0eSk7CiAgICAgICAgICAgICBpZiAodmlld1Zpc2liaWxpdHkgIT0gVmlldy5WSVNJQkxFIHx8IG1OZXdTdXJmYWNlTmVlZGVkKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1Vc2VHTCkgewotICAgICAgICAgICAgICAgICAgICBkZXN0cm95R0woKTsKKyAgICAgICAgICAgICAgICBpZiAobUh3UmVuZGVyZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtSHdSZW5kZXJlci5kZXN0cm95KCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKHZpZXdWaXNpYmlsaXR5ID09IFZpZXcuR09ORSkgewpAQCAtODk5LDEwICs3OTUsMTIgQEAKIAogICAgICAgICBmaW5hbCBib29sZWFuIGNvbXB1dGVzSW50ZXJuYWxJbnNldHMgPQogICAgICAgICAgICAgICAgIGF0dGFjaEluZm8ubVRyZWVPYnNlcnZlci5oYXNDb21wdXRlSW50ZXJuYWxJbnNldHNMaXN0ZW5lcnMoKTsKKwogICAgICAgICBib29sZWFuIGluc2V0c1BlbmRpbmcgPSBmYWxzZTsKICAgICAgICAgaW50IHJlbGF5b3V0UmVzdWx0ID0gMDsKLSAgICAgICAgaWYgKG1GaXJzdCB8fCB3aW5kb3dTaG91bGRSZXNpemUgfHwgaW5zZXRzQ2hhbmdlZAotICAgICAgICAgICAgICAgIHx8IHZpZXdWaXNpYmlsaXR5Q2hhbmdlZCB8fCBwYXJhbXMgIT0gbnVsbCkgeworCisgICAgICAgIGlmIChtRmlyc3QgfHwgd2luZG93U2hvdWxkUmVzaXplIHx8IGluc2V0c0NoYW5nZWQgfHwKKyAgICAgICAgICAgICAgICB2aWV3VmlzaWJpbGl0eUNoYW5nZWQgfHwgcGFyYW1zICE9IG51bGwpIHsKIAogICAgICAgICAgICAgaWYgKHZpZXdWaXNpYmlsaXR5ID09IFZpZXcuVklTSUJMRSkgewogICAgICAgICAgICAgICAgIC8vIElmIHRoaXMgd2luZG93IGlzIGdpdmluZyBpbnRlcm5hbCBpbnNldHMgdG8gdGhlIHdpbmRvdwpAQCAtOTE0LDE1ICs4MTIsNyBAQAogICAgICAgICAgICAgICAgIC8vIHdpbmRvdywgd2FpdGluZyB1bnRpbCB3ZSBjYW4gZmluaXNoIGxheWluZyBvdXQgdGhpcyB3aW5kb3cKICAgICAgICAgICAgICAgICAvLyBhbmQgZ2V0IGJhY2sgdG8gdGhlIHdpbmRvdyBtYW5hZ2VyIHdpdGggdGhlIHVsdGltYXRlbHkKICAgICAgICAgICAgICAgICAvLyBjb21wdXRlZCBpbnNldHMuCi0gICAgICAgICAgICAgICAgaW5zZXRzUGVuZGluZyA9IGNvbXB1dGVzSW50ZXJuYWxJbnNldHMKLSAgICAgICAgICAgICAgICAgICAgICAgICYmIChtRmlyc3QgfHwgdmlld1Zpc2liaWxpdHlDaGFuZ2VkKTsKLQotICAgICAgICAgICAgICAgIGlmIChtV2luZG93QXR0cmlidXRlcy5tZW1vcnlUeXBlID09IFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zLk1FTU9SWV9UWVBFX0dQVSkgewotICAgICAgICAgICAgICAgICAgICBpZiAocGFyYW1zID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcyA9IG1XaW5kb3dBdHRyaWJ1dGVzOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1HbFdhbnRlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGluc2V0c1BlbmRpbmcgPSBjb21wdXRlc0ludGVybmFsSW5zZXRzICYmIChtRmlyc3QgfHwgdmlld1Zpc2liaWxpdHlDaGFuZ2VkKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgaWYgKG1TdXJmYWNlSG9sZGVyICE9IG51bGwpIHsKQEAgLTkzMSwxMSArODIxLDEyIEBACiAgICAgICAgICAgICAgICAgbHAuZm9ybWF0ID0gbVN1cmZhY2VIb2xkZXIuZ2V0UmVxdWVzdGVkRm9ybWF0KCk7CiAgICAgICAgICAgICAgICAgbHAudHlwZSA9IG1TdXJmYWNlSG9sZGVyLmdldFJlcXVlc3RlZFR5cGUoKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAotICAgICAgICAgICAgYm9vbGVhbiBpbml0aWFsaXplZCA9IGZhbHNlOworCisgICAgICAgICAgICBib29sZWFuIGh3SW50aWFsaXplZCA9IGZhbHNlOwogICAgICAgICAgICAgYm9vbGVhbiBjb250ZW50SW5zZXRzQ2hhbmdlZCA9IGZhbHNlOwogICAgICAgICAgICAgYm9vbGVhbiB2aXNpYmxlSW5zZXRzQ2hhbmdlZDsKICAgICAgICAgICAgIGJvb2xlYW4gaGFkU3VyZmFjZSA9IG1TdXJmYWNlLmlzVmFsaWQoKTsKKwogICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICBpbnQgZmwgPSAwOwogICAgICAgICAgICAgICAgIGlmIChwYXJhbXMgIT0gbnVsbCkgewpAQCAtOTk1LDkgKzg4Niw4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBmdWxsUmVkcmF3TmVlZGVkID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgIG1QcmV2aW91c1RyYW5zcGFyZW50UmVnaW9uLnNldEVtcHR5KCk7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtR2xXYW50ZWQgJiYgIW1Vc2VHTCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVHTCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVkID0gbUdsQ2FudmFzICE9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUh3UmVuZGVyZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGh3SW50aWFsaXplZCA9IG1Id1JlbmRlcmVyLmluaXRpYWxpemUobUhvbGRlcik7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFtU3VyZmFjZS5pc1ZhbGlkKCkpIHsKQEAgLTEwNzUsOSArOTY1LDggQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICAKLSAgICAgICAgICAgIGlmIChpbml0aWFsaXplZCkgewotICAgICAgICAgICAgICAgIG1HbENhbnZhcy5zZXRWaWV3cG9ydCgoaW50KSAobVdpZHRoICogYXBwU2NhbGUgKyAwLjVmKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpIChtSGVpZ2h0ICogYXBwU2NhbGUgKyAwLjVmKSk7CisgICAgICAgICAgICBpZiAoaHdJbnRpYWxpemVkKSB7CisgICAgICAgICAgICAgICAgbUh3UmVuZGVyZXIuc2V0dXAobVdpZHRoLCBtSGVpZ2h0LCBtQXR0YWNoSW5mbyk7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGJvb2xlYW4gZm9jdXNDaGFuZ2VkRHVlVG9Ub3VjaE1vZGUgPSBlbnN1cmVUb3VjaE1vZGVMb2NhbGx5KApAQCAtMTMzOCw3ICsxMjI3LDggQEAKICAgICAgICAgaWYgKCFzRmlyc3REcmF3Q29tcGxldGUpIHsKICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoc0ZpcnN0RHJhd0hhbmRsZXJzKSB7CiAgICAgICAgICAgICAgICAgc0ZpcnN0RHJhd0NvbXBsZXRlID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8c0ZpcnN0RHJhd0hhbmRsZXJzLnNpemUoKTsgaSsrKSB7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IGNvdW50ID0gc0ZpcnN0RHJhd0hhbmRsZXJzLnNpemUoKTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaTwgY291bnQ7IGkrKykgewogICAgICAgICAgICAgICAgICAgICBwb3N0KHNGaXJzdERyYXdIYW5kbGVycy5nZXQoaSkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KQEAgLTEzNzIsNTMgKzEyNjIsMTYgQEAKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogICAgICAgICAKLSAgICAgICAgaWYgKG1Vc2VHTCkgeworICAgICAgICBpZiAobUh3UmVuZGVyZXIgIT0gbnVsbCAmJiBtSHdSZW5kZXJlci5pc0VuYWJsZWQoKSkgewogICAgICAgICAgICAgaWYgKCFkaXJ0eS5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgICAgICBDYW52YXMgY2FudmFzID0gbUdsQ2FudmFzOwotICAgICAgICAgICAgICAgIGlmIChtR0wgIT0gbnVsbCAmJiBjYW52YXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtR0wuZ2xEaXNhYmxlKEdMX1NDSVNTT1JfVEVTVCk7Ci0gICAgICAgICAgICAgICAgICAgIG1HTC5nbENsZWFyQ29sb3IoMCwgMCwgMCwgMCk7Ci0gICAgICAgICAgICAgICAgICAgIG1HTC5nbENsZWFyKEdMX0NPTE9SX0JVRkZFUl9CSVQpOwotICAgICAgICAgICAgICAgICAgICBtR0wuZ2xFbmFibGUoR0xfU0NJU1NPUl9URVNUKTsKLQotICAgICAgICAgICAgICAgICAgICBtQXR0YWNoSW5mby5tRHJhd2luZ1RpbWUgPSBTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKTsKLSAgICAgICAgICAgICAgICAgICAgbUF0dGFjaEluZm8ubUlnbm9yZURpcnR5U3RhdGUgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBtVmlldy5tUHJpdmF0ZUZsYWdzIHw9IFZpZXcuRFJBV047Ci0KLSAgICAgICAgICAgICAgICAgICAgaW50IHNhdmVDb3VudCA9IGNhbnZhcy5zYXZlKENhbnZhcy5NQVRSSVhfU0FWRV9GTEFHKTsKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMCwgLXlvZmYpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1UcmFuc2xhdG9yICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVHJhbnNsYXRvci50cmFuc2xhdGVDYW52YXMoY2FudmFzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5zZXRTY3JlZW5EZW5zaXR5KHNjYWxpbmdSZXF1aXJlZAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IERpc3BsYXlNZXRyaWNzLkRFTlNJVFlfREVWSUNFIDogMCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtVmlldy5kcmF3KGNhbnZhcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoQ29uZmlnLkRFQlVHICYmIFZpZXdEZWJ1Zy5jb25zaXN0ZW5jeUNoZWNrRW5hYmxlZCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1WaWV3LmRpc3BhdGNoQ29uc2lzdGVuY3lDaGVjayhWaWV3RGVidWcuQ09OU0lTVEVOQ1lfRFJBV0lORyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMucmVzdG9yZVRvQ291bnQoc2F2ZUNvdW50KTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIG1BdHRhY2hJbmZvLm1JZ25vcmVEaXJ0eVN0YXRlID0gZmFsc2U7Ci0KLSAgICAgICAgICAgICAgICAgICAgbUVnbC5lZ2xTd2FwQnVmZmVycyhtRWdsRGlzcGxheSwgbUVnbFN1cmZhY2UpOwotICAgICAgICAgICAgICAgICAgICBjaGVja0VnbEVycm9ycygpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChTSE9XX0ZQUyB8fCBDb25maWcuREVCVUcgJiYgVmlld0RlYnVnLnNob3dGcHMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBub3cgPSAoaW50KVN5c3RlbUNsb2NrLmVsYXBzZWRSZWFsdGltZSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNEcmF3VGltZSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2hvd0ZQUyhjYW52YXMsIG5vdyAtIHNEcmF3VGltZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBzRHJhd1RpbWUgPSBub3c7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbUh3UmVuZGVyZXIuZHJhdyhtVmlldywgbUF0dGFjaEluZm8sIG1UcmFuc2xhdG9yLCB5b2ZmLCBtRGVuc2l0eSwgc2NhbGluZ1JlcXVpcmVkKTsKICAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgaWYgKHNjcm9sbGluZykgewogICAgICAgICAgICAgICAgIG1GdWxsUmVkcmF3TmVlZGVkID0gdHJ1ZTsKICAgICAgICAgICAgICAgICBzY2hlZHVsZVRyYXZlcnNhbHMoKTsKICAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTE3MzAsOCArMTU4Myw2IEBACiAgICAgfQogCiAgICAgdm9pZCBkaXNwYXRjaERldGFjaGVkRnJvbVdpbmRvdygpIHsKLSAgICAgICAgaWYgKENvbmZpZy5MT0dWKSBMb2cudigiVmlld1Jvb3QiLCAiRGV0YWNoaW5nIGluICIgKyB0aGlzICsgIiBvZiAiICsgbVN1cmZhY2UpOwotCiAgICAgICAgIGlmIChtVmlldyAhPSBudWxsKSB7CiAgICAgICAgICAgICBtVmlldy5kaXNwYXRjaERldGFjaGVkRnJvbVdpbmRvdygpOwogICAgICAgICB9CkBAIC0xNzQwLDggKzE1OTEsOCBAQAogICAgICAgICBtQXR0YWNoSW5mby5tUm9vdFZpZXcgPSBudWxsOwogICAgICAgICBtQXR0YWNoSW5mby5tU3VyZmFjZSA9IG51bGw7CiAKLSAgICAgICAgaWYgKG1Vc2VHTCkgewotICAgICAgICAgICAgZGVzdHJveUdMKCk7CisgICAgICAgIGlmIChtSHdSZW5kZXJlciAhPSBudWxsKSB7CisgICAgICAgICAgICBtSHdSZW5kZXJlci5kZXN0cm95KCk7CiAgICAgICAgIH0KICAgICAgICAgbVN1cmZhY2UucmVsZWFzZSgpOwogCkBAIC0xODgxLDggKzE3MzIsMTAgQEAKICAgICAgICAgICAgICAgICBldmVudCA9IGdldFBlbmRpbmdQb2ludGVyTW90aW9uRXZlbnQoKTsKIAogICAgICAgICAgICAgICAgIGlmIChNRUFTVVJFX0xBVEVOQ1kgJiYgZXZlbnQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBsdC5zYW1wbGUoIjkgQ2xpZW50IGdvdCBldmVudHMgICAgICAiLCBTeXN0ZW0ubmFub1RpbWUoKSAtIGV2ZW50LmdldEV2ZW50VGltZU5hbm8oKSk7Ci0gICAgICAgICAgICAgICAgICAgIGx0LnNhbXBsZSgiOCBDbGllbnQgZ2V0dGluZyBldmVudHMgICIsIHRpbWVCZWZvcmVHZXR0aW5nRXZlbnRzIC0gZXZlbnQuZ2V0RXZlbnRUaW1lTmFubygpKTsKKyAgICAgICAgICAgICAgICAgICAgbHQuc2FtcGxlKCI5IENsaWVudCBnb3QgZXZlbnRzICAgICAgIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0ubmFub1RpbWUoKSAtIGV2ZW50LmdldEV2ZW50VGltZU5hbm8oKSk7CisgICAgICAgICAgICAgICAgICAgIGx0LnNhbXBsZSgiOCBDbGllbnQgZ2V0dGluZyBldmVudHMgICIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZUJlZm9yZUdldHRpbmdFdmVudHMgLSBldmVudC5nZXRFdmVudFRpbWVOYW5vKCkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBjYWxsV2hlbkRvbmUgPSBmYWxzZTsKICAgICAgICAgICAgIH0KQEAgLTE5MDUsMTEgKzE3NTgsMTMgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50Lm9mZnNldExvY2F0aW9uKDAsIG1DdXJTY3JvbGxZKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBpZiAoTUVBU1VSRV9MQVRFTkNZKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsdC5zYW1wbGUoIkEgRGlzcGF0Y2hpbmcgVG91Y2hFdmVudHMiLCBTeXN0ZW0ubmFub1RpbWUoKSAtIGV2ZW50LmdldEV2ZW50VGltZU5hbm8oKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBsdC5zYW1wbGUoIkEgRGlzcGF0Y2hpbmcgVG91Y2hFdmVudHMiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTeXN0ZW0ubmFub1RpbWUoKSAtIGV2ZW50LmdldEV2ZW50VGltZU5hbm8oKSk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IG1WaWV3LmRpc3BhdGNoVG91Y2hFdmVudChldmVudCk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChNRUFTVVJFX0xBVEVOQ1kpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGx0LnNhbXBsZSgiQiBEaXNwYXRjaGVkIFRvdWNoRXZlbnRzICIsIFN5c3RlbS5uYW5vVGltZSgpIC0gZXZlbnQuZ2V0RXZlbnRUaW1lTmFubygpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGx0LnNhbXBsZSgiQiBEaXNwYXRjaGVkIFRvdWNoRXZlbnRzICIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5uYW5vVGltZSgpIC0gZXZlbnQuZ2V0RXZlbnRUaW1lTmFubygpKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBpZiAoIWhhbmRsZWQgJiYgaXNEb3duKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZWRnZVNsb3AgPSBtVmlld0NvbmZpZ3VyYXRpb24uZ2V0U2NhbGVkRWRnZVNsb3AoKTsKQEAgLTIwMTQsMTggKzE4NjksOCBAQAogICAgICAgICAgICAgICAgICAgICBib29sZWFuIGluVG91Y2hNb2RlID0gbXNnLmFyZzIgIT0gMDsKICAgICAgICAgICAgICAgICAgICAgZW5zdXJlVG91Y2hNb2RlTG9jYWxseShpblRvdWNoTW9kZSk7CiAKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1HbFdhbnRlZCkgewotICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2tFZ2xFcnJvcnMoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIGxvc3QgdGhlIGdsIGNvbnRleHQsIHNvIHJlY3JlYXRlIGl0LgotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1HbFdhbnRlZCAmJiAhbVVzZUdMKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdGlhbGl6ZUdMKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1HbENhbnZhcyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IGFwcFNjYWxlID0gbUF0dGFjaEluZm8ubUFwcGxpY2F0aW9uU2NhbGU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1HbENhbnZhcy5zZXRWaWV3cG9ydCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaW50KSAobVdpZHRoICogYXBwU2NhbGUgKyAwLjVmKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaW50KSAobUhlaWdodCAqIGFwcFNjYWxlICsgMC41ZikpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG1Id1JlbmRlcmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Id1JlbmRlcmVyLmluaXRpYWxpemVJZk5lZWRlZChtV2lkdGgsIG1IZWlnaHQsIG1BdHRhY2hJbmZvLCBtSG9sZGVyKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KIApAQCAtMjA3NSw4ICsxOTIwLDcgQEAKICAgICAgICAgICAgIGlmICgoZXZlbnQuZ2V0RmxhZ3MoKSZLZXlFdmVudC5GTEFHX0ZST01fU1lTVEVNKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgLy8gVGhlIElNRSBpcyB0cnlpbmcgdG8gc2F5IHRoaXMgZXZlbnQgaXMgZnJvbSB0aGUKICAgICAgICAgICAgICAgICAvLyBzeXN0ZW0hICBCYWQgYmFkIGJhZCEKLSAgICAgICAgICAgICAgICBldmVudCA9IEtleUV2ZW50LmNoYW5nZUZsYWdzKGV2ZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQuZ2V0RmxhZ3MoKSZ+S2V5RXZlbnQuRkxBR19GUk9NX1NZU1RFTSk7CisgICAgICAgICAgICAgICAgZXZlbnQgPSBLZXlFdmVudC5jaGFuZ2VGbGFncyhldmVudCwgZXZlbnQuZ2V0RmxhZ3MoKSAmIH5LZXlFdmVudC5GTEFHX0ZST01fU1lTVEVNKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGRlbGl2ZXJLZXlFdmVudFRvVmlld0hpZXJhcmNoeSgoS2V5RXZlbnQpbXNnLm9iaiwgZmFsc2UpOwogICAgICAgICB9IGJyZWFrOwpAQCAtMjU2NCw4ICsyNDA4LDcgQEAKICAgICBwcml2YXRlIHZvaWQgZGVsaXZlcktleUV2ZW50KEtleUV2ZW50IGV2ZW50LCBib29sZWFuIHNlbmREb25lKSB7CiAgICAgICAgIC8vIElmIG1WaWV3IGlzIG51bGwsIHdlIGp1c3QgY29uc3VtZSB0aGUga2V5IGV2ZW50IGJlY2F1c2UgaXQgZG9lc24ndAogICAgICAgICAvLyBtYWtlIHNlbnNlIHRvIGRvIGFueXRoaW5nIGVsc2Ugd2l0aCBpdC4KLSAgICAgICAgYm9vbGVhbiBoYW5kbGVkID0gbVZpZXcgIT0gbnVsbAotICAgICAgICAgICAgICAgID8gbVZpZXcuZGlzcGF0Y2hLZXlFdmVudFByZUltZShldmVudCkgOiB0cnVlOworICAgICAgICBib29sZWFuIGhhbmRsZWQgPSBtVmlldyA9PSBudWxsIHx8IG1WaWV3LmRpc3BhdGNoS2V5RXZlbnRQcmVJbWUoZXZlbnQpOwogICAgICAgICBpZiAoaGFuZGxlZCkgewogICAgICAgICAgICAgaWYgKHNlbmREb25lKSB7CiAgICAgICAgICAgICAgICAgaWYgKExPQ0FMX0xPR1YpIExvZy52KApAQCAtMjU5OSw3ICsyNDQyLDYgQEAKICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gc2VuZERvbmUgPSBzZXEgPj0gMDsKICAgICAgICAgICAgIGlmICghaGFuZGxlZCkgewogICAgICAgICAgICAgICAgIGRlbGl2ZXJLZXlFdmVudFRvVmlld0hpZXJhcmNoeShldmVudCwgc2VuZERvbmUpOwotICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2VuZERvbmUpIHsKICAgICAgICAgICAgICAgICBpZiAoTE9DQUxfTE9HVikgTG9nLnYoCiAgICAgICAgICAgICAgICAgICAgICAgICAiVmlld1Jvb3QiLCAiVGVsbGluZyB3aW5kb3cgbWFuYWdlciBrZXkgaXMgZmluaXNoZWQiKTsKQEAgLTI4MDAsNyArMjY0Miw3IEBACiAKICAgICB2b2lkIGRvRGllKCkgewogICAgICAgICBjaGVja1RocmVhZCgpOwotICAgICAgICBpZiAoQ29uZmlnLkxPR1YpIExvZy52KCJWaWV3Um9vdCIsICJESUUgaW4gIiArIHRoaXMgKyAiIG9mICIgKyBtU3VyZmFjZSk7CisgICAgICAgIGlmIChMT0NBTF9MT0dWKSBMb2cudigiVmlld1Jvb3QiLCAiRElFIGluICIgKyB0aGlzICsgIiBvZiAiICsgbVN1cmZhY2UpOwogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGlmIChtQWRkZWQgJiYgIW1GaXJzdCkgewogICAgICAgICAgICAgICAgIGludCB2aWV3VmlzaWJpbGl0eSA9IG1WaWV3LmdldFZpc2liaWxpdHkoKTsKQEAgLTI5MDgsMTMgKzI3NTAsMTIgQEAKICAgICAgICAgaWYgKGV2ZW50LmdldEFjdGlvbigpID09IEtleUV2ZW50LkFDVElPTl9ET1dOKSB7CiAgICAgICAgICAgICAvL25vaW5zcGVjdGlvbiBDb25zdGFudENvbmRpdGlvbnMKICAgICAgICAgICAgIGlmIChmYWxzZSAmJiBldmVudC5nZXRLZXlDb2RlKCkgPT0gS2V5RXZlbnQuS0VZQ09ERV9DQU1FUkEpIHsKLSAgICAgICAgICAgICAgICBpZiAoQ29uZmlnLkxPR0QpIExvZy5kKCJrZXlkaXNwIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0iKTsKLSAgICAgICAgICAgICAgICBpZiAoQ29uZmlnLkxPR0QpIExvZy5kKCJrZXlkaXNwIiwgIkZvY3VzZWQgdmlldyBIaWVyYXJjaHkgaXM6Iik7CisgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoImtleWRpc3AiLCAiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Iik7CisgICAgICAgICAgICAgICAgaWYgKERCRykgTG9nLmQoImtleWRpc3AiLCAiRm9jdXNlZCB2aWV3IEhpZXJhcmNoeSBpczoiKTsKKwogICAgICAgICAgICAgICAgIGRlYnVnKCk7CiAKLSAgICAgICAgICAgICAgICBpZiAoQ29uZmlnLkxPR0QpIExvZy5kKCJrZXlkaXNwIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0iKTsKKyAgICAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZCgia2V5ZGlzcCIsICI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0iKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC0zNTY3LDggKzM0MDgsNCBAQAogICAgIH0KIAogICAgIHByaXZhdGUgc3RhdGljIG5hdGl2ZSB2b2lkIG5hdGl2ZVNob3dGUFMoQ2FudmFzIGNhbnZhcywgaW50IGR1cmF0aW9uTWlsbGlzKTsKLQotICAgIC8vIGluZm9ybSBza2lhIHRvIGp1c3QgYWJhbmRvbiBpdHMgdGV4dHVyZSBjYWNoZSBJRHMKLSAgICAvLyBkb2Vzbid0IGNhbGwgZ2xEZWxldGVUZXh0dXJlcwotICAgIHByaXZhdGUgc3RhdGljIG5hdGl2ZSB2b2lkIG5hdGl2ZUFiYW5kb25HbENhY2hlcygpOwogfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9XaW5kb3cuamF2YSBiL2NvcmUvamF2YS9hb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BQ0NFU1NJQklMSVRZX1NFUlZJQ0UpOwotICAgICAgICBtU2VydmljZSA9IElBY2Nlc3NpYmlsaXR5TWFuYWdlci5TdHViLmFzSW50ZXJmYWNlKGlCaW5kZXIpOworICAgICAgICBtU2VydmljZSA9IHNlcnZpY2U7CisKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIG1TZXJ2aWNlLmFkZENsaWVudChtQ2xpZW50KTsKKyAgICAgICAgICAgIG1Jc0VuYWJsZWQgPSBtU2VydmljZS5hZGRDbGllbnQobUNsaWVudCk7CiAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiByZSkgewogICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkFjY2Vzc2liaWxpdHlNYW5hZ2VyU2VydmljZSBpcyBkZWFkIiwgcmUpOwogICAgICAgICB9CkBAIC0xMjgsNiArMTMzLDE4IEBACiAgICAgfQogCiAgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgY2xpZW50IGludGVyZmFjZSB0aGlzIGluc3RhbmNlIHJlZ2lzdGVycyBpbgorICAgICAqIHRoZSBjZW50cmFsaXplZCBhY2Nlc3NpYmlsaXR5IG1hbmFnZXIgc2VydmljZS4KKyAgICAgKgorICAgICAqIEByZXR1cm4gVGhlIGNsaWVudC4KKyAgICAgKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIElBY2Nlc3NpYmlsaXR5TWFuYWdlckNsaWVudCBnZXRDbGllbnQoKSB7CisgICAgICAgcmV0dXJuIChJQWNjZXNzaWJpbGl0eU1hbmFnZXJDbGllbnQpIG1DbGllbnQuYXNCaW5kZXIoKTsgCisgICAgfQorCisgICAgLyoqCiAgICAgICogU2VuZHMgYW4ge0BsaW5rIEFjY2Vzc2liaWxpdHlFdmVudH0uIElmIHRoaXMge0BsaW5rIEFjY2Vzc2liaWxpdHlNYW5hZ2VyfSBpcyBub3QKICAgICAgKiBlbmFibGVkIHRoZSBjYWxsIGlzIGEgTk9PUC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NzZWQuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gb25LZXlFdmVudChLZXlFdmVudCBldmVudCkgeworCisgICAgICAgIC8vIGFzIGEgcHJvb2Ygb2YgY29uY2VwdCBsZXQgdXMgZG8gdGhlIHNpbXBsZXN0IGV4YW1wbGUKKworICAgICAgICBpZiAoZXZlbnQuZ2V0QWN0aW9uKCkgIT0gS2V5RXZlbnQuQUNUSU9OX1VQKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBpbnQga2V5Q29kZSA9IGV2ZW50LmdldEtleUNvZGUoKTsKKworICAgICAgICBzd2l0Y2ggKGtleUNvZGUpIHsKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9OOgorICAgICAgICAgICAgICAgIG1vZGlmeVNlbGVjdGlvbigiZXh0ZW5kIiwgImZvcndhcmQiLCAic2VudGVuY2UiKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9QOgorICAgICAgICAgICAgICAgIG1vZGlmeVNlbGVjdGlvbigiZXh0ZW5kIiwgImJhY2t3YXJkIiwgInNlbnRlbmNlIik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2FsbGVkIHdoZW4gdGhlIDxjb2RlPnNlbGVjdGlvblN0cmluZzwvY29kZT4gaGFzIGNoYW5nZWQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgb25TZWxlY3Rpb25TdHJpbmdDaGFuZ2UoU3RyaW5nIHNlbGVjdGlvblN0cmluZykgeworICAgICAgICAvLyBwdXQgdGhlIHNlbGVjdGlvbiBzdHJpbmcgaW4gYW4gQWNjZXNzaWJpbGl0eUV2ZW50IGFuZCBzZW5kIGl0CisgICAgICAgIEFjY2Vzc2liaWxpdHlFdmVudCBldm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orCisgICAgLyoqCiAgICAgICogU3RhcnQgbG9hZGluZyBhIHJlc291cmNlLgogICAgICAqIEBwYXJhbSBsb2FkZXJIYW5kbGUgVGhlIG5hdGl2ZSBSZXNvdXJjZUxvYWRlciB0aGF0IGlzIHRoZSB0YXJnZXQgb2YgdGhlCiAgICAgICogICAgICAgICAgICAgICAgICAgICBkYXRhLgpAQCAtNzg1LDExICs4MTQsNyBAQAogICAgICAqIEByZXR1cm4gVGhlIEJyb3dzZXJGcmFtZSBvYmplY3Qgc3RvcmVkIGluIHRoZSBuZXcgV2ViVmlldy4KICAgICAgKi8KICAgICBwcml2YXRlIEJyb3dzZXJGcmFtZSBjcmVhdGVXaW5kb3coYm9vbGVhbiBkaWFsb2csIGJvb2xlYW4gdXNlckdlc3R1cmUpIHsKLSAgICAgICAgV2ViVmlldyB3ID0gbUNhbGxiYWNrUHJveHkuY3JlYXRlV2luZG93KGRpYWxvZywgdXNlckdlc3R1cmUpOwotICAgICAgICBpZiAodyAhPSBudWxsKSB7Ci0gICAgICAgICAgICByZXR1cm4gdy5nZXRXZWJWaWV3Q29yZSgpLmdldEJyb3dzZXJGcmFtZSgpOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBudWxsOworICAgICAgICByZXR1cm4gbUNhbGxiYWNrUHJveHkuY3JlYXRlV2luZG93KGRpYWxvZywgdXNlckdlc3R1cmUpOwogICAgIH0KIAogICAgIC8qKgpAQCAtODQ2LDYgKzg3MSw3IEBACiAgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEZJTEVfVVBMT0FEX0xBQkVMID0gNDsKICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgUkVTRVRfTEFCRUwgPSA1OwogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBTVUJNSVRfTEFCRUwgPSA2OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBGSUxFX1VQTE9BRF9OT19GSUxFX0NIT1NFTiA9IDc7CiAKICAgICBTd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S5nZXRTdHJpbmcoInVybCIpOwogICAgICAgICAgICAgICAgICAgICBpZiAoIW1XZWJDaHJvbWVDbGllbnQub25Kc0FsZXJ0KG1XZWJWaWV3LCB1cmwsIG1lc3NhZ2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gb25seSBkaXNwbGF5IHRoZSBhbGVydCBkaWFsb2cgaWYgdGhlIG1Db250ZXh0IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBBY3Rpdml0eSBhbmQgaXRzIHdpbmRvdyBoYXMgdGhlIGZvY3VzLgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEobUNvbnRleHQgaW5zdGFuY2VvZiBBY3Rpdml0eSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgISgoQWN0aXZpdHkpIG1Db250ZXh0KS5oYXNXaW5kb3dGb2N1cygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLmNhbmNlbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5zZXRSZWFkeSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEFsZXJ0RGlhbG9nLkJ1aWxkZXIobUNvbnRleHQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRUaXRsZShnZXRKc0RpYWxvZ1RpdGxlKHVybCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRNZXNzYWdlKG1lc3NhZ2UpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRQb3NpdGl2ZUJ1dHRvbihSLnN0cmluZy5vaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgQWxlcnREaWFsb2cuT25DbGlja0xpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBEaWFsb2dJbnRlcmZhY2UuT25DbGlja0xpc3RlbmVyKCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERpYWxvZ0ludGVyZmFjZSBkaWFsb2csCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHdoaWNoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuY29uZmlybSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNldENhbmNlbGFibGUoZmFsc2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRPbkNhbmNlbExpc3RlbmVyKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBEaWFsb2dJbnRlcmZhY2UuT25DYW5jZWxMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25DYW5jZWwoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGlhbG9nSW50ZXJmYWNlIGRpYWxvZykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLmNhbmNlbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNob3coKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICByZXMuc2V0UmVhZHkoKTsKQEAgLTUyNSw2ICs1NDIsMTQgQEAKICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHVybCA9IG1zZy5nZXREYXRhKCkuZ2V0U3RyaW5nKCJ1cmwiKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKCFtV2ViQ2hyb21lQ2xpZW50Lm9uSnNDb25maXJtKG1XZWJWaWV3LCB1cmwsIG1lc3NhZ2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gb25seSBkaXNwbGF5IHRoZSBhbGVydCBkaWFsb2cgaWYgdGhlIG1Db250ZXh0IGlzCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBBY3Rpdml0eSBhbmQgaXRzIHdpbmRvdyBoYXMgdGhlIGZvY3VzLgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEobUNvbnRleHQgaW5zdGFuY2VvZiBBY3Rpdml0eSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgISgoQWN0aXZpdHkpIG1Db250ZXh0KS5oYXNXaW5kb3dGb2N1cygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLmNhbmNlbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5zZXRSZWFkeSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEFsZXJ0RGlhbG9nLkJ1aWxkZXIobUNvbnRleHQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRUaXRsZShnZXRKc0RpYWxvZ1RpdGxlKHVybCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRNZXNzYWdlKG1lc3NhZ2UpCkBAIC01NjUsNiArNTkwLDE0IEBACiAgICAgICAgICAgICAgICAgICAgIFN0cmluZyB1cmwgPSBtc2cuZ2V0RGF0YSgpLmdldFN0cmluZygidXJsIik7CiAgICAgICAgICAgICAgICAgICAgIGlmICghbVdlYkNocm9tZUNsaWVudC5vbkpzUHJvbXB0KG1XZWJWaWV3LCB1cmwsIG1lc3NhZ2UsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWwsIHJlcykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgZGlzcGxheSB0aGUgYWxlcnQgZGlhbG9nIGlmIHRoZSBtQ29udGV4dCBpcworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWN0aXZpdHkgYW5kIGl0cyB3aW5kb3cgaGFzIHRoZSBmb2N1cy4KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKG1Db250ZXh0IGluc3RhbmNlb2YgQWN0aXZpdHkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEoKEFjdGl2aXR5KSBtQ29udGV4dCkuaGFzV2luZG93Rm9jdXMoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5jYW5jZWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuc2V0UmVhZHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIExheW91dEluZmxhdGVyIGZhY3RvcnkgPSBMYXlvdXRJbmZsYXRlcgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZnJvbShtQ29udGV4dCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBWaWV3IHZpZXcgPSBmYWN0b3J5LmluZmxhdGUoUi5sYXlvdXQuanNfcHJvbXB0LApAQCAtNjE2LDYgKzY0OSwxNCBAQAogICAgICAgICAgICAgICAgICAgICBTdHJpbmcgdXJsID0gbXNnLmdldERhdGEoKS5nZXRTdHJpbmcoInVybCIpOwogICAgICAgICAgICAgICAgICAgICBpZiAoIW1XZWJDaHJvbWVDbGllbnQub25Kc0JlZm9yZVVubG9hZChtV2ViVmlldywgdXJsLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UsIHJlcykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgZGlzcGxheSB0aGUgYWxlcnQgZGlhbG9nIGlmIHRoZSBtQ29udGV4dCBpcworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWN0aXZpdHkgYW5kIGl0cyB3aW5kb3cgaGFzIHRoZSBmb2N1cy4KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKG1Db250ZXh0IGluc3RhbmNlb2YgQWN0aXZpdHkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICEoKEFjdGl2aXR5KSBtQ29udGV4dCkuaGFzV2luZG93Rm9jdXMoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5jYW5jZWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuc2V0UmVhZHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyBtID0gbUNvbnRleHQuZ2V0U3RyaW5nKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSLnN0cmluZy5qc19kaWFsb2dfYmVmb3JlX3VubG9hZCwgbWVzc2FnZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgQWxlcnREaWFsb2cuQnVpbGRlcihtQ29udGV4dCkKQEAgLTcyNSw3ICs3NjYsOCBAQAogCiAgICAgICAgICAgICBjYXNlIE9QRU5fRklMRV9DSE9PU0VSOgogICAgICAgICAgICAgICAgIGlmIChtV2ViQ2hyb21lQ2xpZW50ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgbVdlYkNocm9tZUNsaWVudC5vcGVuRmlsZUNob29zZXIoKFVwbG9hZEZpbGUpIG1zZy5vYmopOworICAgICAgICAgICAgICAgICAgICBVcGxvYWRGaWxlTWVzc2FnZURhdGEgZGF0YSA9IChVcGxvYWRGaWxlTWVzc2FnZURhdGEpbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgbVdlYkNocm9tZUNsaWVudC5vcGVuRmlsZUNob29zZXIoZGF0YS5nZXRVcGxvYWRGaWxlKCksIGRhdGEuZ2V0QWNjZXB0VHlwZSgpKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgYnJlYWs7CiAKQEAgLTc1MCw2ICs3OTIsOSBAQAogICAgICAgICAgICAgICAgIG1XZWJWaWV3LnNldEh0dHBBdXRoVXNlcm5hbWVQYXNzd29yZCgKICAgICAgICAgICAgICAgICAgICAgICAgIGhvc3QsIHJlYWxtLCB1c2VybmFtZSwgcGFzc3dvcmQpOwogICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTRVRfSU5TVEFMTEFCTEVfV0VCQVBQOgorICAgICAgICAgICAgICAgIG1XZWJDaHJvbWVDbGllbnQuc2V0SW5zdGFsbGFibGVXZWJBcHAoKTsKKyAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgfQogICAgIH0KIApAQCAtMTA4NywxMCArMTEzMiwxNSBAQAogICAgIHB1YmxpYyB2b2lkIG9uUHJvZ3Jlc3NDaGFuZ2VkKGludCBuZXdQcm9ncmVzcykgewogICAgICAgICAvLyBTeW5jaHJvbml6ZSBzbyB0aGF0IG1MYXRlc3RQcm9ncmVzcyBpcyB1cC10by1kYXRlLgogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKLSAgICAgICAgICAgIGlmIChtV2ViQ2hyb21lQ2xpZW50ID09IG51bGwgfHwgbU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kgewpAQCAtMTEyMiw5ICsxMTcyLDE1IEBACiAKICAgICAgICAgV2ViVmlldyB3ID0gdHJhbnNwb3J0LmdldFdlYlZpZXcoKTsKICAgICAgICAgaWYgKHcgIT0gbnVsbCkgewotICAgICAgICAgICAgdy5nZXRXZWJWaWV3Q29yZSgpLmluaXRpYWxpemVTdWJ3aW5kb3coKTsKKyAgICAgICAgICAgIFdlYlZpZXdDb3JlIGNvcmUgPSB3LmdldFdlYlZpZXdDb3JlKCk7CisgICAgICAgICAgICAvLyBJZiBXZWJWaWV3LmRlc3Ryb3koKSBoYXMgYmVlbiBjYWxsZWQsIGNvcmUgbWF5IGJlIG51bGwuICBTa2lwCisgICAgICAgICAgICAvLyBpbml0aWFsaXphdGlvbiBpbiB0aGF0IGNhc2UgYW5kIHJldHVybiBudWxsLgorICAgICAgICAgICAgaWYgKGNvcmUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGNvcmUuaW5pdGlhbGl6ZVN1YndpbmRvdygpOworICAgICAgICAgICAgICAgIHJldHVybiBjb3JlLmdldEJyb3dzZXJGcmFtZSgpOworICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIHJldHVybiB3OworICAgICAgICByZXR1cm4gbnVsbDsKICAgICB9CiAKICAgICBwdWJsaWMgdm9pZCBvblJlcXVlc3RGb2N1cygpIHsKQEAgLTE0MjYsNiArMTQ4MiwyNCBAQAogICAgICAgICBzZW5kTWVzc2FnZShtc2cpOwogICAgIH0KIAorICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIFVwbG9hZEZpbGVNZXNzYWdlRGF0YSB7CisgICAgICAgIHByaXZhdGUgVXBsb2FkRmlsZSBtQ2FsbGJhY2s7CisgICAgICAgIHByaXZhdGUgU3RyaW5nIG1BY2NlcHRUeXBlOworCisgICAgICAgIHB1YmxpYyBVcGxvYWRGaWxlTWVzc2FnZURhdGEoVXBsb2FkRmlsZSB1cGxvYWRGaWxlLCBTdHJpbmcgYWNjZXB0VHlwZSkgeworICAgICAgICAgICAgbUNhbGxiYWNrID0gdXBsb2FkRmlsZTsKKyAgICAgICAgICAgIG1BY2NlcHRUeXBlID0gYWNjZXB0VHlwZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBVcGxvYWRGaWxlIGdldFVwbG9hZEZpbGUoKSB7CisgICAgICAgICAgICByZXR1cm4gbUNhbGxiYWNrOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIFN0cmluZyBnZXRBY2NlcHRUeXBlKCkgeworICAgICAgICAgICAgcmV0dXJuIG1BY2NlcHRUeXBlOworICAgICAgICB9CisgICAgfQorCiAgICAgcHJpdmF0ZSBjbGFzcyBVcGxvYWRGaWxlIGltcGxlbWVudHMgVmFsdWVDYWxsYmFjazxVcmk+IHsKICAgICAgICAgcHJpdmF0ZSBVcmkgbVZhbHVlOwogICAgICAgICBwdWJsaWMgdm9pZCBvblJlY2VpdmVWYWx1ZShVcmkgdmFsdWUpIHsKQEAgLTE0NDIsMTMgKzE1MTYsMTQgQEAKICAgICAvKioKICAgICAgKiBDYWxsZWQgYnkgV2ViVmlld0NvcmUgdG8gb3BlbiBhIGZpbGUgY2hvb3Nlci4KICAgICAgKi8KLSAgICAvKiBwYWNrYWdlICovIFVyaSBvcGVuRmlsZUNob29zZXIoKSB7CisgICAgLyogcGFja2FnZSAqLyBVcmkgb3BlbkZpbGVDaG9vc2VyKFN0cmluZyBhY2NlcHRUeXBlKSB7CiAgICAgICAgIGlmIChtV2ViQ2hyb21lQ2xpZW50ID09IG51bGwpIHsKICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9CiAgICAgICAgIE1lc3NhZ2UgbXlNZXNzYWdlID0gb2J0YWluTWVzc2FnZShPUEVOX0ZJTEVfQ0hPT1NFUik7CiAgICAgICAgIFVwbG9hZEZpbGUgdXBsb2FkRmlsZSA9IG5ldyBVcGxvYWRGaWxlKCk7Ci0gICAgICAgIG15TWVzc2FnZS5vYmogPSB1cGxvYWRGaWxlOworICAgIC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ZXJBdmFpbGFibGUgPSB0cnVlOworICAgICAgICAgICAgLy8gUmVnaXN0cmF0aW9uIG1heSBmYWlsIGlmIHByb3ZpZGVycyBhcmUgbm90IHByZXNlbnQgb24gdGhlIGRldmljZS4KKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgbUxvY2F0aW9uTWFuYWdlci5yZXF1ZXN0TG9jYXRpb25VcGRhdGVzKExvY2F0aW9uTWFuYWdlci5ORVRXT1JLX1BST1ZJREVSLCAwLCAwLCB0aGlzKTsKKyAgICAgICAgICAgICAgICBtSXNOZXR3b3JrUHJvdmlkZXJBdmFpbGFibGUgPSB0cnVlOworICAgICAgICAgICAgfSBjYXRjaChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gZSkgeyB9CiAgICAgICAgICAgICBpZiAobUlzR3BzRW5hYmxlZCkgewotICAgICAgICAgICAgICAgIG1Mb2NhdGlvbk1hbmFnZXIucmVxdWVzdExvY2F0aW9uVXBkYXRlcyhMb2NhdGlvbk1hbmFnZXIuR1BTX1BST1ZJREVSLCAwLCAwLCB0aGlzKTsKLSAgICAgICAgICAgICAgICBtSXNHcHNQcm92aWRlckF2YWlsYWJsZSA9IHRydWU7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgbUxvY2F0aW9uTWFuYWdlci5yZXF1ZXN0TG9jYXRpb25VcGRhdGVzKExvY2F0aW9uTWFuYWdlci5HUFNfUFJPVklERVIsIDAsIDAsIHRoaXMpOworICAgICAgICAgICAgICAgICAgICBtSXNHcHNQcm92aWRlckF2YWlsYWJsZSA9IHRydWU7CisgICAgICAgICAgICAgICAgfSBjYXRjaChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gZSkgeyB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gY2F0Y2goU2VjdXJpdHlFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgTG9nLmUoVEFHLCAiQ2F1Z2h0IHNlY3VyaXR5IGV4Y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ZXNzYWdlKE1lc3NhZ2UgbXNnKSB7CisgICAgICAgIHN3aXRjaCAobXNnLndoYXQpIHsKKyAgICAgICAgICAgIGNhc2UgVElNRVVQREFURTogeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChtU3RhdGUgIT0gRVJST1IgJiYgbU1lZGlhUGxheWVyLmlzUGxheWluZygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaXRpb24gPSBtTWVkaWFQbGF5ZXIuZ2V0Q3VycmVudFBvc2l0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVPblRpbWV1cGRhdGUocG9zaXRpb24sIG1OYXRpdmVQb2ludGVyKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIG1TdGF0ZSA9IEVSUk9SOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8vIGV2ZW50IGxpc3RlbmVycyBmb3IgTWVkaWFQbGF5ZXIKKyAgICAvLyBUaG9zZSBhcmUgY2FsbGVkIGZyb20gdGhlIHNhbWUgdGhyZWFkIHdlIGNyZWF0ZWQgdGhlIE1lZGlhUGxheWVyCisgICAgLy8gKGkuZS4gdGhlIHdlYnZpZXdjb3JlIHRocmVhZCBoZXJlKQorCisgICAgLy8gTWVkaWFQbGF5ZXIuT25CdWZmZXJpbmdVcGRhdGVMaXN0ZW5lcgorICAgIHB1YmxpYyB2b2lkIG9uQnVmZmVyaW5nVXBkYXRlKE1lZGlhUGxheWVyIG1wLCBpbnQgcGVyY2VudCkgeworICAgICAgICBuYXRpdmVPbkJ1ZmZlcmluZyhwZXJjZW50LCBtTmF0aXZlUG9pbnRlcik7CisgICAgfQorCisgICAgLy8gTWVkaWFQbGF5ZXIuT25Db21wbGV0aW9uTGlzdGVuZXI7CisgICAgcHVibGljIHZvaWQgb25Db21wbGV0aW9uKE1lZGlhUGxheWVyIG1wKSB7CisgICAgICAgIHJlc2V0TWVkaWFQbGF5ZXIoKTsKKyAgICAgICAgbVN0YXRlID0gSURMRTsKKyAgICAgICAgbmF0aXZlT25FbmRlZChtTmF0aXZlUG9pbnRlcik7CisgICAgfQorCisgICAgLy8gTWVkaWFQbGF5ZXIuT25FcnJvckxpc3RlbmVyCisgICAgcHVibGljIGJvb2xlYW4gb25FcnJvcihNZWRpYVBsYXllciBtcCwgaW50IHdoYXQsIGludCBleHRyYSkgeworICAgICAgICBtU3RhdGUgPSBFUlJPUjsKKyAgICAgICAgcmVzZXRNZWRpYVBsYXllcigpOworICAgICAgICBtU3RhdGUgPSBJRExFOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLy8gTWVkaWFQbGF5ZXIuT25QcmVwYXJlZExpc3RlbmVyCisgICAgcHVibGljIHZvaWQgb25QcmVwYXJlZChNZWRpYVBsYXllciBtcCkgeworICAgICAgICBtU3RhdGUgPSBQUkVQQVJFRDsKKyAgICAgICAgaWYgKG1UaW1lciAhPSBudWxsKSB7CisgICAgICAgICAgICBtVGltZXIuc2NoZWR1bGUobmV3IFRpbWV1cGRhdGVUYXNrKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVElNRVVQREFURV9QRVJJT0QsIFRJTUVVUERBVEVfUEVSSU9EKTsKKyAgICAgICAgfQorICAgICAgICBuYXRpdmVPblByZXBhcmVkKG1wLmdldER1cmF0aW9uKCksIDAsIDAsIG1OYXRpdmVQb2ludGVyKTsKKyAgICAgICAgaWYgKG1Bc2tUb1BsYXkpIHsKKyAgICAgICAgICAgIG1Bc2tUb1BsYXkgPSBmYWxzZTsKKyAgICAgICAgICAgIHBsYXkoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vIE1lZGlhUGxheWVyLk9uU2Vla0NvbXBsZXRlTGlzdGVuZXIKKyAgICBwdWJsaWMgdm9pZCBvblNlZWtDb21wbGV0ZShNZWRpYVBsYXllciBtcCkgeworICAgICAgICBuYXRpdmVPblRpbWV1cGRhdGUobXAuZ2V0Q3VycmVudFBvc2l0aW9uKCksIG1OYXRpdmVQb2ludGVyKTsKKyAgICB9CisKKworICAgIC8qKgorICAgICAqIEBwYXJhbSBuYXRpdmVQdHIgaXMgdGhlIEMrKyBwb2ludGVyIHRvIHRoZSBNZWRpYVBsYXllclByaXZhdGUgb2JqZWN0LgorICAgICAqLworICAgIHB1YmxpYyBIVE1MNUF1ZGlvKGludCBuYXRpdmVQdHIpIHsKKyAgICAgICAgLy8gU2F2ZSB0aGUgbmF0aXZlIHB0cgorICAgICAgICBtTmF0aXZlUG9pbnRlciA9IG5hdGl2ZVB0cjsKKyAgICAgICAgcmVzZXRNZWRpYVBsYXllcigpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZXNldE1lZGlhUGxheWVyKCkgeworICAgICAgICBpZiAobU1lZGlhUGxheWVyID09IG51bGwpIHsKKyAgICAgICAgICAgIG1NZWRpYVBsYXllciA9IG5ldyBNZWRpYVBsYXllcigpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbU1lZGlhUGxheWVyLnJlc2V0KCk7CisgICAgICAgIH0KKyAgICAgICAgbU1lZGlhUGxheWVyLnNldE9uQnVmZmVyaW5nVXBkYXRlTGlzdGVuZXIodGhpcyk7CisgICAgICAgIG1NZWRpYVBsYXllci5zZXRPbkNvbXBsZXRpb25MaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgbU1lZGlhUGxheWVyLnNldE9uRXJyb3JMaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgbU1lZGlhUGxheWVyLnNldE9uUHJlcGFyZWRMaXN0ZW5lcih0aGlzKTsKKyAgICAgICAgbU1lZGlhUGxheWVyLnNldE9uU2Vla0NvbXBsZXRlTGlzdGVuZXIodGhpcyk7CisKKyAgICAgICAgaWYgKG1UaW1lciAhPSBudWxsKSB7CisgICAgICAgICAgICBtVGltZXIuY2FuY2VsKCk7CisgICAgICAgIH0KKyAgICAgICAgbVRpbWVyID0gbmV3IFRpbWVyKCk7CisgICAgICAgIG1TdGF0ZSA9IElETEU7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHNldERhdGFTb3VyY2UoU3RyaW5nIHVybCkgeworICAgICAgICBtVXJsID0gdXJsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaWYgKG1TdGF0ZSAhPSBJRExFKSB7CisgICAgICAgICAgICAgICAgcmVzZXRNZWRpYVBsYXllcigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbU1lZGlhUGxheWVyLnNldERhdGFTb3VyY2UodXJsKTsKKyAgICAgICAgICAgIG1TdGF0ZSA9IElOSVRJQUxJWkVEOworICAgICAgICAgICAgbU1lZGlhUGxheWVyLnByZXBhcmVBc3luYygpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJjb3VsZG4ndCBsb2FkIHRoZSByZXNvdXJjZTogIiArIHVybCArICIgZXhjOiAiICsgZSk7CisgICAgICAgICAgICByZXNldE1lZGlhUGxheWVyKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcGxheSgpIHsKKyAgICAgICAgaWYgKChtU3RhdGUgPT0gRVJST1IgfHwgbVN0YXRlID09IElETEUpICYmIG1VcmwgIT0gbnVsbCkgeworICAgICAgICAgICAgcmVzZXRNZWRpYVBsYXllcigpOworICAgICAgICAgICAgc2V0RGF0YVNvdXJjZShtVXJsKTsKKyAgICAgICAgICAgIG1Bc2tUb1BsYXkgPSB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG1TdGF0ZSA+PSBQUkVQQVJFRCkgeworICAgICAgICAgICAgbU1lZGlhUGxheWVyLnN0YXJ0KCk7CisgICAgICAgICAgICBtU3RhdGUgPSBTVEFSVEVEOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHBhdXNlKCkgeworICAgICAgICBpZiAobVN0YXRlID09IFNUQVJURUQpIHsKKyAgICAgICAgICAgIGlmIChtVGltZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1UaW1lci5wdXJnZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbU1lZGlhUGxheWVyLnBhdXNlKCk7CisgICAgICAgICAgICBtU3RhdGUgPSBQQVVTRUQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgc2VlayhpbnQgbXNlYykgeworICAgICAgICBpZiAobVN0YXRlID49IFBSRVBBUkVEKSB7CisgICAgICAgICAgICBtTWVkaWFQbGF5ZXIuc2Vla1RvKG1zZWMpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHRlYXJkb3duKCkgeworICAgICAgICBtTWVkaWFQbGF5ZXIucmVsZWFzZSgpOworICAgICAgICBtU3RhdGUgPSBFUlJPUjsKKyAgICAgICAgbU5hdGl2ZVBvaW50ZXIgPSAwOworICAgIH0KKworICAgIHByaXZhdGUgZmxvYXQgZ2V0TWF4VGltZVNlZWthYmxlKCkgeworICAgICAgICByZXR1cm4gbU1lZGlhUGxheWVyLmdldER1cmF0aW9uKCkgLyAxMDAwLjBmOworICAgIH0KKworICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgbmF0aXZlT25CdWZmZXJpbmcoaW50IHBlcmNlbnQsIGludCBuYXRpdmVQb2ludGVyKTsKKyAgICBwcml2YXRlIG5hdGl2ZSB2b2lkIG5hdGl2ZU9uRW5kZWQoaW50IG5hdGl2ZVBvaW50ZXIpOworICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgbmF0aXZlT25QcmVwYXJlZChpbnQgZHVyYXRpb24sIGludCB3aWR0aCwgaW50IGhlaWdodCwgaW50IG5hdGl2ZVBvaW50ZXIpOworICAgIHByaXZhdGUgbmF0aXZlIHZvaWQgbm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wpAQCAtNzYsNiArODEsMTkgQEAKICAgICAgKi8KICAgICBwcml2YXRlIEh0dHBBdXRoSGFuZGxlciBtSHR0cEF1dGhIYW5kbGVyOwogCisgICAgcHJpdmF0ZSBDb250ZXh0IG1Db250ZXh0OworCisgICAgLyoqCisgICAgICogVHJ1ZSBpZiB0aGUgY3VycmVudGx5IHVzZWQgbmV0d29yayBjb25uZWN0aW9uIGlzIGEgcm9hbWluZyBwaG9uZQorICAgICAqIGNvbm5lY3Rpb24uCisgICAgICovCisgICAgcHJpdmF0ZSBib29sZWFuIG1Sb2FtaW5nOworCisgICAgLyoqCisgICAgICogVHJhY2tzIGlmIHdlIGFyZSByb2FtaW5nLgorICAgICAqLworICAgIHByaXZhdGUgUm9hbWluZ01vbml0b3IgbVJvYW1pbmdNb25pdG9yOworCiAgICAgLyoqCiAgICAgICogQHJldHVybiBUaGUgc2luZ2xldG9uIGluc3RhbmNlIG9mIHRoZSBuZXR3b3JrLgogICAgICAqLwpAQCAtMTA3LDYgKzEyNSw3IEBACiAgICAgICAgIGlmICgrK3NQbGF0Zm9ybU5vdGlmaWNhdGlvbkVuYWJsZVJlZkNvdW50ID09IDEpIHsKICAgICAgICAgICAgIGlmIChzTmV0d29yayAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgc05ldHdvcmsubVJlcXVlc3RRdWV1ZS5lbmFibGVQbGF0Zm9ybU5vdGlmaWNhdGlvbnMoKTsKKyAgICAgICAgICAgICAgICBzTmV0d29yay5tb25pdG9yUm9hbWluZygpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBzUGxhdGZvcm1Ob3RpZmljYXRpb25zID0gdHJ1ZTsKICAgICAgICAgICAgIH0KQEAgLTEyMSw2ICsxNDAsNyBAQAogICAgICAgICBpZiAoLS1zUGxhdGZvcm1Ob3RpZmljYXRpb25FbmFibGVSZWZDb3VudCA9PSAwKSB7CiAgICAgICAgICAgICBpZiAoc05ldHdvcmsgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHNOZXR3b3JrLm1SZXF1ZXN0UXVldWUuZGlzYWJsZVBsYXRmb3JtTm90aWZpY2F0aW9ucygpOworICAgICAgICAgICAgICAgIHNOZXR3b3JrLnN0b3BNb25pdG9yaW5nUm9hbWluZygpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBzUGxhdGZvcm1Ob3RpZmljYXRpb25zID0gZmFsc2U7CiAgICAgICAgICAgICB9CkBAIC0xMzYsMTIgKzE1NiwzOSBAQAogICAgICAgICAgICAgQXNzZXJ0LmFzc2VydFRydWUoVGhyZWFkLmN1cnJlbnRUaHJlYWQoKS4KICAgICAgICAgICAgICAgICAgICAgZ2V0TmFtZSgpLmVxdWFscyhXZWJWaWV3Q29yZS5USFJFQURfTkFNRSkpOwogICAgICAgICB9CisgICAgICAgIG1Db250ZXh0ID0gY29udGV4dDsKICAgICAgICAgbVNzbEVycm9ySGFuZGxlciA9IG5ldyBTc2xFcnJvckhhbmRsZXIoKTsKICAgICAgICAgbUh0dHBBdXRoSGFuZGxlciA9IG5ldyBIdHRwQXV0aEhhbmRsZXIodGhpcyk7CiAKICAgICAgICAgbVJlcXVlc3RRdWV1ZSA9IG5ldyBSZXF1ZXN0UXVldWUoY29udGV4dCk7CiAgICAgfQogCisgICAgcHJpdmF0ZSBjbGFzcyBSb2FtaW5nTW9uaXRvciBleHRlbmRzIEJyb2FkY2FzdFJlY2VpdmVyIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZShDb250ZXh0IGNvbnRleHQsIEludGVudCBpbnRlbnQpIHsKKyAgICAgICAgICAgIGlmICghQ29ubmVjdGl2aXR5TWFuYWdlci5DT05ORUNUSVZJVFlfQUNUSU9OLmVxdWFscyhpbnRlbnQuZ2V0QWN0aW9uKCkpKQorICAgICAgICAgICAgICAgIHJldHVybjsKKworICAgICAgICAgICAgTmV0d29ya0luZm8gaW5mbyA9IChOZXR3b3JrSW5mbylpbnRlbnQuZ2V0UGFyY2VsYWJsZUV4dHJhKENvbm5lY3Rpdml0eU1hbmFnZXIuRVhUUkFfTkVUV09SS19JTkZPKTsKKyAgICAgICAgICAgIGlmIChpbmZvICE9IG51bGwpCisgICAgICAgICAgICAgICAgbVJvYW1pbmcgPSBpbmZvLmlzUm9hbWluZygpOworICAgICAgICB9OworICAgIH07CisKKyAgICBwcml2YXRlIHZvaWQgbW9uaXRvclJvYW1pbmcoKSB7CisgICAgICAgIG1Sb2FtaW5nTW9uaXRvciA9IG5ldyBSb2FtaW5nTW9uaXRvcigpOworICAgICAgICBJbnRlbnRGaWx0ZXIgZmlsdGVyID0gbmV3IEludGVudEZpbHRlcigpOworICAgICAgICBmaWx0ZXIuYWRkQWN0aW9uKENvbm5lY3Rpdml0eU1hbmFnZXIuQ09OTkVDVElWSVRZX0FDVElPTik7CisgICAgICAgIG1Db250ZXh0LnJlZ2lzdGVyUmVjZWl2ZXIoc05ldHdvcmsubVJvYW1pbmdNb25pdG9yLCBmaWx0ZXIpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzdG9wTW9uaXRvcmluZ1JvYW1pbmcoKSB7CisgICAgICAgIGlmIChtUm9hbWluZ01vbml0b3IgIT0gbnVsbCkgeworICAgICAgICAgICAgbUNvbnRleHQudW5yZWdpc3RlclJlY2VpdmVyKG1Sb2FtaW5nTW9uaXRvcik7CisgICAgICAgICAgICBtUm9hbWluZ01vbml0b3IgPSBudWxsOworICAgICAgICB9CisgICAgfQorCiAgICAgLyoqCiAgICAgICogUmVxdWVzdCBhIHVybCBmcm9tIGVpdGhlciB0aGUgbmV0d29yayBvciB0aGUgZmlsZSBzeXN0ZW0uCiAgICAgICogQHBhcmFtIHVybCBUaGUgdXJsIHRvIGxvYWQuCkBAIC0xNzAsNiArMjE3LDExIEBACiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KIAorICAgICAgICAvLyBJZiB0aGlzIGlzIGEg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Y291bnRyeSA9IGxvY2FsZS5nZXRDb3VudHJ5KCk7Ci0gICAgICAgICAgICBpZiAoY291bnRyeSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgYnVmZmVyLmFwcGVuZCgiLSIpOwotICAgICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQoY291bnRyeSk7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVmZmVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKKyAgICAgICAgYWRkTG9jYWxlVG9IdHRwQWNjZXB0TGFuZ3VhZ2UoYnVmZmVyLCBsb2NhbGUpOworCisgICAgICAgIGlmICghTG9jYWxlLlVTLmVxdWFscyhsb2NhbGUpKSB7CisgICAgICAgICAgICBpZiAoYnVmZmVyLmxlbmd0aCgpID4gMCkgeworICAgICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQoIiwgIik7CiAgICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKCFsb2NhbGUuZXF1YWxzKExvY2FsZS5VUykpIHsKLSAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQoIiwgIik7Ci0gICAgICAgICAgICBqYXZhLnV0aWwuTG9jYWxlIHVzID0gTG9jYWxlLlVTOwotICAgICAgICAgICAgaWYgKHVzLmdldExhbmd1YWdlKCkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQodXMuZ2V0TGFuZ3VhZ2UoKSk7Ci0gICAgICAgICAgICAgICAgZmluYWwgU3RyaW5nIGNvdW50cnkgPSB1cy5nZXRDb3VudHJ5KCk7Ci0gICAgICAgICAgICAgICAgaWYgKGNvdW50cnkgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCItIik7Ci0gICAgICAgICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQoY291bnRyeSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQorICAgICAgICAgICAgYnVmZmVyLmFwcGVuZChBQ0NFUFRfTEFOR19GT1JfVVNfTE9DQUxFKTsKICAgICAgICAgfQogCiAgICAgICAgIHJldHVybiBidWZmZXIudG9TdHJpbmcoKTsKICAgICB9Ci0gICAgCisKKyAgICAvKioKKyAgICAgKiBDb252ZXJ0IG9ic29sZXRlIGxhbmd1YWdlIGNvZGVzLCBpbmNsdWRpbmcgSGVicmV3L0luZG9uZXNpYW4vWWlkZGlzaCwKKyAgICAgKiB0byBuZXcgc3RhbmRhcmQuCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgU3RyaW5nIGNvbnZlcnRPYnNvbGV0ZUxhbmd1YWdlQ29kZVRvTmV3KFN0cmluZyBsYW5nQ29kZSkgeworICAgICAgICBpZiAobGFuZ0NvZGUgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCJpdyIuZXF1YWxzKGxhbmdDb2RlKSkgeworICAgICAgICAgICAgLy8gSGVicmV3CisgICAgICAgICAgICByZXR1cm4gImhlIjsKKyAgICAgICAgfSBlbHNlIGlmICgiaW4iLmVxdWFscyhsYW5nQ29kZSkpIHsKKyAgICAgICAgICAgIC8vIEluZG9uZXNpYW4KKyAgICAgICAgICAgIHJldHVybiAiaWQiOworICAgICAgICB9IGVsc2UgaWYgKCJqaSIuZXF1YWxzKGxhbmdDb2RlKSkgeworICAgICAgICAgICAgLy8gWWlkZGlzaAorICAgICAgICAgICAgcmV0dXJuICJ5aSI7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGxhbmdDb2RlOworICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIHZvaWQgYWRkTG9jYWxlVG9IdHRwQWNjZXB0TGFuZ3VhZ2UoU3RyaW5nQnVpbGRlciBidWlsZGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9jYWxlIGxvY2FsZSkgeworICAgICAgICBTdHJpbmcgbGFuZ3VhZ2UgPSBjb252ZXJ0T2Jzb2xldGVMYW5ndWFnZUNvZGVUb05ldyhsb2NhbGUuZ2V0TGFuZ3VhZ2UoKSk7CisgICAgICAgIGlmIChsYW5ndWFnZSAhPSBudWxsKSB7CisgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChsYW5ndWFnZSk7CisgICAgICAgICAgICBTdHJpbmcgY291bnRyeSA9IGxvY2FsZS5nZXRDb3VudHJ5KCk7CisgICAgICAgICAgICBpZiAoY291bnRyeSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoIi0iKTsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChjb3VudHJ5KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKwogICAgIC8qKgogICAgICAqIExvb2tzIGF0IHNMb2NhbGUgYW5kIG1Db250ZXh0IGFuZCByZXR1cm5zIGN1cnJlbnQgVXNlckFnZW50IFN0cmluZy4KICAgICAgKiBAcmV0dXJuIEN1cnJlbnQgVXNlckFnZW50IFN0cmluZy4KQEAgLTM3OSwxMSArNDA2LDExIEBACiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAvLyBkZWZhdWx0IHRvICIxLjAiCiAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCIxLjAiKTsKLSAgICAgICAgfSAgCisgICAgICAgIH0KICAgICAgICAgYnVmZmVyLmFwcGVuZCgiOyAiKTsKICAgICAgICAgZmluYWwgU3RyaW5nIGxhbmd1YWdlID0gbG9jYWxlLmdldExhbmd1YWdlKCk7CiAgICAgICAgIGlmIChsYW5ndWFnZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICBidWZmZXIuYXBwZW5kKGxhbmd1YWdlLnRvTG93ZXJDYXNlKCkpOworICAgICAgICAgICAgYnVmZmVyLmFwcGVuZChjb252ZXJ0T2Jzb2xldGVMYW5ndWFnZUNvZGVUb05ldyhsYW5ndWFnZSkpOwogICAgICA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VNtb290aFRyYW5zaXRpb247CisgICAgfQorCisgICAgLyoqCiAgICAgICogU3RvcmUgd2hldGhlciB0aGUgV2ViVmlldyBpcyBzYXZpbmcgZm9ybSBkYXRhLgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldFNhdmVGb3JtRGF0YShib29sZWFuIHNhdmUpIHsKQEAgLTk4NCw4ICsxMDQ4LDggQEAKIAogICAgIHByaXZhdGUgdm9pZCB2ZXJpZnlOZXR3b3JrQWNjZXNzKCkgewogICAgICAgICBpZiAoIW1CbG9ja05ldHdvcmtMb2FkcykgewotICAgICAgICAgICAgaWYgKG1Db250ZXh0LmNoZWNrUGVybWlzc2lvbigiYW5kcm9pZC5wZXJtaXNzaW9uLklOVEVSTkVUIiwgCi0gICAgICAgICAgICAgICAgICAgIGFuZHJvaWQub3MuUHJvY2Vzcy5teVBpZCgpLCBhbmRyb2lkLm9zLlByb2Nlc3MubXlVaWQoKSkgIT0gCisgICAgICAgICAgICBpZiAobUNvbnRleHQuY2hlY2tQZXJtaXNzaW9uKCJhbmRyb2lkLnBlcm1pc3Npb24uSU5URVJORVQiLAorICAgICAgICAgICAgICAgICAgICBhbmRyb2lkLm9zLlByb2Nlc3MubXlQaWQoKSwgYW5kcm9pZC5vcy5Qcm9jZXNzLm15VWlkKCkpICE9CiAgICAgICAgICAgICAgICAgICAgICAgICBQYWNrYWdlTWFuYWdlci5QRVJNSVNTSU9OX0dSQU5URUQpIHsKICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU2VjdXJpdHlFeGNlcHRpb24KICAgICAgICAgICAgICAgICAgICAgICAgICgiUGVybWlzc2lvbiBkZW5pZWQgLSAiICsKQEAgLTEwMTEsNiArMTA3NSw3IEBACiAgICAgICogQGRlcHJlY2F0ZWQgVGhpcyBtZXRob2QgaGFzIGJlZW4gZGVwcmVjYXRlZCBpbiBmYXZvciBvZgogICAgICAqICAgICAgICAgICAgIHtAbGluayAjc2V0UGx1Z2luU3RhdGV9CiAgICAgICovCis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gIEBEZXByZWNhdGVkCiAgICAgcHVibGljIHN5bmNocm9uaXplZCBib29sZWFuIGdldFBsdWdpbnNFbmFibGVkKCkgewogICAgICAgICByZXR1cm4gbVBsdWdpblN0YXRlID09IFBsdWdpblN0YXRlLk9OOwogICAgIH0KQEAgLTEyNTYsNyArMTMzNCw3IEBACiAgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHNldFVzZXJBZ2VudFN0cmluZyhTdHJpbmcgdWEpIHsKICAgICAgICAgaWYgKHVhID09IG51bGwgfHwgdWEubGVuZ3RoKCkgPT0gMCkgewogICAgICAgICAgICAgc3luY2hyb25pemVkKHNMb2NrRm9yTG9jYWxlU2V0dGluZ3MpIHsKLSAgICAgICAgICAgICAgICBMb2NhbGUgY3VycmVudExvY2FsZSA9IExvY2FsZS5nZXREZWZhdWx0KCk7IAorICAgICAgICAgICAgICAgIExvY2FsZSBjdXJyZW50TG9jYWxlID0gTG9jYWxlLmdldERlZmF1bHQoKTsKICAgICAgICAgICAgICAgICBpZiAoIXNMb2NhbGUuZXF1YWxzKGN1cnJlbnRMb2NhbGUpKSB7CiAgICAgICAgICAgICAgICAgICAgIHNMb2NhbGUgPSBjdXJyZW50TG9jYWxlOwogICAgICAgICAgICAgICAgICAgICBtQWNjZXB0TGFuZ3VhZ2UgPSBnZXRDdXJyZW50QWNjZXB0TGFuZ3VhZ2UoKTsKQEAgLTEzMTEsMTEgKzEzODksMTEgQEAKICAgICAgICAgfQogICAgICAgICByZXR1cm4gbUFjY2VwdExhbmd1YWdlOwogICAgIH0KLSAgICAKKwogICAgIC8qKgogICAgICAqIFRlbGwgdGhlIFdlYlZpZXcgd2hldGhlciBpdCBuZWVkcyB0byBzZXQgYSBub2RlIHRvIGhhdmUgZm9jdXMgd2hlbgogICAgICAqIHtAbGluayBXZWJWaWV3I3JlcXVlc3RGb2N1cyhpbnQsIGFuZHJvaWQuZ3JhcGhpY3MuUmVjdCl9IGlzIGNhbGxlZC4KLSAgICAgKiAKKyAg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YlZpZXcgIT0gbnVsbCAmJiBsYXlvdXQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBmbG9hdCBtYXhTY3JvbGxYID0gKGZsb2F0KSBUb3VjaC5nZXRNYXhTY3JvbGxYKHRoaXMsIGxheW91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2Nyb2xsWSk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9URVhUX1ZJRVcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIm9uVG91Y2hFdmVudCB4PSIgKyBtU2Nyb2xsWCArICIgeT0iCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbVNjcm9sbFkgKyAiIG1heFg9IiArIG1heFNjcm9sbFgpOwpAQCAtNjY3LDYgKzY4NSw3IEBACiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICBTZWxlY3Rpb24uc2V0U2VsZWN0aW9uKHRleHQsIHNlbGVjdGlvbiwgc2VsZWN0aW9uKTsKICAgICAgICAgfQorICAgICAgICBpZiAobVdlYlZpZXcgIT0gbnVsbCkgbVdlYlZpZXcuaW5jcmVtZW50VGV4dEdlbmVyYXRpb24oKTsKICAgICB9CiAKICAgICAvKioKQEAgLTkxOSwxNCArOTM4LDQgQEAKICAgICAvKiBwYWNrYWdlICovIHZvaWQgdXBkYXRlQ2FjaGVkVGV4dGZpZWxkKCkgewogICAgICAgICBtV2ViVmlldy51cGRhdGVDYWNoZWRUZXh0ZmllbGQoZ2V0VGV4dCgpLnRvU3RyaW5nKCkpOwogICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyBib29sZWFuIHJlcXVlc3RSZWN0YW5nbGVPblNjcmVlbihSZWN0IHJlY3RhbmdsZSkgewotICAgICAgICAvLyBkb24ndCBzY3JvbGwgd2hpbGUgaW4gem9vbSBhbmltYXRpb24uIFdoZW4gaXQgaXMgZG9uZSwgd2Ugd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HRoaXMsIHRydWUpOwotICAgICAgICAgICAgbVBsdXNNaW51c1pvb21Db250cm9scyA9IChab29tQ29udHJvbHMpIGZpbmRWaWV3QnlJZCgKLSAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC56b29tQ29udHJvbHMpOwotICAgICAgICAgICAgZmluZFZpZXdCeUlkKGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQuem9vbU1hZ25pZnkpLnNldFZpc2liaWxpdHkoCi0gICAgICAgICAgICAgICAgICAgIFZpZXcuR09ORSk7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBzaG93KGJvb2xlYW4gc2hvd1pvb20sIGJvb2xlYW4gY2FuWm9vbU91dCkgewotICAgICAgICAgICAgbVBsdXNNaW51c1pvb21Db250cm9scy5zZXRWaXNpYmlsaXR5KAotICAgICAgICAgICAgICAgICAgICBzaG93Wm9vbSA/IFZpZXcuVklTSUJMRSA6IFZpZXcuR09ORSk7Ci0gICAgICAgICAgICBmYWRlKFZpZXcuVklTSUJMRSwgMC4wZiwgMS4wZik7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBoaWRlKCkgewotICAgICAgICAgICAgZmFkZShWaWV3LkdPTkUsIDEuMGYsIDAuMGYpOwotICAgICAgICB9Ci0KLSAgICAgICAgcHJpdmF0ZSB2b2lkIGZhZGUoaW50IHZpc2liaWxpdHksIGZsb2F0IHN0YXJ0QWxwaGEsIGZsb2F0IGVuZEFscGhhKSB7Ci0gICAgICAgICAgICBBbHBoYUFuaW1hdGlvbiBhbmltID0gbmV3IEFscGhhQW5pbWF0aW9uKHN0YXJ0QWxwaGEsIGVuZEFscGhhKTsKLSAgICAgICAgICAgIGFuaW0uc2V0RHVyYXRpb24oNTAwKTsKLSAgICAgICAgICAgIHN0YXJ0QW5pbWF0aW9uKGFuaW0pOwotICAgICAgICAgICAgc2V0VmlzaWJpbGl0eSh2aXNpYmlsaXR5KTs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YWludCBmb3IgdGhlIHRvdWNoIGhpZ2hsaWdodAorICAgIHByaXZhdGUgUGFpbnQgbVRvdWNoSGlnaHRsaWdodFBhaW50OworICAgIC8vIGRlYnVnIG9ubHkKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBib29sZWFuIERFQlVHX1RPVUNIX0hJR0hMSUdIVCA9IHRydWU7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFRPVUNIX0hJR0hMSUdIVF9FTEFQU0VfVElNRSA9IDIwMDA7CisgICAgcHJpdmF0ZSBQYWludCBtVG91Y2hDcm9zc0hhaXJDb2xvcjsKKyAgICBwcml2YXRlIGludCBtVG91Y2hIaWdobGlnaHRYOworICAgIHByaXZhdGUgaW50IG1Ub3VjaEhpZ2hsaWdodFk7CiAKICAgICAvKgogICAgICAqIFByaXZhdGUgbWVzc2FnZSBpZHMKQEAgLTYwNiw3ICs1NzAsNyBAQAogICAgIHN0YXRpYyBmaW5hbCBpbnQgV0VCQ09SRV9JTklUSUFMSVpFRF9NU0dfSUQgICAgICAgICA9IDEwNzsKICAgICBzdGF0aWMgZmluYWwgaW50IFVQREFURV9URVhURklFTERfVEVYVF9NU0dfSUQgICAgICAgPSAxMDg7CiAgICAgc3RhdGljIGZpbmFsIGludCBVUERBVEVfWk9PTV9SQU5HRSAgICAgICAgICAgICAgICAgID0gMTA5OwotICAgIHN0YXRpYyBmaW5hbCBpbnQgTU9WRV9PVVRfT0ZfUExVR0lOICAgICAgICAgICAgICAgICA9IDExMDsKKyAgICBzdGF0aWMgZmluYWwgaW50IFVOSEFORExFRF9OQVZfS0VZICAgICAgICAgICAgICAgICAgPSAxMTA7CiAgICAgc3RhdGljIGZpbmFsIGludCBDTEVBUl9URVhUX0VOVFJZICAgICAgICAgICAgICAgICAgID0gMTExOwogICAgIHN0YXRpYyBmaW5hbCBpbnQgVVBEQVRFX1RFWFRfU0VMRUNUSU9OX01TR19JRCAgICAgICA9IDExMjsKICAgICBzdGF0aWMgZ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0lEIiwgLy8gICA9IDEwODsKICAgICAgICAgIlVQREFURV9aT09NX1JBTkdFIiwgLy8gICAgICAgICAgICAgID0gMTA5OwotICAgICAgICAiTU9WRV9PVVRfT0ZfUExVR0lOIiwgLy8gICAgICAgICAgICAgPSAxMTA7CisgICAgICAgICJVTkhBTkRMRURfTkFWX0tFWSIsIC8vICAgICAgICAgICAgICA9IDExMDsKICAgICAgICAgIkNMRUFSX1RFWFRfRU5UUlkiLCAvLyAgICAgICAgICAgICAgID0gMTExOwogICAgICAgICAiVVBEQVRFX1RFWFRfU0VMRUNUSU9OX01TR19JRCIsIC8vICAgPSAxMTI7CiAgICAgICAgICJTSE9XX1JFQ1RfTVNHX0lEIiwgLy8gICAgICAgICAgICAgICA9IDExMzsKQEAgLTY3Myw3ICs2MzksOSBAQAogICAgICAgICAiRklORF9BR0FJTiIsIC8vICAgICAgICAgICAgICAgICAgICAgPSAxMjY7CiAgICAgICAgICJDRU5URVJfRklUX1JFQ1QiLCAvLyAgICAgICAgICAgICAgICA9IDEyNzsKICAgICAgICAgIlJFUVVFU1RfS0VZQk9BUkRfV0lUSF9TRUxFQ1RJT05fTVNHX0lEIiwgLy8gPSAxMjg7Ci0gICAgICAgICJTRVRfU0NST0xMQkFSX01PREVTIiAvLyAgICAgICAgICAgICA9IDEyOTsKKyAgICAgICAgIlNFVF9TQ1JPTExCQVJfTU9ERVMiLCAvLyAgICAgICAgICAgID0gMTI5OworICAgICAgICAiU0VMRUNUSU9OX1NUUklOR19DSEFOR0VEIiwgLy8gICAgICAgPSAxMzA7CisgICAgICAgICJTRVRfVE9VQ0hfSElHSExJR0hUX1JFQ1RTIiAvLyAgICAgICA9IDEzMTsKICAgICB9OwogCiAgICAgLy8gSWYgdGhlIHNpdGUgZG9lc24ndCB1c2UgdGhlIHZpZXdwb3J0IG1ldGEgdGFnIHRvIHNwZWNpZnkgdGhlIHZpZXdwb3J0LApAQCAtNjg2LDQ5ICs2NTQsOSBAQAogICAgIC8vIHRoZSBt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JIHRoZSB1c2VyIHNwZWNpZmllZCBvbmUgd2lucy4KKyAgICAgKgorICAgICAqIEBwYXJhbSBqYXZhc2NyaXB0SW50ZXJmYWNlcyBBIG1hcCB3aXRoIGludGVyZmFjZXMgdG8gYmUgZXhwb3NlZCB0byBKYXZhU2NyaXB0LgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBleHBvc2VBY2Nlc3NpYmlsaXR5SmF2YVNjcmlwdEFwaShNYXA8U3RyaW5nLCBPYmplY3Q+IGphdmFzY3JpcHRJbnRlcmZhY2VzKSB7CisgICAgICAgIGlmIChqYXZhc2NyaXB0SW50ZXJmYWNlcy5jb250YWluc0tleShBTElBU19BQ0NFU1NJQklMSVRZX0pTX0lOVEVSRkFDRSkpIHsKKyAgICAgICAgICAgIExvZy53KExPR1RBRywgIkphdmFTY3JpcHQgaW50ZXJmYWNlIG1hcHBlZCB0byBcIiIgKyBBTElBU19BQ0NFU1NJQklMSVRZX0pTX0lOVEVSRkFDRQorICAgICAgICAgICAgICAgICAgICArICJcIiBvdmVycmlkZXMgdGhlIGFjY2Vzc2liaWxpdHkgQVBJIEphdmFTY3JpcHQgaW50ZXJmYWNlLiBObyBhY2Nlc3NpYmlsaXR5IgorICAgICAgICAgICAgICAgICAgICArICJBUEkgd2lsbCBiZSBleHBvc2VkIHRvIEphdmFTY3JpcHQhIik7CisgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KKworICAgICAgICAvLyBleHBvc2UgdGhlIFRUUyBmb3Igbm93IC4uLgorICAgICAgICBqYXZhc2NyaXB0SW50ZXJmYWNlcy5wdXQoQUxJQVNfQUNDRVNTSUJJTElUWV9KU19JTlRFUkZBQ0UsCisgICAgICAgICAgICAgICAgbmV3IFRleHRUb1NwZWVjaChnZXRDb250ZXh0KCksIG51bGwpKTsKKyAgICB9CisKKyAgICAvKiBwYWNrYWdlICovdm9pZCB1cGRhdGVEZWZhdWx0Wm9vbURlbnNpdHkoaW50IHpvb21EZW5zaXR5KSB7CisgICAgICAgIGZpbmFsIGZsb2F0IGRlbnNpdHkgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXREaXNwbGF5TWV0cmljcygpLmRlbnNpdHkKKyAgICAgICAgICAgICAgICAqIDEwMCAvIHpvb21EZW5zaXR5OworICAgICAgICBtTmF2U2xvcCA9IChpbnQpICgxNiAqIGRlbnNpdHkpOworICAgICAgICBtWm9vbU1hbmFnZXIudXBkYXRlRGVmYXVsdFpvb21EZW5zaXR5KGRlbnNpdHkpOwogICAgIH0KIAogICAgIC8qIHBhY2thZ2UgKi8gYm9vbGVhbiBvblNhdmVQYXNzd29yZChTdHJpbmcgc2NoZW1lUGx1c0hvc3QsIFN0cmluZyB1c2VybmFtZSwKQEAgLTExMzYsMTQgKzEwMjcsMTQgQEAKICAgICAgKiByZXR1cm5zIHRoZSBoZWlnaHQgb2YgdGhlIHRpdGxlYmFydmlldyAoaWYgYW55KS4gRG9lcyBub3QgY2FyZSBhYm91dAogICAgICAqIHNjcm9sbGluZwogICAgICAqLwotICAgIHByaXZhdGUgaW50IGdldFRpdGxlSGVpZ2h0KCkgeworICAgIGludCBnZXRUaXRsZUhlaWdodCgpIHsKICAgICAgICAgcmV0dXJuIG1UaXRsZUJhciAhPSBudWxsID8gbVRpdGxlQmFyLmdldEhlaWdodCgpIDogMDsKICAgICB9CiAKICAgICAvKgogICAgICAqIFJldHVybiB0aGUgYW1vdW50IG9mIHRoZSB0aXRsZWJhcnZpZXcgKGlmIGFueSkgdGhhdCBpcyB2aXNpYmxlCiAgICAgICovCi0gICAgcHJpdmF0ZSBpbnQgZ2V0VmlzaWJsZVRpdGxlSGVpZ2h0KCkgeworICAgIGludCBnZXRWaXNpYmxlVGl0bGVIZWlnaHQoKSB7CiAgICAgICAgIHJldHVybiBNYXRoLm1heChnZXRUaXRsZUhlaWdodCgpIC0gbVNjcm9sbFksIDApOwogICAgIH0KIApAQCAtMTQwNCwyOSArMTI5NSwyMyBAQAogICAgICAgICAvLyBub3cgd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V0SW5pdGlhbFNjYWxlSW5QZXJjZW50KHNjYWxlSW5QZXJjZW50KTsKICAgICB9CiAKICAgICAvKioKQEAgLTE4NzUsMTMgKzE3NjAsNyBAQAogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAgICAgICAgIGNsZWFyVGV4dEVudHJ5KGZhbHNlKTsKLSAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuZ2V0QnVpbHRJblpvb21Db250cm9scygpKSB7Ci0gICAgICAgICAgICBnZXRab29tQnV0dG9uc0NvbnRyb2xsZXIoKS5zZXRWaXNpYmxlKHRydWUpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtWm9vbUNvbnRyb2xSdW5uYWJsZSk7Ci0gICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsCi0gICAgICAgICAgICAgICAgICAgIFpPT01fQ09OVFJPTFNfVElNRU9VVCk7Ci0gICAgICAgIH0KKyAgICAgICAgbVpvb21NYW5hZ2VyLmludm9rZVpvb21QaWNrZXIoKTsKICAgICB9CiAKICAgICAvKioKQEAgLTE5OTYsNyArMTg3NSw3IEBACiAgICAgICAgIG1zZy5zZW5kVG9UYXJnZXQoKTsKICAgICB9CiAKLSAgICBwcml2YXRlIHN0YXRpYyBpbnQgcGluTG9jKGludCB4LCBpbnQgdmlld01heCwgaW50IGRvY01heCkgeworICAgIHN0YXRpYyBpbnQgcGluTG9jKGludCB4LCBpbnQgdmlld01heCwgaW50IGRvY01heCkgewogLy8gICAgICAgIExvZy5kKExPR1RBRywgIi0tIHBpbkxvYyAiICsgeCArICIgIiArIHZpZXdNYXggKyAiICIgKyBkb2NNYXgpOwogICAgICAgICBpZiAoZG9jTWF4IDwgdmlld01heCkgeyAgIC8vIHRoZSBkb2MgaGFzIHJvb20gb24gdGhlIHNpZGVzIGZvciAiYmxhbmsiCiAgICAgICAgICAgICAvLyBwaW4gdGhlIHNob3J0IGRvY3VtZW50IHRvIHRoZSB0b3AvbGVmdCBvZiB0aGUgc2NyZWVuCkBAIC0yMDEzLDEyICsxODkyLDEyIEBACiAgICAgfQogCiAgICAgLy8gRXhwZWN0cyB4IGluIHZpZXcgY29vcmRpbmF0ZXMKLSAgICBwcml2YXRlIGludCBwaW5Mb2NYKGludCB4KSB7CisgICAgaW50IHBpbkxvY1goaW50IHgpIHsKICAgICAgICAgcmV0dXJuIHBpbkxvYyh4LCBnZXRWaWV3V2lkdGgoKSwgY29tcHV0ZUhvcml6b250YWxTY3JvbGxSYW5nZSgpKTsKICAgICB9CiAKICAgICAvLyBFeHBlY3RzIHkgaW4gdmlldyBjb29yZGluYXRlcwotICAgIHByaXZhdGUgaW50IHBpbkxvY1koaW50IHkpIHsKKyAgICBpbnQgcGluTG9jWShpbnQgeSkgewogICAgICAgICByZXR1cm4gcGluTG9jKHksIGdldFZpZXdIZWlnaHRXaXRoVGl0bGUoKSwKICAgICAgICAgICAgICAgICAgICAgICBjb21wdXRlVmVydGljYWxTY3JvbGxSYW5nZSgpICsgZ2V0VGl0bGVIZWlnaHQoKSk7CiAgICAgfQpAQCAtMjA2OCw3ICsxOTQ3LDcgQEAKICAgICAgKiBoZWlnaHQuCiAgICAgICovCiAgICAgcHJpdmF0ZSBpbnQgdmlld1RvQ29udGVudERpbWVuc2lvbihpbnQgZCkgewotICAgICAgICByZXR1cm4gTWF0aC5yb3VuZChkICogbUludkFjdHVhbFNjYWxlKTsKKyAgICAgICAgcmV0dXJuIE1hdGgucm91bmQoZCAqIG1ab29tTWFuYWdlci5nZXRJbnZTY2FsZSgpKTsKICAgICB9CiAKICAgICAvKioKQEAgLTIwOTQsNyArMTk3Myw3IEBACiAgICAgICogUmV0dXJucyB0aGUgcmVzdWx0IGFzIGEgZmxvYXQuCiAgICAgICovCiAgICAgcHJpdmF0ZSBmbG9hdCB2aWV3VG9Db250ZW50WGYoaW50IHgpIHs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FsU2NhbGUgPSAxIC8gc2NhbGU7Ci0gICAgICAgICAgICAgICAgc2VuZFZpZXdTaXplWm9vbSgpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyB1cGRhdGUgb3VyIHNjcm9sbCBzbyB3ZSBkb24ndCBhcHBlYXIgdG8ganVtcAotICAgICAgICAgICAgICAgIC8vIGkuZS4ga2VlcCB0aGUgY2VudGVyIG9mIHRoZSBkb2MgaW4gdGhlIGNlbnRlciBvZiB0aGUgdmlldwotCi0gICAgICAgICAgICAgICAgaW50IG9sZFggPSBtU2Nyb2xsWDsKLSAgICAgICAgICAgICAgICBpbnQgb2xkWSA9IG1TY3JvbGxZOwotICAgICAgICAgICAgICAgIGZsb2F0IHJhdGlvID0gc2NhbGUgKiBtSW52QWN0dWFsU2NhbGU7ICAgLy8gb2xkIGludmVyc2UKLSAgICAgICAgICAgICAgICBmbG9hdCBzeCA9IHJhdGlvICogb2xkWCArIChyYXRpbyAtIDEpICogbVpvb21DZW50ZXJYOwotICAgICAgICAgICAgICAgIGZsb2F0IHN5ID0gcmF0aW8gKiBvbGRZICsgKHJhdGlvIC0gMSkKLSAgICAgICAgICAgICAgICAgICAgICAgICogKG1ab29tQ2VudGVyWSAtIGdldFRpdGxlSGVpZ2h0KCkpOwotCi0gICAgICAgICAgICAgICAgLy8gbm93IHVwZGF0ZSBvdXIgbmV3IHNjYWxlIGFuZCBpbnZlcnNlCi0gICAgICAgICAgICAgICAgaWYgKHNjYWxlICE9IG1BY3R1YWxTY2FsZSAmJiAhbVByZXZpZXdab29tT25seSkgewotICAgICAgICAgICAgICAgICAgICBtQ2FsbGJhY2tQcm94eS5vblNjYWxlQ2hhbmdlZChtQWN0dWFsU2NhbGUsIHNjYWxlKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbUFjdHVhbFNjYWxlID0gc2NhbGU7Ci0gICAgICAgICAgICAgICAgbUludkFjdHVhbFNjYWxlID0gMSAvIHNjYWxlOwotCi0gICAgICAgICAgICAgICAgLy8gU2NhbGUgYWxsIHRoZSBjaGlsZCB2aWV3cwotICAgICAgICAgICAgICAgIG1WaWV3TWFuYWdlci5zY2FsZUFsbCgpOwotCi0gICAgICAgICAgICAgICAgLy8gYXMgd2UgZG9uJ3QgaGF2ZSBhbmltYXRpb24gZm9yIHNjYWxpbmcsIGRvbid0IGRvIGFuaW1hdGlvbgotICAgICAgICAgICAgICAgIC8vIGZvciBzY3JvbGxpbmcsIGFzIGl0IGNhdXNlcyB3ZWlyZCBpbnRlcm1lZGlhdGUgc3RhdGUKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgcGluU2Nyb2xsVG8oTWF0aC5yb3VuZChzeCksIE1hdGgucm91bmQoc3kpKTsKLSAgICAgICAgICAgICAgICBtU2Nyb2xsWCA9IHBpbkxvY1goTWF0aC5yb3VuZChzeCkpOwotICAgICAgICAgICAgICAgIG1TY3JvbGxZID0gcGluTG9jWShNYXRoLnJvdW5kKHN5KSk7Ci0KLSAgICAgICAgICAgICAgICAvLyB1cGRhdGUgd2Via2l0Ci0gICAgICAgICAgICAgICAgaWYgKG9sZFggIT0gbVNjcm9sbFggfHwgb2xkWSAhPSBtU2Nyb2xsWSkgewotICAgICAgICAgICAgICAgICAgICBvblNjcm9sbENoYW5nZWQobVNjcm9sbFgsIG1TY3JvbGxZLCBvbGRYLCBvbGRZKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAvLyB0aGUgc2Nyb2xsIHBvc2l0aW9uIGlzIGFkanVzdGVkIGF0IHRoZSBiZWdpbm5pbmcgb2YgdGhlCi0gICAgICAgICAgICAgICAgICAgIC8vIHpvb20gYW5pbWF0aW9uLiBCdXQgd2Ugd2FudCB0byB1cGRhdGUgdGhlIFdlYktpdCBhdCB0aGUKLSAgICAgICAgICAgICAgICAgICAgLy8gZW5kIG9mIHRoZSB6b29tIGFuaW1hdGlvbi4gU2VlIGNvbW1lbnRzIG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XIuY2xlYXJEb2N1bWVudEFuY2hvcigpOwogICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgIH0KICAgICAgICAgcmV0dXJuIGZhbHNlOwpAQCAtMjQxOCwxMiArMjIyNywxMiBAQAogICAgICAgICBpZiAobURyYXdIaXN0b3J5KSB7CiAgICAgICAgICAgICByZXR1cm4gbUhpc3RvcnlXaWR0aDsKICAgICAgICAgfSBlbHNlIGlmIChtSG9yaXpvbnRhbFNjcm9sbEJhck1vZGUgPT0gU0NST0xMQkFSX0FMV0FZU09GRgotICAgICAgICAgICAgICAgICYmIChtQWN0dWFsU2NhbGUgLSBtTWluWm9vbVNjYWxlIDw9IE1JTklNVU1fU0NBTEVfSU5DUkVNRU5UKSkgeworICAgICAgICAgICAgICAgICYmICFtWm9vbU1hbmFnZXIuY2FuWm9vbU91dCgpKSB7CiAgICAgICAgICAgICAvLyBvbmx5IGhvbm9yIHRoZSBzY3JvbGxiYXIgbW9kZSB3aGVuIGl0IGlzIGF0IG1pbmltdW0gem9vbSBsZXZlbAogICAgICAgICAgICAgcmV0dXJuIGNvbXB1dGVIb3Jpem9udGFsU2Nyb2xsRXh0ZW50KCk7CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAvLyB0byBhdm9pZCByb3VuZGluZyBlcnJvciBjYXVzZWQgdW5uZWNlc3Nhcnkgc2Nyb2xsYmFyLCB1c2UgZmxvb3IKLSAgICAgICAgICAgIHJldHVybiAoaW50KSBNYXRoLmZsb29yKG1Db250ZW50V2lkdGggKiBtQWN0dWFsU2NhbGUpOworICAgICAgICAgICAgcmV0dXJuIChpbnQpIE1hdGguZmxvb3IobUNvbnRlbnRXaWR0aCAqIG1ab29tTWFuYWdlci5nZXRTY2FsZSgpKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMjQzMiwxMiArMjI0MSwxMiBAQAogICAgICAgICBpZiAobURyYXdIaXN0b3J5KSB7CiAgICAgICAgICAgICByZXR1cm4gbUhpc3RvcnlI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GNvcnJlY3QgZGltZW5zaW9ucy4KLSAgICAgICAgICAgIHNlbmRWaWV3U2l6ZVpvb20oKTsKKyAgICAgICAgICAgIHNlbmRWaWV3U2l6ZVpvb20oZmFsc2UpOwogICAgICAgICB9CiAgICAgfQogCkBAIC0zMTQ0LDcgKzI5NzIsNyBAQAogICAgICAqICAgICAgICAgc2V0dGluZ3MuCiAgICAgICovCiAgICAgcHVibGljIFdlYlNldHRpbmdzIGdldFNldHRpbmdzKCkgewotICAgICAgICByZXR1cm4gbVdlYlZpZXdDb3JlLmdldFNldHRpbmdzKCk7CisgICAgICAgIHJldHVybiAobVdlYlZpZXdDb3JlICE9IG51bGwpID8gbVdlYlZpZXdDb3JlLmdldFNldHRpbmdzKCkgOiBudWxsOwogICAgIH0KIAogICAgIC8qKgpAQCAtMzI4NSw3ICszMTEzLDQ3IEBACiAgICAgICAgIGlmIChBVVRPX1JFRFJBV19IQUNLICYmIG1BdXRvUmVkcmF3KSB7CiAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CiAgICAgICAgIH0KKyAgICAgICAgaWYgKGluRWRpdGluZ01vZGUoKSkgbVdlYlRleHRWaWV3Lm9uRHJhd1N1YnN0aXR1dGUoKTsKICAgICAgICAgbVdlYlZpZXdDb3JlLnNpZ25hbFJlcGFpbnREb25lKCk7CisKKyAgICAgICAgLy8gcGFpbnQgdGhlIGhpZ2hsaWdodCBpbiB0aGUgZW5kCisgICAgICAgIGlmICghbVRvdWNoSGlnaGxpZ2h0UmVnaW9uLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgaWYgKG1Ub3VjaEhpZ2h0bGlnaHRQYWludCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVRvdWNoSGlnaHRsaWdodFBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICAgICAgbVRvdWNoSGlnaHRsaWdodFBhaW50LnNldENvbG9yKG1IaWdodGxpZ2h0Q29sb3IpOworICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2h0bGlnaHRQYWludC5zZXRBbnRpQWxpYXModHJ1ZSk7CisgICAgICAgICAgICAgICAgbVRvdWNoSGlnaHRsaWdodFBhaW50LnNldFBhdGhFZmZlY3QobmV3IENvcm5lclBhdGhFZmZlY3QoCisgICAgICAgICAgICAgICAgICAgICAgICBUT1VDSF9ISUdITElHSFRfQVJDKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjYW52YXMuZHJhd1BhdGgobVRvdWNoSGlnaGxpZ2h0UmVnaW9uLmdldEJvdW5kYXJ5UGF0aCgpLAorICAgICAgICAgICAgICAgICAgICBtVG91Y2hIaWdodGxpZ2h0UGFpbnQpOworICAgICAgICB9CisgICAgICAgIGlmIChERUJVR19UT1VDSF9ISUdITElHSFQpIHsKKyAgICAgICAgICAgIGlmIChnZXRTZXR0aW5ncygpLmdldE5hdkR1bXAoKSkgeworICAgICAgICAgICAgICAgIGlmICgobVRvdWNoSGlnaGxpZ2h0WCB8IG1Ub3VjaEhpZ2hsaWdodFkpICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1Ub3VjaENyb3NzSGFpckNvbG9yID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaENyb3NzSGFpckNvbG9yID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hDcm9zc0hhaXJDb2xvci5zZXRDb2xvcihDb2xvci5SRUQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5kcmF3TGluZShtVG91Y2hIaWdobGlnaHRYIC0gbU5hdlNsb3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoSGlnaGxpZ2h0WSAtIG1OYXZTbG9wLCBtVG91Y2hIaWdobGlnaHRYCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG1OYXZTbG9wICsgMSwgbVRvdWNoSGlnaGxpZ2h0WSArIG1OYXZTbG9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIDEsIG1Ub3VjaENyb3NzSGFpckNvbG9yKTsKKyAgICAgICAgICAgICAgICAgICAgY2FudmFzLmRyYXdMaW5lKG1Ub3VjaEhpZ2hsaWdodFggKyBtTmF2U2xvcCArIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoSGlnaGxpZ2h0WSAtIG1OYXZTbG9wLCBtVG91Y2hIaWdobGlnaHRYCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1OYXZTbG9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2hsaWdodFkgKyBtTmF2U2xvcCArIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvdWNoQ3Jvc3NIYWlyQ29sb3IpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZW1vdmVUb3VjaEhpZ2hsaWdodChib29sZWFuIHJlbW92ZVBlbmRpbmdNZXNzYWdlKSB7CisgICAgICAgIGlmIChyZW1vdmVQZW5kaW5nTWVzc2FnZSkgeworICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnJlbW92ZU1lc3NhZ2VzKEV2ZW50SHViLkdFVF9UT1VDSF9ISUdITElHSFRfUkVDVFMpOworICAgICAgICB9CisgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5SRU1PVkVfVE9VQ0hfSElHSExJR0hUX1JFQ1RTKTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKQEAgLTMzMDYsMjcgKzMxNzQsMzUgQEAKICAgICAgICAgICAgIC8vIFNlbmQgdGhlIGNsaWNrIHNvIHRoYXQgdGhlIHRleHRmaWVsZCBpcyBpbiBmb2N1cwogICAgICAgICAgICAgY2VudGVyS2V5UHJlc3NPblRleHRGaWVsZCgpOwogICAgICAgIC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eGVkTGVuZ3RoQW5pbWF0aW9uSW5Qcm9ncmVzcygpOwogICAgICAgICBib29sZWFuIGFuaW1hdGVTY3JvbGwgPSAoKCFtU2Nyb2xsZXIuaXNGaW5pc2hlZCgpCiAgICAgICAgICAgICAgICAgfHwgbVZlbG9jaXR5VHJhY2tlciAhPSBudWxsKQogICAgICAgICAgICAgICAgICYmIChtVG91Y2hNb2RlICE9IFRPVUNIX0RSQUdfTU9ERSB8fApAQCAtMzM5MSw1OSArMzI5Myw5IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgaWYgKGFuaW1hdGVab29tKSB7Ci0gICAgICAgICAgICBmbG9hdCB6b29tU2NhbGU7Ci0gICAgICAgICAgICBpbnQgaW50ZXJ2YWwgPSAoaW50KSAoU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCkgLSBtWm9vbVN0YXJ0KTsKLSAgICAgICAgICAgIGlmIChpbnRlcnZhbCA8IFpPT01fQU5JTUFUSU9OX0xFTkdUSCkgewotICAgICAgICAgICAgICAgIGZsb2F0IHJhdGlvID0gKGZsb2F0KSBpbnRlcnZhbCAvIFpPT01fQU5JTUFUSU9OX0xFTkdUSDsKLSAgICAgICAgICAgICAgICB6b29tU2NhbGUgPSAxLjBmIC8gKG1JbnZJbml0aWFsWm9vbVNjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICArIChtSW52RmluYWxab29tU2NhbGUgLSBtSW52SW5pdGlhbFpvb21TY2FsZSkgKiByYXRpbyk7Ci0gICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICB6b29tU2NhbGUgPSBtWm9vbVNjYWxlOwotICAgICAgICAgICAgICAgIC8vIHNldCBtWm9vbVNjYWxlIHRvIGJlIDAgYXMgd2UgaGF2ZSBkb25lIGFuaW1hdGlvbgotICAgICAgICAgICAgICAgIG1ab29tU2NhbGUgPSAwOwotICAgICAgICAgICAgICAgI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gICAgICAgICAgIGludCB0eCA9IE1hdGgucm91bmQoc2NhbGUgKiAobUluaXRpYWxTY3JvbGxYICsgbVpvb21DZW50ZXJYKQotICAgICAgICAgICAgICAgICAgICAtIG1ab29tQ2VudGVyWCk7Ci0gICAgICAgICAgICB0eCA9IC1waW5Mb2ModHgsIGdldFZpZXdXaWR0aCgpLCBNYXRoLnJvdW5kKG1Db250ZW50V2lkdGgKLSAgICAgICAgICAgICAgICAgICAgKiB6b29tU2NhbGUpKSArIG1TY3JvbGxYOwotICAgICAgICAgICAgaW50IHRpdGxlSGVpZ2h0ID0gZ2V0VGl0bGVIZWlnaHQoKTsKLSAgICAgICAgICAgIGludCB0eSA9IE1hdGgucm91bmQoc2NhbGUKLSAgICAgICAgICAgICAgICAgICAgKiAobUluaXRpYWxTY3JvbGxZICsgbVpvb21DZW50ZXJZIC0gdGl0bGVIZWlnaHQpCi0gICAgICAgICAgICAgICAgICAgIC0gKG1ab29tQ2VudGVyWSAtIHRpdGxlSGVpZ2h0KSk7Ci0gICAgICAgICAgICB0eSA9IC0odHkgPD0gdGl0bGVIZWlnaHQgPyBNYXRoLm1heCh0eSwgMCkgOiBwaW5Mb2ModHkKLSAgICAgICAgICAgICAgICAgICAgLSB0aXRsZUhlaWdodCwgZ2V0Vmlld0hlaWdodCgpLCBNYXRoLnJvdW5kKG1Db250ZW50SGVpZ2h0Ci0gICAgICAgICAgICAgICAgICAgICogem9vbVNjYWxlKSkgKyB0aXRsZUhlaWdodCkgKyBtU2Nyb2xsWTsKLSAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUodHgsIHR5KTsKLSAgICAgICAgICAgIGNhbnZhcy5zY2FsZSh6b29tU2NhbGUsIHpvb21TY2FsZSk7Ci0gICAgICAgICAgICBpZiAoaW5FZGl0aW5nTW9kZSgpICYmICFtTmVlZFRvQWRqdXN0V2ViVGV4dFZpZXcKLSAgICAgICAgICAgICAgICAgICAgJiYgbVpvb21TY2FsZSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgLy8gVGhlIFdlYlRleHRWaWV3IGlzIHVwLiAgS2VlcCB0cmFjayBvZiB0aGlzIHNvIHdlIGNhbiBhZGp1c3QKLSAgICAgICAgICAgICAgICAvLyBpdHMgc2l6ZSBhbmQgcGxhY2VtZW50IHdoZW4gd2UgZmluaXNoIHpvb21pbmcKLSAgICAgICAgICAgICAgICBtTmVlZFRvQWRqdXN0V2ViVGV4dFZpZXcgPSB0cnVlOwotICAgICAgICAgICAgICAgIC8vIElmIGl0IGlzIGluIHBhc3N3b3JkIG1vZGUsIHR1cm4gaXQgb2ZmIHNvIGl0IGRvZXMgbm90IGRyYXcKLSAgICAgICAgICAgICAgICAvLyBtaXNwbGFjZWQuCi0gICAgICAgICAgICAgICAgaWYgKG5hdGl2ZUZvY3VzQ2FuZGlkYXRlSXNQYXNzd29yZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5zZXRJblBhc3N3b3JkKGZhbHNlKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBtWm9vbU1hbmFnZXIuYW5pbWF0ZVpvb20oY2FudmFzKTsKICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGNhbnZhcy5zY2FsZShtQWN0dWFsU2NhbGUsIG1BY3R1YWxTY2FsZSk7CisgICAgICAgICAgICBjYW52YXMuc2NhbGUobVpvb21NYW5hZ2VyLmdldFNjYWxlKCksIG1ab29tTWFuYWdlci5nZXRTY2FsZSgpKTsKICAgICAgICAgfQogCiAgICAgICAgIGJvb2xlYW4gVUlBbmltYXRpb25zUnVubmluZyA9IGZhbHNlOwpAQCAtMzQ1NiwyNSArMzMwOCwyNSBAQAogICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwogICAgICAgICB9CiAgICAgICAgIG1XZWJWaWV3Q29yZS5kcmF3Q29udGVudFBpY3R1cmUoY2FudmFzLCBjb2xvciwKLSAgICAgICAgICAgICAgICAoYW5pbWF0ZVpvb20gfHwgbVByZXZpZXdab29tT25seSB8fCBVSUFuaW1hdGlvbnNSdW5uaW5nKSwKKyAgICAgICAgICAgICAgICAobVpvb21NYW5hZ2VyLmlzWm9vbUFuaW1hdGluZygpIHx8IFVJQW5pbWF0aW9uc1J1bm5pbmcpLAogICAgICAgICAgICAgICAgIGFuaW1hdGVTY3JvbGwpOwogICAgICAgICBpZiAobU5hdGl2ZUNsYXNzID09IDApIHJldHVybjsKICAgICAgICAgLy8gZGVjaWRlIHdoaWNoIGFkb3JubWVudHMgdG8gZHJhdwogICAgICAgICBpbnQgZXh0cmFzID0gRFJBV19FWFRSQVNfTk9ORTsKKyAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIHsKKyAgICAgICAgICAgIExvZy52KExPR1RBRywgIm1GaW5kSXNVcD0iICsgbUZpbmRJc1VwCisgICAgICAgICAgICAgICAgICAgICsgIiBtU2VsZWN0aW5nVGV4dD0iICsgbVNlbGVjdGluZ1RleHQKKyAgICAgICAgICAgICAgICAgICAgKyAiIG5hdGl2ZVBhZ2VTaG91bGRIYW5kbGVTaGlmdEFuZEFycm93cygpPSIKKyAgICAgICAgICAgICAgICAgICAgKyBuYXRpdmVQYWdlU2hvdWxkSGFuZGxlU2hpZnRBbmRBcnJvd3MoKQorICAgICAgICAgICAgICAgICAgICArICIgYW5pbWF0ZVpvb209IiArIGFuaW1hdGVab29tKTsKKyAgICAgICAgfQogICAgICAgICBpZiAobUZpbmRJc1VwKSB7Ci0gICAgICAgICAgICAvLyBXaGVuIHRoZSBGaW5kRGlhbG9nIGlzIHVwLCBvbmx5IGRyYXcgdGhlIG1hdGNoZXMgaWYgd2UgYXJlIG5vdCBpbgotICAgICAgICAgICAgLy8gdGhlIHByb2Nlc3Mgb2Ygc2Nyb2xsaW5nIHRoZW0gaW50byB2aWV3LgotICAgICAgICAgICAgaWYgKCFhbmltYXRlU2Nyb2xsKSB7Ci0gICAgICAgICAgICAgICAgZXh0cmFzID0gRFJBV19FWFRSQVNfRklORDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIGlmIChtU2hpZnRJc1ByZXNzZWQgJiYgIW5hdGl2ZUZvY3VzSXNQbHVnaW4oKSkgewotICAgICAgICAgICAgaWYgKCFhbmltYXRlWm9vbSAmJiAhbVByZXZpZXdab29tT25seSkgewotICAgICAgICAgICAgICAgIGV4dHJhcyA9IERSQVdfRVhUUkFTX1NFTEVDVElPTjsKLSAgICAgICAgICAgICAgICBuYXRpdmVTZXRTZWxlY3Rpb25SZWdpb24obVRvdWNoU2VsZWN0aW9uIHx8IG1FeHRlbmRTZWxlY3Rpb24pOwotICAgICAgICAgICAgICAgIG5hdGl2ZVNldFNlbGVjdGlvblBvaW50ZXIoIW1Ub3VjaFNlbGVjdGlvbiwgbUludkFjdHVhbFNjYWxlLAotICAgICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdFgsIG1TZWxlY3RZIC0gZ2V0VGl0bGVIZWlnaHQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIG1FeHRlbmRTZWxlY3Rpb24pOwotICAgICAgICAgICAgfQorICAgICAgICAgICAgZXh0cmFzID0gRFJBV19FWFRSQVNfRklORDsKKyAgICAgICAgfSBlbHNlIGlmIChtU2VsZWN0aW5nVGV4dCkgeworICAgICAgICAgICAgZXh0cmFzID0gRFJBV19FWFRSQVNfU0VMRUNUSU9OOworICAgICAgICAgICAgbmF0aXZlU2V0U2VsZWN0aW9uUG9pbnRlcihtRHJhd1NlbGVjdGlvblBvaW50ZXIsCisgICAgICAgICAgICAgICAgICAgIG1ab29tTWFuYWdlci5nZXRJbnZTY2FsZSgpLAorICAgICAgICAgICAgICAgICAgICBtU2VsZWN0WCwgbVNlbGVjdFkgLSBnZXRUaXRsZUhlaWdodCgpKTsKICAgICAgICAgfSBlbHNlIGlmIChkcmF3Q3Vyc29yUmluZykgewogICAgICAgICAgICAgZXh0cmFzID0gRFJBV19FWFRSQVNfQ1VSU09SX1JJTkc7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W50KGV2ZW50KSkpIHsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfU0hJRlRfTEVGVAogICAgICAgICAgICAgICAgIHx8IGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9TSElGVF9SSUdIVCkgewotICAgICAgICAgICAgaWYgKG5hdGl2ZUZvY3VzSXNQbHVnaW4oKSkgeworICAgICAgICAgICAgaWYgKG5hdGl2ZVBhZ2VTaG91bGRIYW5kbGVTaGlmdEFuZEFycm93cygpKSB7CiAgICAgICAgICAgICAgICAgbVNoaWZ0SXNQcmVzc2VkID0gdHJ1ZTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoIW5hdGl2ZUN1cnNvcldhbnRzS2V5RXZlbnRzKCkgJiYgIW1TaGlmdElzUHJlc3NlZCkgewotICAgICAgICAgICAgICAgIHNldFVwU2VsZWN0WFkoKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoIW5hdGl2ZUN1cnNvcldhbnRzS2V5RXZlbnRzKCkgJiYgIW1TZWxlY3RpbmdUZXh0KSB7CisgICAgICAgICAgICAgICAgc2V0VXBTZWxlY3QoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC0zODQ0LDExICszNjk2LDExIEBACiAgICAgICAgIGlmIChrZXlDb2RlID49IEtleUV2ZW50LktFWUNPREVfRFBBRF9VUAogICAgICAgICAgICAgICAgICYmIGtleUNvZGUgPD0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1JJR0hUKSB7CiAgICAgICAgICAgICBzd2l0Y2hPdXREcmF3SGlzdG9yeSgpOwotICAgICAgICAgICAgaWYgKG5hdGl2ZUZvY3VzSXNQbHVnaW4oKSkgewotICAgICAgICAgICAgICAgIGxldFBsdWdpbkhhbmRsZU5hdktleShrZXlDb2RlLCBldmVudC5nZXRFdmVudFRpbWUoKSwgdHJ1ZSk7CisgICAgICAgICAgICBpZiAobmF0aXZlUGFnZVNob3VsZEhhbmRsZVNoaWZ0QW5kQXJyb3dzKCkpIHsKKyAgICAgICAgICAgICAgICBsZXRQYWdlSGFuZGxlTmF2S2V5KGtleUNvZGUsIGV2ZW50LmdldEV2ZW50VGltZSgpLCB0cnVlKTsKICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtU2hpZnRJc1ByZXNzZWQpIHsKKyAgICAgICAgICAgIGlmIChtU2VsZWN0aW5nVGV4dCkgewogICAgICAgICAgICAgICAgIGludCB4UmF0ZSA9IGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0xFRlQKICAgICAgICAgICAgICAgICAgICAgPyAtMSA6IGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1JJR0hUID8gMSA6IDA7CiAgICAgICAgICAgICAgICAgaW50IHlSYXRlID0ga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfVVAgPwpAQCAtMzg2OCw3ICszNzIwLDcgQEAKICAgICAgICAgaWYgKGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0NFTlRFUikgewogICAgICAgICAgICAgc3dpdGNoT3V0RHJhd0hpc3RvcnkoKTsKICAgICAgICAgICAgIGlmIChldmVudC5nZXRSZXBlYXRDb3VudCgpID09IDApIHsKLSAgICAgICAgICAgICAgICBpZiAobVNoaWZ0SXNQcmVzc2VkICYmICFuYXRpdmVGb2N1c0lzUGx1Z2luKCkpIHsKKyAgICAgICAgICAgICAgICBpZiAobVNlbGVjdGluZ1RleHQpIHsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7IC8vIGRpc2NhcmQgcHJlc3MgaWYgY29weSBpbiBwcm9ncmVzcwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBtR290Q2VudGVyRG93biA9IHRydWU7CkBAIC0z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ICAgICAgICAgICAgfHwgbUNhbGxiYWNrUHJveHkudWlPdmVycmlkZUtleUV2ZW50KGV2ZW50KQorICAgICAgICAgICAgICAgIHx8IChtQWNjZXNzaWJpbGl0eUluamVjdG9yICE9IG51bGwgJiYgbUFjY2Vzc2liaWxpdHlJbmplY3Rvci5vbktleUV2ZW50KGV2ZW50KSkpIHsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogCiAgICAgICAgIGlmIChrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfU0hJRlRfTEVGVAogICAgICAgICAgICAgICAgIHx8IGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9TSElGVF9SSUdIVCkgewotICAgICAgICAgICAgaWYgKG5hdGl2ZUZvY3VzSXNQbHVnaW4oKSkgeworICAgICAgICAgICAgaWYgKG5hdGl2ZVBhZ2VTaG91bGRIYW5kbGVTaGlmdEFuZEFycm93cygpKSB7CiAgICAgICAgICAgICAgICAgbVNoaWZ0SXNQcmVzc2VkID0gZmFsc2U7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGNvbW1pdENvcHkoKSkgeworICAgICAgICAgICAgfSBlbHNlIGlmIChjb3B5U2VsZWN0aW9uKCkpIHsKKyAgICAgICAgICAgICAgICBzZWxlY3Rpb25Eb25lKCk7CiAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAogICAgICAgICBpZiAoa2V5Q29kZSA+PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfVVAKICAgICAgICAgICAgICAgICAmJiBrZXlDb2RlIDw9IEtleUV2ZW50LktFWUNPREVfRFBBRF9SSUdIVCkgewotICAgICAgICAgICAgaWYgKG5hdGl2ZUZvY3VzSXNQbHVnaW4oKSkgewotICAgICAgICAgICAgICAgIGxldFBsdWdpbkhhbmRsZU5hdktleShrZXlDb2RlLCBldmVudC5nZXRFdmVudFRpbWUoKSwgZmFsc2UpOworICAgICAgICAgICAgaWYgKG5hdGl2ZVBhZ2VTaG91bGRIYW5kbGVTaGlmdEFuZEFycm93cygpKSB7CisgICAgICAgICAgICAgICAgbGV0UGFnZUhhbmRsZU5hdktleShrZXlDb2RlLCBldmVudC5nZXRFdmVudFRpbWUoKSwgZmFsc2UpOwogICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgLy8gYWx3YXlzIGhhbmRsZSB0aGUgbmF2aWdhdGlvbiBrZXlzIGluIHRoZSBVSSB0aHJlYWQKQEAgLTQwMDAsMTEgKzM4NTQsMTMgQEAKICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhMT05HX1BSRVNTX0NFTlRFUik7CiAgICAgICAgICAgICBtR290Q2VudGVyRG93biA9IGZhbHNlOwogCi0gICAgICAgICAgICBpZiAobVNoaWZ0SXNQcmVzc2VkICYmICFuYXRpdmVGb2N1c0lzUGx1Z2luKCkpIHsKKyAgICAgICAgICAgIGlmIChtU2VsZWN0aW5nVGV4dCkgewogICAgICAgICAgICAgICAgIGlmIChtRXh0ZW5kU2VsZWN0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbW1pdENvcHkoKTsKKyAgICAgICAgICAgICAgICAgICAgY29weVNlbGVjdGlvbigpOworICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb25Eb25lKCk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgbUV4dGVuZFNlbGVjdGlvbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNldEV4dGVuZFNlbGVjdGlvbigpOwogICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7IC8vIGRyYXcgdGhlIGktYmVhbSBpbnN0ZWFkIG9mIHRoZSBhcnJvdwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsgLy8gZGlz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IHB1YmxpYyB2b2lkIG5vdGlmeVNlbGVjdERpYWxvZ0Rpc21pc3NlZCgpIHsKKyAgICAgICAgbVNlbGVjdGluZ1RleHQgPSBmYWxzZTsKKyAgICAgICAgV2ViVmlld0NvcmUucmVzdW1lVXBkYXRlUGljdHVyZShtV2ViVmlld0NvcmUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEBoaWRlIHBlbmRpbmcgQVBJIGNvdW5jaWwgYXBwcm92YWwuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2VsZWN0aW9uRG9uZSgpIHsKKyAgICAgICAgaWYgKG1TZWxlY3RpbmdUZXh0KSB7CisgICAgICAgICAgICBnZXRXZWJDaHJvbWVDbGllbnQoKS5vblNlbGVjdGlvbkRvbmUoKTsKKyAgICAgICAgICAgIGludmFsaWRhdGUoKTsgLy8gcmVkcmF3IHdpdGhvdXQgc2VsZWN0aW9uCisgICAgICAgICAgICBub3RpZnlTZWxlY3REaWFsb2dEaXNtaXNzZWQoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEBoaWRlIHBlbmRpbmcgQVBJIGNvdW5jaWwgYXBwcm92YWwuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gY29weVNlbGVjdGlvbigpIHsKICAgICAgICAgYm9vbGVhbiBjb3BpZWRTb21ldGhpbmcgPSBmYWxzZTsKLSAgICAgICAgaWYgKG1FeHRlbmRTZWxlY3Rpb24pIHsKLSAgICAgICAgICAgIFN0cmluZyBzZWxlY3Rpb24gPSBuYXRpdmVHZXRTZWxlY3Rpb24oKTsKLSAgICAgICAgICAgIGlmIChzZWxlY3Rpb24gIT0gIiIpIHsKLSAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewotICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJjb21taXRDb3B5IFwiIiArIHNlbGVjdGlvbiArICJcIiIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBUb2FzdC5tYWtlVGV4dChtQ29udGV4dAotICAgICAgICAgICAgICAgICAgICAgICAgLCBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0cmluZy50ZXh0X2NvcGllZAotICAgICAgICAgICAgICAgICAgICAgICAgLCBUb2FzdC5MRU5HVEhfU0hPUlQpLnNob3coKTsKLSAgICAgICAgICAgICAgICBjb3BpZWRTb21ldGhpbmcgPSB0cnVlOwotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIElDbGlwYm9hcmQgY2xpcCA9IElDbGlwYm9hcmQuU3R1Yi5hc0ludGVyZmFjZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5nZXRTZXJ2aWNlKCJjbGlwYm9hcmQiKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xpcC5zZXRDbGlwYm9hcmRUZXh0KHNlbGVjdGlvbik7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoYW5kcm9pZC5vcy5SZW1vdGVFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJDbGlwYm9hcmQgZmFpbGVkIiwgZSk7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICBTdHJpbmcgc2VsZWN0aW9uID0gZ2V0U2VsZWN0aW9uKCk7CisgICAgICAgIGlmIChzZWxlY3Rpb24gIT0gIiIpIHsKKyAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7CisgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiY29weVNlbGVjdGlvbiBcIiIgKyBzZWxlY3Rpb24gKyAiXCIiKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1FeHRlbmRTZWxlY3Rpb24gPSBmYWxzZTsKKyAgICAgICAgICAgIFRvYXN0Lm1ha2VUZXh0KG1Db250ZXh0CisgICAgICAgICAgICAgICAgICAgICwgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcudGV4dF9jb3BpZWQKKyAgICAgICAgICAgICAgICAgICAgLCBUb2FzdC5MRU5HVEhfU0hPUlQpLnNob3coKTsKKyAgICAgICAgICAgIGNvcGllZFNvbWV0aGluZyA9IHRydWU7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIElDbGlwYm9hcmQgY2xpcCA9IElDbGlwYm9hcmQuU3R1Yi5hc0ludGVyZmFjZSgKKyAgICAgICAgICAgICAgICAgICAgICAgIFNlcnZpY2VNYW5hZ2VyLmdldFNlcnZpY2UoImNsaXBib2FyZCIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNsaXAuc2V0Q2xpcGJvYXJkVGV4dChzZWxlY3Rpb24pOworICAgICAgICAgICAgfSBjYXRjaCAoYW5kcm9pZC5vcy5SZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy5lKExPR1RBRywgIkNsaXBib2FyZCBmYWlsZWQiLCBlKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICBtU2hpZnRJc1ByZXNzZWQgPSBmYWxzZTsKICAgICAgICAgaW52YWxpZGF0ZSgpOyAvLyByZW1vdmUgc2VsZWN0aW9uIHJlZ2lvbiBhbmQgcG9pbnRlcgotICAgICAgICBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9TRUxFQ1RfTU9ERSkgewotICAgICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX0lOSVRfTU9ERTsKLSAgICAgICAgfQogICAgICAgICByZXR1cm4gY29waWVkU29tZXRoaW5nOwogICAgIH0KIAorICAgIC8qKgorICAgICAqIEBoaWRlIHBlbmRpbmcgQVBJIGNvdW5jaWwgYXBwcm92YWwuCisgICAgICovCisgICAgcHVibGljIFN0cmluZyBnZXRTZWxlY3Rpb24oKSB7CisgICAgICAgIGlmIChtTmF0aXZlQ2xhc3MgPT0gMCkgcmV0dXJuICIiOworICAgICAgICByZXR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LmRpc21pc3Nab29tUGlja2VyKCk7CisgICAgICAgIH0KKyAgICB9CisKICAgICAvKioKICAgICAgKiBAZGVwcmVjYXRlZCBXZWJWaWV3IG5vIGxvbmdlciBuZWVkcyB0byBpbXBsZW1lbnQKICAgICAgKiBWaWV3R3JvdXAuT25IaWVyYXJjaHlDaGFuZ2VMaXN0ZW5lci4gIFRoaXMgbWV0aG9kIGRvZXMgbm90aGluZyBub3cuCkBAIC00MTYzLDE3ICs0MDgwLDE0IEBACiAgICAgICAgICAgICAgICAgLy8gZmFsc2UgZm9yIHRoZSBmaXJzdCBwYXJhbWV0ZXIKICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGlmIChtV2ViVmlld0NvcmUgIT0gbnVsbCAmJiBnZXRTZXR0aW5ncygpLmdldEJ1aWx0SW5ab29tQ29udHJvbHMoKQotICAgICAgICAgICAgICAgICAgICAmJiAobVpvb21CdXR0b25zQ29udHJvbGxlciA9PSBudWxsIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIW1ab29tQnV0dG9uc0NvbnRyb2xsZXIuaXNWaXNpYmxlKCkpKSB7CisgICAgICAgICAgICBpZiAoIW1ab29tTWFuYWdlci5pc1pvb21QaWNrZXJWaXNpYmxlKCkpIHsKICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIFRoZSB6b29tIGNvbnRyb2xzIGNvbWUgaW4gdGhlaXIgb3duIHdpbmRvdywgc28gb3VyIHdpbmRvdwotICAgICAgICAgICAgICAgICAqIGxvc2VzIGZvY3VzLiBPdXIgcG9saWN5IGlzIHRvIG5vdCBkcmF3IHRoZSBjdXJzb3IgcmluZyBpZgotICAgICAgICAgICAgICAgICAqIG91ciB3aW5kb3cgaXMgbm90IGZvY3VzZWQsIGJ1dCB0aGlzIGlzIGFuIGV4Y2VwdGlvbiBzaW5jZQorICAgICAgICAgICAgICAgICAqIFRoZSBleHRlcm5hbCB6b29tIGNvbnRyb2xzIGNvbWUgaW4gdGhlaXIgb3duIHdpbmRvdywgc28gb3VyCisgICAgICAgICAgICAgICAgICogd2luZG93IGxvc2VzIGZvY3VzLiBPdXIgcG9saWN5IGlzIHRvIG5vdCBkcmF3IHRoZSBjdXJzb3IgcmluZworICAgICAgICAgICAgICAgICAqIGlmIG91ciB3aW5kb3cgaXMgbm90IGZvY3VzZWQsIGJ1dCB0aGlzIGlzIGFuIGV4Y2VwdGlvbiBzaW5jZQogICAgICAgICAgICAgICAgICAqIHRoZSB1c2VyIGNhbiBzdGlsbCBuYXZpZ2F0ZSB0aGUgd2ViIHBhZ2Ugd2l0aCB0aGUgem9vbQogICAgICAgICAgICAgICAgICAqIGNvbnRyb2xzIHNob3dpbmcuCiAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgLy8gSWYgb3VyIHdpbmRvdyBoYXMgbG9zdCBmb2N1cywgc3RvcCBkcmF3aW5nIHRoZSBjdXJzb3IgcmluZwogICAgICAgICAgICAgICAgIG1EcmF3Q3Vyc29yUmluZyA9IGZhbHNlOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgbUdvdEtleURvd24gPSBmYWxzZTsKQEAgLTQyNjIsODEgKzQxNzYsMjQgQEAKICAgICAgICAgICAgIC8vIHN5c3RlbSB3b24ndCBjYWxsIG9uU2l6ZUNoYW5nZWQgaWYgdGhlIGRpbWVuc2lvbiBpcyBub3QgY2hhbmdlZC4KICAgICAgICAgICAgIC8vIEluIHRoaXMgY2FzZSwgd2UgbmVlZCB0byBjYWxsIHNlbmRWaWV3U2l6ZVpvb20oKSBleHBsaWNpdGx5IHRvCiAgICAgICAgICAgICAvLyBub3RpZnkgdGhlIFdlYktpdCBhYm91dCB0aGUgbmV3IGRpbWVuc2lvbnMuCi0gICAgICAgICAgICBzZW5kVmlld1NpemVab29tKCk7CisgICAgICAgICAgICBzZW5kVmlld1NpemVab29tKGZhbHNlKTsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gY2hhbmdlZDs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OwotICAgICAgICAgICAgLy8gSWYgaXQgaXMgaW4gcGFzc3dvcmQgbW9kZSwgdHVybiBpdCBvZmYgc28gaXQgZG9lcyBub3QgZHJhdwotICAgICAgICAgICAgLy8gbWlzcGxhY2VkLgotICAgICAgICAgICAgaWYgKGluRWRpdGluZ01vZGUoKSAmJiBuYXRpdmVGb2N1c0NhbmRpZGF0ZUlzUGFzc3dvcmQoKSkgewotICAgICAgICAgICAgICAgIG1XZWJUZXh0Vmlldy5zZXRJblBhc3N3b3JkKGZhbHNlKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbVZpZXdNYW5hZ2VyLnN0YXJ0Wm9vbSgpOwotCi0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIG9uU2NhbGVFbmQoU2NhbGVHZXN0dXJlRGV0ZWN0b3IgZGV0ZWN0b3IpIHsKLSAgICAgICAgICAgIGlmIChtUHJldmlld1pvb21Pbmx5KSB7Ci0gICAgICAgICAgICAgICAgbVByZXZpZXdab29tT25seSA9IGZhbHNlOwotICAgICAgICAgICAgICAgIG1BbmNob3JYID0gdmlld1RvQ29udGVudFgoKGludCkgbVpvb21DZW50ZXJYICsgbVNjcm9sbFgpOwotICAgICAgICAgICAgICAgIG1BbmNob3JZID0gdmlld1RvQ29udGVudFkoKGludCkgbVpvb21DZW50ZXJZICsgbVNjcm9sbFkpOwotICAgICAgICAgICAgICAgIC8vIGRvbid0IHJlZmxvdyB3aGVuIHpvb20gaW47IHdoZW4gem9vbSBvdXQsIGRvIHJlZmxvdyBpZiB0aGUKLSAgICAgICAgICAgICAgICAvLyBuZXcgc2NhbGUgaXMgYWxtb3N0IG1pbmltdW0gc2NhbGU7Ci0gICAgICAgICAgICAgICAgYm9vbGVhbiByZWZsb3dOb3cgPSAobUFjdHVhbFNjYWxlIC0gbU1pblpvb21TY2FsZQotICAgICAgICAgICAgICAgICAgICAgICAgPD0gTUlOSU1VT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WYpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHNjYWxlID0gTWF0aC5tYXgoc2NhbGUsIG1BY3R1YWxTY2FsZSAqIDAuOGYpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtWm9vbUNlbnRlclggPSBkZXRlY3Rvci5nZXRGb2N1c1goKTsKLSAgICAgICAgICAgICAgICBtWm9vbUNlbnRlclkgPSBkZXRlY3Rvci5nZXRGb2N1c1koKTsKLSAgICAgICAgICAgICAgICBzZXROZXdab29tU2NhbGUoc2NhbGUsIGZhbHNlLCBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0gICAgfQotCiAgICAgcHJpdmF0ZSBib29sZWFuIGhpdEZvY3VzZWRQbHVnaW4oaW50IGNvbnRlbnRYLCBpbnQgY29udGVudFkpIHsKICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIHsKICAgICAgICAgICAgIExvZy52KExPR1RBRywgIm5hdGl2ZUZvY3VzSXNQbHVnaW4oKT0iICsgbmF0aXZlRm9jdXNJc1BsdWdpbigpKTsKQEAgLTQ2NzksNyArNDQ2Myw3IEBACiAKICAgICBwcml2YXRlIGJvb2xlYW4gc2hvdWxkRm9yd2FyZFRvdWNoRXZlbnQoKSB7CiAgICAgICAgIHJldHVybiBtRnVsbFNjcmVlbkhvbGRlciAhPSBudWxsIHx8IChtRm9yd2FyZFRvdWNoRXZlbnRzCi0gICAgICAgICAgICAgICAgJiYgbVRvdWNoTW9kZSAhPSBUT1VDSF9TRUxFQ1RfTU9ERQorICAgICAgICAgICAgICAgICYmICFtU2VsZWN0aW5nVGV4dAogICAgICAgICAgICAgICAgICYmIG1QcmV2ZW50RGVmYXVsdCAhPSBQUkVW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ICFpc0NsaWNrYWJsZSgpIHx8ICFpc0xvbmdDbGlja2FibGUoKSkgewpAQCAtNDcwNCwzMiArNDUwNCwzNiBAQAogCiAgICAgICAgIC8vIEZJWE1FOiB3ZSBtYXkgY29uc2lkZXIgdG8gZ2l2ZSBXZWJLaXQgYW4gb3B0aW9uIHRvIGhhbmRsZSBtdWx0aS10b3VjaAogICAgICAgICAvLyBldmVudHMgbGF0ZXIuCi0gICAgICAgIGlmIChtU3VwcG9ydE11bHRpVG91Y2ggJiYgZXYuZ2V0UG9pbnRlckNvdW50KCkgPiAxKSB7Ci0gICAgICAgICAgICBpZiAobU1pblpvb21TY2FsZSA8IG1NYXhab29tU2NhbGUpIHsKLSAgICAgICAgICAgICAgICBtU2NhbGVEZXRlY3Rvci5vblRvdWNoRXZlbnQoZXYpOwotICAgICAgICAgICAgICAgIGlmIChtU2NhbGVEZXRlY3Rvci5pc0luUHJvZ3Jlc3MoKSkgewotICAgICAgICAgICAgICAgICAgICBtTGFzdFRvdWNoVGltZSA9IGV2ZW50VGltZTsKKyAgICAgICAgaWYgKG1ab29tTWFuYWdlci5zdXBwb3J0c011bHRpVG91Y2hab29tKCkgJiYgZXYuZ2V0UG9pbnRlckNvdW50KCkgPiAxKSB7CisKKyAgICAgICAgICAgIC8vIGlmIHRoZSBwYWdlIGRpc2FsbG93cyB6b29tLCB0aGVuIHNraXAgbXVsdGktcG9pbnRlciBhY3Rpb24KKyAgICAgICAgICAgIGlmIChtWm9vbU1hbmFnZXIuaXNab29tU2NhbGVGaXhlZCgpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFNjYWxlR2VzdHVyZURldGVjdG9yIGRldGVjdG9yID0gbVpvb21NYW5hZ2VyLmdldE11bHRpVG91Y2hHZXN0dXJlRGV0ZWN0b3IoKTsKKyAgICAgICAgICAgIGRldGVjdG9yLm9uVG91Y2hFdmVudChldik7CisKKyAgICAgICAgICAgIGlmIChkZXRlY3Rvci5pc0luUHJvZ3Jlc3MoKSkgeworICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hUaW1lID0gZXZlbnRUaW1lOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB4ID0gZGV0ZWN0b3IuZ2V0Rm9jdXNYKCk7CisgICAgICAgICAgICB5ID0gZGV0ZWN0b3IuZ2V0Rm9jdXNZKCk7CisgICAgICAgICAgICBhY3Rpb24gPSBldi5nZXRBY3Rpb24oKSAmIE1vdGlvbkV2ZW50LkFDVElPTl9NQVNLOworICAgICAgICAgICAgaWYgKGFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fUE9JTlRFUl9ET1dOKSB7CisgICAgICAgICAgICAgICAgY2FuY2VsVG91Y2goKTsKKyAgICAgICAgICAgICAgICBhY3Rpb24gPSBNb3Rpb25FdmVudC5BQ1RJT05fRE9XTjsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX1VQKSB7CisgICAgICAgICAgICAgICAgLy8gc2V0IG1MYXN0VG91Y2hYL1kgdG8gdGhlIHJlbWFpbmluZyBwb2ludAorICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hYID0geDsKKyAgICAgICAgICAgICAgICBtTGFzdFRvdWNoWSA9IHk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRSkgeworICAgICAgICAgICAgICAgIC8vIG5lZ2F0aXZlIHggb3IgeSBpbmRpY2F0ZSBpdCBpcyBvbiB0aGUgZWRnZSwgc2tpcCBpdC4KKyAgICAgICAgICAgICAgICBpZiAoeCA8IDAgfHwgeSA8IDApIHsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHggPSBtU2NhbGVEZXRlY3Rvci5nZXRGb2N1c1goKTsKLSAgICAgICAgICAgICAgICB5ID0gbVNjYWxlRGV0ZWN0b3IuZ2V0Rm9jdXNZKCk7Ci0gICAgICAgICAgICAgICAgYWN0aW9uID0gZXYuZ2V0QWN0aW9uKCkgJiBNb3Rpb25FdmVudC5BQ1RJT05fTUFTSzsKLSAgICAgICAgICAgICAgICBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9QT0lOVEVSX0RPV04pIHsKLSAgICAgICAgICAgICAgICAgICAgY2FuY2VsVG91Y2goKTsKLSAgICAgICAgICAgICAgICAgICAgYWN0aW9uID0gTW90aW9uRXZlbnQuQUNUSU9OX0RPV047Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24gPT0gTW90aW9uRXZlbnQuQUNUSU9OX1BPSU5URVJfVVApIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gc2V0IG1MYXN0VG91Y2hYL1kgdG8gdGhlIHJlbWFpbmluZyBwb2ludAotICAgICAgICAgICAgICAgICAgICBtTGFzdFRvdWNoWCA9IHg7Ci0gICAgICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hZID0geTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRSkgewotICAgICAgICAgICAgICAgICAgICAvLyBuZWdhdGl2ZSB4IG9yIHkgaW5kaWNhdGUgaXQgaXMgb24gdGhlIGVkZ2UsIHNraXAgaXQuCi0gICAgICAgICAgICAgICAgICAgIGlmICh4IDwgMCB8fCB5IDwgMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBwYWdlIGRpc2FsbG93IHpvb20sIHNraXAgbXVsdGktcG9pbnRlciBhY3Rpb24KLSAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIGFjdGlvbiA9IGV2LmdldEFjdGlvbigpOwpAQCAtNDc2NywxOCArNDU3MSwxMSBAQAogICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfRFJBR19TVEFSVF9NT0RFOwogICAgICAgICAgICAgICAgICAgICBtQ29uZmlybU1vdmUgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlTWVzc2FnZXMoUkVTVU1FX1dFQkNPUkVfUFJJT1JJVFkpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIWluRnVsbFNjcmVlbk1vZGUoKSAmJiBtU2hpZnRJc1ByZXNzZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgbVNlbGVjdFggPSBtU2Nyb2xsWCArIChpbnQpIHg7Ci0gICAgICAgICAgICAgICAgICAgIG1TZWxlY3RZID0gbVNjcm9sbFkgKyAoaW50KSB5OwotICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfU0VMRUNUX01PREU7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJzZWxlY3Q9IiArIG1TZWxlY3RYICsgIiwiICsgbVNlbGVjdFkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG5hdGl2ZU1vdmVTZWxlY3Rpb24oY29udGVudFgsIGNvbnRlbnRZLCBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgICAgIG1Ub3VjaFNlbGVjdGlvbiA9IG1FeHRlbmRTZWxlY3Rpb24gPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7IC8vIGRyYXcgdGhlIGktYmVhbSBpbnN0ZWFkIG9mIHRoZSBhcnJvdwogICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVByaXZhdGVIYW5kbGVyLmhhc01lc3NhZ2VzKFJFTEVBU0VfU0lOR0xFX1RBUCkpIHsKICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKFJFTEVBU0VfU0lOR0xFX1RBUCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChnZXRTZXR0aW5ncygpLnN1cHBvcnRUb3VjaE9ubHkoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlVG91Y2hIaWdobGlnaHQodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgaWYgKGRlbHRhWCAqIGRlbHRhWCArIGRlbHRhWSAqIGRlbHRhWSA8IG1Eb3VibGVUYXBTbG9wU3F1YXJlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfRE9VQkxFX1RBUF9NT0RFOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewpAQCAtNDc5MCwxNyArNDU4Nyw0NSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50WCwgY29udGVudFkpIDogZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9IGVsc2UgeyAvLyB0aGUgbm9ybWFsIGNhc2UKLSAgICAgICAgICAgICAgICAgICAgbVByZXZpZXdab29tT25seSA9IGZhbHNlOwogICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfSU5JVF9NT0RFOwogICAgICAgICAgICAgICAgICAgICBtRGVmZXJUb3VjaFByb2Nlc3MgPSAoIWluRnVsbFNjcmVlbk1vZGUoKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIG1Gb3J3YXJkVG91Y2hFdmVudHMpID8gaGl0Rm9jdXNlZFBsdWdpbigKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50WCwgY29udGVudFkpIDogZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudEh1Yi5VUERBVEVfRlJBTUVfQ0FDSEVfSUZfTE9BRElORyk7CisgICAgICAgICAgICAgICAgICAgIGlmIChnZXRTZXR0aW5ncygpLnN1cHBvcnRUb3VjaE9ubHkoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgVG91Y2hIaWdobGlnaHREYXRhIGRhdGEgPSBuZXcgVG91Y2hIaWdobGlnaHREYXRhKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLm1YID0gY29udGVudFg7CisgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLm1ZID0gY29udGVudFk7CisgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLm1TbG9wID0gdmlld1RvQ29udGVudERpbWVuc2lvbihtTmF2U2xvcCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2VEZWxheWVkKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFdmVudEh1Yi5HRVRfVE9VQ0hfSElHSExJR0hUX1JFQ1RTLCBkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaWV3Q29uZmlndXJhdGlvbi5nZXRUYXBUaW1lb3V0KCkpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX1RPVUNIX0hJR0hMSUdIVCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChnZXRTZXR0aW5ncygpLmdldE5hdkR1bXAoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hIaWdobGlnaHRYID0gKGludCkgeCArIG1TY3JvbGxYOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hIaWdobGlnaHRZID0gKGludCkgeSArIG1TY3JvbGxZOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2hsaWdodFggPSBtVG91Y2hIaWdobGlnaHRZID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIFRPVUNIX0hJR0hMSUdIVF9FTEFQU0VfVElNRSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGlmIChtTG9nRXZlbnQgJiYgZXZlbnRUaW1lIC0gbUxhc3RUb3VjaFVwVGltZSA8IDEwMDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgIEV2ZW50TG9nLndyaXRlRXZlbnQoRXZlbnRMb2dUYWdzLkJST1dTRVJfRE9VQkxFX1RBUF9EVVJBVElPTiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGV2ZW50VGltZSAtIG1MYXN0VG91Y2hVcFRpbWUpLCBldmVudFRpbWUpOwogICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChtU2VsZWN0aW5nVGV4dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbURyYXdTZWxlY3Rpb25Qb2ludGVyID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBtU2VsZWN0aW9uU3RhcnRlZCA9IG5hdGl2ZVN0YXJ0U2VsZWN0aW9uKGNvbnRlbnRYLCBjb250ZW50WSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgInNlbGVjdD0iICsgY29udGVudFggKyAiLCIgKyBjb250ZW50WSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgLy8gVHJpZ2dlciB0aGUgbGluawogICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX0lOSVRfTU9ERQpAQCAtNDgyNCwxNyArNDY0OSwxNSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1ZID0gY29udGVudFk7CiAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubU1ldGFTdGF0ZSA9IGV2LmdldE1ldGFTdGF0ZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1SZXByb2Nlc3MgPSBtRGVmZXJUb3VjaFByb2Nlc3M7CisgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlld0NvcmUuc2VuZE1lc3NhZ2UoRXZlbnRIdWIuVE9VQ0hfRVZFTlQsIHRlZCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobURlZmVyVG91Y2hQcm9jZXNzKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3RpbGwgbmVlZHMgdG8gc2V0IHRoZW0gZm9yIGNvbXB1dGUgZGVsdGFYL1kKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFRvdWNoWCA9IHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RUb3VjaFkgPSB5OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tVmlld1ggPSB4OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tVmlld1kgPSB5OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5UT1VDSF9FVkVOVCwgdGVkKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5UT1VDSF9FVkVOVCwgdGVkKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaW5GdWxsU2NyZWVuTW9kZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKFBSRVZFTlRfREVGQVVMVF9USU1FT1VUKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIuc2VuZE1lc3NhZ2VEZWxheWVkKG1Qcml2YXRlSGFuZGxlcgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm9idGFpbk1lc3NhZ2UoUFJFVkVOVF9ERUZBVUxUX1RJTUVPVVQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGlvbiwgMCksIFRBUF9USU1FT1VUKTsKQEAgLTQ4NTUsMjQgKzQ2NzgsMjQgQEAKICAgICAgICAgICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgPT0gVE9VQ0hfRE9VQkxFX1RBUF9NT0RFKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfSU5JVF9NT0RFOwogICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChnZXRTZXR0aW5ncygpLnN1cHBvcnRUb3VjaE9ubHkoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlVG91Y2hIaWdobGlnaHQodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgLy8gcGFzcyB0aGUgdG91Y2ggZXZlbnRzIGZyb20gVUkgdGhyZWFkIHRvIFdlYkNvcmUgdGhyZWFkCiAgICAgICAgICAgICAgICAgaWYgKHNob3VsZEZvcndhcmRUb3VjaEV2ZW50KCkgJiYgbUNvbmZpcm1Nb3ZlICYmIChmaXJzdE1vdmUKICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGV2ZW50VGltZSAtIG1MYXN0U2VudFRvdWNoVGltZSA+IG1DdXJyZW50VG91Y2hJbnRlcnZhbCkpIHsKLSAgICAgICAgICAgICAgICAgICAgbUxhc3RTZW50VG91Y2hUaW1lID0gZXZlbnRUaW1lOwogICAgICAgICAgICAgICAgICAgICBUb3VjaEV2ZW50RGF0YSB0ZWQgPSBuZXcgVG91Y2hFdmVudERhdGEoKTsKICAgICAgICAgICAgICAgICAgICAgdGVkLm1BY3Rpb24gPSBhY3Rpb247CiAgICAgICAgICAgICAgICAgICAgIHRlZC5tWCA9IGNvbnRlbnRYOwogICAgICAgICAgICAgICAgICAgICB0ZWQubVkgPSBjb250ZW50WTsKICAgICAgICAgICAgICAgICAgICAgdGVkLm1NZXRhU3RhdGUgPSBldi5nZXRNZXRhU3RhdGUoKTsKICAgICAgICAgICAgICAgICAgICAgdGVkLm1SZXByb2Nlc3MgPSBtRGVmZXJUb3VjaFByb2Nlc3M7CisgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5UT1VDSF9FVkVOVCwgdGVkKTsKKyAgICAgICAgICAgICAgICAgICAgbUxhc3RTZW50VG91Y2hUaW1lID0gZXZlbnRUaW1lOwogICAgICAgICAgICAgICAgICAgICBpZiAobURlZmVyVG91Y2hQcm9jZXNzKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVZpZXdYID0geDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tVmlld1kgPSB5OwotICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlRPVUNIX0VWRU5ULCB0ZWQpOwogICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlRPVUNIX0VWRU5ULCB0ZWQpOwogICAgICAgICAgICAgICAgICAgICBpZiAoZmlyc3RNb3ZlICYmICFpbkZ1bGxTY3JlZW5Nb2RlKCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5zZW5kTWVzc2FnZURlbGF5ZWQobVByaXZhdGVIYW5kbGVyCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vYnRhaW5NZXNzYWdlKFBSRVZFTlRfREVGQVVMVF9USU1FT1VULApAQCAtNDg5MiwyMCArNDcxNSwyMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtVG91Y2hNb2RlID0gIiArIG1Ub3VjaE1vZGUpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBtVmVsb2NpdHlUcmFja2VyLmFkZE1vdmVtZW50KGV2KTsKLSAgICAgICAgICAgICAgICBpZiAobVRvdWNoTW9kZSAhPSBUT1VDSF9EUkFHX01PREUpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgPT0gVE9VQ0hfU0VMRUNUX01PREUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1TZWxlY3RYID0gbVNjcm9sbFggKyAoaW50KSB4OwotICAgICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdFkgPSBtU2Nyb2xsWSArIChpbnQpIHk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgInh0ZW5kPSIgKyBtU2VsZWN0WCArICIsIiArIG1TZWxlY3RZKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZU1vdmVTZWxlY3Rpb24oY29udGVudFgsIGNvbnRlbnRZLCB0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGlmIChtU2VsZWN0aW5nVGV4dCAmJiBtU2VsZWN0aW9uU3RhcnRlZCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgeworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiZXh0ZW5kPSIgKyBjb250ZW50WCArICIsIiArIGNvbnRlbnRZKTsKICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBuYXRpdmVFeHRlbmRTZWxlY3Rpb24oY29udGVudFgsIGNvbnRlbnRZKTsKKyAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZSgpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgIT0gVE9VQ0hfRFJBR19NT0RFKSB7CisKICAgICAgICAgICAgICAgICAgICAgaWYgKCFtQ29uZmlybU1vdmUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICB9CisKICAgICAgICAgICAgICAgICAgICAgaWYgKG1QcmV2ZW50RGVmYXVsdCA9PSBQUkVWRU5UX0RFRkFVTFRfTUFZQkVfWUVTCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgbVByZXZlbnREZWZhdWx0ID09IFBSRVZFTlRfREVGQVVMVF9OT19GUk9NX1RPVUNIX0RPV04pIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRyYWNrIG1MYXN0VG91Y2hUaW1lIGFzIHdlIG1heSBuZWVkIHRvIGRvIGZsaW5nIGF0CkBAIC01MDMzLDYgKzQ4NTYsNyBAQAogICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fVVA6IHsKKyAgICAgICAgICAgICAgICBpZiAoIWlzRm9jdXNlZCgpKSByZXF1ZXN0Rm9jdXMoKTsKICAgICAgICAgICAgICAgICAvLyBwYXNzIHRoZSB0b3VjaCBldmVudHMgZnJvbSBVSSB0aHJlYWQgdG8gV2ViQ29yZSB0aHJlYWQKICAgICAgICAgICAgICAgICBpZiAoc2hvdWxkRm9yd2FyZFRvdWNoRXZlbnQoKSkgewogICAgICAgICAgICAgICAgICAgICBUb3VjaEV2ZW50RGF0YSB0ZWQgPSBuZXcgVG91Y2hFdmVudERhdGEoKTsKQEAgLTUwNDEsMTAgKzQ4NjUsNiBAQAogICAgICAgICAgICAgICAgICAgICB0ZWQubVkgPSBjb250ZW50WTsKICAgICAgICAgICAgICAgICAgICAgdGVkLm1NZXRhU3RhdGUgPSBldi5nZXRNZXRhU3RhdGUoKTsKICAgICAgICAgICAgICAgICAgICAgdGVkLm1SZXByb2Nlc3MgPSBtRGVmZXJUb3VjaFByb2Nlc3M7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtRGVmZXJUb3VjaFByb2Nlc3MpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tVmlld1ggPSB4OwotICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1WaWV3WSA9IHk7Ci0gICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlRPVUNIX0VWRU5ULCB0ZWQpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBtTGFzdFRvdWNoVXBUaW1lID0gZXZlbnRUaW1lOwpAQCAtNTA1OSwyMCArNDg3OSwxMiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tWSA9IGNvbnRlbnRZOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlZC5tTWV0YVN0YXRlID0gZXYuZ2V0TWV0YVN0YXRlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1SZXByb2Nlc3MgPSBtRGVmZXJUb3VjaFByb2Nlc3M7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1EZWZlclRvdWNoUHJvY2VzcykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVZpZXdYID0geDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1WaWV3WSA9IHk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1XZWJWaWV3Q29yZS5zZW5kTWVzc2FnZShFdmVudEh1Yi5UT1VDSF9FVkVOVCwgdGVkKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVByZXZlbnREZWZhdWx0ICE9IFBSRVZFTlRfREVGQVVMVF9ZRVMpewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvRG91YmxlVGFwKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVpvb21NYW5hZ2VyLmhhbmRsZURvdWJsZVRhcChtTGFzdFRvdWNoWCwgbUxhc3RUb3VjaFkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaE1vZGUgPSBUT1VDSF9ET05FX01PREU7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBUT1VDSF9TRUxFQ1RfTU9ERToKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1pdENvcHkoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaFNlbGVjdGlvbiA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgVE9VQ0hfSU5JVF9NT0RFOiAvLyB0YXAKICAgICAgICAgICAgICAgICAgICAgY2FzZSBUT1VDSF9TSE9SVFBSRVNTX1NUQVJUX01PREU6CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgVE9VQ0hfU0hPUlRQUkVTU19NT0RFOgpAQCAtNTA4NCw5ICs0ODk2LDE3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1QcmV2ZW50RGVmYXVsdCAhPSBQUkVWRU5UX0RFRkFVTFRfWUVTCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAoY29tcHV0ZU1heFNjcm9sbFgoKSA+IDAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgY29tcHV0ZU1heFNjcm9sbFkoKSA+IDApKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFVJIHRha2VzIGNvbnRyb2wgYmFjaywgY2FuY2VsIFdlYkNvcmUgdG91Y2gKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FuY2VsV2ViQ29yZVRvdWNoRXZlbnQoY29udGVudFgsIGNvbnRlbnRZLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgdXNlciBoYXMgcGVyZm9ybWVkIGEgdmVyeSBxdWljayB0b3VjaAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzZXF1ZW5jZSBpdCBpcyBwb3NzaWJsZSB0aGF0IHdlIG1heSBnZXQgaGVyZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBiZWZvcmUgV2ViQ29yZSBoYXMgaGFkIGEgY2hhbmNlIHRvIHByb2Nlc3MgdGhlIGV2ZW50cy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSW4gdGhpcyBjYXNlLCBhbnkgY2FsbCB0byBwcmV2ZW50RGVmYXVsdCBpbiB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSlMgdG91Y2ggaGFuZGxlciB3aWxsIG5vdCBoYXZlIGJlZW4gZXhlY3V0ZWQgeWV0LgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBIZW5jZSB3ZSB3aWxsIHNlZSBib3RoIHRoZSBVSSAobm93KSBhbmQgV2ViQ29yZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAod2hlbiBjb250ZXh0IHN3aXRjaGVzKSBoYW5kbGluZyB0aGUgZXZlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlZ2FyZGxlc3Mgb2Ygd2hldGhlciB0aGUgd2ViIGRldmVsb3BlciBhY3R1YWxseQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkb2VzZXMgcHJldmVudERlZmF1bHQgaW4gdGhlaXIgdG91Y2ggaGFuZGxlci4gVGhpcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpcyB0aGUgbmF0dXJlIG9mIG91ciBhc3luY2hyb25vdXMgdG91Y2ggbW9kZWwuCisKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2Ugd2lsbCBub3QgcmV3cml0ZSBkcmFnIGNvZGUgaGVyZSwgYnV0IHdlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdpbGwgdHJ5IGZsaW5nIGlmIGl0IGFwcGxpZXMuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdlYlZpZXdDb3JlLnJlZHVjZVByaW9yaXR5KCk7CkBAIC01MTAzLDcgKzQ5MjMsMTcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVRvdWNoTW9kZSA9PSBUT1VDSF9JTklUX01PREUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVNlbGVjdGluZ1RleHQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGFwcGluZyBvbiBzZWxlY3Rpb24gb3IgY29udHJvbHMgZG9lcyBub3RoaW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbmF0aXZlSGl0U2VsZWN0aW9uKGNvbnRlbnRYLCBjb250ZW50WSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbkRvbmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb25seSB0cmlnZ2VyIGRvdWJsZSB0YXAgaWYgdGhlIFdlYlZpZXcgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzY2FsYWJsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtVG91Y2hNb2RlID09IFRPVUNIX0lOSVRfTU9ERQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKGNhblpvb21JbigpIHx8IGNhblpvb21PdXQoKSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnNlbmRFbXB0eU1lc3NhZ2VEZWxheWVkKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFTEVBU0VfU0lOR0xFX1RBUCwgVmlld0NvbmZpZ3VyYXRpb24KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5nZXREb3VibGVUYXBUaW1lb3V0KCkpOwpAQCAtNTE5NCwyMSArNTAyNCwxMCBAQAogICAgICAgICBpZiAoIW1EcmFnRnJvbVRleHRJbnB1dCkgewogICAgICAgICAgICAgbmF0aXZlSGlkZUN1cnNvcigpOwogICAgICAgICB9Ci0gICAgICAgIFdlYlNldHRpbmdzIHNldHRpbmdzID0gZ2V0U2V0dGluZ3MoKTsKLSAgICAgICAgaWYgKHNldHRpbmdzLnN1cHBvcnRab29tKCkKLSAgICAgICAgICAgICAgICAmJiBzZXR0aW5ncy5nZXRCdWlsdEluWm9vbUNvbnRyb2xzKCkKLSAgICAgICAgICAgICAgICAmJiAhZ2V0Wm9vbUJ1dHRvbnNDb250cm9sbGVyKCkuaXNWaXNpYmxlKCkKLSAgICAgICAgICAgICAgICAmJiBtTWluWm9vbVNjYWxlIDwgbU1heFpvb21TY2FsZQotICAgICAgICAgICAgICAgICYmIChtSG9yaXpvbnRhbFNjcm9sbEJhck1vZGUgIT0gU0NST0xMQkFSX0FMV0FZU09GRgotICAgICAgICAgICAgICAgICAgICAgICAgfHwgbVZlcnRpY2FsU2Nyb2xsQmFyTW9kZSAhPSBTQ1JPTExCQVJfQUxXQVlTT0ZGKSkgewotICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5zZXRWaXNpYmxlKHRydWUpOwotICAgICAgICAgICAgaW50IGNvdW50ID0gc2V0dGluZ3MuZ2V0RG91YmxlVGFwVG9hc3RDb3VudCgpOwotICAgICAgICAgICAgaWYgKG1Jblpvb21PdmVydmlldyAmJiBjb3VudCA+IDApIHsKLSAgICAgICAgICAgICAgICBzZXR0aW5ncy5zZXREb3VibGVUYXBUb2FzdENvdW50KC0tY291bnQpOwotICAgICAgICAgICAgICAgIFRvYXN0Lm1ha2VUZXh0KG1Db250ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHJpbmcuZG91YmxlX3RhcF90b2FzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgIFRvYXN0LkxFTkdUSF9MT05HKS5zaG93KCk7Ci0gICAgICAgICAgICB9CisKKyAgICAgICAgaWYgKG1Ib3Jpem9udGFsU2Nyb2xsQmFyTW9kZSAhPSBTQ1JPTExCQVJfQUxXQVlTT0ZGCisgICAgICAgICAgICAgICAgfHwgbVZlcnRpY2FsU2Nyb2xsQmFyTW9kZSAhPSBTQ1JPTExCQVJfQUxXQVlTT0ZGKSB7CisgICAgICAgICAgICBtWm9vbU1hbmFnZXIuaW52b2tlWm9vbVBpY2tlcigpOwogICAgICAgICB9CiAgICAgfQogCkBAIC01MjE2LDE4ICs1MDM1LDcgQEAKICAgICAgICAgaWYgKChkZWx0YVggfCBkZWx0YVkpICE9IDApIHsKICAgICAgICAgICAgIHNjcm9sbEJ5KGRlbHRhWCwgZGVsdGFZKTsKICAgICAgICAgfQotICAgICAgICBpZiAoIWdldFNldHRpbmdzKCkuZ2V0QnVpbHRJblpvb21Db250cm9scygpKSB7Ci0gICAgICAgICAgICBib29sZWFuIHNob3dQbHVzTWludXMgPSBtTWluWm9vbVNjYWxlIDwgbU1heFpvb21TY2FsZTsKLSAgICAgICAgICAgIGlmIChtWm9vbUNvbnRyb2xzICE9IG51bGwgJiYgc2hvd1BsdXNNaW51cykgewotICAgICAgICAgICAgICAgIGlmIChtWm9vbUNvbnRyb2xzLmdldFZpc2liaWxpdHkoKSA9PSBWaWV3LlZJU0lCTEUpIHsKLSAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJ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ICAgICAgICAgaWYgKG1TZWxlY3RpbmdUZXh0KSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7IC8vIGRpc2NhcmQgcHJlc3MgaWYgY29weSBpbiBwcm9ncmVzcwogICAgICAgICAgICAgfQogICAgICAgICAgICAgbVRyYWNrYmFsbERvd24gPSB0cnVlOwpAQCAtNTM0MSwxMSArNTE1MiwxMyBAQAogICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZU1lc3NhZ2VzKExPTkdfUFJFU1NfQ0VOVEVSKTsKICAgICAgICAgICAgIG1UcmFja2JhbGxEb3duID0gZmFsc2U7CiAgICAgICAgICAgICBtVHJhY2tiYWxsVXBUaW1lID0gdGltZTsKLSAgICAgICAgICAgIGlmIChzaGlmdFByZXNzZWQpIHsKKyAgICAgICAgICAgIGlmIChtU2VsZWN0aW5nVGV4dCkgewogICAgICAgICAgICAgICAgIGlmIChtRXh0ZW5kU2VsZWN0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbW1pdENvcHkoKTsKKyAgICAgICAgICAgICAgICAgICAgY29weVNlbGVjdGlvbigpOworICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb25Eb25lKCk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgbUV4dGVuZFNlbGVjdGlvbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNldEV4dGVuZFNlbGVjdGlvbigpOwogICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKCk7IC8vIGRyYXcgdGhlIGktYmVhbSBpbnN0ZWFkIG9mIHRoZSBhcnJvdwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsgLy8gZGlzY2FyZCBwcmVzcyBpZiBjb3B5IGluIHByb2dyZXNzCkBAIC01NDEyLDggKzUyMjUsNyBAQAogICAgICAgICAgICAgICAgICAgICArICIgeVJhdGU9IiArI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pb24gcG9pbnRlci4gQWxsb3cgdGhlIHRyYWNrYmFsbCB0byBhZGp1c3QgdGhlCisgICAgICAgICAgICAgICAgLy8gcG9zaXRpb24gb2YgdGhlIHRvdWNoIGNvbnRyb2wuCisgICAgICAgICAgICAgICAgbVNlbGVjdFggPSBjb250ZW50VG9WaWV3WChuYXRpdmVTZWxlY3Rpb25YKCkpOworICAgICAgICAgICAgICAgIG1TZWxlY3RZID0gY29udGVudFRvVmlld1kobmF0aXZlU2VsZWN0aW9uWSgpKTsKKyAgICAgICAgICAgICAgICBtRHJhd1NlbGVjdGlvblBvaW50ZXIgPSBtRXh0ZW5kU2VsZWN0aW9uID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBuYXRpdmVTZXRFeHRlbmRTZWxlY3Rpb24oKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIG1vdmVTZWxlY3Rpb24oc2NhbGVUcmFja2JhbGxYKHhSYXRlLCB2aWV3V2lkdGgpLAogICAgICAgICAgICAgICAgICAgICBzY2FsZVRyYWNrYmFsbFkoeVJhdGUsIHZpZXdIZWlnaHQpKTsKICAgICAgICAgICAgIG1UcmFja2JhbGxSZW1haW5zWCA9IG1UcmFja2JhbGxSZW1haW5zWSA9IDA7CkBAIC01NTE3LDExICs1MzM4LDExIEBACiAgICAgICAgICAgICAgICAgICAgICAgICArICIgbVRyYWNrYmFsbFJlbWFpbnNYPSIgKyBtVHJhY2tiYWxsUmVtYWluc1gKICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtVHJhY2tiYWxsUmVtYWluc1k9IiArIG1UcmFja2JhbGxSZW1haW5zWSk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobU5hdGl2ZUNsYXNzICE9IDAgJiYgbmF0aXZlRm9jdXNJc1BsdWdpbigpKSB7CisgICAgICAgICAgICBpZiAobU5hdGl2ZUNsYXNzICE9IDAgJiYgbmF0aXZlUGFnZVNob3VsZEhhbmRsZVNoaWZ0QW5kQXJyb3dzKCkpIHsKICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgbGV0UGx1Z2luSGFuZGxlTmF2S2V5KHNlbGVjdEtleUNvZGUsIHRpbWUsIHRydWUpOworICAgICAgICAgICAgICAgICAgICBsZXRQYWdlSGFuZGxlTmF2S2V5KHNlbGVjdEtleUNvZGUsIHRpbWUsIHRydWUpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBsZXRQbHVnaW5IYW5kbGVOYXZLZXkoc2VsZWN0S2V5Q29kZSwgdGltZSwgZmFsc2UpOworICAgICAgICAgICAgICAgIGxldFBhZ2VIYW5kbGVOYXZLZXkoc2VsZWN0S2V5Q29kZSwgdGltZSwgZmFsc2UpOwogICAgICAgICAgICAgfSBlbHNlIGlmIChuYXZIYW5kbGVkS2V5KHNlbGVjdEtleUNvZGUsIGNvdW50LCBmYWxzZSwgdGltZSkpIHsKICAgICAgICAgICAgICAgICBwbGF5U291bmRFZmZlY3Qoa2V5Q29kZVRvU291bmRzRWZmZWN0KHNlbGVjdEtleUNvZGUpKTsKICAgICAgICAgICAgIH0KQEAgLTU1NjAsNiArNTM4MSwxOSBAQAogICAgICAgICAgICAgICAgIC0gZ2V0Vmlld0hlaWdodFdpdGhUaXRsZSgpLCAwKTsKICAgICB9CiAKKyAgICBib29sZWFuIHVwZGF0ZVNjcm9sbENvb3JkaW5hdGVzKGludCB4LCBpbnQgeSkgeworICAgICAgICBpbnQgb2xkWCA9IG1TY3JvbGxYOworICAgICAgICBpbnQgb2xkWSA9IG1TY3JvbGxZOworICAgICAgICBtU2Nyb2xsWCA9IHg7CisgICAgICAgIG1TY3JvbGxZID0geTsKKyAgICAgICAgaWYgKG9sZFggIT0gbVNjcm9sbFggfHwgb2xkWSAhPSBtU2Nyb2xsWSkgeworICAgICAgICAgICAgb25TY3JvbGxDaGFuZ2VkKG1TY3JvbGxYLCBtU2Nyb2xsWSw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pvb21TdGFydCA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOwotICAgICAgICAgICAgbUludkluaXRpYWxab29tU2NhbGUgPSAxLjBmIC8gb2xkU2NhbGU7Ci0gICAgICAgICAgICBtSW52RmluYWxab29tU2NhbGUgPSAxLjBmIC8gbUFjdHVhbFNjYWxlOwotICAgICAgICAgICAgbVpvb21TY2FsZSA9IG1BY3R1YWxTY2FsZTsKLSAgICAgICAgICAgIFdlYlZpZXdDb3JlLnBhdXNlVXBkYXRlUGljdHVyZShtV2ViVmlld0NvcmUpOwotICAgICAgICAgICAgaW52YWxpZGF0ZSgpOwotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICB9Ci0KICAgICAvKioKICAgICAgKiBSZXR1cm5zIGEgdmlldyBjb250YWluaW5nIHpvb20gY29udHJvbHMgaS5lLiArLy0gYnV0dG9ucy4gVGhlIGNhbGxlciBpcwogICAgICAqIGluIGNoYXJnZSBvZiBpbnN0YWxsaW5nIHRoaXMgdmlldyB0byB0aGUgdmlldyBoaWVyYXJjaHkuIFRoaXMgdmlldyB3aWxsCkBAIC01Njc1LDgxICs1NDgyLDI5IEBACiAgICAgICAgICAgICBMb2cudyhMT0dUQUcsICJUaGlzIFdlYlZpZXcgZG9lc24ndCBzdXBwb3J0IHpvb20uIik7CiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgfQotICAgICAgICBpZiAobVpvb21Db250cm9scyA9PSBudWxsKSB7Ci0gICAgICAgICAgICBtWm9vbUNvbnRyb2xzID0gY3JlYXRlWm9vbUNvbnRyb2xzKCk7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBuZWVkIHRvIGJlIHNldCB0byBWSVNJQkxFIGZpcnN0IHNvIHRoYXQgZ2V0TWVhc3VyZWRIZWlnaHQoKSBpbgotICAgICAgICAgICAgICoge0BsaW5rICNvblNpemVDaGFuZ2VkKCl9IGNhbiByZXR1cm4gdGhlIG1lYXN1cmVkIHZhbHVlIGZvciBwcm9wZXIKLSAgICAgICAgICAgICAqIGxheW91dC4KLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgbVpvb21Db250cm9scy5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7Ci0gICAgICAgICAgICBtWm9vbUNvbnRyb2xSdW5uYWJsZSA9IG5ldyBSdW5uYWJsZSgpIHsKLSAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogRG9uJ3QgZGlzbWlzcyB0aGUgY29udHJvbHMgaWYgdGhlIHVzZXIgaGFzCi0gICAgICAgICAgICAgICAgICAgICAqIGZvY3VzIG9uIHRoZW0uIFdhaXQgYW5kIGNoZWNrIGFnYWluIGxhdGVyLgotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgaWYgKCFtWm9vbUNvbnRyb2xzLmhhc0ZvY3VzKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1ab29tQ29udHJvbHMuaGlkZSgpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtWm9vbUNvbnRyb2xSdW5uYWJsZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFpPT01fQ09OVFJPTFNfVElNRU9VVCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9OwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBtWm9vbUNvbnRyb2xzOworICAgICAgICByZXR1cm4gbVpvb21NYW5hZ2VyLmdldEV4dGVybmFsWm9vbVBpY2tlcigpOwogICAgIH0KIAotICAgIHByaXZhdGUgRXh0ZW5kZWRab29tQ29udHJvbHMgY3JlYXRlWm9vbUNvbnRyb2xzKCkgewotICAgICAgICBFeHRlbmRlZFpvb21Db250cm9scyB6b29tQ29udHJvbHMgPSBuZXcgRXh0ZW5kZWRab29tQ29udHJvbHMobUNvbnRleHQKLSAgICAgICAgICAgICwgbnVsbCk7Ci0gICAgICAgIHpvb21Db250cm9scy5zZXRPblpvb21JbkNsaWNrTGlzdGVuZXIobmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKLSAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7Ci0gICAgICAgICAgICAgICAgLy8gcmVzZXQgdGltZSBvdXQKLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBaT09NX0NPTlRST0xTX1RJTUVPVVQpOwotICAgICAgICAgICAgICAgIHpvb21JbigpOwotICAgICAgICAgICAgfQotICAgICAgICB9KTsKLSAgICAgICAgem9vbUNvbnRyb2xzLnNldE9uWm9vbU91dENsaWNrTGlzdGVuZXIobmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKLSAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7Ci0gICAgICAgICAgICAgICAgLy8gcmVzZXQgdGltZSBvdXQKLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBaT09NX0NPTlRST0xTX1RJTUVPVVQpOwotICAgICAgICAgICAgICAgIHpvb21PdXQoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSk7Ci0gICAgICAgIHJldHVybiB6b29tQ29udHJvbHM7CisgICAgdm9pZCBkaXNtaXNzWm9vbUNvbnRyb2woKSB7CisgICAgICAgIG1ab29tTWFuYWdlci5kaXNtaXNzWm9vbVBpY2tlcigpOworICAgIH0KKworICAgIGZsb2F0IGdldERlZmF1bHRab29tU2NhbGUoKSB7CisgICAgICAgIHJldHVybiBtWm9vbU1hbmFnZXIuZ2V0RGVmYXVsdFNjYWxlKCk7CiAgICAgfQogCiAgICAgLyoqCi0gICAgICogR2V0cyB0aGUge0BsaW5rIFpvb21CdXR0b25zQ29udHJvbGxlcn0gd2hpY2ggY2FuIGJlIHVzZWQgdG8gYWRkCi0gICAgICogYWRkaXRpb25hbCBidXR0b25zIHRvIHRoZSB6b29tIGNvbnRyb2xzIHdpbmRvdy4KLSAgICAgKgotICAgICAqIEByZXR1cm4gVGhlIGluc3RhbmNlIG9mIHtAbGluayBab29tQnV0dG9uc0NvbnRyb2xsZXJ9IHVzZWQgYnkgdGhpcyBjbGFzcywKLSAgICAgKiAgICAgICAgIG9yIG51bGwgaWYgaXQgaXMgdW5hdmFpbGFibGUuCi0gICAgICogQGhpZGUKKyAgICAgKiBAcmV0dXJuIFRSVUUgaWYgdGhlIFdlYlZpZXcgY2FuIGJlIHpvb21lZCBpbi4KICAgICAgKi8KLSAgICBwdWJsaWMgWm9vbUJ1dHRvbnNDb250cm9sbGVyIGdldFpvb21CdXR0b25zQ29udHJvbGxlcigpIHsKLSAgICAgICAgaWYgKG1ab29tQnV0dG9uc0NvbnRyb2xsZXIgPT0gbnVsbCkgewotICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlciA9IG5ldyBab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iYgY29udGVudFRvVmlld1kodmlldy55ICsgdmlldy5oZWlnaHQpIDw9IG1TY3JvbGxZCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB2aWV3SGVpZ2h0KSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIGJvb2xlYW4gaXNQbHVnaW5GaXRPblNjcmVlbihWaWV3TWFuYWdlci5DaGlsZFZpZXcgdmlldykgeworICAgICAgICBmaW5hbCBpbnQgdmlld1dpZHRoID0gZ2V0Vmlld1dpZHRoKCk7CisgICAgICAgIGZpbmFsIGludCB2aWV3SGVpZ2h0ID0gZ2V0Vmlld0hlaWdodFdpdGhUaXRsZSgpOworICAgICAgICBmbG9hdCBzY2FsZSA9IE1hdGgubWluKChmbG9hdCkgdmlld1dpZHRoIC8gdmlldy53aWR0aCwgKGZsb2F0KSB2aWV3SGVpZ2h0IC8gdmlldy5oZWlnaHQpOworICAgICAgICBzY2FsZSA9IG1ab29tTWFuYWdlci5jb21wdXRlU2NhbGVXaXRoTGltaXRzKHNjYWxlKTsKKyAgICAgICAgcmV0dXJuICFtWm9vbU1hbmFnZXIud2lsbFNjYWxlVHJpZ2dlclpvb20oc2NhbGUpCisgICAgICAgICAgICAgICAgJiYgY29udGVudFRvVmlld1godmlldy54KSA+PSBtU2Nyb2xsWAorICAgICAgICAgICAgICAgICYmIGNvbnRlbnRUb1ZpZXdYKHZpZXcueCArIHZpZXcud2lkdGgpIDw9IG1TY3JvbGxYICsgdmlld1dpZHRoCisgICAgICAgICAgICAgICAgJiYgY29udGVudFRvVmlld1kodmlldy55KSA+PSBtU2Nyb2xsWQorICAgICAgICAgICAgICAgICYmIGNvbnRlbnRUb1ZpZXdZKHZpZXcueSArIHZpZXcuaGVpZ2h0KSA8PSBtU2Nyb2xsWSArIHZpZXdIZWlnaHQ7CiAgICAgfQogCiAgICAgLyoKQEAg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gICAgIGlmICghbVpvb21NYW5hZ2VyLndpbGxTY2FsZVRyaWdnZXJab29tKHNjYWxlKSkgewogICAgICAgICAgICAgcGluU2Nyb2xsVG8oY29udGVudFRvVmlld1goZG9jWCArIGRvY1dpZHRoIC8gMikgLSB2aWV3V2lkdGggLyAyLAogICAgICAgICAgICAgICAgICAgICBjb250ZW50VG9WaWV3WShkb2NZICsgZG9jSGVpZ2h0IC8gMikgLSB2aWV3SGVpZ2h0IC8gMiwKICAgICAgICAgICAgICAgICAgICAgdHJ1ZSwgMCk7CiAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBmbG9hdCBvbGRTY3JlZW5YID0gZG9jWCAqIG1BY3R1YWxTY2FsZSAtIG1TY3JvbGxYOworICAgICAgICAgICAgZmxvYXQgYWN0dWFsU2NhbGUgPSBtWm9vbU1hbmFnZXIuZ2V0U2NhbGUoKTsKKyAgICAgICAgICAgIGZsb2F0IG9sZFNjcmVlblggPSBkb2NYICogYWN0dWFsU2NhbGUgLSBtU2Nyb2xsWDsKICAgICAgICAgICAgIGZsb2F0IHJlY3RWaWV3WCA9IGRvY1ggKiBzY2FsZTsKICAgICAgICAgICAgIGZsb2F0IHJlY3RWaWV3V2lkdGggPSBkb2NXaWR0aCAqIHNjYWxlOwogICAgICAgICAgICAgZmxvYXQgbmV3TWF4V2lkdGggPSBtQ29udGVudFdpZHRoICogc2NhbGU7CkBAIC01OTY0LDkgKzU2OTcsOSBAQAogICAgICAgICAgICAgfSBlbHNlIGlmIChuZXdTY3JlZW5YID4gKG5ld01heFdpZHRoIC0gcmVjdFZpZXdYIC0gcmVjdFZpZXdXaWR0aCkpIHsKICAgICAgICAgICAgICAgICBuZXdTY3JlZW5YID0gdmlld1dpZHRoIC0gKG5ld01heFdpZHRoIC0gcmVjdFZpZXdYKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1ab29tQ2VudGVyWCA9IChvbGRTY3JlZW5YICogc2NhbGUgLSBuZXdTY3JlZW5YICog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mYWxzZSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICB2b2lkIGRpc21pc3Nab29tQ29udHJvbCgpIHsKLSAgICAgICAgaWYgKG1XZWJWaWV3Q29yZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAvLyBtYXliZSBjYWxsZWQgYWZ0ZXIgV2ViVmlldydzIGRlc3Ryb3koKS4gQXMgd2UgY2FuJ3QgZ2V0IHNldHRpbmdzLAotICAgICAgICAgICAgLy8ganVzdCBoaWRlIHpvb20gY29udHJvbCBmb3IgYm90aCBzdHlsZXMuCi0gICAgICAgICAgICBpZiAobVpvb21CdXR0b25zQ29udHJvbGxlciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5zZXRWaXNpYmxlKGZhbHNlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtWm9vbUNvbnRyb2xzICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtWm9vbUNvbnRyb2xzLmhpZGUoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgICAgICBXZWJTZXR0aW5ncyBzZXR0aW5ncyA9IGdldFNldHRpbmdzKCk7Ci0gICAgICAgIGlmIChzZXR0aW5ncy5nZXRCdWlsdEluWm9vbUNvbnRyb2xzKCkpIHsKLSAgICAgICAgICAgIGlmIChtWm9vbUJ1dHRvbnNDb250cm9sbGVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtWm9vbUJ1dHRvbnNDb250cm9sbGVyLnNldFZpc2libGUoZmFsc2UpOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKG1ab29tQ29udHJvbFJ1bm5hYmxlICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKL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dldFNldHRpbmdzKCk7Ci0gICAgICAgIHNldHRpbmdzLnNldERvdWJsZVRhcFRvYXN0Q291bnQoMCk7Ci0gICAgICAgIC8vIHJlbW92ZSB0aGUgem9vbSBjb250cm9sIGFmdGVyIGRvdWJsZSB0YXAKLSAgICAgICAgZGlzbWlzc1pvb21Db250cm9sKCk7Ci0gICAgICAgIFZpZXdNYW5hZ2VyLkNoaWxkVmlldyBwbHVnaW4gPSBtVmlld01hbmFnZXIuaGl0VGVzdChtQW5jaG9yWCwgbUFuY2hvclkpOwotICAgICAgICBpZiAocGx1Z2luICE9IG51bGwpIHsKLSAgICAgICAgICAgIGlmIChpc1BsdWdpbkZpdE9uU2NyZWVuKHBsdWdpbikpIHsKLSAgICAgICAgICAgICAgICBtSW5ab29tT3ZlcnZpZXcgPSB0cnVlOwotICAgICAgICAgICAgICAgIC8vIEZvcmNlIHRoZSB0aXRsZWJhciBmdWxseSByZXZlYWwgaW4gb3ZlcnZpZXcgbW9kZQotICAgICAgICAgICAgICAgIGlmIChtU2Nyb2xsWSA8IGdldFRpdGxlSGVpZ2h0KCkpIG1TY3JvbGxZID0gMDsKLSAgICAgICAgICAgICAgICB6b29tV2l0aFByZXZpZXcoKGZsb2F0KSBnZXRWaWV3V2lkdGgoKSAvIG1ab29tT3ZlcnZpZXdXaWR0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHRydWUpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtSW5ab29tT3ZlcnZpZXcgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICBjZW50ZXJGaXRSZWN0KHBsdWdpbi54LCBwbHVnaW4ueSwgcGx1Z2luLndpZHRoLCBwbHVnaW4uaGVpZ2h0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgICAgICBib29sZWFuIHpvb21Ub0RlZmF1bHQgPSBmYWxzZTsKLSAgICAgICAgaWYgKChzZXR0aW5ncy5nZ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oUHJldmlldyhuZXdTY2FsZSwgdHJ1ZSk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKE1hdGguYWJzKG1BY3R1YWxTY2FsZSAtIG1EZWZhdWx0U2NhbGUpID49IE1JTklNVU1fU0NBTEVfSU5DUkVNRU5UKSB7Ci0gICAgICAgICAgICAgICAgem9vbVRvRGVmYXVsdCA9IHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICB6b29tVG9EZWZhdWx0ID0gdHJ1ZTsKLSAgICAgICAgfQotICAgICAgICBpZiAoem9vbVRvRGVmYXVsdCkgewotICAgICAgICAgICAgbUluWm9vbU92ZXJ2aWV3ID0gZmFsc2U7Ci0gICAgICAgICAgICBpbnQgbGVmdCA9IG5hdGl2ZUdldEJsb2NrTGVmdEVkZ2UobUFuY2hvclgsIG1BbmNob3JZLCBtQWN0dWFsU2NhbGUpOwotICAgICAgICAgICAgaWYgKGxlZnQgIT0gTk9fTEVGVEVER0UpIHsKLSAgICAgICAgICAgICAgICAvLyBhZGQgYSA1cHQgcGFkZGluZyB0byB0aGUgbGVmdCBlZGdlLgotICAgICAgICAgICAgICAgIGludCB2aWV3TGVmdCA9IGNvbnRlbnRUb1ZpZXdYKGxlZnQgPCA1ID8gMCA6IChsZWZ0IC0gNSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAtIG1TY3JvbGxYOwotICAgICAgICAgICAgICAgIC8vIFJlLWNhbGN1bGF0ZSB0aGUgem9vbSBjZW50ZXIgc28gdGhhdCB0aGUgbmV3IHNjcm9sbCB4IHdpbGwgYmUKLSAgICAgICAgICAgICAgICAvLyBvbiB0aGUgbGVmdCBlZGdlLgotICAgICAgICAgICAgICAgIGlmICh2aWV3TGVmdCA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbVpvb21DZW50ZXJYID0gdmlld0xlZnQgKiBtRGVmYXVsdFNjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyAobURl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KICAgICAgICAgICAgIHJlc3VsdCA9IG1XZWJUZXh0Vmlldy5yZXF1ZXN0Rm9jdXMoZGlyZWN0aW9uLApAQCAtNjE3OSw2ICs1ODE2LDEyIEBACiAgICAgcHVibGljIGJvb2xlYW4gcmVxdWVzdENoaWxkUmVjdGFuZ2xlT25TY3JlZW4oVmlldyBjaGlsZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWN0IHJlY3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBpbW1lZGlhdGUpIHsKKyAgICAgICAgLy8gZG9uJ3Qgc2Nyb2xsIHdoaWxlIGluIHpvb20gYW5pbWF0aW9uLiBXaGVuIGl0IGlzIGRvbmUsIHdlIHdpbGwgYWRqdXN0CisgICAgICAgIC8vIHRoZSBuZWNlc3NhcnkgY29tcG9uZW50cyAoZS5nLiwgV2ViVGV4dFZpZXcgaWYgaXQgaXMgaW4gZWRpdGluZyBtb2RlKQorICAgICAgICBpZiAobVpvb21NYW5hZ2VyLmlzRml4ZWRMZW5ndGhBbmltYXRpb25JblByb2dyZXNzKCkpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCiAgICAgICAgIHJlY3Qub2Zmc2V0KGNoaWxkLmdldExlZnQoKSAtIGNoaWxkLmdldFNjcm9sbFgoKSwKICAgICAgICAgICAgICAgICBjaGlsZC5nZXRUb3AoKSAtIGNoaWxkLmdldFNjcm9sbFkoKSk7CiAKQEAgLTYzMjEsNyArNTk2NCw4IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGNhc2UgU1dJVENIX1RPX1NIT1JUUFJFU1M6IHsKICAgICAgICAgICAgICAgICAgICAgaWYgKG1Ub3VjaE1vZGUgPT0gVE9VQ0hfSU5JVF9NT0RFKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobVByZXZlbnREZWZhdWx0ICE9IFBSRVZFTlRfREVGQVVMVF9ZRVMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZ2V0U2V0dGluZ3MoKS5zdXBwb3J0VG91Y2hPbmx5KCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbVByZXZlbnREZWZhdWx0ICE9IFBSRVZFTlRfREVGQVVMVF9ZRVMpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfU0hPUlRQUkVTU19TVEFSVF9NT0RFOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVNlbGVjdGlvbigpOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKQEAgLTYzMzUsNiArNTk3OSw5IEBACiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBjYXNlIFNXSVRDSF9UT19MT05HUFJFU1M6IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuc3VwcG9ydFRvdWNoT25seSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVUb3VjaEhpZ2hsaWdodChmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgaWYgKGluRnVsbFNjcmVlbk1vZGUoKSB8fCBtRGVmZXJUb3VjaFByb2Nlc3MpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIFRvdWNoRXZlbnREYXRhIHRlZCA9IG5ldyBUb3VjaEV2ZW50RGF0YSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1BY3Rpb24gPSBXZWJWaWV3Q29yZS5BQ1RJT05fTE9OR1BSRVNTOwpAQCAtNjM0NiwxNSArNTk5MywxMCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2ltcGxpY2l0eSBmb3Igbm93LCB3ZSBkb24ndCBzZXQgaXQuCiAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubU1ldGFTdGF0ZSA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVJlcHJvY2VzcyA9IG1EZWZlclRvdWNoUHJvY2VzczsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtRGVmZXJUb3VjaFByb2Nlc3MpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZWQubVZpZXdYID0gbUxhc3RUb3VjaFg7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVkLm1WaWV3WSA9IG1MYXN0VG91Y2hZOwotICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXdDb3JlLnNlbmRNZXNzYWdlKEV2ZW50SHViLlRPVUNIX0VWRU5ULCB0ZWQpOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1QcmV2ZW50RGVmYXVsdCAhPSBQUkVWRU5UX0RFRkFVTFRfWUVTKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBtVG91Y2hNb2RlID0gVE9VQ0hfRE9ORV9NT0RFOwogICAgICAgICAgICAgICAgICAgICAgICAgcGVyZm9ybUxvbmdDbGljaygpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVidWlsZFdlYlRleHRWaWV3KCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgfQpAQCAtNjM4NywxMSArNjAyOSw5IEBACiAgICAgICAgICAgICAgICAgICAgIHNwYXduQ29udGVudFNjcm9sbFRvKG1zZy5hcmcxLCBtc2cuYXJnMik7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgVVBEQVRFX1pPT01fUkFOR0U6IHsKLSAgICAgICAgICAgICAgICAgICAgV2ViVmlld0NvcmUuUmVzdG9yZVN0YXRlIHJlc3RvcmVTdGF0ZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gKFdlYlZpZXdDb3JlLlJlc3RvcmVTdGF0ZSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgV2ViVmlld0NvcmUuVmlld1N0YXRlIHZpZXdTdGF0ZSA9IChXZWJWaWV3Q29yZS5WaWV3U3RhdGUpIG1zZy5vYmo7CiAgICAgICAgICAgICAgICAgICAgIC8vIG1TY3JvbGxYIGNvbnRhaW5zIHRoZSBuZXcgbWluUHJlZldpZHRoCi0gICAgICAgICAgICAgICAgICAgIHVwZGF0ZVpvb21SYW5nZShyZXN0b3JlU3RhdGUsIGdldFZpZXdXaWR0aCgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3RvcmVTdGF0ZS5tU2Nyb2xsWCwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBtWm9vbU1hbmFnZXIudXBkYXRlWm9vbVJhbmdlKHZpZXdTdGF0ZSwgZ2V0Vmlld1dpZHRoKCksIHZpZXdTdGF0ZS5tU2Nyb2xsWCk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBjYXNlIE5FV19QSUNUVVJFX01TR19JRDogewpAQCAtNjQwMSw1NiArNjA0MSwyNiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgbURlbGF5ZWREZWxldGVSb290TGF5ZXIgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZVNldFJvb3RMYXllcigwKTsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBXZWJTZXR0aW5ncyBzZXR0aW5ncyA9IG1XZWJWaWV3Q29yZS5nZXRTZXR0aW5ncygpOwogICAgICAgICAgICAgICAgICAgICAvLyBjYWxsZWQgZm9yIG5ldyBjb250ZW50Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIGludCB2aWV3V2lkdGggPSBnZXRWaWV3V2lkdGgoKTsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgV2ViVmlld0NvcmUuRHJhd0RhdGEgZHJhdyA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdlYlZpZXdDb3JlLkRyYXdEYXRhKSBtc2cub2JqOwotICAgICAgICAgICAgICAgICAgICBmaW5hbCBQb2ludCB2aWV3U2l6ZSA9IGRyYXcubVZpZXdQb2ludDsKLSAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiB1c2VXaWRlVmlld3BvcnQgPSBzZXR0aW5ncy5nZXRVc2VXaWRlVmlld1BvcnQoKTsKLSAgICAgICAgICAgICAgICAgICAgV2ViVmlld0NvcmUuUmVzdG9yZVN0YXRlIHJlc3RvcmVTdGF0ZSA9IGRyYXcubVJlc3RvcmVTdGF0ZTsKLSAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBoYXNSZXN0b3JlU3RhdGUgPSByZXN0b3JlU3RhdGUgIT0gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGhhc1Jlc3RvcmVTdGF0ZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlWm9vbVJhbmdlKHJlc3RvcmVTdGF0ZSwgdmlld1NpemUueCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhdy5tTWluUHJlZldpZHRoLCB0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbURyYXdIaXN0b3J5KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUluWm9vbU92ZXJ2aWV3ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsIFdlYlZpZXdDb3JlLkRyYXdEYXRhIGRyYXcgPSAoV2ViVmlld0NvcmUuRHJhd0RhdGEpIG1zZy5vYmo7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUluaXRpYWxTY2FsZUluUGVyY2VudCA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0TmV3Wm9vbVNjYWxlKG1Jbml0aWFsU2NhbGVJblBlcmNlbnQgLyAxMDAuMGYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW5pdGlhbFNjYWxlSW5QZXJjZW50ICE9IG1UZXh0V3JhcFNjYWxlICogMTAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzdG9yZVN0YXRlLm1WaWV3U2NhbGUgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UZXh0V3JhcFNjYWxlID0gcmVzdG9yZVN0YXRlLm1UZXh0V3JhcFNjYWxlOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXROZXdab29tU2NhbGUocmVzdG9yZVN0YXRlLm1WaWV3U2NhbGUsIGZhbHNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Jblpvb21PdmVydmlldyA9IHVzZVdpZGVWaWV3cG9ydAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc2V0dGluZ3MuZ2V0TG9hZFdpdGhPdmVydmlld01vZGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgc2NhbGU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtSW5ab29tT3ZlcnZpZXcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlID0gKGZsb2F0KSB2aWV3V2lkdGgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvIERFRkFVTFRfVklFV1BPUlRfV0lEVEg7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZSA9IHJlc3RvcmVTdGF0ZS5tVGV4dFdyYXBTY2FsZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXROZXdab29tU2NhbGUoc2NhbGUsIE1hdGguYWJzKHNjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1UZXh0V3JhcFNjYWxlKSA+PSBNSU5JTVVNX1NDQUxFX0lOQ1JFTUVOVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0Q29udGVudFNjcm9sbFRvKHJlc3RvcmVTdGF0ZS5tU2Nyb2xsWCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdG9yZVN0YXRlLm1TY3JvbGxZKTsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgUG9pbnQgdmlld1NpemUgPSBkcmF3Lm1WaWV3UG9pbnQ7CisgICAgICAgICAgICAgICAgICAgIFdlYlZpZXdDb3JlLlZpZXdTdGF0ZSB2aWV3U3RhdGUgPSBkcmF3Lm1WaWV3U3RhdGU7CisgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaXNQaWN0dXJlQWZ0ZXJGaXJzdExheW91dCA9IHZpZXdTdGF0ZSAhPSBudWxsOworICAgICAgICAgICAgICAgICAgICBpZiAoaXNQaWN0dXJlQWZ0ZXJGaXJzdExheW91dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVzZXQgdGhlIGxhc3Qgc2VudCBkYXRhIGhlcmUgc2luY2UgZGVhbGluZyB3aXRoIG5ldyBwYWdlLgorICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RXaWR0aFNlbnQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgbVpvb21NYW5hZ2VyLm9uRmlyc3RMYXlvdXQoZHJhdyk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1EcmF3SGlzdG9yeSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldENvbnRlbnRTY3JvbGxUbyh2aWV3U3RhdGUubVNjcm9sbFgsIHZpZXdTdGF0ZS5tU2Nyb2xsWSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQXMgd2UgYXJlIG9uIGEgbmV3IHBhZ2UsIHJlbW92ZSB0aGUgV2ViVGV4dFZpZXcuIFRoaXMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpcyBuZWNlc3NhcnkgZm9yIHBhZ2UgbG9hZHMgZHJpdmVuIGJ5IHdlYmtpdCwgYW5kIGluCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcGFydGljdWxhciB3aGVuIHRoZSB1c2VyIHdhcyBvbiBhIHBhc3N3b3JkIGZpZWxkLCBzbwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBXZWJUZXh0VmlldyB3YXMgdmlzaWJsZS4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhclRleHRFbnRyeShmYWxzZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdXBkYXRlIHRoZSB6b29tIGJ1dHRvbnMgYXMgdGhlIHNjYWxlIGNhbiBiZSBjaGFuZ2VkCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdldFNldHRpbmdzKCkuZ2V0QnVpbHRJblpvb21Db250cm9scygpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVpvb21CdXR0b25zRW5hYmxlZCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQorCiAgICAgICAgICAgICAgICAgICAgIC8vIFdlIHVwZGF0ZSB0aGUgbGF5b3V0IChpLmUuIHJlcXVlc3QgYSBsYXlvdXQgZnJvbSB0aGUKICAgICAgICAgICAgICAgICAgICAgLy8gdmlldyBzeXN0ZW0pIGlmIHRoZSBsYXN0IHZpZXcgc2l6ZSB0aGF0IHdlIHNlbnQgdG8KICAgICAgICAgICAgICAgICAgICAgLy8gV2ViQ29yZSBtYXRjaGVzIHRoZSB2aWV3IHNpemUgb2YgdGhlIHBpY3R1cmUgd2UganVzdApAQCAtNjQ1OCw0NSArNjA2OCwyNSBAQAogICAgICAgICAgICAgICAgICAgICBmaW5hbCBib29sZWFuIHVwZGF0ZUxheW91dCA9IHZpZXdTaXplLnggPT0gbUxhc3RXaWR0aFNlbnQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB2aWV3U2l6ZS55ID09IG1MYXN0SGVpZ2h0U2VudDsKICAgICAgICAgICAgICAgICAgICAgcmVjb3JkTmV3Q29udGVudFNpemUoZHJhdy5tV2lkdGhIZWlnaHQueCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Lm1XaWR0aEhlaWdodC55Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAobUZpbmRJc1VwID8gbUZpbmRIZWlnaHQgOiAwKSwgdXBkYXRlTGF5b3V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Lm1XaWR0aEhlaWdodC55LCB1cGRhdGVMYXlvdXQpOwogICAgICAgICAgICAgICAgICAgICBpZiAoRGVidWdGbGFncy5XRUJfVklFVykgewogICAgICAgICAgICAgICAgICAgICAgICAgUmVjdCBiID0gZHJhdy5tSW52YWxSZWdpb24uZ2V0Qm91bmRzKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJORVdfUElDVFVSRV9NU0dfSUQgeyIgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiLmxlZnQrIiwiK2IudG9wKyIsIitiLnJpZ2h0KyIsIitiLmJvdHRvbSsifSIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGVDb250ZW50UmVjdChkcmF3Lm1JbnZhbFJlZ2lvbi5nZXRCb3VuZHMoKSk7CisKICAgICAgICAgICAgICAgICAgICAgaWYgKG1QaWN0dXJlTGlzdGVuZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgbVBpY3R1cmVMaXN0ZW5lci5vbk5ld1BpY3R1cmUoV2ViVmlldy50aGlzLCBjYXB0dXJlUGljdHVyZSgpKTsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAodXNlV2lkZVZpZXdwb3J0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBsaW1pdCBtWm9vbU92ZXJ2aWV3V2lkdGggdXBwZXIgYm91bmQgdG8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNNYXhWaWV3cG9ydFdpZHRoIHNvIHRoYXQgaWYgdGhlIHBhZ2UgZG9lc24ndCBiZWhhdmUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlbGwsIHRoZSBXZWJWaWV3IHdvbid0IGdvIGluc2FuZS4gbGltaXQgdGhlIGxvd2VyCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBib3VuZCB0byBtYXRjaCB0aGUgZGVmYXVsdCBzY2FsZSBmb3IgbW9iaWxlIHNpdGVzLgotICAgICAgICAgICAgICAgICAgICAgICAgbVpvb21PdmVydmlld1dpZHRoID0gTWF0aC5taW4oc01heFZpZXdwb3J0V2lkdGgsIE1hdGgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm1heCgoaW50KSAodmlld1dpZHRoIC8gbURlZmF1bHRTY2FsZSksIE1hdGgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWF4KGRyYXcubU1pblByZWZXaWR0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXcubVZpZXdQb2ludC54KSkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmICghbU1pblpvb21TY2FsZUZpeGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gKGZsb2F0KSB2aWV3V2lkdGggLyBtWm9vbU92ZXJ2aWV3V2lkdGg7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKCFtRHJhd0hpc3RvcnkgJiYgbUluWm9vbU92ZXJ2aWV3KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBmaXQgdGhlIGNvbnRlbnQgd2lkdGggdG8gdGhlIGN1cnJlbnQgdmlldy4gSWdub3JlCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgcm91bmRpbmcgZXJyb3IgY2FzZS4KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNYXRoLmFicygodmlld1dpZHRoICogbUludkFjdHVhbFNjYWxlKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1ab29tT3ZlcnZpZXdXaWR0aCkgPiAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0TmV3Wm9vbVNjYWxlKChmbG9hdCkgdmlld1dpZHRoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvIG1ab29tT3ZlcnZpZXdXaWR0aCwgTWF0aC5hYnMobUFjdHVhbFNjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1UZXh0V3JhcFNjYWxlKSA8IE1JTklNVU1fU0NBTEVfSU5DUkVNRU5ULAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gdXBkYXRlIHRoZSB6b29tIGluZm9ybWF0aW9uIGJhc2VkIG9uIHRoZSBuZXcgcGljdHVyZQorICAgICAgICAgICAgICAgICAgICBtWm9vbU1hbmFnZXIub25OZXdQaWN0dXJlKGRyYXcpOworCiAgICAgICAgICAgICAgICAgICAgIGlmIChkcmF3Lm1Gb2N1c1NpemVDaGFuZ2VkICYmIGluRWRpdGluZ01vZGUoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgbUZvY3VzU2l6ZUNoYW5nZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmIChoYXNSZXN0b3JlU3RhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGlzUGljdHVyZUFmdGVyRmlyc3RMYXlvdXQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIG1WaWV3TWFuYWdlci5wb3N0UmVhZHlUb0RyYXdBbGwoKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBicmVhazsKQEAgLTY1MzAsMTQgKzYxMjAsOCBAQAogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFJFUVVFU1RfS0VZQk9BUkRfV0lUSF9TRUxFQ1RJT05fTVNHX0lEOgogICAgICAgICAgICAgICAgICAgICBkaXNwbGF5U29mdEtleWJvYXJkKHRydWUpOwotICAgICAgICAgICAgICAgICAgICB1cGRhdGVUZXh0U2VsZWN0aW9uRnJvbU1lc3NhZ2UobXNnLmFyZzEsIG1zZy5hcmcyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXZWJWaWV3Q29yZS5UZXh0U2VsZWN0aW9uRGF0YSkgbXNnLm9iaik7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2ggdG8gVVBEQVRFX1RFWFRfU0VMRUNUSU9OX01TR19JRAogICAgICAgICAgICAgICAgIGNhc2UgVVBEQVRFX1RFWFRfU0VMRUNUSU9OX01TR19JRDoKLSAgICAgICAgICAgICAgICAgICAgLy8gSWYgbm8gdGV4dGZpZWxkIHdhcyBpbiBmb2N1cywgYW5kIHRoZSB1c2VyIHRvdWNoZWQgb25lLAotICAgICAgICAgICAgICAgICAgICAvLyBjYXVzaW5nIGl0IHRvIHNlbmQgdGhpcyBtZXNzYWdlLCB0aGVuIFdlYlRleHRWaWV3IGhhcyBub3QKLSAgICAgICAgICAgICAgICAgICAgLy8gYmVlbiBzZXQgdXAgeWV0LiAgUmVidWlsZCBpdCBzbyBpdCBjYW4gc2V0IGl0cyBzZWxlY3Rpb24uCi0gICAgICAgICAgICAgICAgICAgIHJlYnVpbGRXZWJUZXh0VmlldygpOwogICAgICAgICAgICAgICAgICAgICB1cGRhdGVUZXh0U2VsZWN0aW9uRnJvbU1lc3NhZ2UobXNnLmFyZzEsIG1zZy5hcmcyLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXZWJWaWV3Q29yZS5UZXh0U2VsZWN0aW9uRGF0YSkgbXNnLm9iaik7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtNjU1NSw3ICs2MTM5LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIE1PVkVfT1VUX09GX1BMVUdJTjoKKyAgICAgICAgICAgICAgICBjYXNlIFVOSEFORExFRF9OQVZfS0VZOgogICAgICAgICAgICAgICAgICAgICBuYXZIYW5kbGVkS2V5KG1zZy5hcmcxLCAxLCBmYWxzZSwgMCk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgVVBEQVRFX1RFWFRfRU5UUllfTVNHX0lEOgpAQCAtNjY0MCwzMyArNjIyNCw0MCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QcmV2ZW50RGVmYXVsdCA9IG1zZy5hcmcyID09IDEgPyBQUkVWRU5UX0RFRkFVTFRfWUVTCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFBSRVZFTlRfREVGQVVMVF9OTzsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtUHJldmVudERlZmF1bHQgPT0gUFJFVkVOVF9ERUZBVUxUX1lFUykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2hsaWdodFJlZ2lvbi5zZXRFbXB0eSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1zZy5hcmcyID09IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHByZXZlbnQgZGVmYXVsdCBpcyBub3QgY2FsbGVkIGluIFdlYkNvcmUsIHNvIHRoZQogICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWVzc2FnZSBuZWVkcyB0byBiZSByZXByb2Nlc3NlZCBpbiBVSQogICAgICAgICAgICAgICAgICAgICAgICAgVG91Y2hFdmVudERhdGEgdGVkID0gKFRvdWNoRXZlbnREYXRhKSBtc2cub2JqOwogICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh0ZWQubUFjdGlvbikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX0RPV046Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0RGVmZXJUb3VjaFggPSB0ZWQubVZpZXdYOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdERlZmVyVG91Y2hZID0gdGVkLm1WaWV3WTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3REZWZlclRvdWNoWCA9IGNvbnRlbnRUb1ZpZXdYKHRlZC5tWCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1TY3JvbGxYOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdERlZmVyVG91Y2hZID0gY29udGVudFRvVmlld1kodGVkLm1ZKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbVNjcm9sbFk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1EZWZlclRvdWNoTW9kZSA9IFRPVUNIX0lOSVRfTU9ERTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBNb3Rpb25FdmVudC5BQ1RJT05fTU9WRTogewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBubyBzbmFwcGluZyBpbiBkZWZlciBwcm9jZXNzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB4ID0gY29udGVudFRvVmlld1godGVkLm1YKSAtIG1TY3JvbGxYOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeSA9IGNvbnRlbnRUb1ZpZXdZKHRlZC5tWSkgLSBtU2Nyb2xsWTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1EZWZlclRvdWNoTW9kZSAhPSBUT1VDSF9EUkFHX01PREUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1EZWZlclRvdWNoTW9kZSA9IFRPVUNIX0RSQUdfTU9ERTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0RGVmZXJUb3VjaFggPSB0ZWQubVZpZXdYOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3REZWZlclRvdWNoWSA9IHRlZC5tVmlld1k7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdERlZmVyVG91Y2hYID0geDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0RGVmZXJUb3VjaFkgPSB5OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnREcmFnKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRlbHRhWCA9IHBpbkxvY1goKGludCkgKG1TY3JvbGxYCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtTGFzdERlZmVyVG91Y2hYIC0gdGVkLm1WaWV3WCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtTGFzdERlZmVyVG91Y2hYIC0geCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtU2Nyb2xsWDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRlbHRhWSA9IHBpbkxvY1koKGludCkgKG1TY3JvbGxZCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtTGFzdERlZmVyVG91Y2hZIC0gdGVkLm1WaWV3WSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtTGFzdERlZmVyVG91Y2hZIC0geSkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtU2Nyb2xsWTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9EcmFnKGRlbHRhWCwgZGVsdGFZKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRlbHRhWCAhPSAwKSBtTGFzdERlZmVyVG91Y2hYID0gdGVkLm1WaWV3WDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRlbHRhWSAhPSAwKSBtTGFzdERlZmVyVG91Y2hZID0gdGVkLm1WaWV3WTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRlbHRhWCAhPSAwKSBtTGFzdERlZmVyVG91Y2hYID0geDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRlbHRhWSAhPSAwKSBtTGFzdERlZmVyVG91Y2hZID0geTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTW90aW9uRXZlbnQuQUNUSU9OX1VQOgpAQCAtNjY4MCw5ICs2MjcxLDkgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBXZWJWaWV3Q29yZS5BQ1RJT05fRE9VQkxFVEFQOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkb0RvdWJsZVRhcCgpIG5lZWRzIG1MYXN0VG91Y2hYL1kgYXMgYW5jaG9yCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1MYXN0VG91Y2hYID0gdGVkLm1WaWV3WDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RUb3VjaFkgPSB0ZWQubVZpZXdZOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb0RvdWJsZVRhcCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFRvdWNoWCA9IGNvbnRlbnRUb1ZpZXdYKHRlZC5tWCkgLSBtU2Nyb2xsWDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxhc3RUb3VjaFkgPSBjb250ZW50VG9WaWV3WSh0ZWQubVkpIC0gbVNjcm9sbFk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ab29tTWFuYWdlci5oYW5kbGVEb3VibGVUYXAobUxhc3RUb3VjaFgsIG1MYXN0VG91Y2hZKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURlZmVyVG91Y2hNb2RlID0gVE9VQ0hfRE9ORV9NT0RFOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFdlYlZpZXdDb3JlLkFDVElPTl9MT05HUFJFU1M6CkBAIC02NjkwLDcgKzYyODEsNiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGl0VGVzdCAhPSBudWxsICYmIGhpdFRlc3QubVR5cGUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhPSBIaXRUZXN0UmVzdWx0LlVOS05PV05fVFlQRSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVyZm9ybUxvbmdDbGljaygpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVidWlsZFdlYlRleHRWaWV3KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURlZmVyVG91Y2hNb2RlID0gVE9VQ0hfRE9ORV9NT0RFOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKQEAgLTY4MTQsNyArNjQwNCw2IEBACiAKICAgICAgICAgICAgICAgICBjYXNlIENFTlRFUl9GSVRfUkVDVDoKICAgICAgICAgICAgICAgICAgICAgUmVjdCByID0gKFJlY3QpbXNnLm9iajsKLSAgICAgICAgICAgICAgICAgICAgbUluWm9vbU92ZXJ2aWV3ID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgIGNlbnRlckZpdFJlY3Qoci5sZWZ0LCByLnRvcCwgci53aWR0aCgpLCByLmhlaWdodCgpKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKQEAgLTY4MjMsNiArNjQxMiwzNiBAQAogICAgICAgICAgICAgICAgICAgICBtVmVydGljYWxTY3JvbGxCYXJNb2RlID0gbXNnLmFyZzI7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCisgICAgICAgICAgICAgICAgY2FzZSBTRUxFQ1RJT05fU1RSSU5HX0NIQU5HRUQ6CisgICAgICAgICAgICAgICAgICAgIGlmIChtQWNjZXNzaWJpbGl0eUluamVjdG9yICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBzZWxlY3Rpb25TdHJpbmcgPSAoU3RyaW5nKSBtc2cub2JqOworICAgICAgICAgICAgICAgICAgICAgICAgbUFjY2Vzc2liaWxpdHlJbmplY3Rvci5vblNlbGVjdGlvblN0cmluZ0NoYW5nZShzZWxlY3Rpb25TdHJpbmcpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTRVRfVE9VQ0hfSElHSExJR0hUX1JFQ1RTOgorICAgICAgICAgICAgICAgICAgICBpbnZhbGlkYXRlKG1Ub3VjaEhpZ2hsaWdodFJlZ2lvbi5nZXRCb3VuZHMoKSk7CisgICAgICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2hsaWdodFJlZ2lvbi5zZXRFbXB0eSgpOworICAgICAgICAgICAgICAgICAgICBpZiAobXNnLm9iaiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBBcnJheUxpc3Q8UmVjdD4gcmVjdHMgPSAoQXJyYXlMaXN0PFJlY3Q+KSBtc2cub2JqOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChSZWN0IHJlY3QgOiByZWN0cykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlY3Qgdmlld1JlY3QgPSBjb250ZW50VG9WaWV3UmVjdChyZWN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzb21lIHNpdGVzLCBsaWtlIHN0b3JpZXMgaW4gbnl0aW1lcy5jb20sIHNldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1vdXNlIGV2ZW50IGhhbmRsZXIgaW4gdGhlIHRvcCBkaXYuIEl0IGlzIG5vdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVzZXIgZnJpZW5kbHkgdG8gaGlnaGxpZ2h0IHRoZSBkaXYgaWYgaXQgY292ZXJzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbW9yZSB0aGFuIGhhbGYgb2YgdGhlIHNjcmVlbi4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmlld1JlY3Qud2lkdGgoKSA8IGdldFdpZHRoKCkgPj4gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgdmlld1JlY3QuaGVpZ2h0KCkgPCBnZXRIZWlnaHQoKSA+PiAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3VjaEhpZ2hsaWdodFJlZ2lvbi51bmlvbih2aWV3UmVjdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUodmlld1JlY3QpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KExPR1RBRywgIlNraXAgdGhlIGh1Z2Ugc2VsZWN0aW9uIHJlY3Q6IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdmlld1JlY3QpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKwogICAgICAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICAgICAgIHN1cGVyLmhhbmRsZU1lc3NhZ2UobXNnKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC03MTMwLDM3ICs2NzQ5LDYgQEAKICAgICAgICAgICAgICAgICBuZXcgSW52b2tlTGlzdEJveChhcnJheSwgZW5hYmxlZEFycmF5LCBzZWxlY3RlZEFycmF5KSk7CiAgICAgfQogCi0gICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZVpvb21SYW5nZShXZWJWaWV3Q29yZS5SZXN0b3JlU3RhdGUgcmVzdG9yZVN0YXRlLAotICAgICAgICAgICAgaW50IHZpZXdXaWR0aCwgaW50IG1pblByZWZXaWR0aCwgYm9vbGVhbiB1cGRhdGVab29tT3ZlcnZpZXcpIHsKLSAgICAgICAgaWYgKHJlc3RvcmVTdGF0ZS5tTWluU2NhbGUgPT0gMCkgewotICAgICAgICAgICAgaWYgKHJlc3RvcmVTdGF0ZS5tTW9iaWxlU2l0ZSkgewotICAgICAgICAgICAgICAgIGlmIChtaW5QcmVmV2lkdGggPiBNYXRoLm1heCgwLCB2aWV3V2lkdGgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1NaW5ab29tU2NhbGUgPSAoZmxvYXQpIHZpZXdXaWR0aCAvIG1pblByZWZXaWR0aDsKLSAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZUZpeGVkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh1cGRhdGVab29tT3ZlcnZpZXcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFdlYlNldHRpbmdzIHNldHRpbmdzID0gZ2V0U2V0dGluZ3MoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Jblpvb21PdmVydmlldyA9IHNldHRpbmdzLmdldFVzZVdpZGVWaWV3UG9ydCgpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLmdldExvYWRXaXRoT3ZlcnZpZXdNb2RlKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gcmVzdG9yZVN0YXRlLm1EZWZhdWx0U2NhbGU7Ci0gICAgICAgICAgICAgICAgICA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RvIGdldCB0aGUgYWN0dWFsIGRhdGEuCi0gICAgICAgIEN1cnNvciBjdXJzb3IgPSBtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5xdWVyeSgKLSAgICAgICAgICAgICAgICB1cmksCi0gICAgICAgICAgICAgICAgbmV3IFN0cmluZ1tdIHsgT3BlbmFibGVDb2x1bW5zLkRJU1BMQVlfTkFNRSB9LAotICAgICAgICAgICAgICAgIG51bGwsCi0gICAgICAgICAgICAgICAgbnVsbCwKLSAgICAgICAgICAgICAgICBudWxsKTsKLSAgICAgICAgU3RyaW5nIG5hbWUgPSAiIjsKLSAgICAgICAgaWYgKGN1cnNvciAhPSBudWxsKSB7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIGlmIChjdXJzb3IubW92ZVRvTmV4dCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG5hbWUgPSBjdXJzb3IuZ2V0U3RyaW5nKDApOworICAgIHByaXZhdGUgU3RyaW5nIG9wZW5GaWxlQ2hvb3NlcihTdHJpbmcgYWNjZXB0VHlwZSkgeworICAgICAgICBVcmkgdXJpID0gbUNhbGxiYWNrUHJveHkub3BlbkZpbGVDaG9vc2VyKGFjY2VwdFR5cGUpOworICAgICAgICBpZiAodXJpICE9IG51bGwpIHsKKyAgICAgICAgICAgIFN0cmluZyBmaWxlUGF0aCA9ICIiOworICAgICAgICAgICAgLy8gTm90ZSAtIHF1ZXJ5aW5nIGZvciBNZWRpYVN0b3JlLkltYWdlcy5NZWRpYS5EQVRBCisgICAgICAgICAgICAvLyBzZWVtcyB0byB3b3JrIGZvciBhbGwgY29udGVudCBVUklzLCBub3QganVzdCBpbWFnZXMKKyAgICAgICAgICAgIEN1cnNvciBjdXJzb3IgPSBtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5xdWVyeSgKKyAgICAgICAgICAgICAgICAgICAgdXJpLAorICAgICAgICAgICAgICAgICAgICBuZXcgU3RyaW5nW10geyBNZWRpYVN0b3JlLkltYWdlcy5NZWRpYS5EQVRBIH0sCisgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG51bGwpOworICAgICAgICAgICAgaWYgKGN1cnNvciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnNvci5tb3ZlVG9OZXh0KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVQYXRoID0gY3Vyc29yLmdldFN0cmluZygwKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgIGN1cnNvci5jbG9zZSgpOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgY3Vyc29yLmNsb3NlKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGZpbGVQYXRoID0gdXJpLmdldExhc3RQYXRoU2VnbWVudCgpOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgU3RyaW5nIHVyaVN0cmluZyA9IHVyaS50b1N0cmluZygpOworICAgICAgICAgICAgQnJvd3NlckZyYW1lLnNKYXZhQnJpZGdlLnN0b3JlRmlsZVBhdGhGb3JDb250ZW50VXJpKGZpbGVQYXRoLCB1cmlTdHJpbmcpOworICAgICAgICAgICAgcmV0dXJuIHVyaVN0cmluZzsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gdXJpLnRvU3RyaW5nKCkgKyAiLyIgKyBuYW1lOworICAgICAgICByZXR1cm4gIiI7CiAgICAgfQogCiAgICAgLyoqCkBAIC00MjQsNiArNDI0LDEzIEBACiAgICAgICAgIHJldHVybiBtQ2FsbGJhY2tQcm94eS5vbkpzVGltZW91dCgpOwogICAgIH0KIAorICAgIC8qKgorICAgICAqIE5vdGlmeSB0aGUgd2VidmlldyB0aGF0IHRoaXMgaXMgYW4gaW5zdGFsbGFibGUgd2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IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlU2V0U2VsZWN0aW9uKG1zZy5hcmcxLCBtc2cuYXJnMik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTU9ESUZZX1NFTEVDVElPTjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNb2RpZnlTZWxlY3Rpb25EYXRhIG1vZGlmeVNlbGVjdGlvbkRhdGEgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTW9kaWZ5U2VsZWN0aW9uRGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgc2VsZWN0aW9uU3RyaW5nID0gbmF0aXZlTW9kaWZ5U2VsZWN0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kaWZ5U2VsZWN0aW9uRGF0YS5tQWx0ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RpZnlTZWxlY3Rpb25EYXRhLm1EaXJlY3Rpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RpZnlTZWxlY3Rpb25EYXRhLm1HcmFudWxhcml0eSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2ViVmlldy5tUHJpdmF0ZUhhbmRsZXIub2J0YWluTWVzc2FnZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuU0VMRUNUSU9OX1NUUklOR19DSEFOR0VELCBzZWxlY3Rpb25TdHJpbmcpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTElTVEJPWF9DSE9JQ0VTOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNwYXJzZUJvb2xlYW5BcnJheSBjaG9pY2VzID0gKFNwYXJzZUJvb2xlYW5BcnJheSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZy5vYmo7CkBAIC0xMzU3LDYgKzE0MDIsMjEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCcm93c2VyRnJhbWUuc0phdmFCcmlkZ2UucmVtb3ZlUGFja2FnZU5hbWUoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoU3RyaW5nKSBtc2cub2JqKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBHRVRfVE9VQ0hfSElHSExJR0hUX1JFQ1RTOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRvdWNoSGlnaGxpZ2h0RGF0YSBkID0gKFRvdWNoSGlnaGxpZ2h0RGF0YSkgbXNnLm9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBcnJheUxpc3Q8UmVjdD4gcmVjdHMgPSBuYXRpdmVHZXRUb3VjaEhpZ2hsaWdodFJlY3RzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZC5tWCwgZC5tWSwgZC5tU2xvcCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLm9idGFpbk1lc3NhZ2UoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlNFVF9UT1VDSF9ISUdITElHSFRfUkVDVFMsIHJlY3RzKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNlbmRUb1RhcmdldCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFJFTU9WRV9UT1VDSF9ISUdITElHSFRfUkVDVFM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLm9idGFpbk1lc3NhZ2UoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXZWJWaWV3LlNFVF9UT1VDSF9ISUdITElHSFRfUkVDVFMsIG51bGwpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2VuZFRvVGFyZ2V0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9OwpAQCAtMTU3NSwxMSArMTYzNSwxMiBAQAogICAgICAgICAgICAgaWYgKGtleUNvZGUgPj0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1VQCiAgICAgICAgICAgICAgICAgICAgICYmIGtleUNvZGUgPD0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1JJR0hUKSB7CiAgICAgICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVdfQ09SRSkgewotICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJrZXk6IGFycm93IHVudXNlZCBieSBwbHVnaW46ICIgKyBrZXlDb2RlKTsKKyAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAia2V5OiBhcnJvdyB1bnVzZWQgYnkgcGFnZTogIiArIGtleUNvZGUpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAobVdlYlZpZXcgIT0gbnVsbCAmJiBldnQuaXNEb3duKCkpIHsKICAgICAgICAgICAgICAgICAgICAgTWVzc2FnZS5vYnRhaW4obVdlYlZpZXcubVByaXZhdGVIYW5kbGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdlYlZpZXcuTU9WRV9PVVRfT0ZfUExVR0lOLCBrZXlDb2RlKS5zZW5kVG9UYXJnZXQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB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ICAgIGludCBtTWluUHJlZldpZHRoOwotICAgICAgICBSZXN0b3JlU3RhdGUgbVJlc3RvcmVTdGF0ZTsgLy8gb25seSBub24tbnVsbCBpZiBpdCBpcyBmb3IgdGhlIGZpcnN0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBwaWN0dXJlIHNldCBhZnRlciB0aGUgZmlyc3QgbGF5b3V0CisgICAgICAgIC8vIG9ubHkgbm9uLW51bGwgaWYgaXQgaXMgZm9yIHRoZSBmaXJzdCBwaWN0dXJlIHNldCBhZnRlciB0aGUgZmlyc3QgbGF5b3V0CisgICAgICAgIFZpZXdTdGF0ZSBtVmlld1N0YXRlOwogICAgICAgICBib29sZWFuIG1Gb2N1c1NpemVDaGFuZ2VkOwogICAgIH0KIApAQCAtMTczNCw5ICsxNzk1LDkgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1WaWV3cG9ydFdpZHRoKSwKICAgICAgICAgICAgICAgICAgICAgICAgIG5hdGl2ZUdldENvbnRlbnRNaW5QcmVmV2lkdGgoKSk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobVJlc3RvcmVTdGF0ZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgZHJhdy5tUmVzdG9yZVN0YXRlID0gbVJlc3RvcmVTdGF0ZTsKLSAgICAgICAgICAgICAgICBtUmVzdG9yZVN0YXRlID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChtSW5pdGlhbFZpZXdTdGF0ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZHJhdy5tVmlld1N0YXRlID0gbUluaXRpYWxWaWV3U3RhdGU7CisgICAgICAgICAgICAgICAgbUluaXRpYWxWaWV3U3RhdGUgPSBudWxsOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVdfQ09SRSkgTG9nLnYoTE9HVEFHLCAid2Via2l0RHJhdyBORVdfU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ICAgICAgICAgIG1Jbml0aWFsVmlld1N0YXRlLm1UZXh0V3JhcFNjYWxlID0gYWRqdXN0OwogICAgICAgICAgICAgICAgIC8vIDAgd2lsbCB0cmlnZ2VyIFdlYlZpZXcgdG8gdHVybiBvbiB6b29tIG92ZXJ2aWV3IG1vZGUKLSAgICAgICAgICAgICAgICBtUmVzdG9yZVN0YXRlLm1WaWV3U2NhbGUgPSAwOworICAgICAgICAgICAgICAgIG1Jbml0aWFsVmlld1N0YXRlLm1WaWV3U2NhbGUgPSAwOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTIxNzcsMTUgKzIyNTEsMTUgQEAKICAgICAgICAgICAgICAgICAvLyBtVmlld1NjYWxlIGFzIDAgbWVhbnMgaXQgaXMgaW4gem9vbSBvdmVydmlldyBtb2RlLiBTbyB3ZSBkb24ndAogICAgICAgICAgICAgICAgIC8vIGtub3cgdGhlIGV4YWN0IHNjYWxlLiBJZiBtUmVzdG9yZWRTY2FsZSBpcyBub24temVybywgdXNlIGl0OwogICAgICAgICAgICAgICAgIC8vIG90aGVyd2lzZSBqdXN0IHVzZSBtVGV4dFdyYXBTY2FsZSBhcyB0aGUgaW5pdGlhbCBzY2FsZS4KLSAgICAgICAgICAgICAgICBkYXRhLm1TY2FsZSA9IG1SZXN0b3JlU3RhdGUubVZpZXdTY2FsZSA9PSAwCisgICAgICAgICAgICAgICAgZGF0YS5tU2NhbGUgPSBtSW5pdGlhbFZpZXdTdGF0ZS5tVmlld1NjYWxlID09IDAKICAgICAgICAgICAgICAgICAgICAgICAgID8gKG1SZXN0b3JlZFNjYWxlID4gMCA/IG1SZXN0b3JlZFNjYWxlIC8gMTAwLjBmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogbVJlc3RvcmVTdGF0ZS5tVGV4dFdyYXBTY2FsZSkKLSAgICAgICAgICAgICAgICAgICAgICAgIDogbVJlc3RvcmVTdGF0ZS5tVmlld1NjYWxlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1Jbml0aWFsVmlld1N0YXRlLm1UZXh0V3JhcFNjYWxlKQorICAgICAgICAgICAgICAgICAgICAgICAgOiBtSW5pdGlhbFZpZXdTdGF0ZS5tVmlld1NjYWxlOwogICAgICAgICAgICAgICAgIGlmIChEZWJ1Z0ZsYWdzLldFQl9WSUVXX0NPUkUpIHsKICAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAic2V0dXBWaWV3cG9ydCIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG1SZXN0b3JlZFNjYWxlPSIgKyBtUmVzdG9yZWRTY2FsZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgbVZpZXdTY2FsZT0iICsgbVJlc3RvcmVTdGF0ZS5tVmlld1NjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBtVGV4dFdyYXBTY2FsZT0iICsgbVJlc3RvcmVTdGF0ZS5tVGV4dFdyYXBTY2FsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgbVZpZXdTY2FsZT0iICsgbUluaXRpYWxWaWV3U3RhdGUubVZpZXdTY2FsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgbVRleHRXcmFwU2NhbGU9IiArIG1Jbml0aWFsVmlld1N0YXRlLm1UZXh0V3JhcFNjYWxlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGRhdGEubVdpZHRoID0gTWF0aC5yb3VuZCh3ZWJWaWV3V2lkdGggLyBkYXRhLm1TY2FsZSk7CkBAIC0yMTk4LDcgKzIyNzIsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgTWF0aC5yb3VuZChtV2ViVmlldy5nZXRWaWV3SGVpZ2h0KCkgLyBkYXRhLm1TY2FsZSkKICAgICAgICAgICAgICAgICAgICAgICAgIDogbUN1cnJlbnRWaWV3SGVpZ2h0ICogZGF0YS5tV2lkdGggLyB2aWV3cG9ydFdpZHRoOwogICAgICAgICAgICAgICAgIGRhdGEubVRleHRXcmFwV2lkdGggPSBNYXRoLnJvdW5kKHdlYlZpZXdXaWR0aAotICAgICAgICAgICAgICAgICAgICAgICAgLyBtUmVzdG9yZVN0YXRlLm1UZXh0V3JhcFNjYWxlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8gbUluaXRpYWxWaWV3U3RhdGUubVRleHRXcmFwU2NhbGUpOwogICAgICAgICAgICAgICAgIGRhdGEubUlnbm9yZUhlaWdodCA9IGZhbHNlOwogICAgICAgICAgICAgICAgIGRhdGEubUFuY2hvclggPSBkYXRhLm1BbmNob3JZID0gMDsKICAgICAgICAgICAgICAgICAvLyBzZW5kIFZJRVdfU0laRV9DSEFOR0VEIHRvIHRoZSBmcm9udCBvZiB0aGUgcXVldWUgc28gdGhhdCB3ZQpAQCAtMjIxMSwyMCArMjI4NSwxMiBAQAogICAgIH0KIAogICAgIC8vIGNhbGxlZCBieSBKTkkKLSAgICBwcml2YXRlIHZvaWQgcmVzdG9yZVNjYWxlKGludCBzY2FsZSkgeworICAgIHByaXZhdGUgdm9pZCByZXN0b3JlU2NhbGUoaW50IHNjYWxlLCBpbnQgdGV4dFdyYXBTY2FsZSkgewogICAgICAgICBpZiAobUJyb3dzZXJGcmFtZS5maXJzdExheW91dERvbmUoKSA9PSBmYWxzZSkgewogICAgICAgICAgICAgbVJlc3RvcmVkU2NhbGUgPSBzY2FsZTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8vIGNhbGxlZCBieSBKTkkKLSAgICBwcml2YXRlIHZvaWQgcmVzdG9yZVNjcmVlbldpZHRoU2NhbGUoaW50IHNjYWxlKSB7Ci0gICAgICAgIGlmICghbVNldHRpbmdzLmdldFVzZVdpZGVWaWV3UG9ydCgpKSB7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobUJyb3dzZXJGcmFtZS5maXJzdExheW91dERvbmU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Fja2dyb3VuZCB0aHJlYWQgY29tcGxldGVzLgorICAgIHByaXZhdGUgYm9vbGVhbiBtSW5pdGlhbGl6ZWQgPSBmYWxzZTsKKworICAgIHByaXZhdGUgV2ViVmlld0RhdGFiYXNlKGZpbmFsIENvbnRleHQgY29udGV4dCkgeworICAgICAgICBuZXcgVGhyZWFkKCkgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgaW5pdChjb250ZXh0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfS5zdGFydCgpOworCiAgICAgICAgIC8vIFNpbmdsZXRvbiBvbmx5LCB1c2UgZ2V0SW5zdGFuY2UoKQogICAgIH0KIAogICAgIHB1YmxpYyBzdGF0aWMgc3luY2hyb25pemVkIFdlYlZpZXdEYXRhYmFzZSBnZXRJbnN0YW5jZShDb250ZXh0IGNvbnRleHQpIHsKICAgICAgICAgaWYgKG1JbnN0YW5jZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICBtSW5zdGFuY2UgPSBuZXcgV2ViVmlld0RhdGFiYXNlKCk7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIG1EYXRhYmFzZSA9IGNvbnRleHQKLSAgICAgICAgICAgICAgICAgICAgICAgIC5vcGVuT3JDcmVhdGVEYXRhYmFzZShEQVRBQkFTRV9GSUxFLCAwLCBudWxsKTsKLSAgICAgICAgICAgIH0gY2F0Y2ggKFNRTGl0ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgLy8gdHJ5IGFnYWluIGJ5IGRlbGV0aW5nIHRoZSBvbGQgZGIgYW5kIGNyZWF0ZSBhIG5ldyBvbmUKLSAgICAgICAgICAgICAgICBpZiAoY29udGV4dC5kZWxldGVEYXRhYmFzZShEQVRBQkFTRV9GSUxFKSkgewotICAgICAgICAgICAgICAgICAgICBtRGF0YWJhc2UgPSBjb250ZXh0Lm9wZW5PckNyZWF0ZURhdGFiYXNlKERBVEFCQVNFX0ZJTEUsIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQorICAgICAgICAgICAgbUluc3RhbmNlID0gbmV3IFdlYlZpZXdEYXRhYmFzZShjb250ZXh0KTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbUluc3RhbmNlOworICAgIH0KIAotICAgICAgICAgICAgLy8gbURhdGFiYXNlIHNob3VsZCBub3QgYmUgbnVsbCwgCi0gICAgICAgICAgICAvLyB0aGUgb25seSBjYXNlIGlzIFJlcXVlc3RBUEkgdGVzdCBoYXMgcHJvYmxlbSB0byBjcmVhdGUgZGIgCi0gICAgICAgICAgICBpZiAobURhdGFiYXNlICE9IG51bGwgJiYgbURhdGFiYXNlLmdldFZlcnNpb24oKSAhPSBEQVRBQkFTRV9WRVJTSU9OKSB7Ci0gICAgICAgICAgICAgICAgbURhdGFiYXNlLmJlZ2luVHJhbnNhY3Rpb24oKTsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICB1cGdyYWRlRGF0YWJhc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgbURhdGFiYXNlLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOwotICAgICAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5lbmRUcmFuc2FjdGlvbigpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KKyAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIGluaXQoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGlmIChtSW5pdGlhbGl6ZWQpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQogCi0gICAgICAgICAgICBpZiAobURhdGFiYXNlICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAvLyB1c2UgcGVyIHRh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dWVzdEFQSSB0ZXN0IGhhcyBwcm9ibGVtIHRvIGNyZWF0ZSBkYgorICAgICAgICBpZiAobURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgICAgIG1Jbml0aWFsaXplZCA9IHRydWU7CisgICAgICAgICAgICBub3RpZnkoKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtRGF0YWJhc2UuZ2V0VmVyc2lvbigpICE9IERBVEFCQVNFX1ZFUlNJT04pIHsKKyAgICAgICAgICAgIG1EYXRhYmFzZS5iZWdpblRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHVwZ3JhZGVEYXRhYmFzZSgpOworICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5zZXRUcmFuc2FjdGlvblN1Y2Nlc3NmdWwoKTsKKyAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgbURhdGFiYXNlLmVuZFRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyB1c2UgcGVyIHRhYmxlIE11dGV4IGxvY2ssIHR1cm4gb2ZmIGRhdGFiYXNlIGxvY2ssIHRoaXMKKyAgICAgICAgLy8gaW1wcm92ZXMgcGVyZm9ybWFuY2UgYXMgZGF0YWJhc2UncyBSZWVudHJhbnRMb2NrIGlzCisgICAgICAgIC8vIGV4cGFuc2l2ZQorICAgICAgICBtRGF0YWJhc2Uuc2V0TG9ja2luZ0VuYWJsZWQoZmFsc2UpOworCisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtQ2FjaGVEYXRhYmFzZSA9IGNvbnRleHQub3Blbk9yQ3JlYXRlRGF0YWJhc2UoCisgICAgICAgICAgICAgICAgICAgIENBQ0hFX0RBVEFCQVNFX0ZJTEUsIDAsIG51bGwpOworICAgICAgICB9IGNhdGNoIChTUUxpdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgLy8gdHJ5IGFnYWluIGJ5IGRlbGV0aW5nIHRoZSBvbGQgZGIgYW5kIGNyZWF0ZSBhIG5ldyBvbmUKKyAgICAgICAgICAgIGlmIChjb250ZXh0LmRlbGV0ZURhdGFiYXNlKENBQ0hFX0RBVEFCQVNFX0ZJTEUpKSB7CisgICAgICAgICAgICAgICAgbUNhY2hlRGF0YWJhc2UgPSBjb250ZXh0Lm9wZW5PckNyZWF0ZURhdGFiYXNlKAorICAgICAgICAgICAgICAgICAgICAgICAgQ0FDSEVfREFUQUJBU0VfRklMRSwgMCwgbnVsbCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBtQ2FjaGVEYXRhYmFzZSBzaG91bGQgbm90IGJlIG51bGwsCisgICAgICAgIC8vIHRoZSBvbmx5IGNhc2UgaXMgUmVxdWVzdEFQSSB0ZXN0IGhhcyBwcm9ibGVtIHRvIGNyZWF0ZSBkYgorICAgICAgICBpZiAobUNhY2hlRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICAgICAgbUluaXRpYWxpemVkID0gdHJ1ZTsKKyAgICAgICAgICAgIG5vdGlmeSgpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG1DYWNoZURhdGFiYXNlLmdldFZlcnNpb24oKSAhPSBDQUNIRV9EQVRBQkFTRV9WRVJTSU9OKSB7CisgICAgICAgICAgICBtQ2FjaGVEYXRhYmFzZS5iZWdpblRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHVwZ3JhZGVDYWNoZURhdGFiYXNlKCk7CisgICAgICAgICAgICAgICAgYm9vdHN0cmFwQ2FjaGVEYXRhYmFzZSgpOworICAgICAgICAgICAgICAgIG1DYWNoZURhdGFiYXNlLnNldFRyYW5zYWN0aW9uU3VjY2Vzc2Z1bCgpOworICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICBtQ2FjaGVEYXRhYmF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ICAgICAgICAgICAgICAgICAgIC5nZXRDb2x1bW5JbmRleChDQUNIRV9VUkxfQ09MKTsKKyAgICAgICAgbUNhY2hlRmlsZVBhdGhDb2xJbmRleCA9IG1DYWNoZUluc2VydGVyCisgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX0ZJTEVfUEFUSF9DT0wpOworICAgICAgICBtQ2FjaGVMYXN0TW9kaWZ5Q29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgorICAgICAgICAgICAgICAgIC5nZXRDb2x1bW5JbmRleChDQUNIRV9MQVNUX01PRElGWV9DT0wpOworICAgICAgICBtQ2FjaGVFVGFnQ29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgorICAgICAgICAgICAgICAgIC5nZXRDb2x1bW5JbmRleChDQUNIRV9FVEFHX0NPTCk7CisgICAgICAgIG1DYWNoZUV4cGlyZXNDb2xJbmRleCA9IG1DYWNoZUluc2VydGVyCisgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX0VYUElSRVNfQ09MKTsKKyAgICAgICAgbUNhY2hlRXhwaXJlc1N0cmluZ0NvbEluZGV4ID0gbUNhY2hlSW5zZXJ0ZXIKKyAgICAgICAgICAgICAgICAuZ2V0Q29sdW1uSW5kZXgoQ0FDSEVfRVhQSVJFU19TVFJJTkdfQ09MKTsKKyAgICAgICAgbUNhY2hlTWltZVR5cGVDb2xJbmRleCA9IG1DYWNoZUluc2VydGVyCisgICAgICAgICAgICAgICAgLmdldENvbHVtbkluZGV4KENBQ0hFX01JTUVUWVBFX0NPTCk7CisgICAgICAgIG1DYWNoZUVuY29kaW5nQ29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgorICAgICAgICAgICAgICAgIC5nZXRDb2x1bW5JbmRleChDQUNIRV9FTkNPRElOR19DT0wpOworICAgICAgICBtQ2FjaGVIdHRwU3RhdHVzQ29sSW5kZXggPSBtQ2FjaGVJbnNlcnRlcgorICAgICAgICAgICAgICAgIC5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HJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIHdoaWxlICghbUluaXRpYWxpemVkKSB7CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgd2FpdCgpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HVEFHLCAiQ2F1Z2h0IGV4Y2VwdGlvbiB3aGlsZSBjaGVja2luZyAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaW5pdGlhbGl6YXRpb24iKTsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HVEFHLCBMb2cuZ2V0U3RhY2tUcmFjZVN0cmluZyhlKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBtRGF0YWJhc2UgIT0gbnVsbDsKKyAgICB9CisKICAgICBwcml2YXRlIGJvb2xlYW4gaGFzRW50cmllcyhpbnQgdGFibGVJZCkgewotICAgICAgICBpZiAobURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKCFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogCkBAIC00MjIsNyArNDY3LDcgQEAKICAgICAgKi8KICAgICBBcnJheUxpc3Q8Q29va2llPiBnZXRDb29raWVzRm9yRG9tYWluKFN0cmluZyBkb21haW4pIHsKICAgICAgICAgQXJyYXlMaXN0PENvb2tpZT4gbGlzdCA9IG5ldyBBcnJheUxpc3Q8Q29va2llPigpOwotICAgICAgICBpZiAoZG9tYWluID09IG51bGwgfHwgbURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKGRvbWFpbiA9PSBudWxsIHx8ICFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybiBsaXN0OwogICAgICAgICB9CiAKQEAgLTQ4MSw3ICs1MjYsNyBAQAogICAgICAqICAgICAgICAgICAgZGVsZXRlZC4KICAgICAgKi8KICAgICB2b2lkIGRlbGV0ZUNvb2tpZXMoU3RyaW5nIGRvbWFpbiwgU3RyaW5nIHBhdGgsIFN0cmluZyBuYW1lKSB7Ci0gICAgICAgIGlmIChkb21haW4gPT0gbnVsbCB8fCBtRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAoZG9tYWluID09IG51bGwgfHwgIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAKQEAgLTUwMSw3ICs1NDYsNyBAQAogICAgICAqLwogICAgIHZvaWQgYWRkQ29va2llKENvb2tpZSBjb29raWUpIHsKICAgICAgICAgaWYgKGNvb2tpZS5kb21haW4gPT0gbnVsbCB8fCBjb29raWUucGF0aCA9PSBudWxsIHx8IGNvb2tpZS5uYW1lID09IG51bGwKLSAgICAgICAgICAgICAgICB8fCBtRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHx8ICFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCkBAIC01MzQsNyArNTc5LDcgQEAKICAgICAgKiBDbGVhciBjb29raWUgZGF0YWJhc2UKICAgICAgKi8KICAgICB2b2lkIGNsZWFyQ29va2llcygpIHsKLSAgICAgICAgaWYgKG1EYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgIGlmICghY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KIApAQCAtNTQ3LDcgKzU5Miw3IEBACiAgICAgICogQ2xlYXIgc2Vzc2lvbiBjb29raWVzLCB3aGljaCBtZWFucyBjb29raWUgZG9lc24ndCBoYXZlIEVYUElSRVMuCiAgICAgICovCiAgICAgdm9pZCBjbGVhclNlc3Npb25Db29raWVzKCkgewotICAgICAgICBpZiAobURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKCFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCkBAIC01NjQsNyArNjA5LDcgQEAKICAgICAgKiBAcGFyYW0gbm93IFRpbWUgZm9yIG5vdwogICAgICAqLwogICAgIHZvaWQgY2xlYXJFeHBpcmVkQ29va2llcyhsb25nIG5vdykgewotICAgICAgICBpZiAobURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKCFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCkBAIC02MjAsNyArNjY1LDcgQEAKICAgICAgKiBAcmV0dXJuIENhY2hlUmVzdWx0IFRoZSBDYWNoZU1hbmFnZXIuQ2FjaGVSZXN1bHQKICAgICAgKi8KICAgICBDYWNoZVJlc3VsdCBnZXRDYWNoZShTdHJpbmcgdXJsKSB7Ci0gICAgICAgIGlmICh1cmwgPT0gbnVsbCB8fCBtQ2FjaGVEYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgIGlmICh1cmwgPT0gbnVsbCB8fCAhY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgfQogCkBAIC02NjAsNyArNzA1LDcgQEAKICAgICAgKiBAcGFyYW0gdXJsIFRoZSB1cmwKICAgICAgKi8KICAgICB2b2lkIHJlbW92ZUNhY2hlKFN0cmluZyB1cmwpIHsKLSAgICAgICAgaWYgKHVybCA9PSBudWxsIHx8IG1DYWNoZURhdGFiYXNlID09IG51bGwpIHsKKyAgICAgICAgaWYgKHVybCA9PSBudWxsIHx8ICFjaGVja0luaXRpYWxpemVkKCkpIHsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCkBAIC02NzQsNyArNzE5LDcgQEAKICAgICAgKiBAcGFyYW0gYyBUaGUgQ2FjaGVNYW5hZ2VyLkNhY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KICAgICAgICAgfQogCkBAIC04NTMsNyArODk4LDcgQEAKICAgICAgKiAgICAgICAgIFN0cmluZ1sxXSBpcyBwYXNzd29yZC4gUmV0dXJuIG51bGwgaWYgaXQgY2FuJ3QgZmluZCBhbnl0aGluZy4KICAgICAgKi8KICAgICBTdHJpbmdbXSBnZXRVc2VybmFtZVBhc3N3b3JkKFN0cmluZyBzY2hlbWVQbHVzSG9zdCkgewotICAgICAgICBpZiAoc2NoZW1lUGx1c0hvc3QgPT0gbnVsbCB8fCBtRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAoc2NoZW1lUGx1c0hvc3QgPT0gbnVsbCB8fCAhY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgfQogCkBAIC04OTksNyArOTQ0LDcgQEAKICAgICAgKiBDbGVhciBwYXNzd29yZCBkYXRhYmFzZQogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIGNsZWFyVXNlcm5hbWVQYXNzd29yZCgpIHsKLSAgICAgICAgaWYgKG1EYXRhYmFzZSA9PSBudWxsKSB7CisgICAgICAgIGlmICghY2hlY2tJbml0aWFsaXplZCgpKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KIApAQCAtOTI0LDcgKzk2OSw3IEBACiAgICAgICovCiAgICAgdm9pZCBzZXRIdHRwQXV0aFVzZXJuYW1lUGFzc3dvcmQoU3RyaW5nIGhvc3QsIFN0cmluZyByZWFsbSwgU3RyaW5nIHVzZXJuYW1lLAogICAgICAgICAgICAgU3RyaW5nIHBhc3N3b3JkKSB7Ci0gICAgICAgIGlmIChob3N0ID09IG51bGwgfHwgcmVhbG0gPT0gbnVsbCB8fCBtRGF0YWJhc2UgPT0gbnVsbCkgeworICAgICAgICBpZiAoaG9zdCA9PSBudWxsIHx8IHJlYWxtID09IG51bGwgfHwgIWNoZWNrSW5pdGlhbGl6ZWQoKSkgewogICAgICAgICAgICAgcmV0dX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RzIFpvb21Db250cm9sQmFzZSB7CisKKyAgICBwcml2YXRlIGZpbmFsIFpvb21NYW5hZ2VyIG1ab29tTWFuYWdlcjsKKyAgICBwcml2YXRlIGZpbmFsIFdlYlZpZXcgbVdlYlZpZXc7CisKKyAgICAvLyBUaGUgY29udHJvbGxlciBpcyBsYXppbHkgaW5pdGlhbGl6ZWQgaW4gZ2V0Q29udHJvbHMoKSBmb3IgcGVyZm9ybWFuY2UuCisgICAgcHJpdmF0ZSBab29tQnV0dG9uc0NvbnRyb2xsZXIgbVpvb21CdXR0b25zQ29udHJvbGxlcjsKKworICAgIHB1YmxpYyBab29tQ29udHJvbEVtYmVkZGVkKFpvb21NYW5hZ2VyIHpvb21NYW5hZ2VyLCBXZWJWaWV3IHdlYlZpZXcpIHsKKyAgICAgICAgbVpvb21NYW5hZ2VyID0gem9vbU1hbmFnZXI7CisgICAgICAgIG1XZWJWaWV3ID0gd2ViVmlldzsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzaG93KCkgeworICAgICAgICBpZiAoIWdldENvbnRyb2xzKCkuaXNWaXNpYmxlKCkgJiYgIW1ab29tTWFuYWdlci5pc1pvb21TY2FsZUZpeGVkKCkpIHsKKworICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5zZXRWaXNpYmxlKHRydWUpOworCisgICAgICAgICAgICBXZWJTZXR0aW5ncyBzZXR0aW5ncyA9IG1XZWJWaWV3LmdldFNldHRpbmdzKCk7CisgICAgICAgICAgICBpbnQgY291bnQgPSBzZXR0aW5ncy5nZXREb3VibGVUYXBUb2FzdENvdW50KCk7CisgICAgICAgICAgICBpZiAobVpvb21NYW5hZ2VyLmlzSW5ab29tT3ZlcnZpZXcoKSAmJiBjb3VudCA+IDApIHsKKyAgICAgICAgICAgICAgICBzZXR0aW5ncy5zZXREb3VibGVUYXBUb2FzdENvdW50KC0tY291bnQpOworICAgICAgICAgICAgICAgIFRvYXN0Lm1ha2VUZXh0KG1XZWJWaWV3LmdldENvbnRleHQoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3RyaW5nLmRvdWJsZV90YXBfdG9hc3QsCisgICAgICAgICAgICAgICAgICAgICAgICBUb2FzdC5MRU5HVEhfTE9ORykuc2hvdygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgaGlkZSgpIHsKKyAgICAgICAgaWYgKG1ab29tQnV0dG9uc0NvbnRyb2xsZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5zZXRWaXNpYmxlKGZhbHNlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzVmlzaWJsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1ab29tQnV0dG9uc0NvbnRyb2xsZXIgIT0gbnVsbCAmJiBtWm9vbUJ1dHRvbnNDb250cm9sbGVyLmlzVmlzaWJsZSgpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHVwZGF0ZSgpIHsKKyAgICAgICAgaWYgKG1ab29tQnV0dG9uc0NvbnRyb2xsZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgYm9vbGVhbiBjYW5ab29tSW4gPSBtWm9vbU1hbmFnZXIuY2FuWm9vbUluKCk7CisgICAgICAgIGJvb2xlYW4gY2FuWm9vbU91dCA9IG1ab29tTWFuYWdlci5jYW5ab29tT3V0KCkgJiYgIW1ab29tTWFuYWdlci5pc0luWm9vbU92ZXJ2aWV3KCk7CisgICAgICAgIGlmICghY2FuWm9vbUluICYmICFjYW5ab29tT3V0KSB7CisgICAgICAgICAgICAvLyBIaWRlIHRoZSB6b29tIGluIGFuZCBvdXQgYnV0dG9ucyBpZiB0aGUgcGFnZSBjYW5ub3Qgem9vbQorICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5nZXRab29tQ29udHJvbHMoKS5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyBTZXQgZWFjaCBvbmUgaW5kaXZpZHVhbGx5LCBhcyBhIHBhZ2UgbWF5IGJlIGFibGUgdG8gem9vbSBpbiBvciBvdXQKKyAgICAgICAgICAgIG1ab29tQnV0dG9uc0NvbnRyb2xsZXIuc2V0Wm9vbUluRW5hYmxlZChjYW5ab29tSW4pOworICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5zZXRab29tT3V0RW5hYmxlZChjYW5ab29tT3V0KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgWm9vbUJ1dHRvbnNDb250cm9sbGVyIGdldENvbnRyb2xzKCkgeworICAgICAgICBpZiAobVpvb21CdXR0b25zQ29udHJvbGxlciA9PSBudWxsKSB7CisgICAgICAgICAgICBtWm9vbUJ1dHRvbnNDb250cm9sbGVyID0gbmV3IFpvb21CdXR0b25zQ29udHJvbGxlcihtV2ViVmlldyk7CisgICAgICAgICAgICBtWm9vbUJ1dHRvbnNDb250cm9sbGVyLnNldE9uWm9vbUxpc3RlbmVyKG5ldyBab29tTGlzdGVuZXIoKSk7CisgICAgICAgICAgICAvLyBab29tQnV0dG9uc0NvbnRyb2xsZXIgcG9zaXRpb25zIHRoZSBidXR0b25zIGF0IHRoZSBib3R0b20sIGJ1dCBpbgorICAgICAgICAgICAgLy8gdGhlIG1pZGRsZS4gQ2hhbmdlIHRoZWlyIGxheW91dCBwYXJhbWV0ZXJzIHNvIHRoZXkgYXBwZWFyIG9uIHRoZQorICAgICAgICAgICAgLy8gcmlnaHQuCisgICAgICAgICAgICBWaWV3IGNvbnRyb2xzID0gbVpvb21CdXR0b25zQ29udHJvbGxlci5nZXRab29tQ29udHJvbHMoKTsKKyAgICAgICAgICAgIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMgcGFyYW1zID0gY29udHJvbHMuZ2V0TGF5b3V0UGFyYW1zKCk7CisgICAgICAgICAgICBpZiAocGFyYW1zIGluc3RhbmNlb2YgRnJhbWVMYXlvdXQuTGF5b3V0UGFyYW1zKSB7CisgICAgICAgICAgICAgICAgKChGcmFtZUxheW91dC5MYXlvdXRQYXJhbXMpIHBhcmFtcykuZ3Jhdml0eSA9IEdyYXZpdHkuUklHSFQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1ab29tQnV0dG9uc0NvbnRyb2xsZXI7CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBab29tTGlzdGVuZXIgaW1wbGVtZW50cyBab29tQnV0dG9uc0NvbnRyb2xsZXIuT25ab29tTGlzdGVuZXIgeworCisgICAgICAgIHB1YmxpYyB2b2lkIG9uVmlzaWJpbGl0eUNoYW5nZWQoYm9vbGVhbiB2aXNpYmxlKSB7CisgICAgICAgICAgICBpZiAodmlzaWJsZSkgeworICAgICAgICAgICAgICAgIG1XZWJWaWV3LnN3aXRjaE91dERyYXdIaXN0b3J5KCk7CisgICAgICAgICAgICAgICAgLy8gQnJpbmcgYmFjayB0aGUgaGlkZGVuIHpvb20gY29udHJvbHMuCisgICAgICAgICAgICAgICAgbVpvb21CdXR0b25zQ29udHJvbGxlci5nZXRab29tQ29udHJvbHMoKS5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7CisgICAgICAgICAgICAgICAgdXBkYXRlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBvblpvb20oYm9vbGVhbiB6b29tSW4pIHsKKyAgICAgICAgICAgIGlmICh6b29tSW4pIHsKKyAgICAgICAgICAgICAgICBtV2ViVmlldy56b29tSW4oKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbVdlYlZpZXcuem9vbU91dCgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgdXBkYXRlKCk7CisgICAgICAgIH0KKyAgICB9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cml2YXRlSGFuZGxlciA9IG5ldyBIYW5kbGVyKCk7CisKKyAgICBwcml2YXRlIGZpbmFsIFdlYlZpZXcgbVdlYlZpZXc7CisKKyAgICBwdWJsaWMgWm9vbUNvbnRyb2xFeHRlcm5hbChXZWJWaWV3IHdlYlZpZXcpIHsKKyAgICAgICAgbVdlYlZpZXcgPSB3ZWJWaWV3OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNob3coKSB7CisgICAgICAgIGlmKG1ab29tQ29udHJvbFJ1bm5hYmxlICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVDYWxsYmFja3MobVpvb21Db250cm9sUnVubmFibGUpOworICAgICAgICB9CisgICAgICAgIGdldENvbnRyb2xzKCkuc2hvdyh0cnVlKTsKKyAgICAgICAgbVByaXZhdGVIYW5kbGVyLnBvc3REZWxheWVkKG1ab29tQ29udHJvbFJ1bm5hYmxlLCBaT09NX0NPTlRST0xTX1RJTUVPVVQpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGhpZGUoKSB7CisgICAgICAgIGlmIChtWm9vbUNvbnRyb2xSdW5uYWJsZSAhPSBudWxsKSB7CisgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobVpvb21Db250cm9scyAhPSBudWxsKSB7CisgICAgICAgICAgICBtWm9vbUNvbnRyb2xzLmhpZGUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzVmlzaWJsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1ab29tQ29udHJvbHMgIT0gbnVsbCAmJiBtWm9vbUNvbnRyb2xzLmlzU2hvd24oKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB1cGRhdGUoKSB7IH0KKworICAgIHB1YmxpYyBFeHRlbmRlZFpvb21Db250cm9scyBnZXRDb250cm9scygpIHsKKyAgICAgICAgaWYgKG1ab29tQ29udHJvbHMgPT0gbnVsbCkgeworICAgICAgICAgICAgbVpvb21Db250cm9scyA9IGNyZWF0ZVpvb21Db250cm9scygpOworCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogbmVlZCB0byBiZSBzZXQgdG8gVklTSUJMRSBmaXJzdCBzbyB0aGF0IGdldE1lYXN1cmVkSGVpZ2h0KCkgaW4KKyAgICAgICAgICAgICAqIHtAbGluayAjb25TaXplQ2hhbmdlZCgpfSBjYW4gcmV0dXJuIHRoZSBtZWFzdXJlZCB2YWx1ZSBmb3IgcHJvcGVyCisgICAgICAgICAgICAgKiBsYXlvdXQuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIG1ab29tQ29udHJvbHMuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICAgICAgbVpvb21Db250cm9sUnVubmFibGUgPSBuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICAvKiBEb24ndCBkaXNtaXNzIHRoZSBjb250cm9scyBpZiB0aGUgdXNlciBoYXMKKyAgICAgICAgICAgICAgICAgICAgICogZm9jdXMgb24gdGhlbS4gV2FpdCBhbmQgY2hlY2sgYWdhaW4gbGF0ZXIuCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBpZiAoIW1ab29tQ29udHJvbHMuaGFzRm9jdXMoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVpvb21Db250cm9scy5oaWRlKCk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5wb3N0RGVsYXllZChtWm9vbUNvbnRyb2xSdW5uYWJsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWk9PTV9DT05UUk9MU19USU1FT1VUKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1ab29tQ29udHJvbHM7CisgICAgfQorCisgICAgcHJpdmF0ZSBFeHRlbmRlZFpvb21Db250cm9scyBjcmVhdGVab29tQ29udHJvbHMoKSB7CisgICAgICAgIEV4dGVuZGVkWm9vbUNvbnRyb2xzIHpvb21Db250cm9scyA9IG5ldyBFeHRlbmRlZFpvb21Db250cm9scyhtV2ViVmlldy5nZXRDb250ZXh0KCkpOworICAgICAgICB6b29tQ29udHJvbHMuc2V0T25ab29tSW5DbGlja0xpc3RlbmVyKG5ldyBPbkNsaWNrTGlzdGVuZXIoKSB7CisgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgICAgIC8vIHJlc2V0IHRpbWUgb3V0CisgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnJlbW92ZUNhbGxiYWNrcyhtWm9vbUNvbnRyb2xSdW5uYWJsZSk7CisgICAgICAgICAgICAgICAgbVByaXZhdGVIYW5kbGVyLnBvc3REZWxheWVkKG1ab29tQ29udHJvbFJ1bm5hYmxlLCBaT09NX0NPTlRST0xTX1RJTUVPVVQpOworICAgICAgICAgICAgICAgIG1XZWJWaWV3Lnpvb21JbigpOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICAgICAgem9vbUNvbnRyb2xzLnNldE9uWm9vbU91dENsaWNrTGlzdGVuZXIobmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7CisgICAgICAgICAgICAgICAgLy8gcmVzZXQgdGltZSBvdXQKKyAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1ab29tQ29udHJvbFJ1bm5hYmxlKTsKKyAgICAgICAgICAgICAgICBtUHJpdmF0ZUhhbmRsZXIucG9zdERlbGF5ZWQobVpvb21Db250cm9sUnVubmFibGUsIFpPT01fQ09OVFJPTFNfVElNRU9VVCk7CisgICAgICAgICAgICAgICAgbVdlYlZpZXcuem9vbU91dCgpOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICAgICAgcmV0dXJuIHpvb21Db250cm9sczsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBFeHRlbmRlZFpvb21Db250cm9scyBleHRlbmRzIEZyYW1lTGF5b3V0IHsKKworICAgICAgICBwcml2YXRlIGFuZHJvaWQud2lkZ2V0Llpvb21Db250cm9scyBtUGx1c01pbnVzWm9vbUNvbnRyb2xzOworCisgICAgICAgIHB1YmxpYyBFeHRlbmRlZFpvb21Db250cm9scyhDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgICAgIHN1cGVyKGNvbnRleHQsIG51bGwpOworICAgICAgICAgICAgTGF5b3V0SW5mbGF0ZXIgaW5mbGF0ZXIgPSAoTGF5b3V0SW5mbGF0ZXIpCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHQuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0LkxBWU9VVF9JTkZMQVRFUl9TRVJWSUNFKTsKKyAgICAgICAgICAgIGluZmxhdGVyLmluZmxhdGUoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5sYXlvdXQuem9vbV9tYWduaWZ5LCB0aGlzLCB0cnVlKTsKKyAgICAgICAgICAgIG1QbHVzTWludXNab29tQ29udHJvbHMgPSAoYW5kcm9pZC53aWRnZXQuWm9vbUNvbnRyb2xzKSBmaW5kVmlld0J5SWQoCisgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQuem9vbUNvbnRyb2xzKTsKKyAgICAgICAgICAgIGZpbmRWaWV3QnlJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLnpvb21NYWduaWZ5KS5zZXRWaXNpYmlsaXR5KAorICAgICAgICAgICAgICAgICAgICBWaWV3LkdPTkUpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgc2hvdyhib29sZWFuIHNob3dab29tKSB7CisgICAgICAgICAgICBtUGx1c01pbnVzWm9vbUNvbnRyb2xzLnNldFZpc2liaWxpdHkoc2hvd1pvb20gPyBWaWV3LlZJU0lCTEUgOiBWaWV3LkdPTkUpOworICAgICAgICAgICAgZmFkZShWaWV3LlZJU0lCTEUsIDAuMGYsIDEuMGYpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgaGlkZSgpIHsKKyAgICAgICAgICAgIGZhZGUoVmlldy5HT05FLCAxLjBmLCAwLjBmKTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgdm9pZCBmYWRlKGludCB2aXNpYmlsaXR5LCBmbG9hdCBzdGFydEFscGhhLCBmbG9hdCBlbmRBbHBoYSkgeworICAgICAgICAgICAgQWxwaGFBbmltYXRpb24gYW5pbSA9IG5ldyBBbHBoYUFuaW1hdGlvbihzdGFydEFscGhhLCBlbmRBbHBoYSk7CisgICAgICAgICAgICBhbmltLnNldER1cmF0aW9uKDUwMCk7CisgICAgICAgICAgICBzdGFydEFuaW1hdGlvbihhbmltKTsKKyAgICAgICAgICAgIHNldFZpc2liaWxpdHkodmlzaWJpbGl0eSk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgYm9vbGVhbiBoYXNGb2N1cygpIHsKKyAgICAgICAgICAgIHJldHVybiBtUGx1c01pbnVzWm9vbUNvbnRyb2xzLmhhc0ZvY3VzKCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRPblpvb21JbkNsaWNrTGlzdGVuZXIoT25DbGlja0xpc3RlbmVyIGx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SU5JTVVNX1NDQUxFX0lOQ1JFTUVOVCkgeworICAgICAgICAgICAgLy8gc2V0IHRoZSBuZXcgZGVmYXVsdCBkZW5zaXR5CisgICAgICAgICAgICBzZXREZWZhdWx0Wm9vbVNjYWxlKGRlbnNpdHkpOworICAgICAgICAgICAgLy8gYWRqdXN0IHRoZSBzY2FsZSBpZiBpdCBmYWxscyBvdXRzaWRlIHRoZSBuZXcgem9vbSBib3VuZHMKKyAgICAgICAgICAgIHNldFpvb21TY2FsZShtQWN0dWFsU2NhbGUsIHRydWUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHNldERlZmF1bHRab29tU2NhbGUoZmxvYXQgZGVmYXVsdFNjYWxlKSB7CisgICAgICAgIG1EZWZhdWx0U2NhbGUgPSBkZWZhdWx0U2NhbGU7CisgICAgICAgIG1JbnZEZWZhdWx0U2NhbGUgPSAxIC8gZGVmYXVsdFNjYWxlOworICAgICAgICBtRGVmYXVsdE1heFpvb21TY2FsZSA9IGRlZmF1bHRTY2FsZSAqIERFRkFVTFRfTUFYX1pPT01fU0NBTEVfRkFDVE9SOworICAgICAgICBtRGVmYXVsdE1pblpvb21TY2FsZSA9IGRlZmF1bHRTY2FsZSAqIERFRkFVTFRfTUlOX1pPT01fU0NBTEVfRkFDVE9SOworICAgICAgICBtTWF4Wm9vbVNjYWxlID0gbURlZmF1bHRNYXhab29tU2NhbGU7CisgICAgICAgIG1NaW5ab29tU2NhbGUgPSBtRGVmYXVsdE1pblpvb21TY2FsZTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgZmxvYXQgZ2V0U2NhbGUoKSB7CisgICAgICAgIHJldHVybiBtQWN0dWFsU2NhbGU7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGZsb2F0IGdldEludlNjYWxlKCkgeworICAgICAgICByZXR1cm4gbUludkFjdHVhbFNjYWxlOworICAgIH0KKworICAgIHB1YmxpYyBmaW5hbCBmbG9hdCBnZXRUZXh0V3JhcFNjYWxlKCkgeworICAgICAgICByZXR1cm4gbVRleHRXcmFwU2NhbGU7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGZsb2F0IGdldE1heFpvb21TY2FsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1NYXhab29tU2NhbGU7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGZsb2F0IGdldE1pblpvb21TY2FsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1NaW5ab29tU2NhbGU7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGZsb2F0IGdldERlZmF1bHRTY2FsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1EZWZhdWx0U2NhbGU7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGZsb2F0IGdldEludkRlZmF1bHRTY2FsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1JbnZEZWZhdWx0U2NhbGU7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGZsb2F0IGdldERlZmF1bHRNYXhab29tU2NhbGUoKSB7CisgICAgICAgIHJldHVybiBtRGVmYXVsdE1heFpvb21TY2FsZTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgZmxvYXQgZ2V0RGVmYXVsdE1pblpvb21TY2FsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1EZWZhdWx0TWluWm9vbVNjYWxlOworICAgIH0KKworICAgIHB1YmxpYyBmaW5hbCBpbnQgZ2V0RG9jdW1lbnRBbmNob3JYKCkgeworICAgICAgICByZXR1cm4gbUFuY2hvclg7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGludCBnZXREb2N1bWVudEFuY2hvclkoKSB7CisgICAgICAgIHJldHVybiBtQW5jaG9yWTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgdm9pZCBjbGVhckRvY3VtZW50QW5jaG9yKCkgeworICAgICAgICBtQW5jaG9yWCA9IG1BbmNob3JZID0gMDsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgdm9pZCBzZXRab29tQ2VudGVyKGZsb2F0IHgsIGZsb2F0IHkpIHsKKyAgICAgICAgbVpvb21DZW50ZXJYID0geDsKKyAgICAgICAgbVpvb21DZW50ZXJZID0geTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgdm9pZCBzZXRJbml0aWFsU2NhbGVJblBlcmNlbnQoaW50IHNjYWxlSW5QZXJjZW50KSB7CisgICAgICAgIG1Jbml0aWFsU2NhbGUgPSBzY2FsZUluUGVyY2VudCAqIDAuMDFmOworICAgIH0KKworICAgIHB1YmxpYyBmaW5hbCBmbG9hdCBjb21wdXRlU2NhbGVXaXRoTGltaXRzKGZsb2F0IHNjYWxlKSB7CisgICAgICAgIGlmIChzY2FsZSA8IG1NaW5ab29tU2NhbGUpIHsKKyAgICAgICAgICAgIHNjYWxlID0gbU1pblpvb21TY2FsZTsKKyAgICAgICAgfSBlbHNlIGlmIChzY2FsZSA+IG1NYXhab29tU2NhbGUpIHsKKyAgICAgICAgICAgIHNjYWxlID0gbU1heFpvb21TY2FsZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gc2NhbGU7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGJvb2xlYW4gaXNab29tU2NhbGVGaXhlZCgpIHsKKyAgICAgICAgcmV0dXJuIG1NaW5ab29tU2NhbGUgPj0gbU1heFpvb21TY2FsZTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGJvb2xlYW4gZXhjZWVkc01pblNjYWxlSW5jcmVtZW50KGZsb2F0IHNjYWxlQSwgZmxvYXQgc2NhbGVCKSB7CisgICAgICAgIHJldHVybiBNYXRoLmFicyhzY2FsZUEgLSBzY2FsZUIpID49IE1JTklNVU1fU0NBTEVfSU5DUkVNRU5UOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIHdpbGxTY2FsZVRyaWdnZXJab29tKGZsb2F0IHNjYWxlKSB7CisgICAgICAgIHJldHVybiBleGNlZWRzTWluU2NhbGVJbmNyZW1lbnQo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gKG9sZFNjYWxlICE9IG1BY3R1YWxTY2FsZSkgeworICAgICAgICAgICAgLy8gdXNlIG1ab29tUGlja2VyU2NhbGUgdG8gc2VlIHpvb20gcHJldmlldyBmaXJzdAorICAgICAgICAgICAgbVpvb21TdGFydCA9IFN5c3RlbUNsb2NrLnVwdGltZU1pbGxpcygpOworICAgICAgICAgICAgbUludkluaXRpYWxab29tU2NhbGUgPSAxLjBmIC8gb2xkU2NhbGU7CisgICAgICAgICAgICBtSW52RmluYWxab29tU2NhbGUgPSAxLjBmIC8gbUFjdHVhbFNjYWxlOworICAgICAgICAgICAgbVpvb21TY2FsZSA9IG1BY3R1YWxTY2FsZTsKKyAgICAgICAgICAgIG1XZWJWaWV3Lm9uRml4ZWRMZW5ndGhab29tQW5pbWF0aW9uU3RhcnQoKTsKKyAgICAgICAgICAgIG1XZWJWaWV3LmludmFsaWRhdGUoKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBtZXRob2QgaXMgY2FsbGVkIGJ5IHRoZSBXZWJWaWV3J3MgZHJhd2luZyBjb2RlIHdoZW4gYSBmaXhlZCBsZW5ndGggem9vbQorICAgICAqIGFuaW1hdGlvbiBpcyBvY2N1cnJpbmcuIEl0cyBwdXJwb3NlIGlzIHRvIGFuaW1hdGUgdGhlIHpvb21pbmcgb2YgdGhlIGNhbnZhcworICAgICAqIHRvIHRoZSBkZXNpcmVkIHNjYWxlIHdoaWNoIHdhcyBzcGVjaWZpZWQgaW4gc3RhcnRab29tQW5pbWF0aW9uKC4uLikuCisgICAgICoKKyAgICAgKiBBIGZpeGVkIGxlbmd0aCBhbmltYXRpb24gYmVnaW5zIHdoZW4gc3RhcnRab29tQW5pbWF0aW9uKC4uLikgaXMgY2FsbGVkIGFuZAorICAgICAqIGNvbnRpbnVlcyB1bnRpbCB0aGUgWk9PTV9BTklNQVRJT05fTEVOR1RIIHRpbWUgaGFzIGVsYXBzZWQuIER1cmluZyB0aGF0CisgICAgICogaW50ZXJ2YWwgZWFjaCB0aW1lIHRoZSBXZWJWaWV3IGRyYXdzIGl0IGNhbGxzIHRoaXMgZnVuY3Rpb24gd2hpY2ggaXMgCisgICAgICogcmVzcG9uc2libGUgZm9yIGdlbmVyYXRpbmcgdGhlIGFuaW1hdGlvbi4KKyAgICAgKgorICAgICAqIEFkZGl0aW9uYWxseSwgdGhlIFdlYlZpZXcgY2FuIGNoZWNrIHRvIHNlZSBpZiBzdWNoIGFuIGFuaW1hdGlvbiBpcyBjdXJyZW50bHkKKyAgICAgKiBpbiBwcm9ncmVzcyBieSBjYWxsaW5nIGlzRml4ZWRMZW5ndGhBbmltYXRpb25JblByb2dyZXNzKCkuCisgICAgICovCisgICAgcHVibGljIHZvaWQgYW5pbWF0ZVpvb20oQ2FudmFzIGNhbnZhcykgeworICAgICAgICBpZiAobVpvb21TY2FsZSA9PSAwKSB7CisgICAgICAgICAgICBMb2cudyhMT0dUQUcsICJBIFdlYlZpZXcgaXMgYXR0ZW1wdGluZyB0byBwZXJmb3JtIGEgZml4ZWQgbGVuZ3RoICIKKyAgICAgICAgICAgICAgICAgICAgKyAiem9vbSBhbmltYXRpb24gd2hlbiBubyB6b29tIGlzIGluIHByb2dyZXNzIik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBmbG9hdCB6b29tU2NhbGU7CisgICAgICAgIGludCBpbnRlcnZhbCA9IChpbnQpIChTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKSAtIG1ab29tU3RhcnQpOworICAgICAgICBpZiAoaW50ZXJ2YWwgPCBaT09NX0FOSU1BVElPTl9MRU5HVEgpIHsKKyAgICAgICAgICAgIGZsb2F0IHJhdGlvID0gKGZsb2F0KSBpbnRlcnZhbCAvIFpPT01fQU5JTUFUSU9OX0xFTkdUSDsKKyAgICAgICAgICAgIHpvb21TY2FsZSA9IDEuMGYgLyAobUludkluaXRpYWxab29tU2NhbGUKKyAgICAgICAgICAgICAgICAgICAgKyAobUludkZpbmFsWm9vbVNjYWxlIC0gbUludkluaXRpYWxab29tU2NhbGUpICogcmF0aW8pOworICAgICAgICAgICAgbVdlYlZpZXcuaW52YWxpZGF0ZSgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgem9vbVNjYWxlID0gbVpvb21TY2FsZTsKKyAgICAgICAgICAgIC8vIHNldCBtWm9vbVNjYWxlIHRvIGJlIDAgYXMgd2UgaGF2ZSBmaW5pc2hlZCBhbmltYXRpbmcKKyAgICAgICAgICAgIG1ab29tU2NhbGUgPSAwOworICAgICAgICAgICAgbVdlYlZpZXcub25GaXhlZExlbmd0aFpvb21BbmltYXRpb25FbmQoKTsKKyAgICAgICAgfQorICAgICAgICAvLyBjYWxjdWxhdGUgdGhlIGludGVybWVkaWF0ZSBzY3JvbGwgcG9zaXRpb24uIFNpbmNlIHdlIG5lZWQgdG8gdXNlCisgICAgICAgIC8vIHpvb21TY2FsZSwgd2UgY2FuJ3QgdXNlIHRoZSBXZWJWaWV3J3MgcGluTG9jWC9ZIGZ1bmN0aW9ucyBkaXJlY3RseS4KKyAgICAgICAgZmxvYXQgc2NhbGUgPSB6b29tU2NhbGUgKiBtSW52SW5pdGlhbFpvb21TY2FsZTsKKyAgICAgICAgaW50IHR4ID0gTWF0aC5yb3VuZChzY2FsZSAqIChtSW5pdGlhbFNjcm9sbFggKyBtWm9vbUNlbnRlclgpIC0gbVpvb21DZW50ZXJYKTsKKyAgICAgICAgdHggPSAtV2ViVmlldy5waW5Mb2ModHgsIG1XZWJWaWV3LmdldFZpZXdXaWR0aCgpLCBNYXRoLnJvdW5kKG1XZWJWaWV3LmdldENvbnRlbnRXaWR0aCgpCisgICAgICAgICAgICAgICAgKiB6b29tU2NhbGUpKSArIG1XZWJWaWV3LmdldFNjcm9sbFgoKTsKKyAgICAgICAgaW50IHRpdGxlSGVpZ2h0ID0gbVdlYlZpZXcuZ2V0VGl0bGVIZWlnaHQoKTsKKyAgICAgICAgaW50IHR5ID0gTWF0aC5yb3VuZChzY2FsZQorICAgICAgICAgICAgICAgICogKG1Jbml0aWFsU2Nyb2xsWSArIG1ab29tQ2VudGVyWSAtIHRpdGxlSGVpZ2h0KQorICAgICAgICAgICAgICAgIC0gKG1ab29tQ2VudGVyWSAtIHRpdGxlSGVpZ2h0KSk7CisgICAgICAgIHR5ID0gLSh0eSA8PSB0aXRsZUhlaWdodCA/IE1hdGgubWF4KHR5LCAwKSA6IFdlYlZpZXcucGluTG9jKHR5CisgICAgICAgICAgICAgICAgLSB0aXRsZUhlaWdodCwgbVdlYlZpZXcuZ2V0Vmlld0hlaWdodCgpLCBNYXRoLnJvdW5kKG1XZWJWaWV3LmdldENvbnRlbnRIZWlnaHQoKQorICAgICAgICAgICAgICAgICogem9vbVNjYWxlKSkgKyB0aXRsZUhlaWdodCkgKyBtV2ViVmlldy5nZXRTY3JvbGxZKCk7CisKKyAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSh0eCwgdHkpOworICAgICAgICBjYW52YXMuc2NhbGUoem9vbVNjYWxlLCB6b29tU2NhbGUpOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzWm9vbUFuaW1hdGluZygpIHsKKyAgICAgICAgcmV0dXJuIGlzRml4ZWRMZW5ndGhBbmltYXRpb25JblByb2dyZXNzKCkgfHwgbVBpbmNoVG9ab29tQW5pbWF0aW5nOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzRml4ZWRMZW5ndGhBbmltYXRpb25JblByb2dyZXNzKCkgeworICAgICAgICByZXR1cm4gbVpvb21TY2FsZSAhPSAwOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHJlZnJlc2hab29tU2NhbGUoYm9vbGVhbiByZWZsb3dUZXh0KSB7CisgICAgICAgIHNldFpvb21TY2FsZShtQWN0dWFsU2NhbGUsIHJlZmxvd1RleHQsIHRydWUpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFpvb21TY2FsZShmbG9hdCBzY2FsZSwgYm9vbGVhbiByZWZsb3dUZXh0KSB7CisgICAgICAgIHNldFpvb21TY2FsZShzY2FsZSwgcmVmbG93VGV4dCwgZmFsc2UpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzZXRab29tU2NhbGUoZmxvYXQgc2NhbGUsIGJvb2xlYW4gcmVmbG93VGV4dCwgYm9vbGVhbiBmb3JjZSkgeworICAgICAgICBmaW5hbCBib29sZWFuIGlzU2NhbGVMZXNzVGhhbk1pblpvb20gPSBzY2FsZSA8IG1NaW5ab29tU2NhbGU7CisgICAgICAgIHNjYWxlID0gY29tcHV0ZVNjYWxlV2l0aExpbWl0cyhzY2FsZSk7CisKKyAgICAgICAgLy8gZGV0ZXJtaW5lIHdoZXRoZXIgb3Igbm90IHdlIGFyZSBpbiB0aGUgem9vbSBvdmVydmlldyBtb2RlCisgICAgICAgIGlmIChpc1NjYWxlTGVzc1RoYW5NaW5ab29tICYmIG1NaW5ab29tU2NhbGUgPCBtRGVmYXVsdFNjYWxlKSB7CisgICAgICAgICAgICBtSW5ab29tT3ZlcnZpZXcgPSB0cnVlOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbUluWm9vbU92ZXJ2aWV3ID0gIWV4Y2VlZHNNaW5TY2FsZUluY3JlbWVudChzY2FsZSwgZ2V0Wm9vbU92ZXJ2aWV3U2NhbGUoKSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAocmVmbG93VGV4dCkgeworICAgICAgICAgICAgbVRleHRXcmFwU2NhbGUgPSBzY2FsZTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChzY2FsZSAhPSBtQWN0dWFsU2NhbGUgfHwgZm9yY2UpIHsKKyAgICAgICAgICAgIGZsb2F0IG9sZFNjYWxlID0gbUFjdHVhbFNjYWxlOworICAgICAgICAgICAgZmxvYXQgb2xkSW52U2NhbGUgPSBtSW52QWN0dWFsU2NhbGU7CisKKyAgICAgICAgICAgIGlmIChzY2FsZSAhPSBtQWN0dWFsU2NhbGUgJiYgIW1QaW5jaFRvWm9vbUFuaW1hdGluZykgeworICAgICAgICAgICAgICAgIG1DYWxsYmFja1Byb3h5Lm9uU2NhbGVDaGFuZ2VkKG1BY3R1YWxTY2FsZSwgc2NhbGUpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtQWN0dWFsU2NhbGUgPSBzY2FsZTsKKyAgICAgICAgICAgIG1JbnZBY3R1YWxTY2FsZSA9IDEgLyBzY2FsZTsKKworICAgICAgICAgICAgaWYgKCFtV2ViVmlldy5kcmF3SGlzdG9yeSgpKSB7CisKKyAgICAgICAgICAgICAgICAvLyBJZiBoaXN0b3J5IFBpY3R1cmUgaXMgZHJhd24sIGRvbid0IHVwZGF0ZSBzY3JvbGwuIFRoZXkgd2lsbAorICAgICAgICAgICAgICAgIC8vIGJlIHVwZGF0ZWQgd2hlbiB3ZSBnZXQgb3V0IG9mIHRoYXQgbW9kZS4KKyAgICAgICAgICAgICAgICAvLyB1cGRhdGUgb3VyIHNjcm9sbCBzbyB3ZSBkb24ndCBhcHBlYXIgdG8ganVtcAorICAgICAgICAgICAgICAgIC8vIGkuZS4ga2VlcCB0aGUgY2VudGVyIG9mIHRoZSBkb2MgaW4gdGhlIGNlbnRlciBvZiB0aGUgdmlldworICAgICAgICAgICAgICAgIGludCBvbGRYID0gbVdlYlZpZXcuZ2V0U2Nyb2xsWCgpOworICAgICAgICAgICAgICAgIGludCBvbGRZID0gbVdlYlZpZXcuZ2V0U2Nyb2xsWSgpOworICAgICAgICAgICAgICAgIGZsb2F0IHJhdGlvID0gc2NhbGUgKiBvbGRJbnZTY2FsZTsKKyAgICAgICAgICAgICAgICBmbG9hdCBzeCA9IHJhdGlvICogb2xkWCArIChyYXRpbyAtIDEpICogbVpvb21DZW50ZXJYOworICAgICAgICAgICAgICAgIGZsb2F0IHN5ID0gcmF0aW8gKiBvbGRZICsgKHJhdGlvIC0gMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICogKG1ab29tQ2VudGVyWSAtIG1XZWJWaWV3LmdldFRpdGxlSGVpZ2h0KCkpOworCisgICAgICAgICAgICAgICAgLy8gU2NhbGUgYWxsIHRoZSBjaGlsZCB2aWV3cworICAgICAgICAgICAgICAgIG1XZWJWaWV3Lm1WaWV3TWFuYWdlci5zY2FsZUFsbCgpOworCisgICAgICAgICAgICAgICAgLy8gYXMgd2UgZG9uJ3QgaGF2ZSBhbmltYXRpb24gZm9yIHNjYWxpbmcsIGRvbid0IGRvIGFuaW1hdGlvbgorICAgICAgICAgICAgICAgIC8vIGZvciBzY3JvbGxpbmcsIGFzIGl0IGNhdXNlcyB3ZWlyZCBpbnRlcm1lZGlhdGUgc3RhdGUKKyAgICAgICAgICAgICAgICBpbnQgc2Nyb2xsWCA9IG1XZWJWaWV3LnBpbkxvY1goTWF0aC5yb3VuZChzeCkpOworICAgICAgICAgICAgICAgIGludCBzY3JvbGxZID0gbVdlYlZpZXcucGluTG9jWShNYXRoLnJvdW5kKHN5KSk7CisgICAgICAgICAgICAgICAgaWYoIW1XZWJWaWV3LnVwZGF0ZVNjcm9sbENvb3JkaW5hdGVzKHNjcm9sbFgsIHNjcm9sbFkpKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBzY3JvbGwgcG9zaXRpb24gaXMgYWRqdXN0ZWQgYXQgdGhlIGJlZ2lubmluZyBvZiB0aGUKKyAgICAgICAgICAgICAgICAgICAgLy8gem9vbSBhbmltYXRpb24uIEJ1dCB3ZSB3YW50IHRvIHVwZGF0ZSB0aGUgV2ViS2l0IGF0IHRoZQorICAgICAgICAgICAgICAgICAgICAvLyBlbmQgb2YgdGhlIHpvb20gYW5pbWF0aW9uLiBTZWUgY29tbWVudHMgaW4gb25TY2FsZUVuZCgpLgorICAgICAgICAgICAgICAgICAgICBtV2ViVmlldy5zZW5kT3VyVmlzaWJsZVJlY3QoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgIC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pvb20gdG8gbWF4aW1pemUgdGhlCisgICAgICAgICAqIHBsdWdpbiBvbiB0aGUgc2NyZWVuIG9yIHNjYWxlIHRvIG92ZXJ2aWV3IG1vZGUuCisgICAgICAgICAqLworICAgICAgICBWaWV3TWFuYWdlci5DaGlsZFZpZXcgcGx1Z2luID0gbVdlYlZpZXcubVZpZXdNYW5hZ2VyLmhpdFRlc3QobUFuY2hvclgsIG1BbmNob3JZKTsKKyAgICAgICAgaWYgKHBsdWdpbiAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAobVdlYlZpZXcuaXNQbHVnaW5GaXRPblNjcmVlbihwbHVnaW4pKSB7CisgICAgICAgICAgICAgICAgem9vbVRvT3ZlcnZpZXcoKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbVdlYlZpZXcuY2VudGVyRml0UmVjdChwbHVnaW4ueCwgcGx1Z2luLnksIHBsdWdpbi53aWR0aCwgcGx1Z2luLmhlaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAoc2V0dGluZ3MuZ2V0TGF5b3V0QWxnb3JpdGhtKCkgPT0gV2ViU2V0dGluZ3MuTGF5b3V0QWxnb3JpdGhtLk5BUlJPV19DT0xVTU5TCisgICAgICAgICAgICAgICAgJiYgd2lsbFNjYWxlVHJpZ2dlclpvb20obVRleHRXcmFwU2NhbGUpKSB7CisgICAgICAgICAgICByZWZyZXNoWm9vbVNjYWxlKHRydWUpOworICAgICAgICB9IGVsc2UgaWYgKCFtSW5ab29tT3ZlcnZpZXcpIHsKKyAgICAgICAgICAgIHpvb21Ub092ZXJ2aWV3KCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB6b29tVG9EZWZhdWx0TGV2ZWwoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzZXRab29tT3ZlcnZpZXdXaWR0aChpbnQgd2lkdGgpIHsKKyA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ViVmlldy5vblBpbmNoVG9ab29tQW5pbWF0aW9uU3RhcnQoKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGJvb2xlYW4gb25TY2FsZShTY2FsZUdlc3R1cmVEZXRlY3RvciBkZXRlY3RvcikgeworICAgICAgICAgICAgZmxvYXQgc2NhbGUgPSBNYXRoLnJvdW5kKGRldGVjdG9yLmdldFNjYWxlRmFjdG9yKCkgKiBtQWN0dWFsU2NhbGUgKiAxMDApICogMC4wMWY7CisgICAgICAgICAgICBpZiAod2lsbFNjYWxlVHJpZ2dlclpvb20oc2NhbGUpKSB7CisgICAgICAgICAgICAgICAgbVBpbmNoVG9ab29tQW5pbWF0aW5nID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAvLyBsaW1pdCB0aGUgc2NhbGUgY2hhbmdlIHBlciBzdGVwCisgICAgICAgICAgICAgICAgaWYgKHNjYWxlID4gbUFjdHVhbFNjYWxlKSB7CisgICAgICAgICAgICAgICAgICAgIHNjYWxlID0gTWF0aC5taW4oc2NhbGUsIG1BY3R1YWxTY2FsZSAqIDEuMjVmKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzY2FsZSA9IE1hdGgubWF4KHNjYWxlLCBtQWN0dWFsU2NhbGUgKiAwLjhmKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2V0Wm9vbUNlbnRlcihkZXRlY3Rvci5nZXRGb2N1c1goKSwgZGV0ZWN0b3IuZ2V0Rm9jdXNZKCkpOworICAgICAgICAgICAgICAgIHNldFpvb21TY2FsZShzY2FsZSwgZmFsc2UpOworICAgICAgICAgICAgICAgIG1XZWJWaWV3LmludmFsaWRhdGUoKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyB2b2lkIG9uU2NhbGVFbmQoU2NhbGVHZXN0dXJlRGV0ZWN0b3IgZGV0ZWN0b3IpIHsKKyAgICAgICAgICAgIGlmIChtUGluY2hUb1pvb21BbmltYXRpbmcpIHsKKyAgICAgICAgICAgICAgICBtUGluY2hUb1pvb21BbmltYXRpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBtQW5jaG9yWCA9IG1XZWJWaWV3LnZpZXdUb0NvbnRlbnRYKChpbnQpIG1ab29tQ2VudGVyWCArIG1XZWJWaWV3LmdldFNjcm9sbFgoKSk7CisgICAgICAgICAgICAgICAgbUFuY2hvclkgPSBtV2ViVmlldy52aWV3VG9Db250ZW50WSgoaW50KSBtWm9vbUNlbnRlclkgKyBtV2ViVmlldy5nZXRTY3JvbGxZKCkpOworICAgICAgICAgICAgICAgIC8vIGRvbid0IHJlZmxvdyB3aGVuIHpvb20gaW47IHdoZW4gem9vbSBvdXQsIGRvIHJlZmxvdyBpZiB0aGUKKyAgICAgICAgICAgICAgICAvLyBuZXcgc2NhbGUgaXMgYWxtb3N0IG1pbmltdW0gc2NhbGU7CisgICAgICAgICAgICAgICAgYm9vbGVhbiByZWZsb3dOb3cgPSAhY2FuWm9vbU91dCgpIHx8IChtQWN0dWFsU2NhbGUgPD0gMC44ICogbVRleHRXcmFwU2NhbGUpOworICAgICAgICAgICAgICAgIC8vIGZvcmNlIHpvb20gYWZ0ZXIgbVByZXZpZXdab29tT25seSBpcyBzZXQgdG8gZmFsc2Ugc28gdGhhdCB0aGUKKyAgICAgICAgICAgICAgICAvLyBuZXcgdmlldyBzaXplIHdpbGwgYmUgcGFzc2VkIHRvIHRoZSBXZWJLaXQKKyAgICAgICAgICAgICAgICByZWZyZXNoWm9vbVNjYWxlKHJlZmxvd05vdyk7CisgICAgICAgICAgICAgICAgLy8gY2FsbCBpbnZhbGlkYXRlKCkgdG8gZHJhdyB3aXRob3V0IHpvb20gZmlsdGVyCisgICAgICAgICAgICAgICAgbVdlYlZpZXcuaW52YWxpZGF0ZSgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtV2ViVmlldy5tVmlld01hbmFnZXIuZW5kWm9vbSgpOworICAgICAgICAgICAgbVdlYlZpZXcub25QaW5jaFRvWm9vbUFuaW1hdGlvbkVuZChkZXRlY3Rvcik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvblNpemVDaGFuZ2VkKGludCB3LCBpbnQgaCwgaW50IG93LCBpbnQgb2gpIHsKKyAgICAgICAgLy8gcmVzZXQgem9vbSBhbmQgYW5jaG9yIHRvIHRoZSB0b3AgbGVmdCBjb3JuZXIgb2YgdGhlIHNjcmVlbgorICAgICAgICAvLyB1bmxlc3Mgd2UgYXJlIGFscmVhZHkgem9vbWluZworICAgICAgICBpZiAoIWlzRml4ZWRMZW5ndGhBbmltYXRpb25JblByb2dyZXNzKCkpIHsKKyAgICAgICAgICAgIGludCB2aXNpYmxlVGl0bGVIZWlnaHQgPSBtV2ViVmlldy5nZXRWaXNpYmxlVGl0bGVIZWlnaHQoKTsKKyAgICAgICAgICAgIG1ab29tQ2VudGVyWCA9IDA7CisgICAgICAgICAgICBtWm9vbUNlbnRlclkgPSB2aXNpYmxlVGl0bGVIZWlnaHQ7CisgICAgICAgICAgICBtQW5jaG9yWCA9IG1XZWJWaWV3LnZpZXdUb0NvbnRlbnRYKG1XZWJWaWV3LmdldFNjcm9sbFgoKSk7CisgICAgICAgICAgICBtQW5jaG9yWSA9IG1XZWJWaWV3LnZpZXdUb0NvbnRlbnRZKHZpc2libGVUaXRsZUhlaWdodCArIG1XZWJWaWV3LmdldFNjcm9sbFkoKSk7CisgICAgICAgIH0KKworICAgICAgICAvLyB1cGRhdGUgbU1pblpvb21TY2FsZSBpZiB0aGUgbWluaW11bSB6b29tIHNjYWxlIGlzIG5vdCBmaXhlZAorICAgICAgICBpZiAoIW1NaW5ab29tU2NhbGVGaXhlZCkgeworICAgICAgICAgICAgLy8gd2hlbiBjaGF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8gdXBkYXRlIHRoZSB6b29tIGJ1dHRvbnMgYXMgdGhlIHNjYWxlIGNhbiBiZSBjaGFuZ2VkCisgICAgICAgICAgICAgICAgdXBkYXRlWm9vbVBpY2tlcigpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdXBkYXRlWm9vbVJhbmdlKFdlYlZpZXdDb3JlLlZpZXdTdGF0ZSB2aWV3U3RhdGUsCisgICAgICAgICAgICBpbnQgdmlld1dpZHRoLCBpbnQgbWluUHJlZldpZHRoKSB7CisgICAgICAgIGlmICh2aWV3U3RhdGUubU1pblNjYWxlID09IDApIHsKKyAgICAgICAgICAgIGlmICh2aWV3U3RhdGUubU1vYmlsZVNpdGUpIHsKKyAgICAgICAgICAgICAgICBpZiAobWluUHJlZldpZHRoID4gTWF0aC5tYXgoMCwgdmlld1dpZHRoKSkgeworICAgICAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlID0gKGZsb2F0KSB2aWV3V2lkdGggLyBtaW5QcmVmV2lkdGg7CisgICAgICAgICAgICAgICAgICAgIG1NaW5ab29tU2NhbGVGaXhlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1NaW5ab29tU2NhbGUgPSB2aWV3U3RhdGUubURlZmF1bHRTY2FsZTsKKyAgICAgICAgICAgICAgICAgICAgbU1pblpvb21TY2FsZUZpeGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1NaW5ab29tU2NhbGUgPSBtRGVmYXVsdE1pblpvb21TY2FsZTsKKyAgICAgICAgICAgICAgICBtTWluWm9vbVNjYWxlRml4ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1NaW5ab29tU2NhbGUgPSB2aWV3U3RhdGUubU1pblNjYWxlOworICAgICAgIC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gICAgICBzZXRab29tT3ZlcnZpZXdXaWR0aChNYXRoLm1pbihXZWJWaWV3LnNNYXhWaWV3cG9ydFdpZHRoLAorICAgICAgICAgICAgICAgICAgICBNYXRoLm1heCgoaW50KSAodmlld1dpZHRoICogbUludkRlZmF1bHRTY2FsZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWF0aC5tYXgoZHJhd0RhdGEubU1pblByZWZXaWR0aCwgZHJhd0RhdGEubVZpZXdQb2ludC54KSkpKTsKKyAgICAgICAgfQorCisgICAgICAgIGZpbmFsIGZsb2F0IHpvb21PdmVydmlld1NjYWxlID0gZ2V0Wm9vbU92ZXJ2aWV3U2NhbGUoKTsKKyAgICAgICAgaWYgKCFtTWluWm9vbVNjYWxlRml4ZWQpIHsKKyAgICAgICAgICAgIG1NaW5ab29tU2NhbGUgPSB6b29tT3ZlcnZpZXdTY2FsZTsKKyAgICAgICAgfQorICAgICAgICAvLyBmaXQgdGhlIGNvbnRlbnQgd2lkdGggdG8gdGhlIGN1cnJlbnQgdmlldy4gSWdub3JlIHRoZSByb3VuZGluZyBlcnJvciBjYXNlLgorICAgICAgICBpZiAoIW1XZWJWaWV3LmRyYXdIaXN0b3J5KCkgJiYgKG1Jblpvb21PdmVydmlldyB8fCBtSW5pdGlhbFpvb21PdmVydmlldykKKyAgICAgICAgICAgICAgICAmJiBNYXRoLmFicygodmlld1dpZHRoICogbUludkFjdHVhbFNjYWxlKSAtIG1ab29tT3ZlcnZpZXdXaWR0aCkgPiAxKSB7CisgICAgICAgICAgICBtSW5pdGlhbFpvb21PdmVydmlldyA9IGZhbHNlOworICAgICAgICAgICAgc2V0Wm9vbVNjYWxlKHpvb21PdmVydmlld1NjYWxlLCAhd2lsbFNjYWxlVHJpZ2dlclpvb20obVRleHRXcmFwU2NhbGUpKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFVwZGF0ZXMgem9vbSB2YWx1ZXMgYWZ0ZXIgV2Via2l0IGNvbXBsZX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ICAgIGZpbmFsIGZsb2F0IHNjYWxlOworICAgICAgICAgICAgZmluYWwgYm9vbGVhbiByZWZsb3dUZXh0OworCisgICAgICAgICAgICBpZiAobUluaXRpYWxTY2FsZSA+IDApIHsKKyAgICAgICAgICAgICAgICBzY2FsZSA9IG1Jbml0aWFsU2NhbGU7CisgICAgICAgICAgICAgICAgcmVmbG93VGV4dCA9IGV4Y2VlZHNNaW5TY2FsZUluY3JlbWVudChtVGV4dFdyYXBTY2FsZSwgc2NhbGUpOworICAgICAgICAgICAgfSBlbHNlIGlmICh2aWV3U3RhdGUubVZpZXdTY2FsZSA+IDApIHsKKyAgICAgICAgICAgICAgICBtVGV4dFdyYXBTY2FsZSA9IHZpZXdTdGF0ZS5tVGV4dFdyYXBTY2FsZTsKKyAgICAgICAgICAgICAgICBzY2FsZSA9IHZpZXdTdGF0ZS5tVmlld1NjYWxlOworICAgICAgICAgICAgICAgIHJlZmxvd1RleHQgPSBmYWxzZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgV2ViU2V0dGluZ3Mgc2V0dGluZ3MgPSBtV2ViVmlldy5nZXRTZXR0aW5ncygpOworICAgICAgICAgICAgICAgIGlmIChzZXR0aW5ncy5nZXRVc2VXaWRlVmlld1BvcnQoKSAmJiBzZXR0aW5ncy5nZXRMb2FkV2l0aE92ZXJ2aWV3TW9kZSgpKSB7CisgICAgICAgICAgICAgICAgICAgIG1Jbml0aWFsWm9vbU92ZXJ2aWV3ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgc2NhbGUgPSAoZmxvYXQpIG1XZWJWaWV3LmdldFZpZXdXaWR0aCgpIC8gV2ViVmlldy5ERUZBVUxUX1ZJRVdQT1JUX1dJRFRIOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNjYWxlID0gdmlld1N0YXRlLm1UZXh0V3JhcFNjYWxlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICA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3JhcFNjYWxlIiwgbUFjdHVhbFNjYWxlKTsKKyAgICAgICAgbUluWm9vbU92ZXJ2aWV3ID0gYi5nZXRCb29sZWFuKCJvdmVydmlldyIpOworICAgIH0KKworICAgIHByaXZhdGUgWm9vbUNvbnRyb2xCYXNlIGdldEN1cnJlbnRab29tQ29udHJvbCgpIHsKKyAgICAgICAgaWYgKG1XZWJWaWV3LmdldFNldHRpbmdzKCkgIT0gbnVsbCAmJiBtV2ViVmlldy5nZXRTZXR0aW5ncygpLnN1cHBvcnRab29tKCkpIHsKKyAgICAgICAgICAgIGlmIChtV2ViVmlldy5nZXRTZXR0aW5ncygpLmdldEJ1aWx0SW5ab29tQ29udHJvbHMoKSkgeworICAgICAgICAgICAgICAgIGlmIChtRW1iZWRkZWRab29tQ29udHJvbCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1FbWJlZGRlZFpvb21Db250cm9sID0gbmV3IFpvb21Db250cm9sRW1iZWRkZWQodGhpcywgbVdlYlZpZXcpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gbUVtYmVkZGVkWm9vbUNvbnRyb2w7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChtRXh0ZXJuYWxab29tQ29udHJvbCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1FeHRlcm5hbFpvb21Db250cm9sID0gbmV3IFpvb21Db250cm9sRXh0ZXJuYWwobVdlYlZpZXcpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gbUV4dGVybmFsWm9vbUNvbnRyb2w7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgaW52b2tlWm9vbVBpY2tlcigpIHsKKyAgICAgICAgWm9vbUNvbnRyb2xCYXNlIGNvbnRyb2wgPSBnZXRDdXJyZW50Wm9vbUNvbnRyb2woKTsKKyAgICAgICAgaWYgKGNvbnRyb2wgIT0gbnVsbCkgeworICAgICAgICAgICAgY29udHJvbC5zaG93KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBkaXNtaXNzWm9vbVBpY2tlcigpIHsKKyAgICAgICAgWm9vbUNvbnRyb2xCYXNlIGNvbnRyb2wgPSBnZXRDdXJyZW50Wm9vbUNvbnRyb2woKTsKKyAgICAgICAgaWYgKGNvbnRyb2wgIT0gbnVsbCkgeworICAgICAgICAgICAgY29udHJvbC5oaWRlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc1pvb21QaWNrZXJWaXNpYmxlKCkgeworICAgICAgICBab29tQ29udHJvbEJhc2UgY29udHJvbCA9IGdldEN1cnJlbnRab29tQ29udHJvbCgpOworICAgICAgICByZXR1cm4gKGNvbnRyb2wgIT0gbnVsbCkgPyBjb250cm9sLmlzVmlzaWJsZSgpIDogZmFsc2U7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdXBkYXRlWm9vbVBpY2tlcigpIHsKKyAgICAgICAgWm9vbUNvbnRyb2xCYXNlIGNvbnRyb2wgPSBnZXRDdXJyZW50Wm9vbUNvbnRyb2woKTsKKyAgICAgICAgaWYgKGNvbnRyb2wgIT0gbnVsbCkgeworICAgICAgICAgICAgY29udHJvbC51cGRhdGUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFRoZSBlbWJlZGRlZCB6b29tIGNvbnRyb2wgaW50ZXJjZXB0cyB0b3VjaCBldmVudHMgYW5kIGF1dG9tYXRpY2FsbHkgc3RheXMKKyAgICAgKiB2aXNpYmxlLiBUaGUgZXh0ZXJuYWwgY29udHJvbCBuZWVkcyB0byBjb25zdGFudGx5IHJlZnJlc2ggaXRzIGludGVybmFsCisgICAgICogdGltZXIgdG8gc3RheSB2aXNpYmxlLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGtlZXBab29t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VRfTUVUQV9EQVRBCisgICAgICAgIFBhY2thZ2VNYW5hZ2VyIHBhY2thZ2VNYW5hZ2VyID0gZ2V0UGFja2FnZU1hbmFnZXIoKTsKKyAgICAgICAgQ29tcG9uZW50TmFtZSBjb21wb25lbnROYW1lID0gbmV3IENvbXBvbmVudE5hbWUodGhpcywgZ2V0Q2xhc3MoKSk7CisgICAgICAgIEFjdGl2aXR5SW5mbyBhY3Rpdml0eUluZm8gPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgYWN0aXZpdHlJbmZvID0gcGFja2FnZU1hbmFnZXIuZ2V0QWN0aXZpdHlJbmZvKGNvbXBvbmVudE5hbWUsIFBhY2thZ2VNYW5hZ2VyLkdFVF9NRVRBX0RBVEEpOworICAgICAgICB9IGNhdGNoIChQYWNrYWdlTWFuYWdlci5OYW1lTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgTG9nLmQoTE9HVEFHLCAiRmFpbGVkIHRvIGZpbmQgY29tcG9uZW50Iik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgaWYgKGFjdGl2aXR5SW5mbyA9PSBudWxsKSB7CisgICAgICAgICAgICBMb2cuZChMT0dUQUcsICJGYWlsZWQgdG8gZ2V0IGFjdGl2aXR5IGluZm8iKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIEJ1bmRsZSBtZXRhRGF0YSA9IGFjdGl2aXR5SW5mby5tZXRhRGF0YTsKKyAgICAgICAgaWYgKG1ldGFEYXRhID09IG51bGwpIHsKKyAgICAgICAgICAgIExvZy5kKExPR1RBRywgIk5vIG1ldGEgZGF0YSIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgU3RyaW5nIHVybCA9IG1ldGFEYXRhLmdldFN0cmluZygiYW5kcm9pZC53ZWJydW50aW1lLnVybCIpOworICAgICAgICBpZiAodXJsID09IG51bGwpIHsKKyAgICAgICAg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jcmVlbiIsICJkcmF3YWJsZSIsIGdldFBhY2thZ2VOYW1lKCkpKTsKKyAgICAgICAgbVdlYlZpZXcuZ2V0U2V0dGluZ3MoKS5zZXRKYXZhU2NyaXB0RW5hYmxlZCh0cnVlKTsKKyAgICAgICAgbVdlYlZpZXcuc2V0V2ViVmlld0NsaWVudChuZXcgV2ViVmlld0NsaWVudCgpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIGJvb2xlYW4gc2hvdWxkT3ZlcnJpZGVVcmxMb2FkaW5nKFdlYlZpZXcgdmlldywgU3RyaW5nIHVybCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIFVSTCBuZXdPcmlnaW4gPSBuZXcgVVJMKHVybCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChhcmVTYW1lT3JpZ2luKG1CYXNlVXJsLCBuZXdPcmlnaW4pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiBzaW1wbGUgc2FtZSBvcmlnaW4gdGVzdCBwYXNzZXMsIGxvYWQgaW4gdGhlIHdlYnZpZXcuCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGNhdGNoKE1hbGZvcm1lZFVSTEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IGxvYWQgYW55dGhpbmcgaWYgdGhpcyB3YXNuJ3QgYSBwcm9wZXIgVVJMLgorICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBPdGhlcndpc2UgdGhpcyBpcyBhIFVSTCB0aGF0IGlzIG5vdCBzYW1lIG9yaWdpbiBzbyBwYXNzIGl0IHRvIHRoZQorICAgICAgICAgICAgICAgIC8vIEJyb3dzZXIgdG8gbG9hZC4KKyAgICAgICAgICAgICAgICBzdGFydEFjdGl2aXR5KG5ldyBJbnRlbnQoSW50ZW50LkFDVElPTl9WSUVXLCBVcmkucGFyc2UodXJsKSkpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uUGFnZUZpbmlzaGVkKFdlYlZpZXcgdmlldywgU3RyaW5nIHVybCkgeworICAgICAgICAgICAgICAgIGlmIChtU3BsYXNoU2NyZWVuLmdldFZpc2liaWxpdHkoKSA9PSBWaWV3LlZJU0lCTEUpIHsKKyAgICAgICAgICAgICAgICAgICAgbVNwbGFzaFNjcmVlbi5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7CisgICAgICAgICAgICAgICAgICAgIG1TcGxhc2hTY3JlZW4gPSBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisKKyAgICAgICAgLy8gVXNlIGEgY3VzdG9tIFdlYkNocm9tZUNsaWVudCB3aXRoIGdlb2xvY2F0aW9uIHBlcm1pc3Npb25zIGhhbmRsaW5nLgorICAgICAgICBtV2ViVmlldy5zZXRXZWJDaHJvbWVDbGllbnQobmV3IFdlYkNocm9tZUNsaWVudCgpIHsKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uR2VvbG9jYXRpb25QZXJtaXNzaW9uc1Nob3dQcm9tcHQoCisgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgb3JpZ2luLCBHZW9sb2NhdGlvblBlcm1pc3Npb25zLkNhbGxiYWNrIGNhbGxiYWNrKSB7CisgICAgICAgICAgICAgICAgLy8gQWxsb3cgdGhpcyBvcmlnaW4gaWYgaXQgaGFzIEdlb2xvY2F0aW9uIHBlcm1pc3Npb25zLCBvdGhlcndpc2UgZGVueS4KKyAgICAgICAgICAgICAgICBib29sZWFuIGFsbG93ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBpZiAoc2Vuc2l0aXZlRmVhdHVyZXMuZ2V0R2VvbG9jYXRpb24oKSkgeworICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgVVJMIG9yaWdpblVybCA9IG5ldyBVUkwob3JpZ2luKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFsbG93ZWQgPSBhcmVTYW1lT3JpZ2luKG1CYXNlVXJsLCBvcmlnaW5VcmwpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoKE1hbGZvcm1lZFVSTEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2FsbGJhY2suaW52b2tlKG9yaWdpbiwgYWxsb3dlZCwgZmFsc2UpOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKworICAgICAgICAvLyBTZXQgdGhlIERCIGxvY2F0aW9uLiBPcHRpb25hbC4gR2VvbG9jYXRpb24gd29ya3Mgd2l0aG91dCBEQnMuCisgICAgICAgIG1XZWJWaWV3LmdldFNldHRpbmdzKCkuc2V0R2VvbG9jYXRpb25EYXRhYmFzZVBhdGgoCisgICAgICAgICAgICAgICAgZ2V0RGlyKCJnZW9sb2NhdGlvbiIsIE1PREVfUFJJVkFURSkuZ2V0UGF0aCgpKTsKKworICAgICAgICBTdHJpbmcgdGl0bGUgPSBtZXRhRGF0YS5nZXRTdHJpbmcoImFuZHJvaWQud2VicnVudGltZS50aXRsZSIpOworICAgICAgICAvLyBXZSB0dXJuZWQgb2ZmIHRoZSB0aXRsZSBiYXIgdG8gZ28gZnVsbCBzY3JlZW4gc28gZGlzcGxheSB0aGUKKyAgICAgICAgLy8gd2ViYXBwJ3MgdGl0bGUgYXMgYSB0b2FzdC4KKyAgICAgICAgaWYgKHRpdGxlICE9IG51bGwpIHsKKyAgICAgICAgICAgIFRvYXN0Lm1ha2VUZXh0KHRoaXMsIHRpdGxlLCBUb2FzdC5MRU5HVEhfU0hPUlQpLnNob3coKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIExvYWQgdGhlIHdlYmFwcCdzIGJhc2UgVVJMLgorICAgICAgICBtV2ViVmlldy5sb2FkVXJsKHVybCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gb25LZXlEb3duKGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCkgeworICAgICAgICBpZiAoa2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0JBQ0sgJiYgbVdlYlZpZXcuY2FuR29CYWNrKCkpIHsKKyAgICAgICAgICAgIG1XZWJWaWV3LmdvQmFjaygpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHN1cGVyLm9uS2V5RG93bihrZXlDb2RlLCBldmVudCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gb25DcmVhdGVPcHRpb25zTWVudShNZW51IG1lbnUpIHsKKyAgICAgICAgbWVudS5hZGQoMCwgMCwgMCwgIk1lbnUgaXRlbSAxIik7CisgICAgICAgIG1lbnUuYWRkKDAsIDEsIDAsICJNZW51IGl0ZW0gMiIpOworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGFyZVNhbWVPcmlnaW4oVVJMIGEsIFVSTCBiKSB7CisgICAgICAgIGludCBhUG9ydCA9IGEuZ2V0UG9ydCgpID09IC0xID8gYS5nZXREZWZhdWx0UG9ydCgpIDogYS5nZXRQb3J0KCk7CisgICAgICAgIGludCBiUG9ydCA9IGIuZ2V0UG9ydCgpID09IC0xID8gYi5nZXREZWZhdWx0UG9ydCgpIDogYi5nZXRQb3J0KCk7CisgICAgICAgIHJldHVybiBhLmdldFByb3RvY29sKCkuZXF1YWxzKGIuZ2V0UHJvdG9jb2woKSkgJiYgYVBvcnQ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AgICAgfQpAQCAtMTU3NSw2ICsxNTg1LDExIEBACiAgICAgICAgICAgICAgICAgdHJlZU9ic2VydmVyLmFkZE9uR2xvYmFsTGF5b3V0TGlzdGVuZXIodGhpcyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtQWRhcHRlciAhPSBudWxsICYmIG1EYXRhU2V0T2JzZXJ2ZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgbURhdGFTZXRPYnNlcnZlciA9IG5ldyBBZGFwdGVyRGF0YVNldE9ic2VydmVyKCk7CisgICAgICAgICAgICBtQWRhcHRlci5yZWdpc3RlckRhdGFTZXRPYnNlcnZlcihtRGF0YVNldE9ic2VydmVyKTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIEBPdmVycmlkZQpAQCAtMTU5NSw2ICsxNjEwLDExIEBACiAgICAgICAgICAgICAgICAgbUdsb2JhbExheW91dExpc3RlbmVyQWRkZWRGaWx0ZXIgPSBmYWxzZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQorCisgICAgICAgIGlmIChtQWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBtQWRhcHRlci51bnJlZ2lzdGVyRGF0YVNldE9ic2VydmVyKG1EYXRhU2V0T2JzZXJ2ZXIpOworICAgICAgICAgICAgbURhdGFTZXRPYnNlcnZlciA9IG51bGw7CisgICAgICAgIH0KICAgICB9CiAKICAgICBAT3ZlcnJpZGUKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3dpZGdldC9BZGFwdGVycy5qYXZhIGIvY29yZS9qYXZhL2FuZHJvaWQvd2lkZ2V0L0FkYXB0ZXJzLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uN2ZkN2ZiNQotLS0gL2Rldi9udWxsCisrKyBiL2NvcmUvamF2YS9hbmRyb2lkL3dpZGdldC9BZGFwdGVycy5qYXZhCkBAIC0wLDAgKzEsMTIzM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aW9uLCBJT0V4Y2VwdGlvbiB7CisKKyAgICAgICAgQmFzZUFkYXB0ZXIgYWRhcHRlciA9IG51bGw7CisKKyAgICAgICAgLy8gTWFrZSBzdXJlIHdlIGFyZSBvbiBhIHN0YXJ0IHRhZy4KKyAgICAgICAgaW50IHR5cGU7CisgICAgICAgIGludCBkZXB0aCA9IHBhcnNlci5nZXREZXB0aCgpOworCisgICAgICAgIHdoaWxlICgoKHR5cGUgPSBwYXJzZXIubmV4dCgpKSAhPSBYbWxQdWxsUGFyc2VyLkVORF9UQUcgfHwgcGFyc2VyLmdldERlcHRoKCkgPiBkZXB0aCkgJiYKKyAgICAgICAgICAgICAgICB0eXBlICE9IFhtbFB1bGxQYXJzZXIuRU5EX0RPQ1VNRU5UKSB7CisKKyAgICAgICAgICAgIGlmICh0eXBlICE9IFhtbFB1bGxQYXJzZXIuU1RBUlRfVEFHKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFN0cmluZyBuYW1lID0gcGFyc2VyLmdldE5hbWUoKTsKKyAgICAgICAgICAgIGlmIChhc3NlcnROYW1lICE9IG51bGwgJiYgIWFzc2VydE5hbWUuZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVGhlIGFkYXB0ZXIgZGVmaW5lZCBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIGMuZ2V0UmVzb3VyY2VzKCkuZ2V0UmVzb3VyY2VFbnRyeU5hbWUoaWQpICsgIiBtdXN0IGJlIGEgPCIgKyBuYW1lICsgIiAvPiIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoQURBUFRFUl9DVVJTT1IuZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICAgICAgYWRhcHRlciA9IGNyZWF0ZUN1cnNvckFkYXB0ZXIoYywgcGFyc2VyLCBhdHRycywgaWQsIHBhcmFtZXRlcnMpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmtub3duIGFkYXB0ZXIgbmFtZSAiICsgcGFyc2VyLmdldE5hbWUoKSArCisgICAgICAgICAgICAgICAgICAgICAgICAiIGluICIgKyBjLmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKGlkKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gYWRhcHRlcjsKKworICAgIH0KKworICAgIC8qKgorICAgICAqIENyZWF0ZXMgYW4gWG1sQ3Vyc29yQWRhcHRlciB1c2luZyBhbiBYbWxDdXJzb3JBZGFwdGVyUGFyc2VyLgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIFhtbEN1cnNvckFkYXB0ZXIgY3JlYXRlQ3Vyc29yQWRhcHRlcihDb250ZXh0IGMsIFhtbFB1bGxQYXJzZXIgcGFyc2VyLAorICAgICAgICAgICAgQXR0cmlidXRlU2V0IGF0dHJzLCBpbnQgaWQsIE9iamVjdFtdIHBhcmFtZXRlcnMpCisgICAgICAgICAgICB0aHJvd3MgSU9FeGNlcHRpb24sIFhtbFB1bGxQYXJzZXJFeGNlcHRpb24geworCisgICAgICAgIHJldHVybiBuZXcgWG1sQ3Vyc29yQWRhcHRlclBhcnNlcihjLCBwYXJzZXIsIGF0dHJzLCBpZCkucGFyc2UocGFyYW1ldGVycyk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUGFyc2VyIHRoYXQgY2FuIGdlbmVyYXRlIFhtbEN1cnNvckFkYXB0ZXIgaW5zdGFuY2VzLiBUaGlzIHBhcnNlciBpcyByZXNwb25zaWJsZSBmb3IKKyAgICAgKiBoYW5kbGluZyBhbGwgdGhlIGF0dHJpYnV0ZXMgYW5kIGNoaWxkIG5vZGVzIGZvciBhICZsdDtjdXJzb3ItYWRhcHRlciAvJmd0Oy4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5hbCBBdHRyaWJ1dGVTZXQgbUF0dHJzOworICAgICAgICBwcml2YXRlIGZpbmFsIGludCBtSWQ7CisKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBIYXNoTWFwPFN0cmluZywgQ3Vyc29yQmluZGVyPiBtQmluZGVyczsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBBcnJheUxpc3Q8U3RyaW5nPiBtRnJvbTsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBBcnJheUxpc3Q8SW50ZWdlcj4gbVRvOworICAgICAgICBwcml2YXRlIGZpbmFsIEN1cnNvclRyYW5zZm9ybWF0aW9uIG1JZGVudGl0eTsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBSZXNvdXJjZXMgbVJlc291cmNlczsKKworICAgICAgICBwdWJsaWMgWG1sQ3Vyc29yQWRhcHRlclBhcnNlcihDb250ZXh0IGMsIFhtbFB1bGxQYXJzZXIgcGFyc2VyLCBBdHRyaWJ1dGVTZXQgYXR0cnMsIGludCBpZCkgeworICAgICAgICAgICAgbUNvbnRleHQgPSBjOworICAgICAgICAgICAgbVBhcnNlciA9IHBhcnNlcjsKKyAgICAgICAgICAgIG1BdHRycyA9IGF0dHJzOworICAgICAgICAgICAgbUlkID0gaWQ7CisKKyAgICAgICAgICAgIG1SZXNvdXJjZXMgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKTsKKyAgICAgICAgICAgIG1CaW5kZXJzID0gbmV3IEhhc2hNYXA8U3RyaW5nLCBDdXJzb3JCaW5kZXI+KCk7CisgICAgICAgICAgICBtRnJvbSA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOworICAgICAgICAgICAgbVRvID0gbmV3IEFycmF5TGlzdDxJbnRlZ2VyPigpOworICAgICAgICAgICAgbUlkZW50aXR5ID0gbmV3IElkZW50aXR5VHJhbnNmb3JtYXRpb24obUNvbnRleHQpOyAgICAgICAgICAgIAorICAgICAgICB9CisKKyAgICAgICAgcHVibGljIFhtbEN1cnN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AgICAgICAgIFhtbFB1bGxQYXJzZXIgcGFyc2VyID0gbVBhcnNlcjsKKyAgICAgICAgICAgIGludCB0eXBlOworICAgICAgICAgICAgaW50IGRlcHRoID0gcGFyc2VyLmdldERlcHRoKCk7CisKKyAgICAgICAgICAgIHdoaWxlICgoKHR5cGUgPSBwYXJzZXIubmV4dCgpKSAhPSBYbWxQdWxsUGFyc2VyLkVORF9UQUcgfHwgcGFyc2VyLmdldERlcHRoKCkgPiBkZXB0aCkgJiYKKyAgICAgICAgICAgICAgICAgICAgdHlwZSAhPSBYbWxQdWxsUGFyc2VyLkVORF9ET0NVTUVOVCkgeworCisgICAgICAgICAgICAgICAgaWYgKHR5cGUgIT0gWG1sUHVsbFBhcnNlci5TVEFSVF9UQUcpIHsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBwYXJzZXIuZ2V0TmFtZSgpOworCisgICAgICAgICAgICAgICAgaWYgKEFEQVBURVJfQ1VSU09SX0JJTkQuZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgIHBhcnNlQmluZFRhZygpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoQURBUFRFUl9DVVJTT1JfU0VMRUNULmVxdWFscyhuYW1lKSkgeworICAgICAgICAgICAgICAgICAgICBwYXJzZVNlbGVjdFRhZygpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJVbmtub3duIHRhZyBuYW1lICIgKyBwYXJzZXIuZ2V0TmFtZSgpICsgIiBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvdXJjZXMuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBTdHJpbmdbXSBmcm9tQXJyYXkgPSBtRnJvbS50b0FycmF5KG5ldyBTdHJpbmdbbUZyb20uc2l6ZSgpXSk7CisgICAgICAgICAgICBpbnRbXSB0b0FycmF5ID0gbmV3IGludFttVG8uc2l6ZSgpXTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgdG9BcnJheS5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgIHRvQXJyYXlbaV0gPSBtVG8uZ2V0KGkpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBTdHJpbmdbXSBzZWxlY3Rpb25BcmdzID0gbnVsbDsKKyAgICAgICAgICAgIGlmIChwYXJhbWV0ZXJzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBzZWxlY3Rpb25BcmdzID0gbmV3IFN0cmluZ1twYXJhbWV0ZXJzLmxlbmd0aF07CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzZWxlY3Rpb25BcmdzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbkFyZ3NbaV0gPSAoU3RyaW5nKSBwYXJhbWV0ZXJzW2ldOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIG5ldyBYbWxDdXJzb3JBZGFwdGVyKG1Db250ZXh0LCBsYXlvdXQsIHVyaSwgZnJvbUFycmF5LCB0b0FycmF5LCBzZWxlY3Rpb24sCisgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbkFyZ3MsIHNvcnRPcmRlciwgbUJpbmRlcnMpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSB2b2lkIHBhcnNlU2VsZWN0VGFnKCkgeworICAgICAgICAgICAgVHlwZWRBcnJheSBhID0gbVJlc291cmNlcy5vYnRhaW5BdHRyaWJ1dGVzKG1BdHRycywKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZC5SLnN0eWxlYWJsZS5DdXJzb3JBZGFwdGVyX1NlbGVjdEl0ZW0pOworCisgICAgICAgICAgICBTdHJpbmcgZnJvbU5hbWUgPSBhLmdldFN0cmluZyhhbmRyb2lkLlIuc3R5bGVhYmxlLkN1cnNvckFkYXB0ZXJfU2VsZWN0SXRlbV9jb2x1bW4pOworICAgICAgICAgICAgaWYgKGZyb21OYW1lID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJBIHNlbGVjdCBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgbVJlc291cmNlcy5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICIgZG9lcyBub3QgaGF2ZSBhICdjb2x1bW4nIGF0dHJpYnV0ZSIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBhLnJlY3ljbGUoKTsKKworICAgICAgICAgICAgbUZyb20uYWRkKGZyb21OYW1lKTsKKyAgICAgICAgICAgIG1Uby5hZGQoVmlldy5OT19JRCk7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIHZvaWQgcGFyc2VCaW5kVGFnKCkgdGhyb3dzIElPRXhjZXB0aW9uLCBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIFJlc291cmNlcyByZXNvdXJjZXMgPSBtUmVzb3VyY2VzOworICAgICAgICAgICAgVHlwZWRBcnJheSBhID0gcmVzb3VyY2VzLm9idGFpbkF0dHJpYnV0ZXMobUF0dHJzLAorICAgICAgICAgICAgICAgICAgICBhbmRyb2lkLlIuc3R5bGVhYmxlLkN1cnNvckFkYXB0ZXJfQmluZEl0ZW0pOworCisgICAgICAgICAgICBTdHJpbmcgZnJvbU5hbWUgPSBhLmdldFN0cmluZyhhbmRyb2lkLlIuc3R5bGVhYmxlLkN1cnNvckFkYXB0ZXJfQmluZEl0ZW1fZnJvbSk7CisgICAgICAgICAgICBpZiAoZnJvbU5hbWUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkEgYmluZCBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiIGRvZXMgbm90IGhhdmUgYSAnZnJvbScgYXR0cmlidXRlIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGludCB0b05hbWUgPSBhLmdldFJlc291cmNlSWQoYW5kcm9pZC5SLnN0eWxlYWJsZS5DdXJzb3JBZGFwdGVyX0JpbmRJdGVtX3RvLCAwKTsKKyAgICAgICAgICAgIGlmICh0b05hbWUgPT0gMCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkEgYmluZCBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiIGRvZXMgbm90IGhhdmUgYSAndG8nIGF0dHJpYnV0ZSIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBTdHJpbmcgYXNUeXBlID0gYS5nZXRTdHJpbmcoYW5kcm9pZC5SLnN0eWxlYWJsZS5DdXJzb3JBZGFwdGVyX0JpbmRJdGVtX2FzKTsKKyAgICAgICAgICAgIGlmIChhc1R5cGUgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkEgYmluZCBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiIGRvZXMgbm90IGhhdmUgYW4gJ2FzJyBhdHRyaWJ1dGUiKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbUZyb20uYWRkKGZyb21OYW1lKTsKKyAgICAgICAgICAgIG1Uby5hZGQodG9OYW1lKTsKKyAgICAgICAgICAgIG1CaW5kZXJzLnB1dChmcm9tTmFtZSwgZmluZEJpbmRlcihhc1R5cGUpKTsKKworICAgICAgICAgICAgYS5yZWN5Y2xlKCk7CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIEN1cnNvckJpbmRlciBmaW5kQmluZGVyKFN0cmluZyB0eXBlKSB0aHJvd3MgSU9FeGNlcHRpb24sIFhtbFB1bGxQYXJzZXJFeGNlcHRpb24geworICAgICAgICAgICAgZmluYWwgWG1sUHVsbFBhcnNlciBwYXJzZXIgPSBtUGFyc2VyOworICAgICAgICAgICAgZmluYWwgQ29udGV4dCBjb250ZXh0ID0gbUNvbnRleHQ7CisgICAgICAgICAgICBDdXJzb3JUcmFuc2Zvcm1hdGlvbiB0cmFuc2Zvcm1hdGlvbiA9IG1JZGVudGl0eTsKKworICAgICAgICAgICAgaW50IHRhZ1R5cGU7CisgICAgICAgICAgICBpbnQgZGVwdGggPSBwYXJzZXIuZ2V0RGVwdGgoKTsKKworICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBpc0RyYXdhYmxlID0gQURBUFRFUl9DVVJTT1JfQVNfRFJBV0FCTEUuZXF1YWxzKHR5cGUpOyAgICAgICAgICAgIAorCisgICAgICAgICAgICB3aGlsZSAoKCh0YWdUeXBlID0gcGFyc2VyLm5leHQoKSkgIT0gWG1sUHVsbFBhcnNlci5FTkRfVEFHIHx8IHBhcnNlci5nZXREZXB0aCgpID4gZGVwdGgpCisgICAgICAgICAgICAgICAgICAgICYmIHRhZ1R5cGUgIT0gWG1sUHVsbFBhcnNlci5FTkRfRE9DVU1FTlQpIHsKKworICAgICAgICAgICAgICAgIGlmICh0YWdUeXBlICE9IFhtbFB1bGxQYXJzZXIuU1RBUlRfVEFHKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIFN0cmluZyBuYW1lID0gcGFyc2VyLmdldE5hbWUoKTsKKworICAgICAgICAgICAgICAgIGlmIChBREFQVEVSX0NVUlNPUl9UUkFOU0ZPUk0uZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgIHRyYW5zZm9ybWF0aW9uID0gZmluZFRyYW5zZm9ybWF0aW9uKCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChBREFQVEVSX0NVUlNPUl9NQVAuZXF1YWxzKG5hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghKHRyYW5zZm9ybWF0aW9uIGluc3RhbmNlb2YgTWFwVHJhbnNmb3JtYXRpb24pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2Zvcm1hdGlvbiA9IG5ldyBNYXBUcmFuc2Zvcm1hdGlvbihjb250ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBmaW5kTWFwKCgoTWFwVHJhbnNmb3JtYXRpb24pIHRyYW5zZm9ybWF0aW9uKSwgaXNEcmF3YWJsZSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIlVua25vd24gdGFnIG5hbWUgIiArIHBhcnNlci5nZXROYW1lKCkgKyAiIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoQURBUFRFUl9DVVJTT1JfQVNfU1RSSU5HLmVxdWFscyh0eXBlKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU3RyaW5nQmluZGVyKGNvbnRleHQsIHRyYW5zZm9ybWF0aW9uKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoQURBUFRFUl9DVVJTT1Jf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CkpOworICAgICAgICAgICAgICAgIGlmIChDdXJzb3JCaW5kZXIuY2xhc3MuaXNBc3NpZ25hYmxlRnJvbShrbGFzcykpIHsKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgQ29uc3RydWN0b3I8Pz4gYyA9IGtsYXNzLmdldERlY2xhcmVkQ29uc3RydWN0b3IoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29udGV4dC5jbGFzcywgQ3Vyc29yVHJhbnNmb3JtYXRpb24uY2xhc3MpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gKEN1cnNvckJpbmRlcikgYy5uZXdJbnN0YW5jZShtQ29udGV4dCwgdHJhbnNmb3JtYXRpb24pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKENsYXNzTm90Rm91bmRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNhbm5vdCBpbnN0YW5jaWF0ZSBiaW5kZXIgdHlwZSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiOiAiICsgdHlwZSwgZSk7CisgICAgICAgICAgICB9IGNhdGNoIChOb1N1Y2hNZXRob2RFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNhbm5vdCBpbnN0YW5jaWF0ZSBiaW5kZXIgdHlwZSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiOiAiICsgdHlwZSwgZSk7CisgICAgICAgICAgICB9IGNhdGNoIChJbnZvY2F0aW9uVGFyZ2V0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJDYW5ub3QgaW5zdGFuY2lhdGUgYmluZGVyIHR5cGUgaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsgIjogIiArIHR5cGUsIGUpOworICAgICAgICAgICAgfSBjYXRjaCAoSW5zdGFudGlhdGlvbkV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQ2Fubm90IGluc3RhbmNpYXRlIGJpbmRlciB0eXBlIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSArICI6ICIgKyB0eXBlLCBlKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBY2Nlc3NFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNhbm5vdCBpbnN0YW5jaWF0ZSBiaW5kZXIgdHlwZSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiOiAiICsgdHlwZSwgZSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSB2b2lkIGZpbmRNYXAoTWFwVHJhbnNmb3JtYXRpb24gdHJhbnNmb3JtYXRpb24sIGJvb2xlYW4gZHJhd2FibGUpIHsKKyAgICAgICAgICAgIFJlc291cmNlcyByZXNvdXJjZXMgPSBtUmVzb3VyY2VzOworCisgICAgICAgICAgICBUeXBlZEFycmF5IGEgPSByZXNvdXJjZXMub2J0YWluQXR0cmlidXRlcyhtQXR0cnMsCisgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQuUi5zdHlsZWFibGUuQ3Vyc29yQWRhcHRlcl9NYXBJdGVtKTsKKworICAgICAgICAgICAgU3RyaW5nIGZyb20gPSBhLmdldFN0cmluZyhhbmRyb2lkLlIuc3R5bGVhYmxlLkN1cnNvckFkYXB0ZXJfTWFwSXRlbV9mcm9tVmFsdWUpOworICAgICAgICAgICAgaWYgKGZyb20gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkEgbWFwIGl0ZW0gaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICByZXNvdXJjZXMuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSArCisgICAgICAgICAgICAgICAgICAgICAgICAiIGRvZXMgbm90IGhhdmUgYSAnZnJvbVZhbHVlJyBhdHRyaWJ1dGUiKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKCFkcmF3YWJsZSkgeworICAgICAgICAgICAgICAgIFN0cmluZyB0byA9IGEuZ2V0U3RyaW5nKGFuZHJvaWQuUi5zdHlsZWFibGUuQ3Vyc29yQWRhcHRlcl9NYXBJdGVtX3RvVmFsdWUpOworICAgICAgICAgICAgICAgIGlmICh0byA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkEgbWFwIGl0ZW0gaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgZG9lcyBub3QgaGF2ZSBhICd0b1ZhbHVlJyBhdHRyaWJ1dGUiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdHJhbnNmb3JtYXRpb24uYWRkU3RyaW5nTWFwcGluZyhmcm9tLCB0byk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGludCB0byA9IGEuZ2V0UmVzb3VyY2VJZChhbmRyb2lkLlIuc3R5bGVhYmxlLkN1cnNvckFkYXB0ZXJfTWFwSXRlbV90b1ZhbHVlLCAwKTsKKyAgICAgICAgICAgICAgICBpZiAodG8gPT0gMCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJBIG1hcCBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc291cmNlcy5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGRvZXMgbm90IGhhdmUgYSAndG9WYWx1ZScgYXR0cmlidXRlIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHRyYW5zZm9ybWF0aW9uLmFkZFJlc291cmNlTWFwcGluZyhmcm9tLCB0byk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGEucmVjeWNsZSgpOworICAgICAgICB9CisKKyAgICAgICAgcHJpdmF0ZSBDdXJzb3JUcmFuc2Zvcm1hdGlvbiBmaW5kVHJhbnNmb3JtYXRpb24oKSB7CisgICAgICAgICAgICBSZXNvdXJjZXMgcmVzb3VyY2VzID0gbVJlc291cmNlczsKKyAgICAgICAgICAgIEN1cnNvclRyYW5zZm9ybWF0aW9uIHRyYW5zZm9ybWF0aW9uID0gbnVsbDsKKyAgICAgICAgICAgIFR5cGVkQXJyYXkgYSA9IHJlc291cmNlcy5vYnRhaW5BdHRyaWJ1dGVzKG1BdHRycywKKyAgICAgICAgICAgICAgICAgICAgYW5kcm9pZC5SLnN0eWxlYWJsZS5DdXJzb3JBZGFwdGVyX1RyYW5zZm9ybUl0ZW0pOworCisgICAgICAgICAgICBTdHJpbmcgY2xhc3NOYW1lID0gYS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isgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNhbm5vdCBpbnN0YW5jaWF0ZSB0cmFuc2Zvcm0gdHlwZSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiOiAiICsgY2xhc3NOYW1lLCBlKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChOb1N1Y2hNZXRob2RFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJDYW5ub3QgaW5zdGFuY2lhdGUgdHJhbnNmb3JtIHR5cGUgaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsgIjogIiArIGNsYXNzTmFtZSwgZSk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSW52b2NhdGlvblRhcmdldEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNhbm5vdCBpbnN0YW5jaWF0ZSB0cmFuc2Zvcm0gdHlwZSBpbiAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFJlc291cmNlRW50cnlOYW1lKG1JZCkgKyAiOiAiICsgY2xhc3NOYW1lLCBlKTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChJbnN0YW50aWF0aW9uRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQ2Fubm90IGluc3RhbmNpYXRlIHRyYW5zZm9ybSB0eXBlIGluICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSArICI6ICIgKyBjbGFzc05hbWUsIGUpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBY2Nlc3NFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJDYW5ub3QgaW5zdGFuY2lhdGUgdHJhbnNmb3JtIHR5cGUgaW4gIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXRSZXNvdXJjZUVudHJ5TmFtZShtSWQpICsgIjogIiArIGNsYXNzTmFtZSwgZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBhLnJlY3ljbGUoKTsKKworICAgICAgICAgICAgaWYgKHRyYW5zZm9ybWF0aW9uID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJBIHRyYW5zZm9ybSBpdGVtIGluICIgKworICAgICAgICAgICAgICAgICAgICByZXNvdXJjZXMuZ2V0UmVzb3VyY2VFbnRyeU5hbWUobUlkKSArICIgbXVzdCBoYXZlIGEgJ3dpdGhDbGFzcycgb3IgIiArCisgICAgICAgICAgICAgICAgICAgICInd2l0aEV4cHJlc3Npb24nIGF0dHJpYnV0ZSIpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gdHJhbnNmb3JtYXRpb247CisgICAgICAgIH0KKworICAgICAgICBwcml2YXRlIEN1cnNvclRyYW5zZm9ybWF0aW9uIGNyZWF0ZUV4cHJlc3Npb25UcmFuc2Zvcm1hdGlvbihTdHJpbmcgZXhwcmVzc2lvbikgeworICAgICAgICAgICAgcmV0dX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JpbmdCaW5kZXIoY29udGV4dCwgbmV3IElkZW50aXR5VHJhbnNmb3JtYXRpb24oY29udGV4dCkpOworICAgICAgICAgICAgZmluYWwgaW50IGNvdW50ID0gZnJvbS5sZW5ndGg7CisgICAgICAgICAgICBtQmluZGVycyA9IG5ldyBDdXJzb3JCaW5kZXJbY291bnRdOworCisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICBDdXJzb3JCaW5kZXIgYmluZGVyID0gYmluZGVycy5nZXQoZnJvbVtpXSk7CisgICAgICAgICAgICAgICAgaWYgKGJpbmRlciA9PSBudWxsKSBiaW5kZXIgPSBiYXNpYzsKKyAgICAgICAgICAgICAgICBtQmluZGVyc1tpXSA9IGJpbmRlcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgdm9pZCBiaW5kVmlldyhWaWV3IHZpZXcsIENvbnRleHQgY29udGV4dCwgQ3Vyc29yIGN1cnNvcikgeworICAgICAgICAgICAgZmluYWwgaW50IGNvdW50ID0gbVRvLmxlbmd0aDsKKyAgICAgICAgICAgIGZpbmFsIGludFtdIGZyb20gPSBtRnJvbTsKKyAgICAgICAgICAgIGZpbmFsIGludFtdIHRvID0gbVRvOworICAgICAgICAgICAgZmluYWwgQ3Vyc29yQmluZGVyW10gYmluZGVycyA9IG1CaW5kZXJzOworCisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBWaWV3IHYgPSB2aWV3LmZpbmRWaWV3QnlJZCh0b1tpXSk7CisgICAgICAgICAgICAgICAgaWYgKHYgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBiaW5kZXJzW2ldLmJpbmQodiwgY3Vyc29yLCBmcm9tW2ldKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBsb2FkKCkgeworICAgICAgICAgICAgaWYgKG1VcmkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Mb2FkVGFzayA9IG5ldyBRdWVyeVRhc2soKS5leGVjdXRlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICB2b2lkIHNldFVyaShTdHJpbmcgdXJpKSB7CisgICAgICAgICAgICBtVXJpID0gdXJpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGNoYW5nZUN1cnNvcihDdXJzb3IgYykgeworICAgICAgICAgICAgaWYgKG1Mb2FkVGFzayAhPSBudWxsICYmIG1Mb2FkVGFzay5nZXRTdGF0dXMoKSAhPSBRdWVyeVRhc2suU3RhdHVzLkZJTklTSEVEKSB7CisgICAgICAgICAgICAgICAgbUxvYWRUYXNrLmNhbmNlbCh0cnVlKTsKKyAgICAgICAgICAgICAgICBtTG9hZFRhc2sgPSBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3VwZXIuY2hhbmdlQ3Vyc29yKGMpOworICAgICAgICB9CisKKyAgICAgICAgY2xhc3MgUXVlcnlUYXNrIGV4dGVuZHMgQXN5bmNUYXNrPFZvaWQsIFZvaWQsIEN1cnNvcj4geworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwcm90ZWN0ZWQgQ3Vyc29yIGRvSW5CYWNrZ3JvdW5kKFZvaWQuLi4gcGFyYW1zKSB7CisgICAgICAgICAgICAgICAgaWYgKG1Db250ZXh0IGluc3RhbmNlb2YgQWN0aXZpdHkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgoQWN0aXZpdHkpIG1Db250ZXh0KS5tYW5hZ2VkUXVlcnkoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVXJpLnBhcnNlKG1VcmkpLCBtQ29sdW1ucywgbVNlbGVjdGlvbiwgbVNlbGVjdGlvbkFyZ3MsIG1Tb3J0T3JkZXIpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5xdWVyeSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBVcmkucGFyc2UobVVyaSksIG1Db2x1bW5zLCBtU2VsZWN0aW9uLCBtU2VsZWN0aW9uQXJncywgbVNvcnRPcmRlcik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uUG9zdEV4ZWN1dGUoQ3Vyc29yIGN1cnNvcikgeworICAgICAgICAgICAgICAgIGlmICghaXNDYW5jZWxsZWQoKSkgeworICAgICAgICAgICAgICAgICAgICBYbWxDdXJzb3JBZGFwdGVyLnN1cGVyLmNoYW5nZUN1cnNvcihjdXJzb3IpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIElkZW50aXR5IHRyYW5zZm9ybWF0aW9uLCByZXR1cm5zIHRoZSBjb250ZW50IG9mIHRoZSBzcGVjaWZpZWQgY29sdW1uIGFzIGEgU3RyaW5nLAorICAgICAqIHdpdGhvdXQgcGVyZm9ybWluZyBhbnkgbWFuaXB1bGF0aW9uLiBUaGlzIGlzIHVzZWQgd2hlbiBubyB0cmFuc2Zvcm1hdGlvbiBpcyBzcGVjaWZpZWQuCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgSWRlbnRpdHlUcmFuc2Zvcm1hdGlvbiBleHRlbmRzIEN1cnNvclRyYW5zZm9ybWF0aW9uIHsKKyAgICAgICAgcHVibGljIElkZW50aXR5VHJhbnNmb3JtYXRpb24oQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0KTsK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JpbmcgZXhwcmVzc2lvbikgeworICAgICAgICAgICAgRXhwcmVzc2lvbk5vZGUgbm9kZSA9IG1GaXJzdE5vZGU7CisgICAgICAgICAgICBpbnQgc2VnbWVudFN0YXJ0OworICAgICAgICAgICAgaW50IGNvdW50ID0gZXhwcmVzc2lvbi5sZW5ndGgoKTsKKworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgY2hhciBjID0gZXhwcmVzc2lvbi5jaGFyQXQoaSk7CisgICAgICAgICAgICAgICAgLy8gU3RhcnQgYSBjb2x1bW4gbmFtZSBzZWdtZW50CisgICAgICAgICAgICAgICAgc2VnbWVudFN0YXJ0ID0gaTsKKyAgICAgICAgICAgICAgICBpZiAoYyA9PSAneycpIHsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGkgPCBjb3VudCAmJiAoYyA9IGV4cHJlc3Npb24uY2hhckF0KGkpKSAhPSAnfScpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGkrKzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvLyBXZSd2ZSByZWFjaGVkIHRoZSBlbmQsIGJ1dCB0aGUgZXhwcmVzc2lvbiBkaWRuJ3QgY2xvc2UKKyAgICAgICAgICAgICAgICAgICAgaWYgKGMgIT0gJ30nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJUaGUgdHJhbnNmb3JtIGV4cHJlc3Npb24gY29udGFpbnMgYSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm5vbi1jbG9zZWQgY29sdW1uIG5hbWU6ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHByZXNzaW9uLnN1YnN0cmluZyhzZWdtZW50U3RhcnQgKyAxLCBpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbm9kZS5uZXh0ID0gbmV3IENvbHVtbkV4cHJlc3Npb25Ob2RlKGV4cHJlc3Npb24uc3Vic3RyaW5nKHNlZ21lbnRTdGFydCArIDEsIGkpKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB3aGlsZSAoaSA8IGNvdW50ICYmIChjID0gZXhwcmVzc2lvbi5jaGFyQXQoaSkpICE9ICd7JykgeworICAgICAgICAgICAgICAgICAgICAgICAgaSsrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG5vZGUubmV4dCA9IG5ldyBDb25zdGFudEV4cHJlc3Npb25Ob2RlKGV4cHJlc3Npb24uc3Vic3RyaW5nKHNlZ21lbnRTdGFydCwgaSkpOworICAgICAgICAgICAgICAgICAgICAvLyBSZXdpbmQgaWYgd2UndmUgcmVhY2hlZCBhIGNvbHVtbiBleHByZXNzaW9uCisgICAgICAgICAgICAgICAgICAgIGlmIChjID09ICd7JykgaS0tOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBub2RlID0gbm9kZS5uZXh0OworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBTdHJpbmcgdHJhbnNmb3JtKEN1cnNvciBjdXJzb3IsIGludCBjb2x1bW5JbmRleCkgeworICAgICAgICAgICAgZmluYWwgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbUJ1aWxkZXI7CisgICAgICAgICAgICBidWlsZGVyLmRlbGV0ZSgwLCBidWlsZGVyLmxlbmd0aCgpKTsKKworICAgICAgICAgICAgRXhwcmVzc2lvbk5vZGUgbm9kZSA9IG1GaXJzdE5vZGU7CisgICAgICAgICAgICAvLyBTa2lwIHRoZSBmaXJzdCBub2RlCisgICAgICAgICAgICB3aGlsZSAoKG5vZGUgPSBub2RlLm5leHQpICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChub2RlLmFzU3RyaW5nKGN1cnNvcikpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gYnVpbGRlci50b1N0cmluZygpOworICAgICAgICB9CisKKyAgICAgICAgc3RhdGljIGFic3RyYWN0IGNsYXNzIEV4cHJlc3Npb25Ob2RlIHsKKyAgICAgICAgICAgIHB1YmxpYyBFeHByZXNzaW9uTm9kZSBuZXh0OworCisgICAgICAgICAgICBwdWJsaWMgYWJzdHJhY3QgU3RyaW5nIGFzU3RyaW5nKEN1cnNvciBjdXJzb3IpOworICAgICAgICB9CisKKyAgICAgICAgc3RhdGljIGNsYXNzIENvbnN0YW50RXhwcmVzc2lvbk5vZGUgZXh0ZW5kcyBFeHByZXNzaW9uTm9kZSB7CisgICAgICAgICAgICBwcml2YXRlIGZpbmFsIFN0cmluZyBtQ29uc3RhbnQ7CisKKyAgICAgICAgICAgIENvbnN0YW50RXhwcmVzc2lvbk5vZGUoU3RyaW5nIGNvbnN0YW50KSB7CisgICAgICAgICAgICAgICAgbUNvbnN0YW50ID0gY29uc3RhbnQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIFN0cmluZyBhc1N0cmluZyhDdXJzb3IgY3Vyc29yKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1Db25zdGFudDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHN0YXRpYyBjbGFzcyBDb2x1bW5FeHByZXNzaW9uTm9kZSBleHRlbmRzIEV4cHJlc3Npb25Ob2RlIHsKKyAgICAgICAgICAgIHByaXZhdGUgZmluYWwgU3RyaW5nIG1Db2x1bW5OYW1lOworICAgICAgICAgICAgcHJpdmF0ZSBDdXJzb3IgbVNpZ25hdHVyZTsKKyAgICAgICAgICAgIHByaXZhdGUgaW50IG1Db2x1bW5JbmRleCA9IC0xOworCisgICAgICAgICAgICBDb2x1bW5FeHByZXNzaW9uTm9kZShTdHJpbmcgY29sdW1uTmFtZSkgeworICAgICAgICAgICAgICAgIG1Db2x1bW5OYW1lID0gY29sdW1uTmFtZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgU3RyaW5nIGFzU3RyaW5nKEN1cnNvciBjdXJzb3IpIHsKKyAgICAgICAgICAgICAgICBpZiAoY3Vyc29yICE9IG1TaWduYXR1cmUgfHwgbUNvbHVtbkluZGV4ID09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgIG1Db2x1bW5JbmRleCA9IGN1cnNvci5nZXRDb2x1bW5JbmRleChtQ29sdW1uTmFtZSk7CisgICAgICAgICAgICAgICAgICAgIG1TaWduYXR1cmUgPSBjdXJzb3I7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcmV0dXJuIGN1cnNvci5nZXRTdHJpbmcobUNvbHVtbkluZGV4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEEgbWFwIHRyYW5zZm9ybWF0aW9uIG9mZmVycyBhIHNpbXBsZSBtYXBwaW5nIGJldHdlZW4gc3BlY2lmaWVkIFN0cmluZyB2YWx1ZXMKKyAgICAgKiB0byBTdHJpbmdzIG9yIGludGVnZXJzLgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIE1hcFRyYW5zZm9ybWF0aW9uIGV4dGVuZHMgQ3Vyc29yVHJhbnNmb3JtYXRpb24geworICAgICAgICBwcml2YXRlIGZpbmFsIEhhc2hNYXA8U3RyaW5nLCBTdHJpbmc+IG1TdHJpbmdNYXBwaW5nczsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBIYXNoTWFwPFN0cmluZywgSW50ZWdlcj4gbVJlc291cmNlTWFwcGluZ3M7CisKKyAgICAgICAgcHVibGljIE1hcFRyYW5zZm9ybWF0aW9uKENvbnRleHQgY29udGV4dCkgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCk7CisgICAgICAgICAgICBtU3RyaW5nTWFwcGluZ3MgPSBuZXcgSGFzaE1hcDxTdHJpbmcsIFN0cmluZz4oKTsKKyAgICAgICAgICAgIG1SZXNvdXJjZU1hcHBpbmdzID0gbmV3IEhhc2hNYXA8U3RyaW5nLCBJbnRlZ2VyPigpOworICAgICAgICB9CisKKyAgICAgICAgdm9pZCBhZGRTdHJpbmdNYXBwaW5nKFN0cmluZyBmcm9tLCBTdHJpbmcgdG8pIHsKKyAgICAgICAgICAgIG1TdHJpbmdNYXBwaW5ncy5wdXQoZnJvbSwgdG8pOworICAgICAgICB9CisKKyAgICAgICAgdm9pZCBhZGRSZXNvdXJjZU1hcHBpbmcoU3RyaW5nIGZyb20sIGludCB0bykgeworICAgICAgICAgICAgbVJlc291cmNlTWFwcGluZ3MucHV0KGZyb20sIHRvKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgU3RyaW5nIHRyYW5zZm9ybShDdXJzb3IgY3Vyc29yLCBpbnQgY29sdW1uSW5kZXgpIHsKKyAgICAgICAgICAgIGZpbmFsIFN0cmluZyB2YWx1ZSA9IGN1cnNvci5nZXRTdHJpbmcoY29sdW1uSW5kZXgpOworICAgICAgICAgICAgZmluYWwgU3RyaW5nIHRyYW5zZm9ybWVkID0gbVN0cmluZ01hcHBpbmdzLmdldCh2YWx1ZSk7CisgICAgICAgICAgICByZXR1cm4gdHJhbnNmb3JtZWQgPT0gbnVsbCA/IHZhbHVlIDogdHJhbnNmb3JtZWQ7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGludCB0cmFuc2Zvcm1Ub1Jlc291cmNlKEN1cnNvciBjdXJzb3IsIGludCBjb2x1bW5JbmRleCkgeworICAgICAgICAgICAgZmluYWwgU3RyaW5nIHZhbHVlID0gY3Vyc29yLmdldFN0cmluZyhjb2x1bW5JbmRleCk7CisgICAgICAgICAgICBmaW5hbCBJbnRlZ2VyIHRyYW5zZm9ybWVkID0gbVJlc291cmNlTWFwcGluZ3MuZ2V0KHZhbHVlKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRyYW5zZm9ybWVkID09IG51bGwgPyBJbnRlZ2VyLnBhcnNlSW50KHZhbHVlKSA6IHRyYW5zZm9ybWVkOworICAgICAgICAgICAgfSBjYXRjaCAoTnVtYmVyRm9ybWF0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEJpbmRzIGEgU3RyaW5nIHRvIGEgVGV4dFZpZXcuCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgU3RyaW5nQmluZGVyIGV4dGVuZHMgQ3Vyc29yQmluZGVyIHsKKyAgICAgICAgcHVibGljIFN0cmluZ0JpbmRlcihDb250ZXh0IGNvbnRleHQsIEN1cnNvclRyYW5zZm9ybWF0aW9uIHRyYW5zZm9ybWF0aW9uKSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0LCB0cmFuc2Zvcm1hdGlvbik7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gYmluZChWaWV3IHZpZXcsIEN1cnNvciBjdXJzb3IsIGludCBjb2x1bW5JbmRleCkgeworICAgICAgICAgICAgaWYgKHZpZXcgaW5zdGFuY2VvZiBUZXh0VmlldykgeworICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZyB0ZXh0ID0gbVRyYW5zZm9ybWF0aW9uLnRyYW5zZm9ybShjdXJzb3IsIGNvbHVtbkluZGV4KTsKKyAgICAgICAgICAgICAgICAoKFRleHRWaWV3KSB2aWV3KS5zZXRUZXh0KHRleHQpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQmluZHMgYW4gaW1hZ2UgYmxvYiB0byBhbiBJbWFnZVZpZXcuCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgSW1hZ2VCaW5kZXIgZXh0ZW5kcyBDdXJzb3JCaW5kZXIgeworICAgICAgICBwdWJsaWMgSW1hZ2VCaW5kZXIoQ29udGV4dCBjb250ZXh0LCBDdXJzb3JUcmFuc2Zvcm1hdGlvbiB0cmFuc2Zvcm1hdGlvbikgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgdHJhbnNmb3JtYXRpb24pOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGJpbmQoVmlldyB2aWV3LCBDdXJzb3IgY3Vyc29yLCBpbnQgY29sdW1uSW5kZXgpIHsKKyAgICAgICAgICAgIGlmICh2aWV3IGluc3RhbmNlb2YgSW1hZ2VWaWV3KSB7CisgICAgICAgICAgICAgICAgZmluYWwgYnl0ZVtdIGRhdGEgPSBjdXJzb3IuZ2V0QmxvYihjb2x1bW5JbmRleCk7CisgICAgICAgICAgICAgICAgKChJbWFnZVZpZXcpIHZpZXcpLnNldEltYWdlQml0bWFwKEJpdG1hcEZhY3RvcnkuZGVjb2RlQnl0ZUFycmF5KGRhdGEsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLmxlbmd0aCkpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgVGFnQmluZGVyIGV4dGVuZHMgQ3Vyc29yQmluZGVyIHsKKyAgICAgICAgcHVibGljIFRhZ0JpbmRlcihDb250ZXh0IGNvbnRleHQsIEN1cnNvclRyYW5zZm9ybWF0aW9uIHRyYW5zZm9ybWF0aW9uKSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0LCB0cmFuc2Zvcm1hdGlvbik7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gYmluZChWaWV3IHZpZXcsIEN1cnNvciBjdXJzb3IsIGludCBjb2x1bW5JbmRleCkgeworICAgICAgICAgICAgZmluYWwgU3RyaW5nIHRleHQgPSBtVHJhbnNmb3JtYXRpb24udHJhbnNmb3JtKGN1cnNvciwgY29sdW1uSW5kZXgpOworICAgICAgICAgICAgdmlldy5zZXRUYWcodGV4dCk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEJpbmRzIGFuIGltYWdlIFVSSSB0byBhbiBJbWFnZVZpZXcuCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgSW1hZ2VVcmlCaW5kZXIgZXh0ZW5kcyBDdXJzb3JCaW5kZXIgeworICAgICAgICBwdWJsaWMgSW1hZ2VVcmlCaW5kZXIoQ29udGV4dCBjb250ZXh0LCBDdXJzb3JUcmFuc2Zvcm1hdGlvbiB0cmFuc2Zvcm1hdGlvbikgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgdHJhbnNmb3JtYXRpb24pOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGJpbmQoVmlldyB2aWV3LCBDdXJzb3IgY3Vyc29yLCBpbnQgY29sdW1uSW5kZXgpIHsKKyAgICAgICAgICAgIGlmICh2aWV3IGluc3RhbmNlb2YgSW1hZ2VWaWV3KSB7CisgICAgICAgICAgICAgICAgKChJbWFnZVZpZXcpIHZpZXcpLnNldEltYWdlVVJJKFVyaS5wYXJzZSgKKyAgICAgICAgICAgICAgICAgICAgICAgIG1UcmFuc2Zvcm1hdGlvbi50cmFuc2Zvcm0oY3Vyc29yLCBjb2x1bW5JbmRleCkpKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEJpbmRzIGEgZHJhd2FibGUgcmVzb3VyY2UgaWRlbnRpZmllciB0byBhbiBJbWFnZVZpZXcuCisgICAgICovCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgRHJhd2FibGVCaW5kZXIgZXh0ZW5kcyBDdXJzb3JCaW5kZXIgeworICAgICAgICBwdWJsaWMgRHJhd2FibGVCaW5kZXIoQ29udGV4dCBjb250ZXh0LCBDdXJzb3JUcmFuc2Zvcm1hdGlvbiB0cmFuc2Zvcm1hdGlvbikgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgdHJhbnNmb3JtYXRpb24pOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGJpbmQoVmlldyB2aWV3LCBDdXJzb3IgY3Vyc29yLCBpbnQgY29sdW1uSW5kZXgpIHsKKyAgICAgICAgICAgIGlmICh2aWV3IGluc3RhbmNlb2YgSW1hZ2VWaWV3KSB7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IHJlc291cmNlID0gbVRyYW5zZm9ybWF0aW9uLnRyYW5zZm9ybVRvUmVzb3VyY2UoY3Vyc29yLCBjb2x1bW5JbmRleCk7CisgICAgICAgICAgICAgICAgaWYgKHJlc291cmNlID09IDApIHJldHVybiBmYWxzZTsKKworICAgICAgICAgICAgICAgICgoSW1hZ2VWaWV3KSB2aWV3KS5zZXRJbWFnZVJlc291cmNlKHJlc291cmNlKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBh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ICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldENvbXBsZXRpb25IaW50KENoYXJTZXF1ZW5jZSBoaW50KSB7CiAgICAgICAgIG1IaW50VGV4dCA9IGhpbnQ7CisgICAgICAgIGlmIChoaW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChtSGludFZpZXcgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGZpbmFsIFRleHRWaWV3IGhpbnRWaWV3ID0gKFRleHRWaWV3KSBMYXlvdXRJbmZsYXRlci5mcm9tKGdldENvbnRleHQoKSkuaW5mbGF0ZSgKKyAgICAgICAgICAgICAgICAgICAgICAgIG1IaW50UmVzb3VyY2UsIG51bGwpLmZpbmRWaWV3QnlJZChjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLnRleHQxKTsKKyAgICAgICAgICAgICAgICBoaW50Vmlldy5zZXRUZXh0KG1IaW50VGV4dCk7CisgICAgICAgICAgICAgICAgbUhpbnRWaWV3ID0gaGludFZpZXc7CisgICAgICAgICAgICAgICAgbVBvcHVwLnNldFByb21wdFZpZXcoaGludFZpZXcpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtSGludFZpZXcuc2V0VGV4dChoaW50KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1Qb3B1cC5zZXRQcm9tcHRWaWV3KG51bGwpOworICAgICAgICAgICAgbUhpbnRWaWV3ID0gbnVsbDsKKyAgICAgICAgfQogICAgIH0KICAgICAKICAgICAvKioKQEAgLTI1MCw3ICsyMzgsNyBAQAogICAgICAqIEBhdHRyIHJlZiBhbmRyb2lkLlIuc3R5bGVhYmxlI0F1dG9Db21wbGV0ZVRleHRWaWV3X2Ryb3BEb3duV2lkdGgKICAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldERyb3BEb3duV2lkdGgoKSB7Ci0gICAgICAgIHJldHVybiBtRHJvcERvd25XaWR0aDsKKyAgICAgICAgcmV0dXJuIG1Qb3B1cC5nZXRXaWR0aCgpOwogICAgIH0KICAgICAKICAgICAvKioKQEAgLTI2Myw3ICsyNTEsNyBAQAogICAgICAqIEBhdHRyIHJlZiBhbmRyb2lkLlIuc3R5bGVhYmxlI0F1dG9Db21wbGV0ZVRleHRWaWV3X2Ryb3BEb3duV2lkdGgKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBzZXREcm9wRG93bldpZHRoKGludCB3aWR0aCkgewotICAgICAgICBtRHJvcERvd25XaWR0aCA9IHdpZHRoOworICAgICAgICBtUG9wdXAuc2V0V2lkdGgod2lkdGgpOwogICAgIH0KIAogICAgIC8qKgpAQCAtMjc3LDcgKzI2NSw3IEBACiAgICAgICogQGF0dHIgcmVmIGFuZHJvaWQuUi5zdHlsZWFibGUjQXV0b0NvbXBsZXRlVGV4dFZpZXdfZHJvcERvd25IZWlnaHQKICAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldERyb3BEb3duSGVpZ2h0KCkgewotICAgICAgICByZXR1cm4gbURyb3BEb3duSGVpZ2h0OworICAgICAgICByZXR1cm4gbVBvcHVwLmdldEhlaWdodCgpOwogICAgIH0KIAogICAgIC8qKgpAQCAtMjkxLDcgKzI3OSw3IEBACiAgICAgICogQGF0dHIgcmVmIGFuZHJvaWQuUi5zdHlsZWFibGUjQXV0b0NvbXBsZXRlVGV4dFZpZXdfZHJvcERvd25IZWlnaHQKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBzZXREcm9wRG93bkhlaWdodChpbnQgaGVpZ2h0KSB7Ci0gICAgICAgIG1Ecm9wRG93bkhlaWdodCA9IGhlaWdodDsKKyAgICAgICAgbVBvcHVwLnNldEhlaWdodChoZWlnaHQpOwogICAgIH0KICAgICAKICAgICAvKioKQEAgLTMxNiw3ICszMDQsNyBAQAogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldERyb3BEb3duQW5jaG9yKGludCBpZCkgewogICAgICAgICBtRHJvcERvd25BbmNob3JJZCA9IGlkOwotICAgICAgICBtRHJvcERvd25BbmNob3JWaWV3ID0gbnVsbDsKKyAgICAgICAgbVBvcHVwLnNldEFuY2hvclZpZXcobnVsbCk7CiAgICAgfQogICAgIAogICAgIC8qKgpAQCAtMzU4LDcgKzM0Niw3IEBACiAgICAgICogQHBhcmFtIG9mZnNldCB0aGUgdmVydGljYWwgb2Zmc2V0CiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc2V0RHJvcERvd25WZXJ0aWNhbE9mZnNldChpbnQgb2Zmc2V0KSB7Ci0gICAgICAgIG1Ecm9wRG93blZlcnRpY2FsT2Zmc2V0ID0gb2Zmc2V0OworICAgICAgICBtUG9wdXAuc2V0VmVydGljYWxPZmZzZXQob2Zmc2V0KTsKICAgICB9CiAgICAgCiAgICAgLyoqCkBAIC0zNjcsNyArMzU1LDcgQEAKICAgICAgKiBAcmV0dXJuIHRoZSB2ZXJ0aWNhbCBvZmZzZXQKICAgICAgKi8KICAgICBwdWJsaWMgaW50IGdldERyb3BEb3duVmVydGljYWxPZmZzZXQoKSB7Ci0gICAgICAgIHJldHVybiBtRHJvcERvd25WZXJ0aWNhbE9mZnNldDsKKyAgICAgICAgcmV0dXJuIG1Qb3B1cC5nZXRWZXJ0aWNhbE9mZnNldCgpOwogICAgIH0KICAgICAKICAgICAvKioKQEAgLTM3Niw3ICszNjQsNyBAQAogICAgICAqIEBwYXJhbSBvZmZzZXQgdGhlIGhvcml6b250YWwgb2Zmc2V0CiAgICAgICovCiAgICAgcHVibGljIHZvaWQgc2V0RHJvcERvd25Ib3Jpem9udGFsT2Zmc2V0KGludCBvZmZzZXQpIHsKLSAgICAgICAgbURyb3BEb3duSG9yaXpvbnRhbE9mZnNldCA9IG9mZnNldDsKKyAgICAgICAgbVBvcHVwLnNldEhvcml6b250YWxPZmZzZXQob2Zmc2V0KTsKICAgICB9CiAgICAgCiAgICAgLyoqCkBAIC0zODUsNyArMzczLDcgQEAKICAgICAgKiBAcmV0dXJuIHRoZSBob3Jpem9udGFsIG9mZnNldAogICAgICAqLwogICAgIHB1YmxpYyBpbnQgZ2V0RHJvcERvd25Ib3Jpem9udGFsT2Zmc2V0KCkgewotICAgICAgICByZXR1cm4gbURyb3BEb3duSG9yaXpvbnRhbE9mZnNldDsKKyAgICAgICAgcmV0dXJuIG1Qb3B1cC5nZXRIb3Jpem9udGFsT2Zmc2V0KCk7CiAgICAgfQogCiAgICAgIC8qKgpAQCAtNDIyLDcgKzQxMCw3IEBACiAgICAgICogQGhpZGUgUGVuZGluZyBBUEkgY291bmNpbCBhcHByb3ZhbAogICAgICAqLwogICAgIHB1YmxpYyBib29sZWFuIGlzRHJvcERvd25BbHdheXNWaXNpYmxlKCkgewotICAgICAgICByZXR1cm4gbURyb3BEb3duQWx3YXlzVmlzaWJsZTsKKyAgICAgICAgcmV0dXJuIG1Qb3B1cC5pc0Ryb3BEb3duQWx3YXlzVmlzaWJsZSgpOwogICAgIH0KIAogICAgIC8qKgpAQCAtNDM5LDcgKzQyNyw3IEBACiAgICAgICogQGhpZGUgUGVuZGluZyBBUEkgY291bmNpbCBhcHByb3ZhbAogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldERyb3BEb3duQWx3YXlzVmlzaWJsZShib29sZWFuIGRyb3BEb3duQWx3YXlzVmlzaWJsZSkgewotICAgICAgICBtRHJvcERvd25BbHdheXNWaXNpYmxlID0gZHJvcERvd25BbHdheXNWaXNpYmxlOworICAgICAgICBtUG9wdXAuc2V0RHJvcERvd25BbHdheXNWaXNpYmxlKGRyb3BEb3duQWx3YXlzVmlzaWJsZSk7CiAgICAgfQogICAgCiAgICAgLyoqCkBAIC02MDYsMTUgKzU5NCwxMyBAQAogICAgICAgICAgICAgbUZpbHRlciA9IG51bGw7CiAgICAgICAgIH0KIAotICAgICAgICBpZiAobURyb3BEb3duTGlzdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldEFkYXB0ZXIobUFkYXB0ZXIpOwotICAgICAgICB9CisgICAgICAgIG1Qb3B1cC5zZXRBZGFwdGVyKG1BZGFwdGVyKTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgYm9vbGVhbiBvbktleVByZUltZShpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQpIHsKICAgICAgICAgaWYgKGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9CQUNLICYmIGlzUG9wdXBTaG93aW5nKCkKLSAgICAgICAgICAgICAgICAmJiAhbURyb3BEb3duQWx3YXlzVmlzaWJsZSkgeworICAgICAgICAgICAgICAgICYmICFtUG9wdXAuaXNEcm9wRG93bkFsd2F5c1Zpc2libGUoKSkgewogICAgICAgICAgICAgLy8gc3BlY2lhbCBjYXNlIGZvciB0aGUgYmFjayBrZXksIHdlIGRvIG5vdCBldmVuIHRyeSB0byBzZW5kIGl0CiAgICAgICAgICAgICAvLyB0byB0aGUgZHJvcCBkb3duIGxpc3QgYnV0IGluc3RlYWQsIGNvbnN1bWUgaXQgaW1tZWRpYXRlbHkKICAgICAgICAgICAgIGlmIChldmVudC5nZXRBY3Rpb24oKSA9PSBLZXlFdmVudC5BQ1RJT05fRE9XTiAmJiBldmVudC5nZXRSZXBlYXRDb3VudCgpID09IDApIHsKQEAgLTYzMywxOCArNjE5LDE2IEBACiAKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgYm9vbGVhbiBvbktleVVwKGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCkgewotICAgICAgICBpZiAoaXNQb3B1cFNob3dpbmcoKSAmJiBtRHJvcERvd25MaXN0LmdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCkgPj0gMCkgewotICAgICAgICAgICAgYm9vbGVhbiBjb25zdW1lZCA9IG1Ecm9wRG93bkxpc3Qub25LZXlVcChrZXlDb2RlLCBldmVudCk7Ci0gICAgICAgICAgICBpZiAoY29uc3VtZWQpIHsKLSAgICAgICAgICAgICAgICBzd2l0Y2ggKGtleUNvZGUpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlIGxpc3QgYWNjZXB0cyB0aGUga2V5IGV2ZW50cyBhbmQgdGhlIGtleSBldmVudAotICAgICAgICAgICAgICAgICAgICAvLyB3YXMgYSBjbGljaywgdGhlIHRleHQgdmlldyBnZXRzIHRoZSBzZWxlY3RlZCBpdGVtCi0gICAgICAgICAgICAgICAgICAgIC8vIGZyb20gdGhlIGRyb3AgZG93biBhcyBpdHMgY29udGVudAotICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRU5URVI6Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0NFTlRFUjoKLSAgICAgICAgICAgICAgICAgICAgICAgIHBlcmZvcm1Db21wbGV0aW9uKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgIGJvb2xlYW4gY29uc3VtZWQgPSBtUG9wdXAub25LZXlVcChrZXlDb2RlLCBldmVudCk7CisgICAgICAgIGlmIChjb25zdW1lZCkgeworICAgICAgICAgICAgc3dpdGNoIChrZXlDb2RlKSB7CisgICAgICAgICAgICAvLyBpZiB0aGUgbGlzdCBhY2NlcHRzIHRoZSBrZXkgZXZlbnRzIGFuZCB0aGUga2V5IGV2ZW50CisgICAgICAgICAgICAvLyB3YXMgYSBjbGljaywgdGhlIHRleHQgdmlldyBnZXRzIHRoZSBzZWxlY3RlZCBpdGVtCisgICAgICAgICAgICAvLyBmcm9tIHRoZSBkcm9wIGRvd24gYXMgaXRzIGNvbnRlbnQKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9FTlRFUjoKKyAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0NFTlRFUjoKKyAgICAgICAgICAgICAgICBwZXJmb3JtQ29tcGxldGlvbigpOworICAgICAgICAgICAgICAgIHJldHV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gICAgICAgICAgICAgICAgICAgICAgICAgJiYga2V5Q29kZSAhPSBLZXlFdmVudC5LRVlDT0RFX0RQQURfQ0VOVEVSKSkpIHsKLSAgICAgICAgICAgICAgICBpbnQgY3VySW5kZXggPSBtRHJvcERvd25MaXN0LmdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCk7Ci0gICAgICAgICAgICAgICAgYm9vbGVhbiBjb25zdW1lZDsKLQotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gYmVsb3cgPSAhbVBvcHVwLmlzQWJvdmVBbmNob3IoKTsKLQotICAgICAgICAgICAgICAgIGZpbmFsIExpc3RBZGFwdGVyIGFkYXB0ZXIgPSBtQWRhcHRlcjsKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBib29sZWFuIGFsbEVuYWJsZWQ7Ci0gICAgICAgICAgICAgICAgaW50IGZpcnN0SXRlbSA9IEludGVnZXIuTUFYX1ZBTFVFOwotICAgICAgICAgICAgICAgIGludCBsYXN0SXRlbSA9IEludGVnZXIuTUlOX1ZBTFVFOwotCi0gICAgICAgICAgICAgICAgaWYgKGFkYXB0ZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBhbGxFbmFibGVkID0gYWRhcHRlci5hcmVBbGxJdGVtc0VuYWJsZWQoKTsKLSAgICAgICAgICAgICAgICAgICAgZmlyc3RJdGVtID0gYWxsRW5hYmxlZCA/IDAgOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93bkxpc3QubG9va0ZvclNlbGVjdGFibGVQb3NpdGlvbigwLCB0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgbGFzdEl0ZW0gPSBhbGxFbmFibGVkID8gYWRhcHRlci5nZXRDb3VudCgpIC0gMSA6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbURyb3BEb3duTGlzdC5sb29rRm9yU2VsZWN0YWJsZVBvc2l0aW9uKGFkYXB0ZXIuZ2V0Q291bnQoKSAtIDEsIGZhbHNlKTsgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBpZiAoKGJlbG93ICYmIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1VQICYmIGN1ckluZGV4IDw9IGZpcnN0SXRlbSkgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICghYmVsb3cgJiYga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfRE9XTiAmJiBjdXJJbmRleCA+PSBsYXN0SXRlbSkpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gV2hlbiB0aGUgc2VsZWN0aW9uIGlzIGF0IHRoZSB0b3AsIHdlIGJsb2NrIHRoZSBrZXkKLSAgICAgICAgICAgICAgICAgICAgLy8gZXZlbnQgdG8gcHJldmVudCBmb2N1cyBmcm9tIG1vdmluZy4KLSAgICAgICAgICAgICAgICAgICAgY2xlYXJMaXN0U2VsZWN0aW9uKCk7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRJbnB1dE1ldGhvZE1vZGUoUG9wdXBXaW5kb3cuSU5QVVRfTUVUSE9EX05FRURFRCk7Ci0gICAgICAgICAgICAgICAgICAgIHNob3dEcm9wRG93bigpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAvLyBXQVJOSU5HOiBQbGVhc2UgcmVhZCB0aGUgY29tbWVudCB3aGVyZSBtTGlzdFNlbGVjdGlvbkhpZGRlbgotICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICBpcyBkZWNsYXJlZAotICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0Lm1MaXN0U2VsZWN0aW9uSGlkZGVuID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgY29uc3VtZWQgPSBtRHJvcERvd25MaXN0Lm9uS2V5RG93bihrZXlDb2RlLCBldmVudCk7Ci0gICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJLZXkgZG93bjogY29kZT0iICsga2V5Q29kZSArICIgbGlzdCBjb25zdW1lZD0iICsgY29uc3VtZWQpOwotCi0gICAgICAgICAgICAgICAgaWYgKGNvbnN1bWVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIElmIGl0IGhhbmRsZWQgdGhlIGtleSBldmVudCwgdGhlbiB0aGUgdXNlciBpcwotICAgICAgICAgICAgICAgICAgICAvLyBuYXZpZ2F0aW5nIGluIHRoZSBsaXN0LCBzbyB3ZSBzaG91bGQgcHV0IGl0IGluIGZyb250LgotICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0SW5wdXRNZXRob2RNb2RlKFBvcHVwV2luZG93LklOUFVUX01FVEhPRF9OT1RfTkVFREVEKTsKLSAgICAgICAgICAgICAgICAgICAgLy8gSGVyZSdzIGEgbGl0dGxlIHRyaWNrIHdlIG5lZWQgdG8gZG8gdG8gbWFrZSBzdXJlIHRoYXQKLSAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGxpc3QgdmlldyBpcyBhY3R1YWxseSBzaG93aW5nIGl0cyBmb2N1cyBpbmRpY2F0b3IsCi0gICAgICAgICAgICAgICAgICAgIC8vIGJ5IGVuc3VyaW5nIGl0IGhhcyBmb2N1cyBhbmQgZ2V0dGluZyBpdHMgd2luZG93IG91dAotICAgICAgICAgICAgICAgICAgICAvLyBvZiB0b3VjaCBtb2RlLgotICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0LnJlcXVlc3RGb2N1c0Zyb21Ub3VjaCgpOwotICAgICAgICAgICAgICAgICAgICBzaG93RHJvcERvd24oKTsKLQotICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGtleUNvZGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGF2b2lkIHBhc3NpbmcgdGhlIGZvY3VzIGZyb20gdGhlIHRleHQgdmlldyB0byB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5leHQgY29tcG9uZW50Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRU5URVI6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9DRU5URVI6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9ET1dOOgotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfVVA6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBpZiAoYmVsb3cgJiYga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfRE9XTikgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2hlbiB0aGUgc2VsZWN0aW9uIGlzIGF0IHRoZSBib3R0b20sIHdlIGJsb2NrIHRoZQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXZlbnQgdG8gYXZvaWQgZ29pbmcgdG8gdGhlIG5leHQgZm9jdXNhYmxlIHdpZGdldAotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1ckluZGV4ID09IGxhc3RJdGVtKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIWJlbG93ICYmIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1VQICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VySW5kZXggPT0gZmlyc3RJdGVtKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgaWYgKG1Qb3B1cC5vbktleURvd24oa2V5Q29kZSwgZXZlbnQpKSB7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgaWYgKCFpc1BvcHVwU2hvd2luZygpKSB7CiAgICAgICAgICAgICBzd2l0Y2goa2V5Q29kZSkgewogICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfRE9XTjoKICAgICAgICAgICAgICAgICBwZXJmb3JtVmFsaWRhdGlvbigpOwpAQCAtNzQzLDcgKzY1MSw3IEBACiAgICAgICAgIGJvb2xlYW4gaGFuZGxlZCA9IHN1cGVyLm9uS2V5RG93bihrZXlDb2RlLCBldmVudCk7CiAgICAgICAgIG1MYXN0S2V5Q29kZSA9IEtleUV2ZW50LktFWUNPREVfVU5LTk9XTjsKIAotICAgICAgICBpZiAoaGFuZGxlZCAmJiBpc1BvcHVwU2hvd2luZygpICYmIG1Ecm9wRG93bkxpc3QgIT0gbnVsbCkgeworICAgICAgICBpZiAoaGFuZGxlZCAmJiBpc1BvcHVwU2hvd2luZygpKSB7CiAgICAgICAgICAgICBjbGVhckxpc3RTZWxlY3Rpb24oKTsKICAgICAgICAgfQogCkBAIC04MDQsMTEgKzcxMiwxMiBAQAogICAgICAgICBpZiAoZW5vdWdoVG9GaWx0ZXIoKSkgewogICAgICAgICAgICAgaWYgKG1GaWx0ZXIgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHBlcmZvcm1GaWx0ZXJpbmcoZ2V0VGV4dCgpLCBtTGFzdEtleUNvZGUpOworICAgICAgICAgICAgICAgIGJ1aWxkSW1lQ29tcGxldGlvbnMoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfS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ZSBwb3NpdGlvbiB0byBtb3ZlIHRoZSBzZWxlY3RvciB0by4KICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBzZXRMaXN0U2VsZWN0aW9uKGludCBwb3NpdGlvbikgewotICAgICAgICBpZiAobVBvcHVwLmlzU2hvd2luZygpICYmIChtRHJvcERvd25MaXN0ICE9IG51bGwpKSB7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0Lm1MaXN0U2VsZWN0aW9uSGlkZGVuID0gZmFsc2U7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldFNlbGVjdGlvbihwb3NpdGlvbik7Ci0gICAgICAgICAgICAvLyBMaXN0Vmlldy5zZXRTZWxlY3Rpb24oKSB3aWxsIGNhbGwgcmVxdWVzdExheW91dCgpCi0gICAgICAgIH0KKyAgICAgICAgbVBvcHVwLnNldFNlbGVjdGlvbihwb3NpdGlvbik7CiAgICAgfQogCiAgICAgLyoqCkBAIC04NzQsMTAgKzc3Myw3IEBACiAgICAgICogQHNlZSBMaXN0VmlldyNnZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpCiAgICAgICovCiAgICAgcHVibGljIGludCBnZXRMaXN0U2VsZWN0aW9uKCkgewotICAgICAgICBpZiAobVBvcHVwLmlzU2hvd2luZygpICYmIChtRHJvcERvd25MaXN0ICE9IG51bGwpKSB7Ci0gICAgICAgICAgICByZXR1cm4gbURyb3BEb3duTGlzdC5nZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBMaXN0Vmlldy5JTlZBTElEX1BPU0lUSU9OOworICAgICAgICByZXR1cm4gbVBvcHVwLmdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCk7CiAgICAgfQogCiAgICAgLyoqCkBAIC05MTEsMTMgKzgwNyw3IEBACiAgICAgICAgICAgICByZXBsYWNlVGV4dChjb21wbGV0aW9uLmdldFRleHQoKSk7CiAgICAgICAgICAgICBtQmxvY2tDb21wbGV0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BAIC05MzksMTggKzgyOSwxOCBAQAogICAgICAgICAgICAgbUJsb2NrQ29tcGxldGlvbiA9IGZhbHNlOyAgICAgICAgICAgIAogCiAgICAgICAgICAgICBpZiAobUl0ZW1DbGlja0xpc3RlbmVyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBmaW5hbCBEcm9wRG93bkxpc3RWaWV3IGxpc3QgPSBtRHJvcERvd25MaXN0OworICAgICAgICAgICAgICAgIGZpbmFsIExpc3RQb3B1cFdpbmRvdyBsaXN0ID0gbVBvcHVwOwogCiAgICAgICAgICAgICAgICAgaWYgKHNlbGVjdGVkVmlldyA9PSBudWxsIHx8IHBvc2l0aW9uIDwgMCkgewogICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZFZpZXcgPSBsaXN0LmdldFNlbGVjdGVkVmlldygpOwogICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGxpc3QuZ2V0U2VsZWN0ZWRJdGVtUG9zaXRpb24oKTsKICAgICAgICAgICAgICAgICAgICAgaWQgPSBsaXN0LmdldFNlbGVjdGVkSXRlbUlkKCk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1JdGVtQ2xpY2tMaXN0ZW5lci5vbkl0ZW1DbGljayhsaXN0LCBzZWxlY3RlZFZpZXcsIHBvc2l0aW9uLCBpZCk7CisgICAgICAgICAgICAgICAgbUl0ZW1DbGlja0xpc3RlbmVyLm9uSXRlbUNsaWNrKGxpc3QuZ2V0TGlzdFZpZXcoKSwgc2VsZWN0ZWRWaWV3LCBwb3NpdGlvbiwgaWQpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgaWYgKG1Ecm9wRG93bkRpc21pc3NlZE9uQ29tcGxldGlvbiAmJiAhbURyb3BEb3duQWx3YXlzVmlzaWJsZSkgeworICAgICAgICBpZiAobURyb3BEb3duRGlzbWlzc2VkT25Db21wbGV0aW9uICYmICFtUG9wdXAuaXNEcm9wRG93bkFsd2F5c1Zpc2libGUoKSkgewogICAgICAgICAgICAgZGlzbWlzc0Ryb3BEb3duKCk7CiAgICAgICAgIH0KICAgICB9CkBAIC0xMDAwLDcgKzg5MCw2IEBACiAgICAgLyoqIHtAaW5oZXJpdERvY30gKi8KICAgICBwdWJsaWMgdm9pZCBvbkZpbHRlckNvbXBsZXRlKGludCBjb3VudCkgewogICAgICAgICB1cGRhdGVEcm9wRG93bkZvckZpbHRlcihjb3VudCk7Ci0KICAgICB9CiAKICAgICBwcml2YXRlIHZvaWQgdXBkYXRlRHJvcERvd25Gb3JGaWx0ZXIoaW50IGNvdW50KSB7CkBAIC0xMDE0LDExICs5MDMsMTIgQEAKICAgICAgICAgICogdG8gZmlsdGVyLgogICAgICAgICAgKi8KIAotICAgICAgICBpZiAoKGNvdW50ID4gMCB8fCBtRHJvcERvd25BbHdheXNWaXNpYmxlKSAmJiBlbm91Z2hUb0ZpbHRlcigpKSB7CisgICAgICAgIGZpbmFsIGJvb2xlYW4gZHJvcERvd25BbHdheXNWaXNpYmxlID0gbVBvcHVwLmlzRHJvcERvd25BbHdheXNWaXNpYmxlKCk7CisgICAgICAgIGlmICgoY291bnQgPiAwIHx8IGRyb3BEb3duQWx3YXlzVmlzaWJsZSkgJiYgZW5vdWdoVG9GaWx0ZXIoKSkgewogICAgICAgICAgICAgaWYgKGhhc0ZvY3VzKCkgJiYgaGFzV2luZG93Rm9jdXMoKSkgewogICAgICAgICAgICAgICAgIHNob3dEcm9wRG93bigpOwogICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgaWYgKCFtRHJvcERvd25BbHdheXNWaXNpYmxlKSB7CisgICAgICAgIH0gZWxzZSBpZiAoIWRyb3BEb3duQWx3YXlzVmlzaWJsZSkgewogICAgICAgICAgICAgZGlzbWlzc0Ryb3BEb3duKCk7CiAgICAgICAgIH0KICAgICB9CkBAIC0xMDI2LDcgKzkxNiw3IEBACiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIHZvaWQgb25XaW5kb3dGb2N1c0NoYW5nZWQoYm9vbGVhbiBoYXNXaW5kb3dGb2N1cykgewogICAgICAgICBzdXBlci5vbldpbmRvd0ZvY3VzQ2hhbmdlZChoYXNXaW5kb3dGb2N1cyk7Ci0gICAgICAgIGlmICghaGFzV2luZG93Rm9jdXMgJiYgIW1Ecm9wRG93bkFsd2F5c1Zpc2libGUpIHsKKyAgICAgICAgaWYgKCFoYXNXaW5kb3dGb2N1cyAmJiAhbVBvcHVwLmlzRHJvcERvd25BbHdheXNWaXNpYmxlKCkpIHsKICAgICAgICAgICAgIGRpc21pc3NEcm9wRG93bigpOwogICAgICAgICB9CiAgICAgfQpAQCAtMTAzNiw3ICs5MjYsNyBAQAogICAgICAgICBzdXBlci5vbkRpc3BsYXlIaW50KGhpbnQpOwogICAgICAgICBzd2l0Y2ggKGhpbnQpIHsKICAgICAgICAgICAgIGNhc2UgSU5WSVNJQkxFOgotICAgICAgICAgICAgICAgIGlmICghbURyb3BEb3duQWx3YXlzVmlzaWJsZSkgeworICAgICAgICAgICAgICAgIGlmICghbVBvcHVwLmlzRHJvcERvd25BbHdheXNWaXNpYmxlKCkpIHsKICAgICAgICAgICAgICAgICAgICAgZGlzbWlzc0Ryb3BEb3duKCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtMTA1MCw3ICs5NDAsNyBAQAogICAgICAgICBpZiAoIWZvY3VzZWQpIHsKICAgICAgICAgICAgIHBlcmZvcm1WYWxpZGF0aW9uKCk7CiAgICAgICAgIH0KLSAgICAgICAgaWYgKCFmb2N1c2VkICYmICFtRHJvcERvd25BbHdheXNWaXNpYmxlKSB7CisgICAgICAgIGlmICghZm9jdXNlZCAmJiAhbVBvcHVwLmlzRHJvcERvd25BbHdheXNWaXNpYmxlKCkpIHsKICAgICAgICAgICAgIGRpc21pc3NEcm9wRG93bigpOwogICAgICAgICB9CiAgICAgfQpAQCAtMTA3NSw4ICs5NjUsNiBAQAogICAgICAgICAgICAgaW1tLmRpc3B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U5QVVRfTUVUSE9EX05PVF9ORUVERUQ7CiAgICAgfQogCiAgICAgLyoqCiAgICAgICogPHA+RGlzcGxheXMgdGhlIGRyb3AgZG93biBvbiBzY3JlZW4uPC9wPgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNob3dEcm9wRG93bigpIHsKLSAgICAgICAgaW50IGhlaWdodCA9IGJ1aWxkRHJvcERvd24oKTsKLQotICAgICAgICBpbnQgd2lkdGhTcGVjID0gMDsKLSAgICAgICAgaW50IGhlaWdodFNwZWMgPSAwOwotCi0gICAgICAgIGJvb2xlYW4gbm9JbnB1dE1ldGhvZCA9IGlzSW5wdXRNZXRob2ROb3ROZWVkZWQoKTsKLQotICAgICAgICBpZiAobVBvcHVwLmlzU2hvd2luZygpKSB7Ci0gICAgICAgICAgICBpZiAobURyb3BEb3duV2lkdGggPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQpIHsKLSAgICAgICAgICAgICAgICAvLyBUaGUgY2FsbCB0byBQb3B1cFdpbmRvdydzIHVwZGF0ZSBtZXRob2QgYmVsb3cgY2FuIGFjY2VwdCAtMSBmb3IgYW55Ci0gICAgICAgICAgICAgICAgLy8gdmFsdWUgeW91IGRvIG5vdCB3YW50IHRvIHVwZGF0ZS4KLSAgICAgICAgICAgICAgICB3aWR0aFNwZWMgPSAtMTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAobURyb3BEb3duV2lkdGggPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpIHsKLSAgICAgICAgICAgICAgICB3aWR0aFNwZWMgPSBnZXREcm9wRG93bkFuY2hvclZpZXcoKS5nZXRXaWR0aCgpOworICAgICAgICBpZiAobVBvcHVwLmdldEFuY2hvclZpZXcoKSA9PSBudWxsKSB7CisgICAgICAgICAgICBpZiAobURyb3BEb3duQW5jaG9ySWQgIT0gVmlldy5OT19JRCkgeworICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRBbmNob3JWaWV3KGdldFJvb3RWaWV3KCkuZmluZFZpZXdCeUlkKG1Ecm9wRG93bkFuY2hvcklkKSk7CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHdpZHRoU3BlYyA9IG1Ecm9wRG93bldpZHRoOworICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRBbmNob3JWaWV3KHRoaXMpOwogICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobURyb3BEb3duSGVpZ2h0ID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSB7Ci0gICAgICAgICAgICAgICAgLy8gVGhlIGNhbGwgdG8gUG9wdXBXaW5kb3cncyB1cGRhdGUgbWV0aG9kIGJlbG93IGNhbiBhY2NlcHQgLTEgZm9yIGFueQotICAgICAgICAgICAgICAgIC8vIHZhbHVlIHlvdSBkbyBub3Qgd2FudCB0byB1cGRhdGUuCi0gICAgICAgICAgICAgICAgaGVpZ2h0U3BlYyA9IG5vSW5wdXRNZXRob2QgPyBoZWlnaHQgOiBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVDsKLSAgICAgICAgICAgICAgICBpZiAobm9JbnB1dE1ldGhvZCkgewotICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0V2luZG93TGF5b3V0TW9kZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25XaWR0aCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCA/Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCA6IDAsIDApOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRXaW5kb3dMYXlvdXRNb2RlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UIDogMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmIChtRHJvcERvd25IZWlnaHQgPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpIHsKLSAgICAgICAgICAgICAgICBoZWlnaHRTcGVjID0gaGVpZ2h0OwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBoZWlnaHRTcGVjID0gbURyb3BEb3duSGVpZ2h0OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtUG9wdXAuc2V0T3V0c2lkZVRvdWNoYWJsZSghbUZvcmNlSWdub3JlT3V0c2lkZVRvdWNoICYmICFtRHJvcERvd25BbHdheXNWaXNpYmxlKTsKLQotICAgICAgICAgICAgbVBvcHVwLnVwZGF0ZShnZXREcm9wRG93bkFuY2hvclZpZXcoKSwgbURyb3BEb3duSG9yaXpvbnRhbE9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgbURyb3BEb3duVmVydGljYWxPZmZzZXQsIHdpZHRoU3BlYywgaGVpZ2h0U3BlYyk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAobURyb3BEb3duV2lkdGggPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQpIHsKLSAgICAgICAgICAgICAgICB3aWR0aFNwZWMgPSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRXaWR0aChnZXREcm9wRG93bkFuY2hvclZpZXcoKS5nZXRXaWR0aCgpKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0V2lkdGgobURyb3BEb3duV2lkdGgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1Ecm9wRG93bkhlaWdodCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCkgewotICAgICAgICAgICAgICAgIGhlaWdodFNwZWMgPSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1Ecm9wRG93bkhlaWdodCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCkgewotICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0SGVpZ2h0KGhlaWdodCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVBvcHVwLnNldEhlaWdodChtRHJvcERvd25IZWlnaHQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbVBvcHVwLnNldFdpbmRvd0xheW91dE1vZGUod2lkdGhTcGVjLCBoZWlnaHRTcGVjKTsKLSAgICAgICAgICAgIG1Qb3B1cC5zZXRJbnB1dE1ldGhvZE1vZGUoUG9wdXBXaW5kb3cuSU5QVVRfTUVUSE9EX05FRURFRCk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIC8vIHVzZSBvdXRzaWRlIHRvdWNoYWJsZSB0byBk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3B1cC5zZXRGb3JjZUlnbm9yZU91dHNpZGVUb3VjaChmb3JjZUlnbm9yZU91dHNpZGVUb3VjaCk7CiAgICAgfQotCi0gICAgLyoqCi0gICAgICogPHA+QnVpbGRzIHRoZSBwb3B1cCB3aW5kb3cncyBjb250ZW50IGFuZCByZXR1cm5zIHRoZSBoZWlnaHQgdGhlIHBvcHVwCi0gICAgICogc2hvdWxkIGhhdmUuIFJldHVybnMgLTEgd2hlbiB0aGUgY29udGVudCBhbHJlYWR5IGV4aXN0cy48L3A+Ci0gICAgICoKLSAgICAgKiBAcmV0dXJuIHRoZSBjb250ZW50J3MgaGVpZ2h0IG9yIC0xIGlmIGNvbnRlbnQgYWxyZWFkeSBleGlzdHMKLSAgICAgKi8KLSAgICBwcml2YXRlIGludCBidWlsZERyb3BEb3duKCkgewotICAgICAgICBWaWV3R3JvdXAgZHJvcERvd25WaWV3OwotICAgICAgICBpbnQgb3RoZXJIZWlnaHRzID0gMDsKLQorICAgIAorICAgIHByaXZhdGUgdm9pZCBidWlsZEltZUNvbXBsZXRpb25zKCkgewogICAgICAgICBmaW5hbCBMaXN0QWRhcHRlciBhZGFwdGVyID0gbUFkYXB0ZXI7CiAgICAgICAgIGlmIChhZGFwdGVyICE9IG51bGwpIHsKICAgICAgICAgICAgIElucHV0TWV0aG9kTWFuYWdlciBpbW0gPSBJbnB1dE1ldGhvZE1hbmFnZXIucGVla0luc3RhbmNlKCk7CkBAIC0xMjYwLDEzNSArMTA1OSw2IEBACiAgICAgICAgICAgICAgICAgaW1tLmRpc3BsYXlDb21wbGV0aW9ucyh0aGlzLCBjb21wbGV0aW9ucyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLQotICAgICAgICBpZiAobURyb3BEb3duTGlzdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICBDb250ZXh0IGNvbnRleHQgPSBnZXRDb250ZXh0KCk7Ci0KLSAgICAgICAgICAgIG1IaWRlU2VsZWN0b3IgPSBuZXcgTGlzdFNlbGVjdG9ySGlkZXIoKTsKLQotICAgICAgICAgICAgLyoqCi0gICAgICAgICAgICAgKiBUaGlzIFJ1bm5hYmxlIGV4aXN0cyBmb3IgdGhlIHNvbGUgcHVycG9zZSBvZiBjaGVja2luZyBpZiB0aGUgdmlldyBsYXlvdXQgaGFzIGdvdAotICAgICAgICAgICAgICogY29tcGxldGVkIGFuZCBpZiBzbyBjYWxsIHNob3dEcm9wRG93biB0byBkaXNwbGF5IHRoZSBkcm9wIGRvd24uIFRoaXMgaXMgdXNlZCB0byBzaG93Ci0gICAgICAgICAgICAgKiB0aGUgZHJvcCBkb3duIGFzIHNvb24gYXMgcG9zc2libGUgYWZ0ZXIgdXNlciBvcGVucyB1cCB0aGUgc2VhcmNoIGRpYWxvZywgd2l0aG91dAotICAgICAgICAgICAgICogd2FpdGluZyBmb3IgdGhlIG5vcm1hbCBVSSBwaXBlbGluZSB0byBkbyBpdCdzIGpvYiB3aGljaCBpcyBzbG93ZXIgdGhhbiB0aGlzIG1ldGhvZC4KLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgbVNob3dEcm9wRG93blJ1bm5hYmxlID0gbmV3IFJ1bm5hYmxlKCkgewotICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gVmlldyBsYXlvdXQgc2hvdWxkIGJlIGFsbCBkb25lIGJlZm9yZSBkaXNwbGF5aW5nIHRoZSBkcm9wIGRvd24uCi0gICAgICAgICAgICAgICAgICAgIFZpZXcgdmlldyA9IGdldERyb3BEb3duQW5jaG9yVmlldygpOwotICAgICAgICAgICAgICAgICAgICBpZiAodmlldyAhPSBudWxsICYmIHZpZXcuZ2V0V2luZG93VG9rZW4oKSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzaG93RHJvcERvd24oKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH07Ci0KLSAgICAgICAgICAgIG1Ecm9wRG93bkxpc3QgPSBuZXcgRHJvcERvd25MaXN0Vmlldyhjb250ZXh0KTsKLSAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0U2VsZWN0b3IobURyb3BEb3duTGlzdEhpZ2hsaWdodCk7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldEFkYXB0ZXIoYWRhcHRlcik7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldFZlcnRpY2FsRmFkaW5nRWRnZUVuYWJsZWQodHJ1ZSk7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldE9uSXRlbUNsaWNrTGlzdGVuZXIobURyb3BEb3duSXRlbUNsaWNrTGlzdGVuZXIpOwotICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRGb2N1c2FibGUodHJ1ZSk7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldEZvY3VzYWJsZUluVG91Y2hNb2RlKHRydWUpOwotICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRPbkl0ZW1TZWxlY3RlZExpc3RlbmVyKG5ldyBBZGFwdGVyVmlldy5Pbkl0ZW1TZWxlY3RlZExpc3RlbmVyKCkgewotICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uSXRlbVNlbGVjdGVkKEFkYXB0ZXJWaWV3PD8+IHBhcmVudCwgVmlldyB2aWV3LAotICAgICAgICAgICAgICAgICAgICAgICAgaW50IHBvc2l0aW9uLCBsb25nIGlkKSB7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHBvc2l0aW9uICE9IC0xKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBEcm9wRG93bkxpc3RWaWV3IGRyb3BEb3duTGlzdCA9IG1Ecm9wRG93bkxpc3Q7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkcm9wRG93bkxpc3QgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyb3BEb3duTGlzdC5tTGlzdFNlbGVjdGlvbkhpZGRlbiA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25Ob3RoaW5nU2VsZWN0ZWQoQWRhcHRlclZpZXc8Pz4gcGFyZW50KSB7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSk7Ci0gICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldE9uU2Nyb2xsTGlzdGVuZXIobmV3IFBvcHVwU2Nyb2xsTGlzdGVuZXIoKSk7Ci0KLSAgICAgICAgICAgIGlmIChtSXRlbVNlbGVjdGVkTGlzdGVuZXIgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0T25JdGVtU2VsZWN0ZWRMaXN0ZW5lcihtSXRlbVNlbGVjdGVkTGlzdGVuZXIpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBkcm9wRG93blZpZXcgPSBtRHJvcERvd25MaXN0OwotCi0gICAgICAgICAgICBWaWV3IGhpbnRWaWV3ID0gZ2V0SGludFZpZXcoY29udGV4dCk7Ci0gICAgICAgICAgICBpZiAoaGludFZpZXcgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIC8vIGlmIGFuIGhpbnQgaGFzIGJlZW4gc3BlY2lmaWVkLCB3ZSBhY2NvbW9kYXRlIG1vcmUgc3BhY2UgZm9yIGl0IGFuZAotICAgICAgICAgICAgICAgIC8vIGFkZCBhIHRleHQgdmlldyBpbiB0aGUgZHJvcCBkb3duIG1lbnUsIGF0IHRoZSBib3R0b20gb2YgdGhlIGxpc3QKLSAgICAgICAgICAgICAgICBMaW5lYXJMYXlvdXQgaGludENvbnRhaW5lciA9IG5ldyBMaW5lYXJMYXlvdXQoY29udGV4dCk7Ci0gICAgICAgICAgICAgICAgaGludENvbnRhaW5lci5zZXRPcmllbnRhdGlvbihMaW5lYXJMYXlvdXQuVkVSVElDQUwpOwotCi0gICAgICAgICAgICAgICAgTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcyBoaW50UGFyYW1zID0gbmV3IExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMoCi0gICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCwgMCwgMS4wZgotICAgICAgICAgICAgICAgICk7Ci0gICAgICAgICAgICAgICAgaGludENvbnRhaW5lci5hZGRWaWV3KGRyb3BEb3duVmlldywgaGludFBhcmFtcyk7Ci0gICAgICAgICAgICAgICAgaGludENvbnRhaW5lci5hZGRWaWV3KGhpbnRWaWV3KTsKLQotICAgICAgICAgICAgICAgIC8vIG1lYXN1cmUgdGhlIGhpbnQncyBoZWlnaHQgdG8gZmluZCBob3cgbXVjaCBtb3JlIHZlcnRpY2FsIHNwYWNlCi0gICAgICAgICAgICAgICAgLy8gd2UgbmVlZCB0byBhZGQgdG8gdGhlIGRyb3AgZG93bidzIGhlaWdodAotICAgICAgICAgICAgICAgIGludCB3aWR0aFNwZWMgPSBNZWFzdXJlU3BlYy5tYWtlTWVhc3VyZVNwZWMoZ2V0V2lkdGgoKSwgTWVhc3VyZVNwZWMuQVRfTU9TVCk7Ci0gICAgICAgICAgICAgICAgaW50IGhlaWdodFNwZWMgPSBNZWFzdXJlU3BlYy5VTlNQRUNJRklFRDsKLSAgICAgICAgICAgICAgICBoaW50Vmlldy5tZWFzdXJlKHdpZHRoU3BlYywgaGVpZ2h0U3BlYyk7Ci0KLSAgICAgICAgICAgICAgICBoaW50UGFyYW1zID0gKExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMpIGhpbnRWaWV3LmdldExheW91dFBhcmFtcygpOwotICAgICAgICAgICAgICAgIG90aGVySGVpZ2h0cyA9IGhpbnRWaWV3LmdldE1lYXN1cmVkSGVpZ2h0KCkgKyBoaW50UGFyYW1zLnRvcE1hcmdpbgotICAgICAgICAgICAgICAgICAgICAgICAgKyBoaW50UGFyYW1zLmJvdHRvbU1hcmdpbjsKLQotICAgICAgICAgICAgICAgIGRyb3BEb3duVmlldyA9IGhpbnRDb250YWluZXI7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1Qb3B1cC5zZXRDb250ZW50Vmlldyhkcm9wRG93blZpZXcpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZHJvcERvd25WaWV3ID0gKFZpZXdHcm91cCkgbVBvcHVwLmdldENvbnRlbnRWaWV3KCk7Ci0gICAgICAgICAgICBmaW5hbCBWaWV3IHZpZXcgPSBkcm9wRG93blZpZXcuZmluZFZpZXdCeUlkKEhJTlRfVklFV19JRCk7Ci0gICAgICAgICAgICBpZiAodmlldyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcyBoaW50UGFyYW1zID0KLSAgICAgICAgICAgICAgICAgICAgICAgIChMaW5lYXJMYXlvdXQuTGF5b3V0UGFyYW1zKSB2aWV3LmdldExheW91dFBhcmFtcygpOwotICAgICAgICAgICAgICAgIG90aGVySGVpZ2h0cyA9IHZpZXcuZ2V0TWVhc3VyZWRIZWlnaHQoKSArIGhpbnRQYXJhbXMudG9wTWFyZ2luCi0gICAgICAgICAgICAgICAgICAgICAgICArIGhpbnRQYXJhbXMuYm90dG9tTWFyZ2luOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLy8gTWF4IGhlaWdodCBhdmFpbGFibGUgb24gdGhlIHNjcmVlbiBmb3IgYSBwb3B1cC4KLSAgICAgICAgYm9vbGVhbiBpZ25vcmVCb3R0b21EZWNvcmF0aW9ucyA9Ci0gICAgICAgICAgICAgICAgbVBvcHVwLmdldElucHV0TWV0aG9kTW9kZSgpID09IFBvcHVwV2luZG93LklOUFVUX01FVEhPRF9OT1RfTkVFREVEOwotICAgICAgICBmaW5hbCBpbnQgbWF4SGVpZ2h0ID0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Bmb3IKLSAgICAgICAgICogQHJldHVybiB0aGUgdmlldyBmb3IgdGhlIHNwZWNpZmllZCBpdGVtCi0gICAgICAgICAqLwotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgVmlldyBvYnRhaW5WaWV3KGludCBwb3NpdGlvbiwgYm9vbGVhbltdIGlzU2NyYXApIHsKLSAgICAgICAgICAgIFZpZXcgdmlldyA9IHN1cGVyLm9idGFpblZpZXcocG9zaXRpb24sIGlzU2NyYXApOwotCi0gICAgICAgICAgICBpZiAodmlldyBpbnN0YW5jZW9mIFRleHRWaWV3KSB7Ci0gICAgICAgICAgICAgICAgKChUZXh0Vmlldykgdmlldykuc2V0SG9yaXpvbnRhbGx5U2Nyb2xsaW5nKHRydWUpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gdmlldzsKLSAgICAgICAgfQotCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBpc0luVG91Y2hNb2RlKCkgewotICAgICAgICAgICAgLy8gV0FSTklORzogUGxlYXNlIHJlYWQgdGhlIGNvbW1lbnQgd2hlcmUgbUxpc3RTZWxlY3Rpb25IaWRkZW4gaXMgZGVjbGFyZWQKLSAgICAgICAgICAgIHJldHVybiBtTGlzdFNlbGVjdGlvbkhpZGRlbiB8fCBzdXBlci5pc0luVG91Y2hNb2RlKCk7Ci0gICAgICAgIH0KLQotICAgICAgICAvKioKLSAgICAgICAgICogPHA+UmV0dXJucyB0aGUgZm9jdXMgc3RhdGUgaW4gdGhlIGRyb3AgZG93bi48L3A+Ci0gICAgICAgICAqCi0gICAgICAgICAqIEByZXR1cm4gdHJ1ZSBhbHdheXMKLSAgICAgICAgICovCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBoYXNXaW5kb3dGb2N1cygpIHsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoqCi0gICAgICAgICAqIDxwPlJldHVybnMgdGhlIGZvY3VzIHN0YXRlIGluIHRoZSBkcm9wIGRvd24uPC9wPgotICAgICAgICAgKgotICAgICAgICAgKiBAcmV0dXJuIHRydWUgYWx3YXlzCi0gICAgICAgICAqLwotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHVibGljIGJvb2xlYW4gaXNGb2N1c2VkKCkgewotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLQotICAgICAgICAvKioKLSAgICAgICAgICogPHA+UmV0dXJucyB0aGUgZm9jdXMgc3RhdGUgaW4gdGhlIGRyb3AgZG93bi48L3A+Ci0gICAgICAgICAqCi0gICAgICAgICAqIEByZXR1cm4gdHJ1ZSBhbHdheXMKLSAgICAgICAgICovCi0gICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBoYXNGb2N1cygpIHsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICBwcm90ZWN0ZWQgaW50W10gb25DcmVhdGVEcmF3YWJsZVN0YXRlKGludCBleHRyYVNwYWNlKSB7Ci0gICAgICAgICAgICBpbnRbXSByZXMgPSBzdXBlci5vbkNyZWF0ZURyYXdhYmxlU3RhdGUoZXh0cmFTcGFjZSk7Ci0gICAgICAgICAgICAvL25vaW5zcGVjdGlvbiBDb25zdGFudElmU3RhdGVtZW50Ci0gICAgICAgICAgICBpZiAoZmFsc2UpIHsKLSAgICAgICAgICAgICAgICBTdHJpbmdCdWlsZGVyIHNiID0gbmV3IFN0cmluZ0J1aWxkZXIoIkNyZWF0ZWQgZHJhd2FibGUgc3RhdGU6IFsiKTsKLSAgICAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8cmVzLmxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChpID4gMCkgc2IuYXBwZW5kKCIsICIpOwotICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoIj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gICAgKiBAcGFyYW0gYWRhcHRlciBUaGUgYWRhcHRlciB0byB1c2UgdG8gY3JlYXRlIHRoaXMgd2luZG93J3MgY29udGVudC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRBZGFwdGVyKExpc3RBZGFwdGVyIGFkYXB0ZXIpIHsKKyAgICAgICAgaWYgKG1PYnNlcnZlciA9PSBudWxsKSB7CisgICAgICAgICAgICBtT2JzZXJ2ZXIgPSBuZXcgUG9wdXBEYXRhU2V0T2JzZXJ2ZXIoKTsKKyAgICAgICAgfSBlbHNlIGlmIChtQWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICBtQWRhcHRlci51bnJlZ2lzdGVyRGF0YVNldE9ic2VydmVyKG1PYnNlcnZlcik7CisgICAgICAgIH0KKyAgICAgICAgbUFkYXB0ZXIgPSBhZGFwdGVyOworICAgICAgICBpZiAobUFkYXB0ZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgYWRhcHRlci5yZWdpc3RlckRhdGFTZXRPYnNlcnZlcihtT2JzZXJ2ZXIpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAobURyb3BEb3duTGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldEFkYXB0ZXIobUFkYXB0ZXIpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHdoZXJlIHRoZSBvcHRpb25hbCBwcm9tcHQgdmlldyBzaG91bGQgYXBwZWFyLiBUaGUgZGVmYXVsdCBpcworICAgICAqIHtAbGluayAjUE9TSVRJT05fUFJPTVBUX0FCT1ZFfS4KKyAgICAgKiAKKyAgICAgKiBAcGFyYW0gcG9zaXRpb24gQSBwb3NpdGlvbiBjb25zdGFudCBkZWNsYXJpbmcgd2hlcmUgdGhlIHByb21wdCBzaG91bGQgYmUgZGlzcGxheWVkLgorICAgICAqIAorICAgICAqIEBzZWUgI1BPU0lUSU9OX1BST01QVF9BQk9WRQorICAgICAqIEBzZWUgI1BPU0lUSU9OX1BST01QVF9CRUxPVworICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFByb21wdFBvc2l0aW9uKGludCBwb3NpdGlvbikgeworICAgICAgICBtUHJvbXB0UG9zaXRpb24gPSBwb3NpdGlvbjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFdoZXJlIHRoZSBvcHRpb25hbCBwcm9tcHQgdmlldyBzaG91bGQgYXBwZWFyLgorICAgICAqIAorICAgICAqIEBzZWUgI1BPU0lUSU9OX1BST01QVF9BQk9WRQorICAgICAqIEBzZWUgI1BPU0lUSU9OX1BST01QVF9CRUxPVworICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0UHJvbXB0UG9zaXRpb24oKSB7CisgICAgICAgIHJldHVybiBtUHJvbXB0UG9zaXRpb247CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHdoZXRoZXIgdGhpcyB3aW5kb3cgc2hvdWxkIGJlIG1vZGFsIHdoZW4gc2hvd24uCisgICAgICogCisgICAgICogPHA+SWYgYSBwb3B1cCB3aW5kb3cgaXMgbW9kYWwsIGl0IHdpbGwgcmVjZWl2ZSBhbGwgdG91Y2ggYW5kIGtleSBpbnB1dC4KKyAgICAgKiBJZiB0aGUgdXNlciB0b3VjaGVzIG91dHNpZGUgdGhlIHBvcHVwIHdpbmRvdydzIGNvbnRlbnQgYXJlYSB0aGUgcG9wdXAgd2luZG93CisgICAgICogd2lsbCBiZSBkaXNtaXNzZWQuCisgICAgICogCisgICAgICogQHBhcmFtIG1vZGFsIHtAY29kZSB0cnVlfSBpZiB0aGUgcG9wdXAgd2luZG93IHNob3VsZCBiZSBtb2RhbCwge0Bjb2RlIGZhbHNlfSBvdGhlcndpc2UuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0TW9kYWwoYm9vbGVhbiBtb2RhbCkgeworICAgICAgICBtTW9kYWwgPSB0cnVlOworICAgICAgICBtUG9wdXAuc2V0Rm9jdXNhY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CisgICAgICogQHBhcmFtIHNlbGVjdG9yIExpc3Qgc2VsZWN0b3IgZHJhd2FibGUgdG8gdXNlIGluIHRoZSBwb3B1cC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRMaXN0U2VsZWN0b3IoRHJhd2FibGUgc2VsZWN0b3IpIHsKKyAgICAgICAgbURyb3BEb3duTGlzdEhpZ2hsaWdodCA9IHNlbGVjdG9yOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gVGhlIGJhY2tncm91bmQgZHJhd2FibGUgZm9yIHRoZSBwb3B1cCB3aW5kb3cuCisgICAgICovCisgICAgcHVibGljIERyYXdhYmxlIGdldEJhY2tncm91bmQoKSB7CisgICAgICAgIHJldHVybiBtUG9wdXAuZ2V0QmFja2dyb3VuZCgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgYSBkcmF3YWJsZSB0byBiZSB0aGUgYmFja2dyb3VuZCBmb3IgdGhlIHBvcHVwIHdpbmRvdy4KKyAgICAgKiAKKyAgICAgKiBAcGFyYW0gZCBBIGRyYXdhYmxlIHRvIHNldCBhcyB0aGUgYmFja2dyb3VuZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRCYWNrZ3JvdW5kRHJhd2FibGUoRHJhd2FibGUgZCkgeworICAgICAgICBtUG9wdXAuc2V0QmFja2dyb3VuZERyYXdhYmxlKGQpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCBhbiBhbmltYXRpb24gc3R5bGUgdG8gdXNlIHdoZW4gdGhlIHBvcHVwIHdpbmRvdyBpcyBzaG93biBvciBkaXNtaXNzZWQuCisgICAgICogCisgICAgICogQHBhcmFtIGFuaW1hdGlvblN0eWxlIEFuaW1hdGlvbiBzdHlsZSB0byB1c2UuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0QW5pbWF0aW9uU3R5bGUoaW50IGFuaW1hdGlvblN0eWxlKSB7CisgICAgICAgIG1Qb3B1cC5zZXRBbmltYXRpb25TdHlsZShhbmltYXRpb25TdHlsZSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgYW5pbWF0aW9uIHN0eWxlIHRoYXQgd2lsbCBiZSB1c2VkIHdoZW4gdGhlIHBvcHVwIHdpbmRvdyBpcworICAgICAqIHNob3duIG9yIGRpc21pc3NlZC4KKyAgICAgKiAKKyAgICAgKiBAcmV0dXJuIEFuaW1hdGlvbiBzdHlsZSB0aGF0IHdpbGwgYmUgdXNlZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldEFuaW1hdGlvblN0eWxlKCkgeworICAgICAgICByZXR1cm4gbVBvcHVwLmdldEFuaW1hdGlvblN0eWxlKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogUmV0dXJucyB0aGUgdmlldyB0aGF0IHdpbGwgYmUgdXNlZCB0byBhbmNob3IgdGhpcyBwb3B1cC4KKyAgICAgKiAKKyAgICAgKiBAcmV0dXJuIFRoZSBwb3B1cCdzIGFuY2hvciB2aWV3CisgICAgICovCisgICAgcHVibGljIFZpZXcgZ2V0QW5jaG9yVmlldygpIHsKKyAgICAgICAgcmV0dXJuIG1Ecm9wRG93bkFuY2hvclZpZXc7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0cyB0aGUgcG9wdXAncyBhbmNob3Igdmlldy4gVGhpcyBwb3B1cCB3aWxsIGFsd2F5cyBiZSBwb3NpdGlvbmVkIHJlbGF0aXZlIHRvCisgICAgICogdGhlIGFuY2hvciB2aWV3IHdoZW4gc2hvd24uCisgICAgICogCisgICAgICogQHBhcmFtIGFuY2hvciBUaGUgdmlldyB0byB1c2UgYXMgYW4gYW5jaG9yLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEFuY2hvclZpZXcoVmlldyBhbmNob3IpIHsKKyAgICAgICAgbURyb3BEb3duQW5jaG9yVmlldyA9IGFuY2hvcjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFRoZSBob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0KGludCBvZmZzZXQpIHsKKyAgICAgICAgbURyb3BEb3duVmVydGljYWxPZmZzZXQgPSBvZmZzZXQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBUaGUgd2lkdGggb2YgdGhlIHBvcHVwIHdpbmRvdyBpbiBwaXhlbHMuCisgICAgICovCisgICAgcHVibGljIGludCBnZXRXaWR0aCgpIHsKKyAgICAgICAgcmV0dXJuIG1Ecm9wRG93bldpZHRoOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgdGhlIHdpZHRoIG9mIHRoZSBwb3B1cCB3aW5kb3cgaW4gcGl4ZWxzLiBDYW4gYWxzbyBiZSB7QGxpbmsgI01BVENIX1BBUkVOVH0KKyAgICAgKiBvciB7QGxpbmsgI1dSQVBfQ09OVEVOVH0uCisgICAgICogCisgICAgICogQHBhcmFtIHdpZHRoIFdpZHRoIG9mIHRoZSBwb3B1cCB3aW5kb3cuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0V2lkdGgoaW50IHdpZHRoKSB7CisgICAgICAgIG1Ecm9wRG93bldpZHRoID0gd2lkdGg7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBUaGUgaGVpZ2h0IG9mIHRoZSBwb3B1cCB3aW5kb3cgaW4gcGl4ZWxzLgorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0SGVpZ2h0KCkgeworICAgICAgICByZXR1cm4gbURyb3BEb3duSGVpZ2h0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldHMgdGhlIGhlaWdodCBvZiB0aGUgcG9wdXAgd2luZG93IGluIHBpeGVscy4gQ2FuIGFsc28gYmUge0BsaW5rICNNQVRDSF9QQVJFTlR9LgorICAgICAqIAorICAgICAqIEBwYXJhbSBoZWlnaHQgSGVpZ2h0IG9mIHRoZSBwb3B1cCB3aW5kb3cuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0SGVpZ2h0KGludCBoZWlnaHQpIHsKKyAgICAgICAgbURy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bGVjdGVkTGlzdGVuZXI7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IGEgdmlldyB0byBhY3QgYXMgYSB1c2VyIHByb21wdCBmb3IgdGhpcyBwb3B1cCB3aW5kb3cuIFdoZXJlIHRoZSBwcm9tcHQgdmlldyB3aWxsIGFwcGVhcgorICAgICAqIGlzIGNvbnRyb2xsZWQgYnkge0BsaW5rICNzZXRQcm9tcHRQb3NpdGlvbihpbnQpfS4KKyAgICAgKiAKKyAgICAgKiBAcGFyYW0gcHJvbXB0IFZpZXcgdG8gdXNlIGFzIGFuIGluZm9ybWF0aW9uYWwgcHJvbXB0LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFByb21wdFZpZXcoVmlldyBwcm9tcHQpIHsKKyAgICAgICAgYm9vbGVhbiBzaG93aW5nID0gaXNTaG93aW5nKCk7CisgICAgICAgIGlmIChzaG93aW5nKSB7CisgICAgICAgICAgICByZW1vdmVQcm9tcHRWaWV3KCk7CisgICAgICAgIH0KKyAgICAgICAgbVByb21wdFZpZXcgPSBwcm9tcHQ7CisgICAgICAgIGlmIChzaG93aW5nKSB7CisgICAgICAgICAgICBzaG93KCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBQb3N0IGEge0BsaW5rICNzaG93KCl9IGNhbGwgdG8gdGhlIFVJIHRocmVhZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBwb3N0U2hvdygpIHsKKyAgICAgICAgbUhhbmRsZXIucG9zdChtU2hvd0Ryb3BEb3duUnVubmFibGUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNob3cgdGhlIHBvcHVwIGxpc3QuIElmIHRoZSBsaXN0IGlzIGFscmVhZHkgc2hvd2luZywgdGhpcyBtZXRob2QKKyAgICAgKiB3aWxsIHJlY2FsY3VsYXRlIHRoZSBwb3B1cCdzIHNpemUgYW5kIHBvc2l0aW9uLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNob3coKSB7CisgICAgICAgIGludCBoZWlnaHQgPSBidWlsZERyb3BEb3duKCk7CisKKyAgICAgICAgaW50IHdpZHRoU3BlYyA9IDA7CisgICAgICAgIGludCBoZWlnaHRTcGVjID0gMDsKKworICAgICAgICBib29sZWFuIG5vSW5wdXRNZXRob2QgPSBpc0lucHV0TWV0aG9kTm90TmVlZGVkKCk7CisKKyAgICAgICAgaWYgKG1Qb3B1cC5pc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgaWYgKG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSB7CisgICAgICAgICAgICAgICAgLy8gVGhlIGNhbGwgdG8gUG9wdXBXaW5kb3cncyB1cGRhdGUgbWV0aG9kIGJlbG93IGNhbiBhY2NlcHQgLTEgZm9yIGFueQorICAgICAgICAgICAgICAgIC8vIHZhbHVlIHlvdSBkbyBub3Qgd2FudCB0byB1cGRhdGUuCisgICAgICAgICAgICAgICAgd2lkdGhTcGVjID0gLTE7CisgICAgICAgICAgICB9IGVsc2UgaWYgKG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UKSB7CisgICAgICAgICAgICAgICAgd2lkdGhTcGVjID0gZ2V0QW5jaG9yVmlldygpLmdldFdpZHRoKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHdpZHRoU3BlYyA9IG1Ecm9wRG93bldpZHRoOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAobURyb3BEb3duSGVpZ2h0ID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSB7CisgICAgICAgICAgICAgICAgLy8gVGhlIGNhbGwgdG8gUG9wdXBXaW5kb3cncyB1cGRhdGUgbWV0aG9kIGJlbG93IGNhbiBhY2NlcHQgLTEgZm9yIGFueQorICAgICAgICAgICAgICAgIC8vIHZhbHVlIHlvdSBkbyBub3Qgd2FudCB0byB1cGRhdGUuCisgICAgICAgICAgICAgICAgaGVpZ2h0U3BlYyA9IG5vSW5wdXRNZXRob2QgPyBoZWlnaHQgOiBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVDsKKyAgICAgICAgICAgICAgICBpZiAobm9JbnB1dE1ldGhvZCkgeworICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0V2luZG93TGF5b3V0TW9kZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25XaWR0aCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCA/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCA6IDAsIDApOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRXaW5kb3dMYXlvdXRNb2RlKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UIDogMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChtRHJvcERvd25IZWlnaHQgPT0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpIHsKKyAgICAgICAgICAgICAgICBoZWlnaHRTcGVjID0gaGVpZ2h0OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBoZWlnaHRTcGVjID0gbURyb3BEb3duSGVpZ2h0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtUG9wdXAuc2V0T3V0c2lkZVRvdWNoYWJsZSghbUZvcmNlSWdub3JlT3V0c2lkZVRvdWNoICYmICFtRHJvcERvd25BbHdheXNWaXNpYmxlKTsKKworICAgICAgICAgICAgbVBvcHVwLnVwZGF0ZShnZXRBbmNob3JWaWV3KCksIG1Ecm9wRG93bkhvcml6b250YWxPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgIG1Ecm9wRG93blZlcnRpY2FsT2Zmc2V0LCB3aWR0aFNwZWMsIGhlaWdodFNwZWMpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKG1Ecm9wRG93bldpZHRoID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSB7CisgICAgICAgICAgICAgICAgd2lkdGhTcGVjID0gVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQ7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChtRHJvcERvd25XaWR0aCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCkgeworICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0V2lkdGgoZ2V0QW5jaG9yVmlldygpLmdldFdpZHRoKCkpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRXaWR0aChtRHJvcERvd25XaWR0aCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAobURyb3BEb3duSGVpZ2h0ID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSB7CisgICAgICAgICAgICAgICAgaGVpZ2h0U3BlYyA9IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAobURyb3BEb3duSGVpZ2h0ID09IFZpZXdHcm91cC5MYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UKSB7CisgICAgICAgICAgICAgICAgICAgIG1Qb3B1cC5zZXRIZWlnaHQoaGVpZ2h0KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0SGVpZ2h0KG1Ecm9wRG93bkhlaWdodCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtUG9wdXAuc2V0V2luZG93TGF5b3V0TW9kZSh3aWR0aFNwZWMsIGhlaWdodFNwZWMpOworICAgICAgICAgICAgbVBvcHVwLnNldElucHV0TWV0aG9kTW9kZShQb3B1cFdpbmRvdy5JTlBVVF9NRVRIT0RfTkVFREVEKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gdXNlIG91dHNpZGUgdG91Y2hhYmxlIHRvIGRpc21pc3MgZHJvcCBkb3duIHdoZW4gdG91Y2hpbmcgb3V0c2lkZSBvZiBpdCwgc28KKyAgICAgICAgICAgIC8vIG9ubHkgc2V0IHRoaXMgaWYgdGhlIGRyb3Bkb3duIGlzIG5vdCBhbHdheXMgdmlzaWJsZQorICAgICAgICAgICAgbVBvcHVwLnNldE91dHNpZGVUb3VjaGFibGUoIW1Gb3JjZUlnbm9yZU91dHNpZGVUb3VjaCAmJiAhbURyb3BEb3duQWx3YXlzVmlzaWJsZSk7CisgICAgICAgICAgICBtUG9wdXAuc2V0VG91Y2hJbnRlcmNlcHRvcihtVG91Y2hJbnRlcmNlcHRvcik7CisgICAgICAgICAgICBtUG9wdXAuc2hvd0FzRHJvcERvd24oZ2V0QW5jaG9yVmlldygpLAorICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25Ib3Jpem9udGFsT2Zmc2V0LCBtRHJvcERvd25WZXJ0aWNhbE9mZnNldCk7CisgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldFNlbGVjdGlvbihMaXN0Vmlldy5JTlZBTElEX1BPU0lUSU9OKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaWYgKCFtTW9kYWwgfHwgbURyb3BEb3duTGlzdC5pc0luVG91Y2hNb2RlKCkpIHsKKyAgICAgICAgICAgICAgICBjbGVhckxpc3RTZWxlY3Rpb24oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghbU1vZGFsKSB7CisgICAgICAgICAgICAgICAgbUhhbmRsZXIucG9zdChtSGlkZVNlbGVjdG9yKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIERpc21pc3MgdGhlIHBvcHVwIHdpbmRvdy4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBkaXNtaXNzKCkgeworICAgICAgICBtUG9wdXAuZGlzbWlzcygpOworICAgICAgICByZW1vdmVQcm9tcHRWaWV3KCk7CisgICAgICAgIG1Qb3B1cC5zZXRDb250ZW50VmlldyhudWxsKTsKKyAgICAgICAgbURyb3BEb3duTGlzdCA9IG51bGw7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlbW92ZVByb21wdFZpZXcoKSB7CisgICAgICAgIGlmIChtUHJvbXB0VmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICBmaW5hbCBWaWV3UGFyZW50IHBhcmVudCA9IG1Qcm9tcHRWaWV3LmdldFBhcmVudCgpOworICAgICAgICAgICAgaWYgKHBhcmVudCBpbnN0YW5jZW9mIFZpZXdHcm91cCkgeworICAgICAgICAgICAgICAgIGZpbmFsIFZpZXdHcm91cCBncm91cCA9IChWaWV3R3JvdXApIHBhcmVudDsKKyAgICAgICAgICAgICAgICBncm91cC5yZW1vdmVWaWV3KG1Qcm9tcHRWaWV3KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIENvbnRyb2wgaG93IHRoZSBwb3B1cCBvcGVyYXRlcyB3aXRoIGFuIGlucHV0IG1ldGhvZDogb25lIG9mCisgICAgICoge0BsaW5rICNJTlBVVF9NRVRIT0RfRlJPTV9GT0NVU0FCTEV9LCB7QGxpbmsgI0lOUFVUX01FVEhPRF9ORUVERUR9LAorICAgICAqIG9yIHtAbGluayAjSU5QVVRfTUVUSE9EX05PVF9ORUVERUR9LgorICAgICAqIAorICAgICAqIDxwPklmIHRoZSBwb3B1cCBpcyBzaG93aW5nLCBjYWxsaW5nIHRoaXMgbWV0aG9kIHdpbGwgdGFrZSBlZmZlY3Qgb25seQorICAgICAqIHRoZSBuZXh0IHRpbWUgdGhlIHBvcHVwIGlzIHNob3duIG9yIHRocm91Z2ggYSBtYW51YWwgY2FsbCB0byB0aGUge0BsaW5rICNzaG93KCl9CisgICAgICogbWV0aG9kLjwvcD4KKyAgICAgKiAKKyAgICAgKiBAc2VlICNnZXRJbnB1dE1ldGhvZE1vZGUoKQorICAgICAqIEBzZWUgI3Nob3coKQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldElucHV0TWV0aG9kTW9kZShpbnQgbW9kZSkgeworICAgICAgICBtUG9wdXAuc2V0SW5wdXRNZXRob2RNb2RlKG1vZGUpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybiB0aGUgY3VycmVudCB2YWx1ZSBpbiB7QGxpbmsgI3NldElucHV0TWV0aG9kTW9kZShpbnQpfS4KKyAgICAgKiAKKyAgICAgKiBAc2VlICNzZXRJbnB1dE1ldGhvZE1vZGUoaW50KQorICAgICAqLworICAgIHB1YmxpYyBpbnQgZ2V0SW5wdXRNZXRob2RNb2RlKCkgeworICAgICAgICByZXR1cm4gbVBvcHVwLmdldElucHV0TWV0aG9kTW9kZSgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCB0aGUgc2VsZWN0ZWQgcG9zaXRpb24gb2YgdGhlIGxpc3QuCisgICAgICogT25seSB2YWxpZCB3aGVuIHtAbGluayAjaXNTaG93aW5nKCl9ID09IHtAY29kZSB0cnVlfS4KKyAgICAgKiAKKyAgICAgKiBAcGFyYW0gcG9zaXRpb24gTGlzdCBwb3NpdGlvbiB0byBzZXQgYXMgc2VsZWN0ZWQuCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0U2VsZWN0aW9uKGludCBwb3NpdGlvbikgeworICAgICAgICBEcm9wRG93bkxpc3RWaWV3IGxpc3QgPSBtRHJvcERvd25MaXN0OworICAgICAgICBpZiAoaXNTaG93aW5nKCkgJiYgbGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICBsaXN0Lm1MaXN0U2VsZWN0aW9uSGlkZGVuID0gZmFsc2U7CisgICAgICAgICAgICBsaXN0LnNldFNlbGVjdGlvbihwb3NpdGlvbik7CisgICAgICAgICAgICBpZiAobGlzdC5nZXRDaG9pY2VNb2RlKCkgIT0gTGlzdFZpZXcuQ0hPSUNFX01PREVfTk9ORSkgeworICAgICAgICAgICAgICAgIGxpc3Quc2V0SXRlbUNoZWNrZWQocG9zaXRpb24sIHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2xlYXIgYW55IGN1cnJlbnQgbGlzdCBzZWxlY3Rpb24uCisgICAgICogT25seSB2YWxpZCB3aGVuIHtAbGluayAjaXNTaG93aW5nKCl9ID09IHtAY29kZSB0cnVlfS4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBjbGVhckxpc3RTZWxlY3Rpb24oKSB7CisgICAgICAgIGZpbmFsIERyb3BEb3duTGlzdFZpZXcgbGlzdCA9IG1Ecm9wRG93bkxpc3Q7CisgICAgICAgIGlmIChsaXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIC8vIFdBUk5JTkc6IFBsZWFzZSByZWFkIHRoZSBjb21tZW50IHdoZXJlIG1MaXN0U2VsZWN0aW9uSGlkZGVuIGlzIGRlY2xhcmVkCisgICAgICAgICAgICBsaXN0Lm1MaXN0U2VsZWN0aW9uSGlkZGVuID0gdHJ1ZTsKKyAgICAgICAgICAgIGxpc3QuaGlkZVNlbGVjdG9yKCk7CisgICAgICAgICAgICBsaXN0LnJlcXVlc3RMYXlvdXQoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4ge0Bjb2RlIHRydWV9IGlmIHRoZSBwb3B1cCBpcyBjdXJyZW50bHkgc2hvd2luZywge0Bjb2RlIGZhbHNlfSBvdGhlcndpc2UuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gaXNTaG93aW5nKCkgeworICAgICAgICByZXR1cm4gbVBvcHVwLmlzU2hvd2luZygpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4ge0Bjb2RlIHRydWV9IGlmIHRoaXMgcG9wdXAgaXMgY29uZmlndXJlZCB0byBhc3N1bWUgdGhlIHVzZXIgZG9lcyBub3QgbmVlZAorICAgICAqIHRvIGludGVyYWN0IHdpdGggdGhlIElNRSB3aGlsZSBpdCBpcyBzaG93aW5nLCB7QGNvZGUgZmFsc2V9IG90aGVyd2lzZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBpc0lucHV0TWV0aG9kTm90TmVlZGVkKCkgeworICAgICAgICByZXR1cm4gbVBvcHVwLmdldElucHV0TWV0aG9kTW9kZSgpID09IElOUFVUX01FVEhPRF9OT1RfTkVFREVEOworICAgIH0KKworICAgIC8qKgorICAgICAqIFBlcmZvcm0gYW4gaXRlbSBjbGljayBvcGVyYXRpb24gb24gdGhlIHNwZWNpZmllZCBsaXN0IGFkYXB0ZXIgcG9zaXRpb24uCisgICAgICogCisgICAgICogQHBhcmFtIHBvc2l0aW9uIEFkYXB0ZXIgcG9zaXRpb24gZm9yIHBlcmZvcm1pbmcgdGhlIGNsaWNrCisgICAgICogQHJldHVybiB0cnVlIGlmIHRoZSBjbGljayBhY3Rpb24gY291bGQgYmUgcGVyZm9ybWVkLCBmYWxzZSBpZiBub3QuCisgICAgICogICAgICAgICAoZS5nLiBpZiB0aGUgcG9wdXAgd2FzIG5vdCBzaG93aW5nLCB0aGlzIG1ldGhvZCB3b3VsZCByZXR1cm4gZmFsc2UuKQorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIHBlcmZvcm1JdGVtQ2xpY2soaW50IHBvc2l0aW9uKSB7CisgICAgICAgIGlmIChpc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgaWYgKG1JdGVtQ2xpY2tMaXN0ZW5lciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZmluYWwgRHJvcERvd25MaXN0VmlldyBsaXN0ID0gbURyb3BEb3duTGlzdDsKKyAgICAgICAgICAgICAgICBmaW5hbCBWaWV3IGNoaWxkID0gbGlzdC5nZXRDaGlsZEF0KHBvc2l0aW9uIC0gbGlzdC5nZXRGaXJzdFZpc2libGVQb3NpdGlvbigpKTsKKyAgICAgICAgICAgICAgICBtSXRlbUNsaWNrTGlzdGVuZXIub25JdGVtQ2xpY2sobGlzdCwgY2hpbGQsIHBvc2l0aW9uLCBjaGlsZC5nZXRJZCgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFRoZSBjdXJyZW50bHkgc2VsZWN0ZWQgaXRlbSBvciBudWxsIGlmIHRoZSBwb3B1cCBpcyBub3Qgc2hvd2luZy4KKyAgICAgKi8KKyAgICBwdWJsaWMgT2JqZWN0IGdldFNlbGVjdGVkSXRlbSgpIHsKKyAgICAgICAgaWYgKCFpc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1Ecm9wRG93bkxpc3QuZ2V0U2VsZWN0ZWRJdGVtKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQHJldHVybiBUaGUgcG9zaXRpb24gb2YgdGhlIGN1cnJlbnRseSBzZWxlY3RlZCBpdGVtIG9yIHtAbGluayBMaXN0VmlldyNJTlZBTElEX1BPU0lUSU9OfQorICAgICAqIGlmIHtAbGluayAjaXNTaG93aW5nKCl9ID09IHtAY29kZSBmYWxzZX0uCisgICAgICogCisgICAgICogQHNlZSBMaXN0VmlldyNnZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpCisgICAgICovCisgICAgcHVibGljIGludCBnZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpIHsKKyAgICAgICAgaWYgKCFpc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgcmV0dXJuIExpc3RWaWV3LklOVkFMSURfUE9TSVRJT047CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1Ecm9wRG93bkxpc3QuZ2V0U2VsZWN0ZWRJdGVtUG9zaXRpb24oKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAcmV0dXJuIFRoZSBJRCBvZiB0aGUgY3VycmVudGx5IHNlbGVjdGVkIGl0ZW0gb3Ige0BsaW5rIExpc3RWaWV3I0lOVkFMSURfUk9XX0lEfQorICAgICAqIGlmIHtAbGluayAjaXNTaG93aW5nKCl9ID09IHtAY29kZSBmYWxzZX0uCisgICAgICogCisgICAgICogQHNlZSBMaXN0VmlldyNnZXRTZWxlY3RlZEl0ZW1JZCgpCisgICAgICovCisgICAgcHVibGljIGxvbmcgZ2V0U2VsZWN0ZWRJdGVtSWQoKSB7CisgICAgICAgIGlmICghaXNTaG93aW5nKCkpIHsKKyAgICAgICAgICAgIHJldHVybiBMaXN0Vmlldy5JTlZBTElEX1JPV19JRDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbURyb3BEb3duTGlzdC5nZXRTZWxlY3RlZEl0ZW1JZCgpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEByZXR1cm4gVGhlIFZpZXcgZm9yIHRoZSBjdXJyZW50bHkgc2VsZWN0ZWQgaXRlbSBvciBudWxsIGlmCisgICAgICoge0BsaW5rICNpc1Nob3dp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zIGhhbmRsZWQsIGZhbHNlIGlmIGl0IHdhcyBpZ25vcmVkLgorICAgICAqIAorICAgICAqIEBzZWUgI3NldE1vZGFsKGJvb2xlYW4pCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gb25LZXlEb3duKGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCkgeworICAgICAgICAvLyB3aGVuIHRoZSBkcm9wIGRvd24gaXMgc2hvd24sIHdlIGRyaXZlIGl0IGRpcmVjdGx5CisgICAgICAgIGlmIChpc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgLy8gdGhlIGtleSBldmVudHMgYXJlIGZvcndhcmRlZCB0byB0aGUgbGlzdCBpbiB0aGUgZHJvcCBkb3duIHZpZXcKKyAgICAgICAgICAgIC8vIG5vdGUgdGhhdCBMaXN0VmlldyBoYW5kbGVzIHNwYWNlIGJ1dCB3ZSBkb24ndCB3YW50IHRoYXQgdG8gaGFwcGVuCisgICAgICAgICAgICAvLyBhbHNvIGlmIHNlbGVjdGlvbiBpcyBub3QgY3VycmVudGx5IGluIHRoZSBkcm9wIGRvd24sIHRoZW4gZG9uJ3QKKyAgICAgICAgICAgIC8vIGxldCBjZW50ZXIgb3IgZW50ZXIgcHJlc3NlcyBnbyB0aGVyZSBzaW5jZSB0aGF0IHdvdWxkIGNhdXNlIGl0CisgICAgICAgICAgICAvLyB0byBzZWxlY3Qgb25lIG9mIGl0cyBpdGVtcworICAgICAgICAgICAgaWYgKGtleUNvZGUgIT0gS2V5RXZlbnQuS0VZQ09ERV9TUEFDRQorICAgICAgICAgICAgICAgICAgICAmJiAobURyb3BEb3duTGlzdC5nZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpID49IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoa2V5Q29kZSAhPSBLZXlFdmVudC5LRVlDT0RFX0VOVEVSCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBrZXlDb2RlICE9IEtleUV2ZW50LktFWUNPREVfRFBBRF9DRU5URVIpKSkgeworICAgICAgICAgICAgICAgIGludCBjdXJJbmRleCA9IG1Ecm9wRG93bkxpc3QuZ2V0U2VsZWN0ZWRJdGVtUG9zaXRpb24oKTsKKyAgICAgICAgICAgICAgICBib29sZWFuIGNvbnN1bWVkOworCisgICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBiZWxvdyA9ICFtUG9wdXAuaXNBYm92ZUFuY2hvcigpOworCisgICAgICAgICAgICAgICAgZmluYWwgTGlzdEFkYXB0ZXIgYWRhcHRlciA9IG1BZGFwdGVyOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGJvb2xlYW4gYWxsRW5hYmxlZDsKKyAgICAgICAgICAgICAgICBpbnQgZmlyc3RJdGVtID0gSW50ZWdlci5NQVhfVkFMVUU7CisgICAgICAgICAgICAgICAgaW50IGxhc3RJdGVtID0gSW50ZWdlci5NSU5fVkFMVUU7CisKKyAgICAgICAgICAgICAgICBpZiAoYWRhcHRlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGFsbEVuYWJsZWQgPSBhZGFwdGVyLmFyZUFsbEl0ZW1zRW5hYmxlZCgpOworICAgICAgICAgICAgICAgICAgICBmaXJzdEl0ZW0gPSBhbGxFbmFibGVkID8gMCA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbURyb3BEb3duTGlzdC5sb29rRm9yU2VsZWN0YWJsZVBvc2l0aW9uKDAsIHRydWUpOworICAgICAgICAgICAgICAgICAgICBsYXN0SXRlbSA9IGFsbEVuYWJsZWQgPyBhZGFwdGVyLmdldENvdW50KCkgLSAxIDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0Lmxvb2tGb3JTZWxlY3RhYmxlUG9zaXRpb24oYWRhcHRlci5nZXRDb3VudCgpIC0gMSwgZmFsc2UpOyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmICgoYmVsb3cgJiYga2V5Q29kZSA9PSBLZXlFdmVudC5LRVlDT0RFX0RQQURfVVAgJiYgY3VySW5kZXggPD0gZmlyc3RJdGVtKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgKCFiZWxvdyAmJiBrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfRFBBRF9ET1dOICYmIGN1ckluZGV4ID49IGxhc3RJdGVtKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBXaGVuIHRoZSBzZWxlY3Rpb24gaXMgYXQgdGhlIHRvcCwgd2UgYmxvY2sgdGhlIGtleQorICAgICAgICAgICAgICAgICAgICAvLyBldmVudCB0byBwcmV2ZW50IGZvY3VzIGZyb20gbW92aW5nLgorICAgICAgICAgICAgICAgICAgICBjbGVhckxpc3RTZWxlY3Rpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgbVBvcHVwLnNldElucHV0TWV0aG9kTW9kZShQb3B1cFdpbmRvdy5JTlBVVF9NRVRIT0RfTkVFREVEKTsKKyAgICAgICAgICAgICAgICAgICAgc2hvdygpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyBXQVJOSU5HOiBQbGVhc2UgcmVhZCB0aGUgY29tbWVudCB3aGVyZSBtTGlzdFNlbGVjdGlvbkhpZGRlbgorICAgICAgICAgICAgICAgICAgICAvLyAgICAgICAgICBpcyBkZWNsYXJlZAorICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0Lm1MaXN0U2VsZWN0aW9uSGlkZGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgY29uc3VtZWQgPSBtRHJvcERvd25MaXN0Lm9uS2V5RG93bihrZXlDb2RlLCBldmVudCk7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cudihUQUcsICJLZXkgZG93bjogY29kZT0iICsga2V5Q29kZSArICIgbGlzdCBjb25zdW1lZD0iICsgY29uc3VtZWQpOworCisgICAgICAgICAgICAgICAgaWYgKGNvbnN1bWVkKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIElmIGl0IGhhbmRsZWQgdGhlIGtleSBldmVudCwgdGhlbiB0aGUgdXNlciBpcworICAgICAgICAgICAgICAgICAgICAvLyBuYXZpZ2F0aW5nIGluIHRoZSBsaXN0LCBzbyB3ZSBzaG91bGQgcHV0IGl0IGluIGZyb250LgorICAgICAgICAgICAgICAgICAgICBtUG9wdXAuc2V0SW5wdXRNZXRob2RNb2RlKFBvcHVwV2luZG93LklOUFVUX01FVEhPRF9OT1RfTkVFREVEKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gSGVyZSdzIGEgbGl0dGxlIHRyaWNrIHdlIG5lZWQgdG8gZG8gdG8gbWFrZSBzdXJlIHRoYXQKKyAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGxpc3QgdmlldyBpcyBhY3R1YWxseSBzaG93aW5nIGl0cyBmb2N1cyBpbmRpY2F0b3IsCisgICAgICAgICAgICAgICAgICAgIC8vIGJ5IGVuc3VyaW5nIGl0IGhhcyBmb2N1cyBhbmQgZ2V0dGluZyBpdHMgd2luZG93IG91dAorICAgICAgICAgICAgICAgICAgICAvLyBvZiB0b3VjaCBtb2RlLgorICAgICAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0LnJlcXVlc3RGb2N1c0Zyb21Ub3VjaCgpOworICAgICAgICAgICAgICAgICAgICBzaG93KCk7CisKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChrZXlDb2RlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBhdm9pZCBwYXNzaW5nIHRoZSBmb2N1cyBmcm9tIHRoZSB0ZXh0IHZpZXcgdG8gdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBuZXh0IGNvbXBvbmVudAorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0VOVEVSOgorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfQ0VOVEVSOgorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0RQQURfRE9XTjoKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgS2V5RXZlbnQuS0VZQ09ERV9EUEFEX1VQOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGJlbG93ICYmIGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9EUEFEX0RPV04pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdoZW4gdGhlIHNlbGVjdGlvbiBpcyBhdCB0aGUgYm90dG9tLCB3ZSBibG9jayB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGV2ZW50IHRvIGF2b2lkIGdvaW5nIHRvIHRoZSBuZXh0IGZvY3VzYWJsZSB3aWRnZXQKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJJbmRleCA9PSBsYXN0SXRlbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFiZWxvdyAmJiBrZXlDb2RlID09IEtleUV2ZW50LktFWUNPREVfRFBBRF9VUCAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1ckluZGV4ID09IGZpcnN0SXRlbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gZmFsc2U7CisgICA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h0IHZpZXcgZ2V0cyB0aGUgc2VsZWN0ZWQgaXRlbQorICAgICAgICAgICAgICAgICAgICAvLyBmcm9tIHRoZSBkcm9wIGRvd24gYXMgaXRzIGNvbnRlbnQKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBLZXlFdmVudC5LRVlDT0RFX0VOVEVSOgorICAgICAgICAgICAgICAgICAgICBjYXNlIEtleUV2ZW50LktFWUNPREVfRFBBRF9DRU5URVI6CisgICAgICAgICAgICAgICAgICAgICAgICBkaXNtaXNzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gY29uc3VtZWQ7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIEZpbHRlciBwcmUtSU1FIGtleSBldmVudHMuIEJ5IGZvcndhcmRpbmcge0BsaW5rIFZpZXcjb25LZXlQcmVJbWUoaW50LCBLZXlFdmVudCl9CisgICAgICogZXZlbnRzIHRvIHRoaXMgZnVuY3Rpb24sIHZpZXdzIHVzaW5nIExpc3RQb3B1cFdpbmRvdyBjYW4gaGF2ZSBpdCBkaXNtaXNzIHRoZSBwb3B1cAorICAgICAqIHdoZW4gdGhlIGJhY2sga2V5IGlzIHByZXNzZWQuCisgICAgICogIAorICAgICAqIEBwYXJhbSBrZXlDb2RlIGtleUNvZGUgcGFyYW0gcGFzc2VkIHRvIHRoZSBob3N0IHZpZXcncyBvbktleVByZUltZQorICAgICAqIEBwYXJhbSBldmVudCBldmVudCBwYXJhbSBwYXNzZWQgdG8gdGhlIGhvc3QgdmlldydzIG9uS2V5UHJlSW1lCisgICAgICogQHJldHVybiB0cnVlIGlmIHRoZSBldmVudCB3YXMgaGFuZGxlZCwgZmFsc2UgaWYgaXQgd2FzIGlnbm9yZWQuCisgICAgICogCisgICAgICogQHNlZSAjc2V0TW9kYWwoYm9vbGVhbikKKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBvbktleVByZUltZShpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQpIHsKKyAgICAgICAgaWYgKGtleUNvZGUgPT0gS2V5RXZlbnQuS0VZQ09ERV9CQUNLICYmIGlzU2hvd2luZygpKSB7CisgICAgICAgICAgICAvLyBzcGVjaWFsIGNhc2UgZm9yIHRoZSBiYWNrIGtleSwgd2UgZG8gbm90IGV2ZW4gdHJ5IHRvIHNlbmQgaXQKKyAgICAgICAgICAgIC8vIHRvIHRoZSBkcm9wIGRvd24gbGlzdCBidXQgaW5zdGVhZCwgY29uc3VtZSBpdCBpbW1lZGlhdGVseQorICAgICAgICAgICAgZmluYWwgVmlldyBhbmNob3JWaWV3ID0gbURyb3BEb3duQW5jaG9yVmlldzsKKyAgICAgICAgICAgIGlmIChldmVudC5nZXRBY3Rpb24oKSA9PSBLZXlFdmVudC5BQ1RJT05fRE9XTiAmJiBldmVudC5nZXRSZXBlYXRDb3VudCgpID09IDApIHsKKyAgICAgICAgICAgICAgICBhbmNob3JWaWV3LmdldEtleURpc3BhdGNoZXJTdGF0ZSgpLnN0YXJ0VHJhY2tpbmcoZXZlbnQsIHRoaXMpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfSBlbHNlIGlmIChldmVudC5nZXRBY3Rpb24oKSA9PSBLZXlFdmVudC5BQ1RJT05fVVApIHsKKyAgICAgICAgICAgICAgICBhbmNob3JWaWV3LmdldEtleURpc3BhdGNoZXJTdGF0ZSgpLmhhbmRsZVVwRXZlbnQoZXZlbnQpOworICAgICAgICAgICAgICAgIGlmIChldmVudC5pc1RyYWNraW5nKCkgJiYgIWV2ZW50LmlzQ2FuY2VsZWQoKSkgeworICAgICAgICAgICAgICAgICAgICBkaXNtaXNzKCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogPHA+QnVpbGRzIHRoZSBwb3B1cCB3aW5kb3cncyBjb250ZW50IGFuZCByZXR1cm5zIHRoZSBoZWlnaHQgdGhlIHBvcHVwCisgICAgICogc2hvdWxkIGhhdmUuIFJldHVybnMgLTEgd2hlbiB0aGUgY29udGVudCBhbHJlYWR5IGV4aXN0cy48L3A+CisgICAgICoKKyAgICAgKiBAcmV0dXJuIHRoZSBjb250ZW50J3MgaGVpZ2h0IG9yIC0xIGlmIGNvbnRlbnQgYWxyZWFkeSBleGlzdHMKKyAgICAgKi8KKyAgICBwcml2YXRlIGludCBidWlsZERyb3BEb3duKCkgeworICAgICAgICBWaWV3R3JvdXAgZHJvcERvd25WaWV3OworICAgICAgICBpbnQgb3RoZXJIZWlnaHRzID0gMDsKKworICAgICAgICBpZiAobURyb3BEb3duTGlzdCA9PSBudWxsKSB7CisgICAgICAgICAgICBDb250ZXh0IGNvbnRleHQgPSBtQ29udGV4dDsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGlzIFJ1bm5hYmxlIGV4aXN0cyBmb3IgdGhlIHNvbGUgcHVycG9zZSBvZiBjaGVja2luZyBpZiB0aGUgdmlldyBsYXlvdXQgaGFzIGdvdAorICAgICAgICAgICAgICogY29tcGxldGVkIGFuZCBpZiBzbyBjYWxsIHNob3dEcm9wRG93biB0byBkaXNwbGF5IHRoZSBkcm9wIGRvd24uIFRoaXMgaXMgdXNlZCB0byBzaG93CisgICAgICAgICAgICAgKiB0aGUgZHJvcCBkb3duIGFzIHNvb24gYXMgcG9zc2libGUgYWZ0ZXIgdXNlciBvcGVucyB1cCB0aGUgc2VhcmNoIGRpYWxvZywgd2l0aG91dAorICAgICAgICAgICAgICogd2FpdGluZyBmb3IgdGhlIG5vcm1hbCBVSSBwaXBlbGluZSB0byBkbyBpdCdzIGpvYiB3aGljaCBpcyBzbG93ZXIgdGhhbiB0aGlzIG1ldGhvZC4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgbVNob3dEcm9wRG93blJ1bm5hYmxlID0gbmV3IFJ1bm5hYmxlKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gVmlldyBsYXlvdXQgc2hvdWxkIGJlIGFsbCBkb25lIGJlZm9yZSBkaXNwbGF5aW5nIHRoZSBkcm9wIGRvd24uCisgICAgICAgICAgICAgICAgICAgIFZpZXcgdmlldyA9IGdldEFuY2hvclZpZXcoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHZpZXcgIT0gbnVsbCAmJiB2aWV3LmdldFdpbmRvd1Rva2VuKCkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2hvdygpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgbURyb3BEb3duTGlzdCA9IG5ldyBEcm9wRG93bkxpc3RWaWV3KGNvbnRleHQsICFtTW9kYWwpOworICAgICAgICAgICAgaWYgKG1Ecm9wRG93bkxpc3RIaWdobGlnaHQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0U2VsZWN0b3IobURyb3BEb3duTGlzdEhpZ2hsaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldEFkYXB0ZXIobUFkYXB0ZXIpOworICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRWZXJ0aWNhbEZhZGluZ0VkZ2VFbmFibGVkKHRydWUpOworICAgICAgICAgICAgbURyb3BEb3duTGlzdC5zZXRPbkl0ZW1DbGlja0xpc3RlbmVyKG1JdGVtQ2xpY2tMaXN0ZW5lcik7CisgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldEZvY3VzYWJsZSh0cnVlKTsKKyAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0Rm9jdXNhYmxlSW5Ub3VjaE1vZGUodHJ1ZSk7CisgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldE9uSXRlbVNlbGVjdGVkTGlzdGVuZXIobmV3IEFkYXB0ZXJWaWV3Lk9uSXRlbVNlbGVjdGVkTGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgb25JdGVtU2VsZWN0ZWQoQWRhcHRlclZpZXc8Pz4gcGFyZW50LCBWaWV3IHZpZXcsCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaXRpb24sIGxvbmcgaWQpIHsKKworICAgICAgICAgICAgICAgICAgICBpZiAocG9zaXRpb24gIT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIERyb3BEb3duTGlzdFZpZXcgZHJvcERvd25MaXN0ID0gbURyb3BEb3duTGlzdDsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRyb3BEb3duTGlzdCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJvcERvd25MaXN0Lm1MaXN0U2VsZWN0aW9uSGlkZGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbk5vdGhpbmdTZWxlY3RlZChBZGFwdGVyVmlldzw/PiBwYXJlbnQpIHsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIG1Ecm9wRG93bkxpc3Quc2V0T25TY3JvbGxMaXN0ZW5lcihtU2Nyb2xsTGlzdGVuZXIpOworCisgICAgICAgICAgICBpZiAobUl0ZW1TZWxlY3RlZExpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtRHJvcERvd25MaXN0LnNldE9uSXRlbVNlbGVjdGVkTGlzdGVuZXIobUl0ZW1TZWxlY3RlZExpc3RlbmVyKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZHJvcERvd25WaWV3ID0gbURyb3BEb3duTGlzdDsKKworICAgICAgICAgICAgVmlldyBoaW50VmlldyA9IG1Qcm9tcHRWaWV3OworICAgICAgICAgICAgaWYgKGhpbnRWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAvLyBpZiBhbiBoaW50IGhhcyBiZWVuIHNwZWNpZmllZCwgd2UgYWNjb21vZGF0ZSBtb3JlIHNwYWNlIGZvciBpdCBhbmQKKyAgICAgICAgICAgICAgICAvLyBhZGQgYSB0ZXh0IHZpZXcgaW4gdGhlIGRyb3AgZG93biBtZW51LCBhdCB0aGUgYm90dG9tIG9mIHRoZSBsaXN0CisgICAgICAgICAgICAgICAgTGluZWFyTGF5b3V0IGhpbnRDb250YWluZXIgPSBuZXcgTGluZWFyTGF5b3V0KGNvbnRleHQpOworICAgICAgICAgICAgICAgIGhpbnRDb250YWluZXIuc2V0T3JpZW50YXRpb24oTGluZWFyTGF5b3V0LlZFUlRJQ0FMKTsKKworICAgICAgICAgICAgICAgIExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMgaGludFBhcmFtcyA9IG5ldyBMaW5lYXJMYXlvdXQuTGF5b3V0UGFyYW1zKAorICAgICAgICAgICAgICAgICAgICAgICAgVmlld0dyb3VwLkxheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQsIDAsIDEuMGYKKyAgICAgICAgICAgICAgICApOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHN3aXRjaCAobVByb21wdFBvc2l0aW9uKSB7CisgICAgICAgICAgICAgICAgY2FzZSBQT1NJVElPTl9QUk9NUFRfQkVMT1c6CisgICAgICAgICAgICAgICAgICAgIGhpbnRDb250YWluZXIuYWRkVmlldyhkcm9wRG93blZpZXcsIGhpbnRQYXJhbXMpOworICAgICAgICAgICAgICAgICAgICBoaW50Q29udGFpbmVyLmFkZFZpZXcoaGludFZpZXcpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgY2FzZSBQT1NJVElPTl9QUk9NUFRfQUJPVkU6CisgICAgICAgICAgICAgICAgICAgIGhpbnRDb250YWluZXIuYWRkVmlldyhoaW50Vmlldyk7CisgICAgICAgICAgICAgICAgICAgIGhpbnRDb250YWluZXIuYWRkVmlldyhkcm9wRG93blZpZXcsIGhpbnRQYXJhbXMpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiSW52YWxpZCBoaW50IHBvc2l0aW9uICIgKyBtUHJvbXB0UG9zaXRpb24pOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBtZWFzdXJlIHRoZSBoaW50J3MgaGVpZ2h0IHRvIGZpbmQgaG93IG11Y2ggbW9yZSB2ZXJ0aWNhbCBzcGFjZQorICAgICAgICAgICAgICAgIC8vIHdlIG5lZWQgdG8gYWRkIHRvIHRoZSBkcm9wIGRvd24ncyBoZWlnaHQKKyAgICAgICAgICAgICAgICBpbnQgd2lkdGhTcGVjID0gTWVhc3VyZVNwZWMubWFrZU1lYXN1cmVTcGVjKG1Ecm9wRG93bldpZHRoLCBNZWFzdXJlU3BlYy5BVF9NT1NUKTsKKyAgICAgICAgICAgICAgICBpbnQgaGVpZ2h0U3BlYyA9IE1lYXN1cmVTcGVjLlVOU1BFQ0lGSUVEOworICAgICAgICAgICAgICAgIGhpbnRWaWV3Lm1lYXN1cmUod2lkdGhTcGVjLCBoZWlnaHRTcGVjKTsKKworICAgICAgICAgICAgICAgIGhpbnRQYXJhbXMgPSAoTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcykgaGludFZpZXcuZ2V0TGF5b3V0UGFyYW1zKCk7CisgICAgICAgICAgICAgICAgb3RoZXJIZWlnaHRzID0gaGludFZpZXcuZ2V0TWVhc3VyZWRIZWlnaHQoKSArIGhpbnRQYXJhbXMudG9wTWFyZ2luCisgICAgICAgICAgICAgICAgICAgICAgICArIGhpbnRQYXJhbXMuYm90dG9tTWFyZ2luOworCisgICAgICAgICAgICAgICAgZHJvcERvd25WaWV3ID0gaGludENvbnRhaW5lcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbVBvcHVwLnNldENvbnRlbnRWaWV3KGRyb3BEb3duVmlldyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBkcm9wRG93blZpZXcgPSAoVmlld0dyb3VwKSBtUG9wdXAuZ2V0Q29udGVudFZpZXcoKTsKKyAgICAgICAgICAgIGZpbmFsIFZpZXcgdmlldyA9IG1Qcm9tcHRWaWV3OworICAgICAgICAgICAgaWYgKHZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIExpbmVhckxheW91dC5MYXlvdXRQYXJhbXMgaGludFBhcmFtcyA9CisgICAgICAgICAgICAgICAgICAgICAgICAoTGluZWFyTGF5b3V0LkxheW91dFBhcmFtcykgdmlldy5nZXRMYXlvdXRQYXJhbXMoKTsKKyAgICAgICAgICAgICAgICBvdGhlckhlaWdodHMgPSB2aWV3LmdldE1lYXN1cmVkSGVpZ2h0KCkgKyBoaW50UGFyYW1zLnRvcE1hcmdpbgorICAgICAgICAgICAgICAgICAgICAgICAgKyBoaW50UGFyYW1zLmJvdHRvbU1hcmdpbjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIE1heCBoZWlnaHQgYXZhaWxhYmxlIG9uIHRoZSBzY3JlZW4gZm9yIGEgcG9wdXAuCisgICAgICAgIGJvb2xlYW4gaWdub3JlQm90dG9tRGVjb3JhdGlvbnMgPQorICAgICAgICAgICAgICAgIG1Qb3B1cC5nZXRJbnB1dE1ldGhvZE1vZGUoKSA9PSBQb3B1cFdpbmRvdy5JTlBVVF9NRVRIT0RfTk9UX05FRURFRDsKKyAgICAgICAgZmluYWwgaW50IG1heEhlaWdodCA9IG1Qb3B1cC5nZXRNYXhBdmFpbGFibGVIZWlnaHQoCisgICAgICAgICAgICAgICAgZ2V0QW5jaG9yVmlldygpLCBtRHJvcERvd25WZXJ0aWNhbE9mZnNldCwgaWdub3JlQm90dG9tRGVjb3JhdGlvbnMpOworCisgICAgICAgIC8vIGdldE1heEF2YWlsYWJsZUhlaWdodCgpIHN1YnRyYWN0cyB0aGUgcGFkZGluZywgc28gd2UgcHV0IGl0IGJhY2ssCisgICAgICAgIC8vIHRvIGdldCB0aGUgYXZhaWxhYmxlIGhlaWdodCBmb3IgdGhlIHdob2xlIHdpbmRvdworICAgICAgICBpbnQgcGFkZGluZyA9IDA7CisgICAgICAgIERyYXdhYmxlIGJhY2tncm91bmQgPSBtUG9wdXAuZ2V0QmFja2dyb3VuZCgpOworICAgICAgICBpZiAoYmFja2dyb3VuZCAhPSBudWxsKSB7CisgICAgICAgICAgICBiYWNrZ3JvdW5kLmdldFBhZGRpbmcobVRlbXBSZWN0KTsKKyAgICAgICAgICAgIHBhZGRpbmcgPSBtVGVtcFJlY3QudG9wICsgbVRlbXBSZWN0LmJvdHRvbTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtRHJvcERvd25BbHdheXNWaXNpYmxlIHx8IG1Ecm9wRG93bkhlaWdodCA9PSBWaWV3R3JvdXAuTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCkgeworICAgICAgICAgICAgcmV0dXJuIG1heEhlaWdodCArIHBhZGRpbmc7CisgICAgICAgIH0KKworICAgICAgICBmaW5hbCBpbnQgbGlzdENvbnRlbnQgPSBtRHJvcERvd25MaXN0Lm1lYXN1cmVIZWlnaHRPZkNoaWxkcmVuKE1lYXN1cmVTcGVjLlVOU1BFQ0lGSUVELAorICAgICAgICAgICAgICAgIDAsIExpc3RWaWV3Lk5PX1BPU0lUSU9OLCBtYXhIZWlnaHQgLS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0IHZpZXcgd3JhcHBlci48L3A+CisgICAgICAgICAqCisgICAgICAgICAqIEBwYXJhbSBjb250ZXh0IHRoaXMgdmlldydzIGNvbnRleHQKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyBEcm9wRG93bkxpc3RWaWV3KENvbnRleHQgY29udGV4dCwgYm9vbGVhbiBoaWphY2tGb2N1cykgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgbnVsbCwgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hdHRyLmRyb3BEb3duTGlzdFZpZXdTdHlsZSk7CisgICAgICAgICAgICBtSGlqYWNrRm9jdXMgPSBoaWphY2tGb2N1czsKKyAgICAgICAgfQorCisgICAgICAgIC8qKgorICAgICAgICAgKiA8cD5Bdm9pZHMgamFycmluZyBzY3JvbGxpbmcgZWZmZWN0IGJ5IGVuc3VyaW5nIHRoYXQgbGlzdCBlbGVtZW50cworICAgICAgICAgKiBtYWRlIG9mIGEgdGV4dCB2aWV3IGZpdCBvbiBhIHNpbmdsZSBsaW5lLjwvcD4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIHBvc2l0aW9uIHRoZSBpdGVtIGluZGV4IGluIHRoZSBsaXN0IHRvIGdldCBhIHZpZXcgZm9yCisgICAgICAgICAqIEByZXR1cm4gdGhlIHZpZXcgZm9yIHRoZSBzcGVjaWZpZWQgaXRlbQorICAgICAgICAgKi8KKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIFZpZXcgb2J0YWluVmlldyhpbnQgcG9zaXRpb24sIGJvb2xlYW5bXSBpc1NjcmFwKSB7CisgICAgICAgICAgICBWaWV3IHZpZXcgPSBzdXBlci5vYnRhaW5WaWV3KHBvc2l0aW9uLCBpc1NjcmFwKTsKKworICAgICAgICAgICAgaWYgKHZpZXcgaW5zdGFuY2VvZiBUZXh0VmlldykgeworICAgICAgICAgICAgICAgICgoVGV4dFZpZXcpIHZpZXcpLnNldEhvcml6b250YWxseVNjcm9sbGluZyh0cnVlKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIHZpZXc7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gaXNJblRvdWNoTW9kZSgpIHsKKyAgICAgICAgICAgIC8vIFdBUk5JTkc6IFBsZWFzZSByZWFkIHRoZSBjb21tZW50IHdoZXJlIG1MaXN0U2VsZWN0aW9uSGlkZGVuIGlzIGRlY2xhcmVkCisgICAgICAgICAgICByZXR1cm4gKG1IaWphY2tGb2N1cyAmJiBtTGlzdFNlbGVjdGlvbkhpZGRlbikgfHwgc3VwZXIuaXNJblRvdWNoTW9kZSgpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIDxwPlJldHVybnMgdGhlIGZvY3VzIHN0YXRlIGluIHRoZSBkcm9wIGRvd24uPC9wPgorICAgICAgICAgKgorICAgICAgICAgKiBAcmV0dXJuIHRydWUgYWx3YXlzIGlmIGhpamFja2luZyBmb2N1cworICAgICAgICAgKi8KKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGhhc1dpbmRvd0ZvY3VzKCkgeworICAgICAgICAgICAgcmV0dXJuIG1IaWphY2tGb2N1cyB8fCBzdXBlci5oYXNXaW5kb3dGb2N1cygpOworICAgICAgICB9CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIDxwPlJldHVybnMgdGhlIGZvY3VzIHN0YXRlIGluIHRoZSBkcm9wIGRvd24uPC9wPgorICAgICAgICAgKgorICAgICAgICAgKiBAcmV0dXJuIHRydWUgYWx3YXlzIGlmIGhpamFja2luZyBmb2N1cworICAgICAgICAgKi8KKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBib29sZWFuIGlzRm9jdXNlZCgpIHsKKyAgICAgICAgICAgIHJldHVybiBtSGlqYWNrRm9jdXMgfHwgc3VwZXIuaXNGb2N1c2VkKCk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogPHA+UmV0dXJucyB0aGUgZm9jdXMgc3RhdGUgaW4gdGhlIGRyb3AgZG93bi48L3A+CisgICAgICAgICAqCisgICAgICAgICAqIEByZXR1cm4gdHJ1ZSBhbHdheXMgaWYgaGlqYWNraW5nIGZvY3VzCisgICAgICAgICAqLworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGJvb2xlYW4gaGFzRm9jdXMoKSB7CisgICAgICAgICAgICByZXR1cm4gbUhpamFja0ZvY3VzIHx8IHN1cGVyLmhhc0ZvY3VzKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIFBvcHVwRGF0YVNldE9ic2VydmVyIGV4dGVuZHMgRGF0YVNldE9ic2VydmVyIHsKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2hhbmdlZCgpIHsKKyAgICAgICAgICAgIGlmIChpc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgICAgIC8vIFJlc2l6ZSB0aGUgcG9wdXAgdG8gZml0IG5ldyBjb250ZW50CisgICAgICAgICAgICAgICAgc2hvdygpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25JbnZhbGlkYXRlZCgpIHsKKyAgICAgICAgICAgIGRpc21pc3MoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgTGlzdFNlbGVjdG9ySGlkZXIgaW1wbGVtZW50cyBSdW5uYWJsZSB7CisgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKKyAgICAgICAgICAgIGNsZWFyTGlzdFNlbGVjdGlvbigpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBSZXNpemVQb3B1cFJ1bm5hYmxlIGltcGxlbWVudHMgUnVubmFibGUgeworICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICBtUG9wdXAuc2V0SW5wdXRNZXRob2RNb2RlKFBvcHVwV2luZG93LklOUFVUX01FVEhPRF9OT1RfTkVFREVEKTsKKyAgICAgICAgICAgIHNob3coKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgUG9wdXBUb3VjaEludGVyY2VwdG9yIGltcGxlbWVudHMgT25Ub3VjaExpc3RlbmVyIHsKKyAgICAgICAgcHVibGljIGJvb2xlYW4gb25Ub3VjaChWaWV3IHYsIE1vdGlvbkV2ZW50IGV2ZW50KSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgYWN0aW9uID0gZXZlbnQuZ2V0QWN0aW9uKCk7CisgICAgICAgICAgICBmaW5hbCBpbnQgeCA9IChpbnQpIGV2ZW50LmdldFgoKTsKKyAgICAgICAgICAgIGZpbmFsIGludCB5ID0gKGludCkgZXZlbnQuZ2V0WSgpOworICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAoYWN0aW9uID09IE1vdGlvbkV2ZW50LkFDVElPTl9ET1dOICYmCisgICAgICAgICAgICAgICAgICAgIG1Qb3B1cCAhPSBudWxsICYmIG1Qb3B1cC5pc1Nob3dpbmcoKSAmJgorICAgICAgICAgICAgICAgICAgICAoeCA+PSAwICYmIHggPCBnZXRXaWR0aCgpICYmIHkgPj0gMCAmJiB5IDwgZ2V0SGVpZ2h0KCkpKSB7CisgICAgICAgICAgICAgICAgbUhhbmRsZXIucG9zdERlbGF5ZWQobVJlc2l6ZVBvcHVwUnVubmFibGUsIEVYUEFORF9MSVNUX1RJTUVPVVQpOworICAgICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24gPT0gTW90aW9uRXZlbnQuQUNUSU9OX1VQKSB7CisgICAgICAgICAgICAgICAgbUhhbmRsZXIucmVtb3ZlQ2FsbGJhY2tzKG1SZXNpemVQb3B1cFJ1bm5hYmxlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJ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LmludGVybmFsLlIuc3R5bGVhYmxlLlNwaW5uZXJfc3Bpbm5lck1vZGUsCisgICAgICAgICAgICAgICAgTU9ERV9ESUFMT0cpOworICAgICAgICAKKyAgICAgICAgc3dpdGNoIChtb2RlKSB7CisgICAgICAgIGNhc2UgTU9ERV9ESUFMT0c6IHsKKyAgICAgICAgICAgIG1Qb3B1cCA9IG5ldyBEaWFsb2dQb3B1cCgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGNhc2UgTU9ERV9EUk9QRE9XTjogeworICAgICAgICAgICAgZmluYWwgaW50IGhpbnRSZXNvdXJjZSA9IGEuZ2V0UmVzb3VyY2VJZCgKKyAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuU3Bpbm5lcl9wb3B1cFByb21wdFZpZXcsIDApOworCisgICAgICAgICAgICBEcm9wZG93blBvcHVwIHBvcHVwID0gbmV3IERyb3Bkb3duUG9wdXAoY29udGV4dCwgYXR0cnMsIGRlZlN0eWxlLCBoaW50UmVzb3VyY2UpOworCisgICAgICAgICAgICBwb3B1cC5zZXRCYWNrZ3JvdW5kRHJhd2FibGUoYS5nZXREcmF3YWJsZSgKKyAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuU3Bpbm5lcl9wb3B1cEJhY2tncm91bmQpKTsKKyAgICAgICAgICAgIHBvcHVwLnNldFZlcnRpY2FsT2Zmc2V0KGEuZ2V0RGltZW5zaW9uUGl4ZWxPZmZzZXQoCisgICAgICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLlNwaW5uZXJfZHJvcERvd25WZXJ0aWNhbE9mZnNldCwgMCkpOworICAgICAgICAgICAgcG9wdXAuc2V0SG9yaXpvbnRhbE9mZnNldChhLmdldERpbWVuc2lvblBpeGVsT2Zmc2V0KAorICAgICAg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CisgICAgICAgIH0KICAgICB9CiAKICAgICBAT3ZlcnJpZGUKQEAgLTE5NCw4ICsyNTEsNiBAQAogICAgICAgICByZXR1cm4gY2hpbGQ7CiAgICAgfQogCi0KLQogICAgIC8qKgogICAgICAqIEhlbHBlciBmb3IgbWFrZUFuZEFkZFZpZXcgdG8gc2V0IHRoZSBwb3NpdGlvbiBvZiBhIHZpZXcKICAgICAgKiBhbmQgZmlsbCBvdXQgaXRzIGxheW91dCBwYXJhbXRlcnMuCkBAIC0yNDYsMTUgKzMwMSwxMCBAQAogICAgICAgICAKICAgICAgICAgaWYgKCFoYW5kbGVkKSB7CiAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTsKLSAgICAgICAgICAgIENvbnRleHQgY29udGV4dCA9IGdldENvbnRleHQoKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgZmluYWwgRHJvcERvd25BZGFwdGVyIGFkYXB0ZXIgPSBuZXcgRHJvcERvd25BZGFwdGVyKGdldEFkYXB0ZXIoKSk7CiAKLSAgICAgICAgICAgIEFsZXJ0RGlhbG9nLkJ1aWxkZXIgYnVpbGRlciA9IG5ldyBBbGVydERpYWxvZy5CdWlsZGVyKGNvbnRleHQpOwotICAgICAgICAgICAgaWYgKG1Qcm9tcHQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIuc2V0VGl0bGUobVByb21wdCk7CisgICAgICAgICAgICBpZiAoIW1Qb3B1cC5pc1Nob3dpbmcoKSkgeworICAgICAgICAgICAgICAgIG1Qb3B1cC5zaG93KCk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBtUG9wdXAgPSBidWlsZGVyLnNldFNpbmdsZUNob2ljZUl0ZW1zKGFkYXB0ZXIsIGdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCksIHRoaXMpLnNob3coKTsKICAgICAgICAgfQogCiAgICAgICAgIHJldHVybiBoYW5kbGVkOwpAQCAtMjcxLDcgKzMyMSw3IEBACiAgICAgICogQHBhcmFtIHByb21wdCB0aGUgcHJvbXB0IHRvIHNldAogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldFByb21wdChDaGFyU2VxdWVuY2UgcHJvbXB0KSB7Ci0gICAgICAgIG1Qcm9tcHQgPSBwcm9tcHQ7CisgICAgICAgIG1Qb3B1cC5zZXRQcm9tcHRUZXh0KHByb21wdCk7CiAgICAgfQogCiAgICAgLyoqCkBAIC0yNzksMTQgKzMyOSwxNCBAQAogICAgICAqIEBwYXJhbSBwcm9tcHRJZCB0aGUgcmVzb3VyY2UgSUQgb2YgdGhlIHByb21wdCB0byBkaXNwbGF5IHdoZW4gdGhlIGRpYWxvZyBpcyBzaG93bgogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIHNldFByb21wdElkKGludCBwcm9tcHRJZCkgewotICAgICAgICBtUHJvbXB0ID0gZ2V0Q29udGV4dCgpLmdldFRleHQocHJvbXB0SWQpOworICAgICAgICBzZXRQcm9tcHQoZ2V0Q29udGV4dCgpLmdldFRleHQocHJvbXB0SWQpKTsKICAgICB9CiAKICAgICAvKioKICAgICAgKiBAcmV0dXJuIFRoZSBwcm9tcHQgdG8gZGlzcGxheSB3aGVuIHRoZSBkaWFsb2cgaXMgc2hvd24KICAgICAgKi8KICAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldFByb21wdCgpIHsKLSAgICAgICAgcmV0dXJuIG1Qcm9tcHQ7CisgICAgICAgIHJldHVybiBtUG9wdXAuZ2V0SGludFRleHQoKTsKICAgICB9CiAgICAgCiAgICAgLyoqCkBAIC0zODQsNCArNDM0LDEyMyBAQAogICAgICAgICAgICAgcmV0dXJuIGdldENvdW50KCkgPT0gMDsKICAgICAgICAgfQogICAgIH0KKyAgICAKKyAgICAvKioKKyAgICAgKiBJbXBsZW1lbnRzIHNvbWUgc29ydCBvZiBwb3B1cCBzZWxlY3Rpb24gaW50ZXJmYWNlIGZvciBzZWxlY3RpbmcgYSBzcGlubmVyIG9wdGlvbi4KKyAgICAgKiBBbGxvd3MgZm9yIGRpZmZlcmVudCBzcGlubmVyIG1vZGVzLgorICAgICAqLworICAgIHByaXZhdGUgaW50ZXJmYWNlIFNwaW5uZXJQb3B1cCB7CisgICAgICAgIHB1YmxpYyB2b2lkIHNldEFkYXB0ZXIoTGlzdEFkYXB0ZXIgYWRhcHRlcik7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogU2hvdyB0aGUgcG9wdXAKKyAgICAgICAgICovCisgICAgICAgIHB1YmxpYyB2b2lkIHNob3coKTsKKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBEaXNtaXNzIHRoZSBwb3B1cAorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgZGlzbWlzcygpOworICAgICAgICAKKyAgICAgICAgLyoqCisgICAgICAgICAqIEByZXR1cm4gdHJ1ZSBpZiB0aGUgcG9wdXAgaXMgc2hvd2luZywgZmFsc2Ugb3RoZXJ3aXNlLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGJvb2xlYW4gaXNTaG93aW5nKCk7CisgICAgICAgIAorICAgICAgICAvKioKKyAgICAgICAgICogU2V0IGhpbnQgdGV4dCB0byBiZSBkaXNwbGF5ZWQgdG8gdGhlIHVzZXIuIFRoaXMgc2hvdWxkIHByb3ZpZGUKKyAgICAgICAgICogYSBkZXNjcmlwdGlvbiBvZiB0aGUgY2hvaWNlIGJlaW5nIG1hZGUuCisgICAgICAgICAqIEBwYXJhbSBoaW50VGV4dCBIaW50IHRleHQgdG8gc2V0LgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIHZvaWQgc2V0UHJvbXB0VGV4dChDaGFyU2VxdWVuY2UgaGludFRleHQpOworICAgICAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldEhpbnRUZXh0KCk7CisgICAgfQorICAgIAorICAgIHByaXZhdGUgY2xhc3MgRGlhbG9nUG9wdXAgaW1wbGVtZW50cyBTcGlubmVyUG9wdXAsIERpYWxvZ0ludGVyZmFjZS5PbkNsaWNrTGlzdGVuZXIgeworICAgICAgICBwcml2YXRlIEFsZXJ0RGlhbG9nIG1Qb3B1cDsKKyAgICAgICAgcHJpdmF0ZSBMaXN0QWRhcHRlciBtTGlzdEFkYXB0ZXI7CisgICAgICAgIHByaXZhdGUgQ2hhclNlcXVlbmNlIG1Qcm9tcHQ7CisKKyAgICAgICAgcHVibGljIHZvaWQgZGlzbWlzcygpIHsKKyAgICAgICAgICAgIG1Qb3B1cC5kaXNtaXNzKCk7CisgICAgICAgICAgICBtUG9wdXAgPSBudWxsOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGJvb2xlYW4gaXNTaG93aW5nKCkgeworICAgICAgICAgICAgcmV0dXJuIG1Qb3B1cCAhPSBudWxsID8gbVBvcHVwLmlzU2hvd2luZygpIDogZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRBZGFwdGVyKExpc3RBZGFwdGVyIGFkYXB0ZXIpIHsKKyAgICAgICAgICAgIG1MaXN0QWRhcHRlciA9IGFkYXB0ZXI7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzZXRQcm9tcHRUZXh0KENoYXJTZXF1ZW5jZSBoaW50VGV4dCkgeworICAgICAgICAgICAgbVByb21wdCA9IGhpbnRUZXh0OworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldEhpbnRUZXh0KCkgeworICAgICAgICAgICAgcmV0dXJuIG1Qcm9tcHQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBzaG93KCkgeworICAgICAgICAgICAgQWxlcnREaWFsb2cuQnVpbGRlciBidWlsZGVyID0gbmV3IEFsZXJ0RGlhbG9nLkJ1aWxkZXIoZ2V0Q29udGV4dCgpKTsKKyAgICAgICAgICAgIGlmIChtUHJvbXB0ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBidWlsZGVyLnNldFRpdGxlKG1Qcm9tcHQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVBvcHVwID0gYnVpbGRlci5zZXRTaW5nbGVDaG9pY2VJdGVtcyhtTGlzdEFkYXB0ZXIsCisgICAgICAgICAgICAgICAgICAgIGdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCksIHRoaXMpLnNob3coKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhEaWFsb2dJbnRlcmZhY2UgZGlhbG9nLCBpbnQgd2hpY2gpIHsKKyAgICAgICAgICAgIHNldFNlbGVjdGlvbih3aGljaCk7CisgICAgICAgICAgICBkaXNtaXNzKCk7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSBjbGFzcyBEcm9wZG93blBvcHVwIGV4dGVuZHMgTGlzdFBvcHVwV2luZG93IGltcGxlbWVudHMgU3Bpbm5lclBvcHVwIHsKKyAgICAgICAgcHJpdmF0ZSBDaGFyU2VxdWVuY2UgbUhpbnRUZXh0OworICAgICAgICBwcml2YXRlIFRleHRWaWV3IG1IaW50VmlldzsKKyAgICAgICAgcHJpdmF0ZSBpbnQgbUhpbnRSZXNvdXJjZTsKKyAgICAgICAgCisgICAgICAgIHB1YmxpYyBEcm9wZG93blBvcHVwKENvbnRleHQgY29udGV4dCwgQXR0cmlidXRlU2V0IGF0dHJzLAorICAgICAgICAgICAgICAgIGludCBkZWZTdHlsZVJlcywgaW50IGhpbnRSZXNvdXJjZSkgeworICAgICAgICAgICAgc3VwZXIoY29udGV4dCwgYXR0cnMsIDAsIGRlZlN0eWxlUmVzKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbUhpbnRSZXNvdXJjZSA9IGhpbnRSZXNvdXJjZTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgc2V0QW5jaG9yVmlldyhTcGlubmVyLnRoaXMpOworICAgICAgICAgICAgc2V0TW9kYWwodHJ1ZSk7CisgICAgICAgICAgICBzZXRQcm9tcHRQb3NpdGlvbihQT1NJVElPTl9QUk9NUFRfQkVMT1cpOworICAgICAgICAgICAgc2V0T25JdGVtQ2xpY2tMaXN0ZW5lcihuZXcgT25JdGVtQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkl0ZW1DbGljayhBZGFwdGVyVmlldyBwYXJlbnQsIFZpZXcgdiwgaW50IHBvc2l0aW9uLCBsb25nIGlkKSB7CisgICAgICAgICAgICAgICAgICAgIFNwaW5uZXIudGhpcy5zZXRTZWxlY3Rpb24ocG9zaXRpb24pOworICAgICAgICAgICAgICAgICAgICBkaXNtaXNzKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0SGludFRleHQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUhpbnRUZXh0OworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgdm9pZCBzZXRQcm9tcHRUZXh0KENoYXJTZXF1ZW5jZSBoaW50VGV4dCkgeworICAgICAgICAgICAgbUhpbnRUZXh0ID0gaGludFRleHQ7CisgICAgICAgICAgICBpZiAobUhpbnRWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtSGludFZpZXcuc2V0VGV4dChoaW50VGV4dCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHB1YmxpYyB2b2lkIHNob3coKSB7CisgICAgICAgICAgICBpZiAobUhpbnRWaWV3ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBUZXh0VmlldyB0ZXh0VmlldyA9IChUZXh0VmlldykgTGF5b3V0SW5mbGF0ZXIuZnJvbShnZXRDb250ZXh0KCkpLmluZmxhdGUoCisgICAgICAgICAgICAgICAgICAgICAgICBtSGludFJlc291cmNlLCBudWxsKS5maW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC50ZXh0MSk7CisgICAgICAgICAgICAgICAgdGV4dFZpZXcuc2V0VGV4dChtSGludFRleHQpOworICAgICAgICAgICAgICAgIHNldFByb21wdFZpZXcodGV4dFZpZXcpOworICAgICAgICAgICAgICAgIG1IaW50VmlldyA9IHRleHRWaWV3OworICAgICAgICAgICAgfQorICAgICAgICAgICAgc3VwZXIuc2hvdygpOworICAgICAgICAgICAgZ2V0TGlzdFZpZXcoKS5zZXRDaG9pY2VNb2RlKExpc3RWaWV3LkNIT0lDRV9NT0RFX1NJTkdMRSk7CisgICAgICAgICAgICBzZXRTZWxlY3Rpb24oU3Bpbm5lci50aGlzLmdldFNlbGVjdGVkSXRlbVBvc2l0aW9uKCkpOworICAgICAgICB9CisgICAgfQogfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvd2lkZ2V0L1RleHRWaWV3LmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC93aWRnZXQvVGV4dFZpZXcuamF2YQppbmRleCBlNmVkNzBhLi4xNzk2N2Q5IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC93aWRnZXQvVGV4dFZpZXcuamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC93aWRnZXQvVGV4dFZpZXcuamF2YQpAQCAtMzIxLDYgKzMyMSw3IEBACiAgICAgICAgIHRoaXMoY29udGV4dCwgYXR0cnMsIGNvbS5hbmRyb2lkLmludGVybmFsLlIuYXR0ci50ZXh0Vmlld1N0eWxlKTsKICAgICB9CiAKKyAgICBAU3VwcHJlc3NXYXJuaW5ncygiZGVwcmVjYXRpb24iKQogICAgIHB1YmxpYyBUZXh0VmlldyhDb250ZXh0IGNvbnRleHQsCiAgICAgICAgICAgICAgICAgICAgIEF0dHJpYnV0ZVNldCBhdHRycywKICAgICAgICAgICAgICAgICAgICAgaW50IGRlZlN0eWxlKSB7CkBAIC03MTQsNyArNzE1LDcgQEAKICAgICAgICAgfQogCiAgICAgICAgIGlmIChpbnB1dE1ldGhvZCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBDbGFzcyBjOworICAgICAgICAgICAgQ2xhc3M8Pz4gYzsKIAogICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICBjID0gQ2xhc3MuZm9yTmFtZShpbnB1dE1ldGhvZC50b1N0cmluZygpKTsKQEAgLTIzMzUsNiArMjMzNiw3IEBACiAgICAgICAgICAgICByZXR1cm4gc3RyICsgIn0iOwogICAgICAgICB9CiAKKyAgICAgICAgQFN1cHByZXNzV2FybmluZ3MoImhpZGluZyIpCiAgICAgICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgUGFyY2VsYWJsZS5DcmVhdG9yPFNhdmVkU3RhdGU+IENSRUFUT1IKICAgICAgICAgICAgICAgICA9IG5ldyBQYXJjZWxhYmxlLkNyZWF0b3I8U2F2ZWRTdGF0ZT4oKSB7CiAgICAgICAgICAgICBwdWJsaWMgU2F2ZWRTdGF0ZSBjcmVhdGVGcm9tUGFyY2VsKFBhcmNlbCBpbikgewpAQCAtMjc1Niw2ICsyNzU4LDcgQEAKICAgICAgICAgICAgIHJldHVybiBtQ2hhcnNbb2ZmICsgbVN0YXJ0XTsKICAgICAgICAgfQogCisgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgewogICAgICAgICAgICAgcmV0dXJuIG5ldyBTdHJpbmcobUNoYXJzLCBtU3RhcnQsIG1MZW5ndGgpOwogICAgICAgICB9CkBAIC0yNzgxLDYgKzI3ODQsMTQgQEAKICAgICAgICAgICAgIGMuZHJhd1RleHQobUNoYXJzLCBzdGFydCArIG1TdGFydCwgZW5kIC0gc3RhcnQsIHgsIHksIHApOwogICAgICAgICB9CiAKKyAgICAgICAgcHVibGljIHZvaWQgZHJhd1RleHRSdW4oQ2FudmFzIGMsIGludCBzdGFydCwgaW50IGVuZCwKKyAgICAgICAgICAgICAgICBpbnQgY29udGV4dFN0YXJ0LCBpbnQgY29udGV4dEVuZCwgZmxvYXQgeCwgZmxvYXQgeSwgaW50IGZsYWdzLCBQYWludCBwKSB7CisgICAgICAgICAgICBpbnQgY291bnQgPSBlbmQgLSBzdGFydDsKKyAgICAgICAgICAgIGludCBjb250ZXh0Q291bnQgPSBjb250ZXh0RW5kIC0gY29udGV4dFN0YXJ0OworICAgICAgICAgICAgYy5kcmF3VGV4dFJ1bihtQ2hhcnMsIHN0YXJ0ICsgbVN0YXJ0LCBjb3VudCwgY29udGV4dFN0YXJ0ICsgbVN0YXJ0LAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0Q291bnQsIHgsIHksIGZsYWdzLCBwKTsKKyAgICAgICAgfQorCiAgICAgICAgIHB1YmxpYyBmbG9hdCBtZWFzdXJlVGV4dChpbnQgc3RhcnQsIGludCBlbmQsIFBhaW50IHApIHsKICAgICAgICAgICAgIHJldHVybiBwLm1lYXN1cmVUZXh0KG1DaGFycywgc3RhcnQgKyBtU3RhcnQsIGVuZCAtIHN0YXJ0KTsKICAgICAgICAgfQpAQCAtMjc4OCw2ICsyNzk5LDIzIEBACiAgICAgICAgIHB1YmxpYyBpbnQgZ2V0VGV4dFdpZHRocyhpbnQgc3RhcnQsIGludCBlbmQsIGZsb2F0W10gd2lkdGhzLCBQYWludCBwKSB7CiAgICAgICAgICAgICByZXR1cm4gcC5nZXRUZXh0V2lkdGhzKG1DaGFycywgc3RhcnQgKyBtU3RhcnQsIGVuZCAtIHN0YXJ0LCB3aWR0aHMpOwogICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGZsb2F0IGdldFRleHRSdW5BZHZhbmNlcyhpbnQgc3RhcnQsIGludCBlbmQsIGludCBjb250ZXh0U3RhcnQsCisgICAgICAgICAgICAgICAgaW50IGNvbnRleHRFbmQsIGludCBmbGFncywgZmxvYXRbXSBhZHZhbmNlcywgaW50IGFkdmFuY2VzSW5kZXgsCisgICAgICAgICAgICAgICAgUGFpbnQgcCkgeworICAgICAgICAgICAgaW50IGNvdW50ID0gZW5kIC0gc3RhcnQ7CisgICAgICAgICAgICBpbnQgY29udGV4dENvdW50ID0gY29udGV4dEVuZCAtIGNvbnRleHRTdGFydDsKKyAgICAgICAgICAgIHJldHVybiBwLmdldFRleHRSdW5BZHZhbmNlcyhtQ2hhcnMsIHN0YXJ0ICsgbVN0YXJ0LCBjb3VudCwKKyAgICAgICAgICAgICAgICAgICAgY29udGV4dFN0YXJ0ICsgbVN0YXJ0LCBjb250ZXh0Q291bnQsIGZsYWdzLCBhZHZhbmNlcywKKyAgICAgICAgICAgICAgICAgICAgYWR2YW5jZXNJbmRleCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgaW50IGdldFRleHRSdW5DdXJzb3IoaW50IGNvbnRleHRTdGFydCwgaW50IGNvbnRleHRFbmQsIGludCBmbGFncywKKyAgICAgICAgICAgICAgICBpbnQgb2Zmc2V0LCBpbnQgY3Vyc29yT3B0LCBQYWludCBwKSB7CisgICAgICAgICAgICBpbnQgY29udGV4dENvdW50ID0gY29udGV4dEVuZCAtIGNvbnRleHRTdGFydDsKKyAgICAgICAgICAgIHJldHVybiBwLmdldFRleHRSdW5DdXJzb3IobUNoYXJzLCBjb250ZXh0U3RhcnQgKyBtU3RhcnQsCisgICAgICAgICAgICAgICAgICAgIGNvbnRleHRDb3VudCwgZmxhZ3MsIG9mZnNldCArIG1TdGFydCwgY3Vyc29yT3B0KTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIC8qKgpAQCAtMzE5OCw3ICszMjI2LDcgQEAKICAgICAgKgogICAgICAqIEBwYXJhbSBjcmVhdGUgSWYgdHJ1ZSwgdGhlIGV4dHJhcyB3aWxsIGJlIGNyZWF0ZWQgaWYgdGhleSBkb24ndCBhbHJlYWR5CiAgICAgICogZXhpc3QuICBPdGhlcndpc2UsIG51bGwgd2lsbCBiZSByZXR1cm5lZCBpZiBub25lIGhhdmUgYmVlbiBjcmVhdGVkLgotICAgICAqIEBzZWUgI3NldElucHV0RXh0cmFzKGludClWaWV3CisgICAgICogQHNlZSAjc2V0SW5wdXRFeHRyYXMoaW50KQogICAgICAqIEBzZWUgRWRpdG9ySW5mbyNleHRyYXMKICAgICAgKiBAYXR0ciByZWYgYW5kcm9pZC5SLnN0eWxlYWJsZSNUZXh0Vmlld19lZGl0b3JFeHRyYXMKICAgICAgKi8KQEAgLTMzMTIsNyArMzM0MCw3IEBACiAKICAgICBwcml2YXRlIHN0YXRpYyBjbGFzcyBFcnJvclBvcHVwIGV4dGVuZHMgUG9wdXBXaW5kb3cgewogICAgICAgICBwcml2YXRlIGJvb2xlYW4gbUFib3ZlID0gZmFsc2U7Ci0gICAgICAgIHByaXZhdGUgVGV4dFZpZXcgbVZpZXc7CisgICAgICAgIHByaXZhdGUgZmluYWwgVGV4dFZpZXcgbVZpZXc7CiAKICAgICAgICAgRXJyb3JQb3B1cChUZXh0VmlldyB2LCBpbnQgd2lkdGgsIGludCBoZWlnaHQpIHsKICAgICAgICAgICAgIHN1cGVyKHYsIHdpZHRoLCBoZWlnaHQpOwpAQCAtNDg0Nyw2ICs0ODc1LDggQEAKICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgY2FzZSBHcmF2aXR5LlJJR0hUOgorICAgICAgICAgICAgICAgIC8vIE5vdGUsIExheW91dCByZXNvbHZlcyBBTElHTl9PUFBPU0lURSB0byBsZWZ0IG9yCisgICAgICAgICAgICAgICAgLy8gcmlnaHQgYmFzZWQgb24gdGhlIHBhcmFncmFwaCBkaXJlY3Rpb24uCiAgICAgICAgICAgICAgICAgYWxpZ25tZW50ID0gTGF5b3V0LkFsaWdubWVudC5BTElHTl9PUFBPU0lURTsKICAgICAgICAgICAgICAgICBicmVhazsKIApAQCAtNTYzMiw2ICs1NjYyLDggQEAKICAgICAgKiB0byB0aGUgdXNlci4gIFRoaXMgd2lsbCBub3QgbW92ZSB0aGUgY3Vyc29yIGlmIGl0IHJlcHJlc2VudHMgbW9yZSB0aGFuCiAgICAgICogb25l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0Q29kZSAhPSBJbnB1dE1ldGhvZE1hbmFnZXIuUkVTVUxUX1NIT1dOKSB7Ci0gICAgICAgICAgICAgICAgZmluYWwgaW50IGxlbiA9IG1UZXh0Lmxlbmd0aCgpOwotICAgICAgICAgICAgICAgIGlmIChtTmV3U3RhcnQgPiBsZW4pIHsKLSAgICAgICAgICAgICAgICAgICAgbU5ld1N0YXJ0ID0gbGVuOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAobU5ld0VuZCA+IGxlbikgewotICAgICAgICAgICAgICAgICAgICBtTmV3RW5kID0gbGVuOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBTZWxlY3Rpb24uc2V0U2VsZWN0aW9uKChTcGFubmFibGUpbVRleHQsIG1OZXdTdGFydCwgbU5ld0VuZCk7CisgICAgICAgICAgICBpbnQgc3RhcnQgPSBtTmV3U3RhcnQ7CisgICAgICAgICAgICBpbnQgZW5kID0gbU5ld0VuZDsKKworICAgICAgICAgICAgLy8gTW92ZSB0aGUgY3Vyc29yIHRvIHRoZSBuZXcgcG9zaXRpb24sIHVubGVzcyB0aGlzIHRhcCB3YXMgYWN0dWFsbHkKKyAgICAgICAgICAgIC8vIHVzZSB0byBzaG93IHRoZSBJTU0uIExlYXZlIGN1cnNvciB1bmNoYW5nZWQgaW4gdGhhdCBjYXNlLgorICAgICAgICAgICAgaWYgKHJlc3VsdENvZGUgPT0gSW5wdXRNZXRob2RNYW5hZ2VyLlJFU1VMVF9TSE9XTikgeworICAgICAgICAgICAgICAgIHN0YXJ0ID0gbVByZXZTdGFydDsKKyAgICAgICAgICAgICAgICBlbmQgPSBtUHJldkVuZDsKICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZmluYWwgaW50IGxlbiA9IG1UZXh0Lmxlbmd0aCgpOworICAgICAgICAgICAgaWYgKHN0YXJ0ID4gbGVuKSB7CisgICAgICAgICAgICAgICAgc3RhcnQgPSBsZW47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZW5kID4gbGVuKSB7CisgICAgICAgICAgICAgICAgZW5kID0gbGVuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgU2VsZWN0aW9uLnNldFNlbGVjdGlvbigoU3Bhbm5hYmxlKW1UZXh0LCBzdGFydCwgZW5kKTsKICAgICAgICAgfQogICAgIH0KICAgICAKQEAgLTY1NjIsNyArNjYxMSw3IEBACiAgICAgICAgICAgICBtVG91Y2hGb2N1c1NlbGVjdGVkID0gZmFsc2U7CiAgICAgICAgICAgICBtU2Nyb2xsZWQgPSBmYWxzZTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBmaW5hbCBib29sZWFuIHN1cGVyUmVzdWx0ID0gc3VwZXIub25Ub3VjaEV2ZW50KGV2ZW50KTsKIAogICAgICAgICAvKgpAQCAtNjU3NSw3ICs2NjI0LDggQEAKICAgICAgICAgICAgIHJldHVybiBzdXBlclJlc3VsdDsKICAgICAgICAgfQogCi0gICAgICAgIGlmICgobU1vdmVtZW50ICE9IG51bGwgfHwgb25DaGVja0lzVGV4dEVkaXRvcigpKSAmJiBtVGV4dCBpbnN0YW5jZW9mIFNwYW5uYWJsZSAmJiBtTGF5b3V0ICE9IG51bGwpIHsKKyAgICAgICAgaWYgKChtTW92ZW1lbnQgIT0gbnVsbCB8fCBvbkNoZWNrSXNUZXh0RWRpdG9yKCkpICYmCisgICAgICAgICAgICAgICAgbVRleHQgaW5zdGFuY2VvZiBTcGFubmFibGUgJiYgbUxheW91dCAhPSBudWxsKSB7CiAgICAgICAgICAgICAKICAgICAgICAgICAgIGJvb2xlYW4gaGFuZGxlZCA9IGZhbHNlOwogICAgICAgICAgICAgCkBAIC02NTkwLDI5ICs2NjQwLDE3IEBACiAgICAgICAgICAgICAgICAgaWYgKGFjdGlvbiA9PSBNb3Rpb25FdmVudC5BQ1RJT05fVVAgJiYgaXNGb2N1c2VkKCkgJiYgIW1TY3JvbGxlZCkgewogICAgICAgICAgICAgICAgICAgICBJbnB1dE1ldGhvZE1hbmFnZXIgaW1tID0gKElucHV0TWV0aG9kTWFuYWdlcikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRDb250ZXh0KCkuZ2V0U3lzdGVtU2VydmljZShDb250ZXh0LklOUFVUX01FVEhPRF9TRVJWSUNFKTsKLSAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgaXMgZ29pbmcgdG8gYmUgZ3Jvc3MuLi4gIGlmIHRhcHBpbmcgb24gdGhlIHRleHQgdmlldwotICAgICAgICAgICAgICAgICAgICAvLyBjYXVzZXMgdGhlIElNRSB0byBiZSBkaXNwbGF5ZWQsIHdlIGRvbid0IHdhbnQgdGhlIHNlbGVjdGlvbgotICAgICAgICAgICAgICAgICAgICAvLyB0byBjaGFuZ2UuICBCdXQgdGhlIHNlbGVjdGlvbiBoYXMgYWxyZWFkeSBjaGFuZ2VkLCBhbmQKLSAgICAgICAgICAgICAgICAgICAgLy8gd2Ugd29uJ3Qga25vdyByaWdodCBhd2F5IHdoZXRoZXIgdGhlIElNRSBpcyBnZXR0aW5nCi0gICAgICAgICAgICAgICAgICAgIC8vIGRpc3BsYXllZCwgc28uLi4KLSAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgIGludCBuZXdTZWxTdGFydCA9IFNlbGVjdGlvbi5nZXRTZWxlY3Rpb25TdGFydChtVGV4dCk7Ci0gICAgICAgICAgICAgICAgICAgIGludCBuZXdTZWxFbmQgPSBTZWxlY3Rpb24uZ2V0U2VsZWN0aW9uRW5kKG1UZXh0KTsKKworICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbmV3U2VsU3RhcnQgPSBTZWxlY3Rpb24uZ2V0U2VsZWN0aW9uU3RhcnQobVRleHQpOworICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbmV3U2VsRW5kID0gU2VsZWN0aW9uLmdldFNlbGVjdGlvbkVuZChtVGV4dCk7CisKICAgICAgICAgICAgICAgICAgICAgQ29tbWl0U2VsZWN0aW9uUmVjZWl2ZXIgY3NyID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1NlbFN0YXJ0ICE9IG9sZFNlbFN0YXJ0IHx8IG5ld1NlbEVuZCAhPSBvbGRTZWxFbmQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNzciA9IG5ldyBDb21taXRTZWxlY3Rpb25SZWNlaXZlcigpOwotICAgICAgICAgICAgICAgICAgICAgICAgY3NyLm1OZXdTdGFydCA9IG5ld1NlbFN0YXJ0OwotICAgICAgICAgICAgICAgICAgICAgICAgY3NyLm1OZXdFbmQgPSBuZXdTZWxFbmQ7CisgICAgICAgICAgICAgICAgICAgICAgICBjc3IgPSBuZXcgQ29tbWl0U2VsZWN0aW9uUmVjZWl2ZXIob2xkU2VsU3RhcnQsIG9sZFNlbEVuZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3U2VsU3RhcnQsIG5ld1NlbEVuZCk7CiAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgIGlmIChpbW0uc2hvd1NvZnRJbnB1dCh0aGlzLCAwLCBjc3IpICYmIGNzciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgSU1FIG1pZ2h0IGdldCBzaG93biAtLSByZXZlcnQgdG8gdGhlIG9sZAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2VsZWN0aW9uLCBhbmQgY2hhbmdlIHRvIHRoZSBuZXcgd2hlbiB3ZSBmaW5hbGx5Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBmaW5kIG91dCBvZiBpdCBpcyBva2F5LgotICAgICAgICAgICAgICAgICAgICAgICAgU2VsZWN0aW9uLnNldFNlbGVjdGlvbigoU3Bhbm5hYmxlKW1UZXh0LCBvbGRTZWxTdGFydCwgb2xkU2VsRW5kKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IGltbS5zaG93U29mdElucHV0KHRoaXMsIDAsIGNzcikgJiYgKGNzciAhPSBudWxsKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAKQEAgLTY2NTcsNyArNjY5NSw3IEBACiAgICAgfQogCiAgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgQmxpbmsgZXh0ZW5kcyBIYW5kbGVyIGltcGxlbWVudHMgUnVubmFibGUgewotICAgICAgICBwcml2YXRlIFdlYWtSZWZlcmVuY2U8VGV4dFZpZXc+IG1WaWV3OworICAgICAgICBwcml2YXRlIGZpbmFsIFdlYWtSZWZlcmVuY2U8VGV4dFZpZXc+IG1WaWV3OwogICAgICAgICBwcml2YXRlIGJvb2xlYW4gbUNhbmNlbGxlZDsKIAogICAgICAgICBwdWJsaWMgQmxpbmsoVGV4dFZpZXcgdikgewpAQCAtNzI5MSw2ICs3MzI5LDcgQEAKICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgIH0KIAorICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIHBlcmZvcm1Mb25nQ2xpY2soKSB7CiAgICAgICAgIGlmIChzdXBlci5wZXJmb3JtTG9uZ0NsaWNrKCkpIHsKICAgICAgICAgICAgIG1FYXRUb3VjaFJlbGVhc2UgPSB0cnVlOwpAQCAtNzMxOCw5ICs3MzU3LDkgQEAKICAgICBwcml2YXRlIEFycmF5TGlzdDxUZXh0V2F0Y2hlcj4gIG1MaXN0ZW5lcnMgPSBudWxsOwogCiAgICAgLy8gZGlzcGxheSBhdHRyaWJ1dGVzCi0gICAgcHJpdmF0ZSBUZXh0UGFpbnQgICAgICAgICAgICAgICBtVGV4dFBhaW50OworICAgIHByaXZhdGUgZmluYWwgVGV4dFBhaW50ICAgICAgICAgbVRleHRQYWludDsKICAgICBw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3BsYXllZCBjaGlsZCB2aWV3LgogICAgICAqLwogICAgIHB1YmxpYyBpbnQgZ2V0RGlzcGxheWVkQ2hpbGQoKSB7CiAgICAgICAgIHJldHVybiBtV2hpY2hDaGlsZDsKICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBNYW51YWxseSBzaG93cyB0aGUgbmV4dCBjaGlsZC4KICAgICAgKi8KQEAgLTEyOCw2ICsxMzQsMzUgQEAKICAgICB9CiAKICAgICAvKioKKyAgICAgKiBTaG93cyBvbmx5IHRoZSBzcGVjaWZpZWQgY2hpbGQuIFRoZSBvdGhlciBkaXNwbGF5cyBWaWV3cyBleGl0IHRoZSBzY3JlZW4sCisgICAgICogb3B0aW9uYWxseSB3aXRoIHRoZSB3aXRoIHRoZSB7QGxpbmsgI2dldE91dEFuaW1hdGlvbigpIG91dCBhbmltYXRpb259IGFuZAorICAgICAqIHRoZSBzcGVjaWZpZWQgY2hpbGQgZW50ZXJzIHRoZSBzY3JlZW4sIG9wdGlvbmFsbHkgd2l0aCB0aGUKKyAgICAgKiB7QGxpbmsgI2dldEluQW5pbWF0aW9uKCkgaW4gYW5pbWF0aW9ufS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBjaGlsZEluZGV4IFRoZSBpbmRleCBvZiB0aGUgY2hpbGQgdG8gYmUgc2hvd24uCisgICAgICogQHBhcmFtIGFuaW1hdGUgV2hldGhlciBvciBub3QgdG8gdXNlIHRoZSBpbiBhbmQgb3V0IGFuaW1hdGlvbnMsIGRlZmF1bHRzCisgICAgICogICAgICAgICAgICB0byB0cnVlLgorICAgICAqLworICAgIHZvaWQgc2hvd09ubHkoaW50IGNoaWxkSW5kZXgsIGJvb2xlYW4gYW5pbWF0ZSkgeworICAgICAgICBmaW5hbCBpbnQgY291bnQgPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgeworICAgICAgICAgICAgZmluYWwgVmlldyBjaGlsZCA9IGdldENoaWxkQXQoaSk7CisgICAgICAgICAgICBpZiAoaSA9PSBjaGlsZEluZGV4KSB7CisgICAgICAgICAgICAgICAgaWYgKGFuaW1hdGUgJiYgbUluQW5pbWF0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgY2hpbGQuc3RhcnRBbmltYXRpb24obUluQW5pbWF0aW9uKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2hpbGQuc2V0VmlzaWJpbGl0eShWaWV3LlZJU0lCTEUpOworICAgICAgICAgICAgICAgIG1GaXJzdFRpbWUgPSBmYWxzZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKGFuaW1hdGUgJiYgbU91dEFuaW1hdGlvbiAhPSBudWxsICYmIGNoaWxkLmdldFZpc2liaWxpdHkoKSA9PSBWaWV3LlZJU0lCTEUpIHsKKyAgICAgICAgICAgICAgICAgICAgY2hpbGQuc3RhcnRBbmltYXRpb24obU91dEFuaW1hdGlvbik7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaGlsZC5nZXRBbmltYXRpb24oKSA9PSBtSW5BbmltYXRpb24pCisgICAgICAgICAgICAgICAgICAgIGNoaWxkLmNsZWFyQW5pbWF0aW9uKCk7CisgICAgICAgICAgICAgICAgY2hpbGQuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorICAgIC8qKgogICAgICAqIFNob3dzIG9ubHkgdGhlIHNwZWNpZmllZCBjaGlsZC4gVGhlIG90aGVyIGRpc3BsYXlzIFZpZXdzIGV4aXQgdGhlIHNjcmVlbgogICAgICAqIHdpdGggdGhlIHtAbGluayAjZ2V0T3V0QW5pbWF0aW9uKCkgb3V0IGFuaW1hdGlvbn0gYW5kIHRoZSBzcGVjaWZpZWQgY2hpbGQKICAgICAgKiBlbnRlcnMgdGhlIHNjcmVlbiB3aXRoIHRoZSB7QGxpbmsgI2dldEluQW5pbWF0aW9uKCkgaW4gYW5pbWF0aW9ufS4KQEAgLTEzNSwyNCArMTcwLDggQEAKICAgICAgKiBAcGFyYW0gY2hpbGRJbmRleCBUaGUgaW5kZXggb2YgdGhlIGNoaWxkIHRvIGJlIHNob3duLgogICAgICAqLwogICAgIHZvaWQgc2hvd09ubHkoaW50IGNoaWxkSW5kZXgpIHsKLSAgICAgICAgZmluYWwgaW50IGNvdW50ID0gZ2V0Q2hpbGRDb3VudCgpOwotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKLSAgICAgICAgICAgIGZpbmFsIFZpZXcgY2hpbGQgPSBnZXRDaGlsZEF0KGkpOwotICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBjaGVja0ZvckZpcnN0ID0gKCFtRmlyc3RUaW1lIHx8IG1BbmltYXRlRmlyc3RUaW1lKTsKLSAgICAgICAgICAgIGlmIChpID09IGNoaWxkSW5kZXgpIHsKLSAgICAgICAgICAgICAgICBpZiAoY2hlY2tGb3JGaXJzdCAmJiBtSW5BbmltYXRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjaGlsZC5zdGFydEFuaW1hdGlvbihtSW5BbmltYXRpb24pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjaGlsZC5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7Ci0gICAgICAgICAgICAgICAgbUZpcnN0VGltZSA9IGZhbHNlOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAoY2hlY2tGb3JGaXJzdCAmJiBtT3V0QW5pbWF0aW9uICE9IG51bGwgJiYgY2hpbGQuZ2V0VmlzaWJpbGl0eSgpID09IFZpZXcuVklTSUJMRSkgewotICAgICAgICAgICAgICAgICAgICBjaGlsZC5zdGFydEFuaW1hdGlvbihtT3V0QW5pbWF0aW9uKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoaWxkLm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RpYyBmaW5hbCBpbnQgQ09OVEVYVF9ESVNQTEFZX1NQTElUID0gMTsKKyAgICAKKyAgICBwcml2YXRlIGludCBtQ29udGV4dERpc3BsYXlNb2RlOworCisgICAgZmluYWwgSGFuZGxlciBtSGFuZGxlciA9IG5ldyBIYW5kbGVyKCk7CisgICAgZmluYWwgUnVubmFibGUgbUNsb3NlQ29udGV4dCA9IG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgbVVwcGVyQ29udGV4dFZpZXcuY2xvc2VNb2RlKCk7CisgICAgICAgICAgICBpZiAobUxvd2VyQ29udGV4dFZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Mb3dlckNvbnRleHRWaWV3LnJlbW92ZUFsbFZpZXdzKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworCisgICAgcHVibGljIEFjdGlvbkJhckltcGwoVmlldyBkZWNvcikgeworICAgICAgICBtQWN0aW9uVmlldyA9IChBY3Rpb25CYXJWaWV3KSBkZWNvci5maW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5hY3Rpb25fYmFyKTsKKyAgICAgICAgbVVwcGVyQ29udGV4dFZpZXcgPSAoQWN0aW9uQmFyQ29udGV4dFZpZXcpIGRlY29yLmZpbmRWaWV3QnlJZCgKKyAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmlkLmFjdGlvbl9jb250ZXh0X2Jhcik7CisgICAgICAgIG1Mb3dlckNvbnRleHRWaWV3ID0gKExpbmVhckxheW91dCkgZGVjb3IuZmluZFZpZXdCeUlkKAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuaWQubG93ZXJfYWN0aW9uX2NvbnRleHRfYmFyKTsKKyAgICAgICAgbUFuaW1hdG9yVmlldyA9IChWaWV3QW5pbWF0b3IpIGRlY29yLmZpbmRWaWV3Q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bGUpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldERpc3BsYXlPcHRpb25zKGludCBvcHRpb25zKSB7CisgICAgICAgIG1BY3Rpb25WaWV3LnNldERpc3BsYXlPcHRpb25zKG9wdGlvbnMpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldERpc3BsYXlPcHRpb25zKGludCBvcHRpb25zLCBpbnQgbWFzaykgeworICAgICAgICBmaW5hbCBpbnQgY3VycmVudCA9IG1BY3Rpb25WaWV3LmdldERpc3BsYXlPcHRpb25zKCk7IAorICAgICAgICBtQWN0aW9uVmlldy5zZXREaXNwbGF5T3B0aW9ucygob3B0aW9ucyAmIG1hc2spIHwgKGN1cnJlbnQgJiB+bWFzaykpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldEJhY2tncm91bmREcmF3YWJsZShEcmF3YWJsZSBkKSB7CisgICAgICAgIG1BY3Rpb25WaWV3LnNldEJhY2tncm91bmREcmF3YWJsZShkKTsKKyAgICB9CisKKyAgICBwdWJsaWMgVmlldyBnZXRDdXN0b21OYXZpZ2F0aW9uVmlldygpIHsKKyAgICAgICAgcmV0dXJuIG1BY3Rpb25WaWV3LmdldEN1c3RvbU5hdmlnYXRpb25WaWV3KCk7CisgICAgfQorCisgICAgcHVibGljIENoYXJTZXF1ZW5jZSBnZXRUaXRsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1BY3Rpb25WaWV3LmdldFRpdGxlKCk7CisgICAgfQorCisgICAgcHVibGljIENoYXJTZXF1ZW5jZSBnZXRTdWJ0aXRsZSgpIHsKKyAgICAgICAgcmV0dXJuIG1BY3Rpb25WaWV3LmdldFN1YnRpdGxlKCk7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXROYXZpZ2F0aW9uTW9kZSgpIHsKKyAgICAgICAgcmV0dXJuIG1BY3Rpb25WaWV3LmdldE5hdmlnYXRpb25Nb2RlKCk7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXREaXNwbGF5T3B0aW9ucygpIHsKKyAgICAgICAgcmV0dXJuIG1BY3Rpb25WaWV3LmdldERpc3BsYXlPcHRpb25zKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc3RhcnRDb250ZXh0TW9kZShDb250ZXh0TW9kZUNhbGxiYWNrIGNhbGxiYWNrKSB7CisgICAgICAgIGlmIChtQ29udGV4dE1vZGUgIT0gbnVsbCkgeworICAgICAgICAgICAgbUNvbnRleHRNb2RlLmZpbmlzaCgpOworICAgICAgICB9CisgICAgICAgIG1Db250ZXh0TW9kZSA9IG5ldyBDb250ZXh0TW9kZShjYWxsYmFjayk7CisgICAgICAgIGlmIChjYWxsYmFjay5vbkNyZWF0ZUNvbnRleHRNb2RlKG1Db250ZXh0TW9kZSwgbUNvbnRleHRNb2RlLmdldE1lbnUoKSkpIHsKKyAgICAgICAgICAgIG1Db250ZXh0TW9kZS5pbnZhbGlkYXRlKCk7CisgICAgICAgICAgICBtVXBwZXJDb250ZXh0Vmlldy5pbml0Rm9yTW9kZShtQ29udGV4dE1vZGUpOworICAgICAgICAgICAgbUFuaW1hdG9yVmlldy5zZXREaXNwbGF5ZWRDaGlsZChDT05URVhUX1ZJRVcpOworICAgICAgICAgICAgaWYgKG1Mb3dlckNvbnRleHRWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAvLyBUT0RPIGFuaW1hdGUgdGhpcworICAgICAgICAgICAgICAgIG1Mb3dlckNvbnRleHRWaWV3LnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGZpbmlzaENvbnRleHRNb2RlKCkgeworICAgICAgICBpZiAobUNvbnRleHRNb2RlICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1Db250ZXh0TW9kZS5maW5pc2goKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIEBoaWRlIAorICAgICAqLworICAgIHB1YmxpYyBjbGFzcyBDb250ZXh0TW9kZSBleHRlbmRzIEFjdGlvbkJhci5Db250ZXh0TW9kZSB7CisgICAgICAgIHByaXZhdGUgQ29udGV4dE1vZGVDYWxsYmFjayBtQ2FsbGJhY2s7CisgICAgICAgIHByaXZhdGUgQWN0aW9uTWVudSBtTWVudTsKKyAgICAgICAgCisgICAgICAgIHB1YmxpYyBDb250ZXh0TW9kZShDb250ZXh0TW9kZUNhbGxiYWNrIGNhbGxiYWNrKSB7CisgICAgICAgICAgICBtQ2FsbGJhY2sgPSBjYWxsYmFjazsKKyAgICAgICAgICAgIG1NZW51ID0gbmV3IEFjdGlvbk1lbnUobUFjdGlvblZpZXcuZ2V0Q29udGV4dCgpKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBNZW51IGdldE1lbnUoKSB7CisgICAgICAgICAgICByZXR1cm4gbU1lbnU7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgZmluaXNoKCkgeworICAgICAgICAgICAgbUNhbGxiYWNrLm9uRGVzdHJveUNvbnRleHRNb2RlKHRoaXMpOworICAgICAgICAgICAgbUFuaW1hdG9yVmlldy5zZXREaXNwbGF5ZWRDaGlsZChOT1JNQUxfVklFVyk7CisKKyAgICAgICAgICAgIC8vIENsZWFyIG91dCB0aGUgY29udGV4dCBtb2RlIHZpZXdzIGFmdGVyIHRoZSBhbmltYXRpb24gZmluaXNoZXMKKyAgICAgICAgICAgIG1IYW5kbGVyLnBvc3REZWxheWVkKG1DbG9zZUNvbnRleHQsIG1BbmltYXRvclZpZXcuZ2V0T3V0QW5pbWF0aW9uKCkuZ2V0RHVyYXRpb24oKSk7CisKKyAgICAgICAgICAgIGlmIChtTG93ZXJDb250ZXh0VmlldyAhPSBudWxsICYmIG1Mb3dlckNvbnRleHRWaWV3LmdldFZpc2liaWxpdHkoKSAhPSBWaWV3LkdPTkUpIHsKKyAgICAgICAgICAgICAgICAvLyBUT0RPIEFuaW1hdGUgdGhpcworICAgICAgICAgICAgICAgIG1Mb3dlckNvbnRleHRWaWV3LnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Db250ZXh0TW9kZSA9IG51bGw7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgaW52YWxpZGF0ZSgpIHsKKyAgICAgICAgICAgIGlmIChtQ2FsbGJhY2sub25QcmVwYXJlQ29udGV4dE1vZGUodGhpcywgbU1lbnUpKSB7CisgICAgICAgICAgICAgICAgLy8gUmVmcmVzaCBjb250ZW50IGluIGJvdGggY29udGV4dCB2aWV3cworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIHNldEN1c3RvbVZpZXcoVmlldyB2aWV3KSB7CisgICAgICAgICAgICBtVXBwZXJDb250ZXh0Vmlldy5zZXRDdXN0b21WaWV3KHZpZXcpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFN1YnRpdGxlKENoYXJTZXF1ZW5jZSBzdWJ0aXRsZSkgeworICAgICAgICAgICAgbVVwcGVyQ29udGV4dFZpZXcuc2V0U3VidGl0bGUoc3VidGl0bGUpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIHNldFRpdGxlKENoYXJTZXF1ZW5jZSB0aXRsZSkgeworICAgICAgICAgICAgbVVwcGVyQ29udGV4dFZpZXcuc2V0VGl0bGUodGl0bGUpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBwdWJsaWMgdm9pZCBkaXNwYXRjaE9uQ29udGV4dEl0ZW1DbGlja2VkKE1lbnVJdGVtIGl0ZW0pIHs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gICAgICAgICAgTG9nLmkoVEFHLCAiUHJvZmlsZXIgaXMgZW5hYmxlZC4iKTsKKyAgICAgICAgICAgIGVuYWJsZWQgPSB0cnVlOworICAgICAgICAgICAgTG9nLmkoVEFHLCAiUHJvZmlsZXIgaXMgZW5hYmxlZC4gU2FtcGxpbmcgUHJvZmlsZXIgSHo6ICIgKyBzYW1wbGluZ1Byb2ZpbGVySHopOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgc25hcHNob3RXcml0ZXIgPSBudWxsOworICAgICAgICAgICAgZW5hYmxlZCA9IGZhbHNlOwogICAgICAgICAgICAgTG9nLmkoVEFHLCAiUHJvZmlsZXIgaXMgZGlzYWJsZWQuIik7CiAgICAgICAgIH0KICAgICB9CkBAIC02MCw0NSArNzMsNDUgQEAKICAgICAgKi8KICAgICBwdWJsaWMgc3RhdGljIHZvaWQgc3RhcnQoKSB7CiAgICAgICAgIGlmICghZW5hYmxlZCkgcmV0dXJuOwotICAgICAgICBTYW1wbGluZ1Byb2ZpbGVyLmdldEluc3RhbmNlKCkuc3RhcnQoMTApOworICAgICAgICBTYW1wbGluZ1Byb2ZpbGVyLmdldEluc3RhbmNlKCkuc3RhcnQoc2FtcGxpbmdQcm9maWxlckh6KTsKICAgICB9CiAKLSAgICAvKiogV2hldGhlciBvciBub3Qgd2UndmUgY3JlYXRlZCB0aGUgc25hcHNob3RzIGRpci4gKi8KLSAgICBzdGF0aWMgYm9vbGVhbiBkaXJNYWRlID0gZmFsc2U7Ci0KLSAgICAvKiogV2hldGhlciBvciBub3QgYSBzbmFwc2hvdCBpcyBiZWluZyBwZXJzaXN0ZWQuICovCi0gICAgc3RhdGljIHZvbGF0aWxlIGJvb2xlYW4gcGVuZGluZzsKLQogICAgIC8qKgotICAgICAqIFdyaXRlcyBhIHNuYXBzaG90IHRvIHRoZSBTRCBjYXJkIGlmIHByb2ZpbGluZyBpcyBlbmFibGVkLgorICAgICAqIFdyaXRlcyBhIHNuYXBzaG90IGlmIHByb2ZpbGluZyBpcyBlbmFibGVkLgogICAgICAqLwotICAgIHB1YmxpYyBzdGF0aWMgdm9pZCB3cml0ZVNuYXBzaG90KGZpbmFsIFN0cmluZyBuYW1lKSB7CisgICAgcHVibGljIHN0YXRpYyB2b2lkIHdyaXRlU25hcHNob3QoZmluYWwgU3RyaW5nIHByb2Nlc3NOYW1lLCBmaW5hbCBQYWNrYWdlSW5mbyBwYWNrYWdlSW5mbykgewogICAgICAgICBpZiAoIWVuYWJsZWQpIHJldHVybjsKIAogICAgICAgICAvKgotICAgICAgICAgKiBJZiB3ZSdyZSBhbHJlYWR5IHdyaXRpbmcgYSBzbmFwc2hvdCwgZG9uJ3QgYm90aGVyIGVucXVlaW5nIGFub3RoZXIKKyAgICAgICAgICogSWYgd2UncmUgYWxyZWFkeSB3cml0aW5nIGEgc25hcHNob3QsIGRvbid0IGJvdGhlciBlbnF1ZXVlaW5nIGFub3RoZXIKICAgICAgICAgICogcmVxdWVzdCByaWdodCBub3cuIFRoaXMgd2lsbCByZWR1Y2UgdGhlIG51bWJlciBvZiBpbmRpdmlkdWFsCiAgICAgICAgICAqIHNuYXBzaG90cyBhbmQgaW4gdHVybiB0aGUgdG90YWwgYW1vdW50IG9mIG1lbW9yeSBjb25zdW1lZCAob25lIGJpZwogICAgICAgICAgKiBzbmFwc2hvdCBpcyBzbWFsbGVyIHRoYW4gTiBzdWJzZXQgc25hcHNob3RzKS4KICAgICAgICAgICovCi0gICAgICAgIGlmICghcGVuZGluZykgewotICAgICAgICAgICAgcGVuZGluZyA9IHRydWU7CisgICAgICAgIGlmIChwZW5kaW5nLmNvbXBhcmVBbmRTZXQoZmFsc2UsIHRydWUpKSB7CiAgICAgICAgICAgICBzbmFwc2hvdFdyaXRlci5leGVjdXRlKG5ldyBSdW5uYWJsZSgpIHsKICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBydW4oKSB7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBkaXIgPSAiL3NkY2FyZC9zbmFwc2hvdHMiOwogICAgICAgICAgICAgICAgICAgICBpZiAoIWRpck1hZGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBGaWxlKGRpcikubWtkaXJzKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3IEZpbGUoZGlyKS5pc0RpcmVjdG9yeSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBGaWxlIGRpciA9IG5ldyBGaWxlKFNOQVBTSE9UX0RJUik7CisgICAgICAgICAgICAgICAgICAgICAgICBkaXIubWtkaXJzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgZGlyZWN0b3J5IG5lZWRzIHRvIGJlIHdyaXRhYmxlIHRvIGFueWJvZHkKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpci5zZXRXcml0YWJsZSh0cnVlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgZGlyZWN0b3J5IG5lZWRzIHRvIGJlIGV4ZWN1dGFibGUgdG8gYW55Ym9keQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG9uJ3Qga25vdyB3aHkgeWV0LCBidXQgbW9kZSA3MjMgd291bGQgd29yaywgd2hpbGUKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1vZGUgNzIyIHRocm93cyBGaWxlTm90Rm91bmRFeGVjcHRpb24gYXQgbGluZSAxNTEKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpci5zZXRFeGVjdXRhYmxlKHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXcgRmlsZShTTkFQU0hPVF9ESVIpLmlzRGlyZWN0b3J5KCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXJNYWRlID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQ3JlYXRpb24gb2YgIiArIGRpciArICIgZmFpbGVkLiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkNyZWF0aW9uIG9mICIgKyBTTkFQU0hPVF9ESVIgKyAiIGZhaWxlZC4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZW5kaW5nLnNldChmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZVNuYXBzaG90KGRpciwgbmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZVNuYXBzaG90KFNOQVBTSE9UX0RJUiwgcHJvY2Vzc05hbWUsIHBhY2thZ2VJbmZvKTsKICAgICAgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBlbmRpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBlbmRpbmcuc2V0KGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0pOwpAQCAtMTEwLDEzICsxMjMsMTMgQEAKICAgICAgKi8KICAgICBwdWJsaWMgc3RhdGljIHZvaWQgd3JpdGVaeWdvdGVTbmFwc2hvdCgpIHsKICAgICAgICAgaWYgKCFlbmFibGVkKSByZXR1cm47Ci0KLSAgICAgICAgU3RyaW5nIGRpciA9ICIvZGF0YS96eWdvdGUvc25hcHNob3RzIjsKLSAgICAgICAgbmV3IEZpbGUoZGlyKS5ta2RpcnMoKTsKLSAgICAgICAgd3JpdGVTbmFwc2hvdChkaXIsICJ6eWdvdGUiKTsKKyAgICAgICAgd3JpdGVTbmFwc2hvdCgienlnb3RlIiwgbnVsbCk7CiAgICAgfQogCi0gICAgcHJpdmF0ZSBzdGF0aW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Ly8gVHJ5IHRvIG9wZW4gdGhlIGZpbGUgYSBmZXcgdGltZXMuIFRoZSBTRCBjYXJkIG1heSBub3QgYmUgbW91bnRlZC4KLSAgICAgICAgICAgIEZpbGVPdXRwdXRTdHJlYW0gb3V0OwotICAgICAgICAgICAgaW50IGNvdW50ID0gMDsKLSAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgb3V0ID0gbmV3IEZpbGVPdXRwdXRTdHJlYW0ocGF0aCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEZpbGVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgrK2NvdW50ID4gMykgewotICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiQ291bGQgbm90IG9wZW4gIiArIHBhdGggKyAiLiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gU2xlZXAgZm9yIGEgYml0IGFuZCB0aGVuIHRyeSBhZ2Fpbi4KLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFRocmVhZC5zbGVlcCgyNTAwKTsKLSAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZTEpIHsgLyogaWdub3JlICovIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgb3V0LndyaXRlKHNuYXBzaG90KTsKLSAgICAgICAgICAgIH0gZmluYWxseSB7Ci0gICAgICAgICAgICAgICAgb3V0LmNsb3NlKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBsb25nIGVsYXBzZWQgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAtIHN0YXJ0OwotICAgICAgICAgICAgTG9nLmkoVEFHLCAiV3JvdGUgc25hcHNob3QgZm9yICIgKyBuYW1lCi0gICAgICAgICAgICAgICAgICAgICsgIiBpbiAiICsgZWxhcHNlZCArICJtcy4iKTsKKyAgICAgICAgICAgIG91dCA9IG5ldyBGaWxlT3V0cHV0U3RyZWFtKHBhdGgpOworICAgICAgICAgICAgZ2VuZXJhdGVTbmFwc2hvdEhlYWRlcihuYW1lLCBwYWNrYWdlSW5mbywgb3V0KTsKKyAgICAgICAgICAgIG91dC53cml0ZShzbmFwc2hvdCk7CiAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgIExvZy5lKFRBRywgIkVycm9yIHdyaXRpbmcgc25hcHNob3QuIiwgZSk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGlmKG91dCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG91dC5jbG9zZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgLy8gbGV0IGl0IGdvLgorICAgICAgICAgICAgfQogICAgICAgICB9CisgICAgICAgIC8vIHNldCBmaWxlIHJlYWRhYmxlIHRvIHRoZSB3b3JsZCBzbyB0aGF0IFNhbXBsaW5nUHJvZmlsZXJTZXJ2aWNlCisgICAgICAgIC8vIGNhbiBwdXQgaXQgdG8gZHJvcGJveAorICAgICAgICBuZXcgRmlsZShwYXRoKS5zZXRSZWFkYWJsZSh0cnVlLCBmYWxzZSk7CisKKyAgICAgICAgbG9uZyBlbGFwc2VkID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSBzdGFydDsKKyAgICAgICAgTG9nLmkoVEFHLCAiV3JvdGU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IGZpbmFsIGJvb2xlYW4gVEhST1dfT05fTUlTU0lOR19QUkVMT0FEID0KLSAgICAgICAgICAgICIxIi5lcXVhbHMoU3lzdGVtUHJvcGVydGllcy5nZXQoInBlcnNpc3Quc2VydmljZS5hZGIuZW5hYmxlIikpOwotCiAgICAgcHVibGljIHN0YXRpYyBmaW5hbCBTdHJpbmcgVVNBR0VfU1RSSU5HID0KICAgICAgICAgICAgICIgPFwidHJ1ZVwifFwiZmFsc2VcIiBmb3Igc3RhcnRTeXN0ZW1TZXJ2ZXI+IjsKIApAQCAtMjg3LDcgKzI4Myw2IEBACiAKICAgICAgICAgICAgICAgICBpbnQgY291bnQgPSAwOwogICAgICAgICAgICAgICAgIFN0cmluZyBsaW5lOwotICAgICAgICAgICAgICAgIFN0cmluZyBtaXNzaW5nQ2xhc3NlcyA9IG51bGw7CiAgICAgICAgICAgICAgICAgd2hpbGUgKChsaW5lID0gYnIucmVhZExpbmUoKSkgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAvLyBTa2lwIGNvbW1lbnRzIGFuZCBibGFuayBsaW5lcy4KICAgICAgICAgICAgICAgICAgICAgbGluZSA9IGxpbmUudHJpbSgpOwpAQCAtMzExLDEyICszMDYsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgY291bnQrKzsKICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoQ2xhc3NOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJDbGFzcyBub3QgZm91bmQgZm9yIHByZWxvYWRpbmc6ICIgKyBsaW5lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtaXNzaW5nQ2xhc3NlcyA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWlzc2luZ0NsYXNzZXMgPSBsaW5lOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaXNzaW5nQ2xhc3NlcyArPSAiICIgKyBsaW5lOwotICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQ2xhc3Mgbm90IGZvdW5kIGZvciBwcmVsb2FkaW5nOiAiICsgbGluZSk7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFRocm93YWJsZSB0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJFcnJvciBwcmVsb2FkaW5nICIgKyBsaW5lICsgIi4iLCB0KTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0IGluc3RhbmNlb2YgRXJyb3IpIHsKQEAgLTMyOSwxMyArMzE5LDYgQEAKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIGlmIChUSFJPV19PTl9NSVNTSU5HX1BSRUxPQUQgJiYKLSAgICAgICAgICAgICAgICAgICAgbWlzc2luZ0NsYXNzZXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJNaXNzaW5nIGNsYXNzKGVzKSBmb3IgcHJlbG9hZGluZywgdXBkYXRlIHByZWxvYWRlZC1jbGFzc2VzIFsiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtaXNzaW5nQ2xhc3NlcyArICJdIik7Ci0gICAgICAgICAgICAgICAgfQotCiAgICAgICAgICAgICAgICAgTG9nLmkoVEFHLCAiLi4ucHJlbG9hZGVkICIgKyBjb3VudCArICIgY2xhc3NlcyBpbiAiCiAgICAgICAgICAgICAgICAgICAgICAgICArIChTeXN0ZW1DbG9jay51cHRpbWVNaWxsaXMoKS1zdGFydFRpbWUpICsgIm1zLiIpOwogICAgICAgICAgICAgfSBjYX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S9jb20vYW5kcm9pZC9pbnRlcm5hbC91dGlsL1htbFV0aWxzLmphdmEKKysrIGIvY29yZS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3V0aWwvWG1sVXRpbHMuamF2YQpAQCAtMjYsNiArMjYsNyBAQAogaW1wb3J0IGphdmEuaW8uT3V0cHV0U3RyZWFtOwogaW1wb3J0IGphdmEudXRpbC5BcnJheUxpc3Q7CiBpbXBvcnQgamF2YS51dGlsLkhhc2hNYXA7CitpbXBvcnQgamF2YS51dGlsLkhhc2hTZXQ7CiBpbXBvcnQgamF2YS51dGlsLkl0ZXJhdG9yOwogaW1wb3J0IGphdmEudXRpbC5MaXN0OwogaW1wb3J0IGphdmEudXRpbC5NYXA7CkBAIC0yODQsNiArMjg1LDI2IEBACiAKICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibGlzdCIpOwogICAgIH0KKyAgICAKKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIHZvaWQgd3JpdGVTZXRYbWwoU2V0IHZhbCwgU3RyaW5nIG5hbWUsIFhtbFNlcmlhbGl6ZXIgb3V0KQorICAgICAgICAgICAgdGhyb3dzIFhtbFB1bGxQYXJzZXJFeGNlcHRpb24sIGphdmEuaW8uSU9FeGNlcHRpb24geworICAgICAgICBpZiAodmFsID09IG51bGwpIHsKKyAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAibnVsbCIpOworICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibnVsbCIpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgInNldCIpOworICAgICAgICBpZiAobmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJuYW1lIiwgbmFtZSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGZvciAoT2JqZWN0IHYgOiB2YWwpIHsKKyAgICAgICAgICAgIHdyaXRl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HRocm93cyBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uCisgICAgICogQHRocm93cyBqYXZhLmlvLklPRXhjZXB0aW9uCisgICAgICogCisgICAgICogQHNlZSAjcmVhZFNldFhtbAorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgSGFzaFNldCByZWFkVGhpc1NldFhtbChYbWxQdWxsUGFyc2VyIHBhcnNlciwgU3RyaW5nIGVuZFRhZywgU3RyaW5nW10gbmFtZSkKKyAgICAgICAgICAgIHRocm93cyBYbWxQdWxsUGFyc2VyRXhjZXB0aW9uLCBqYXZhLmlvLklPRXhjZXB0aW9uIHsKKyAgICAgICAgSGFzaFNldCBzZXQgPSBuZXcgSGFzaFNldCgpOworICAgICAgICAKKyAgICAgICAgaW50IGV2ZW50VHlwZSA9IHBhcnNlci5nZXRFdmVudFR5cGUoKTsKKyAgICAgICAgZG8geworICAgICAgICAgICAgaWYgKGV2ZW50VHlwZSA9PSBwYXJzZXIuU1RBUlRfVEFHKSB7CisgICAgICAgICAgICAgICAgT2JqZWN0IHZhbCA9IHJlYWRUaGlzVmFsdWVYbWwocGFyc2VyLCBuYW1lKTsKKyAgICAgICAgICAgICAgICBzZXQuYWRkKHZhbCk7CisgICAgICAgICAgICAgICAgLy9TeXN0ZW0ub3V0LnByaW50bG4oIkFkZGluZyB0byBzZXQ6ICIgKyB2YWwpOworICAgICAgICAgICAgfSBlbHNlIGlmIChldmVudFR5cGUgPT0gcGFyc2VyLkVORF9UQUcpIHsKKyAgICAgICAgICAgICAgICBpZiAocGFyc2VyLmdldE5hbWUoKS5lcXVhbHMoZW5kVGFnKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2V0OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICJFeHBlY3RlZCAiICsgZW5kVGFnICsgIiBlbmQgdGFnIGF0OiAiICsgcGFyc2VyLmdldE5hbWUoKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBldmVudFR5cGUgPSBwYXJzZXIubmV4dCgpOworICAgICAgICB9IHdoaWxlIChldmVudFR5cGUgIT0gcGFyc2VyLkVORF9ET0NVTUVOVCk7CisgICAgICAgIAorICAgICAgICB0aHJvdyBuZXcgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAiRG9jdW1lbnQgZW5kZWQgYmVmb3JlICIgKyBlbmRUYWcgKyAiIGVuZCB0YWciKTsKKyAgICB9CiAKICAgICAvKioKICAgICAgKiBSZWFkIGFuIGludFtdIG9iamVjdCBmcm9tIGFuIFhtbFB1bGxQYXJzZXIuICBUaGUgWE1MIGRhdGEgY291bGQKQEAgLTc0MCw2ICs4MjgsMTIgQEAKICAgICAgICAgICAgIG5hbWVbMF0gPSB2YWx1ZU5hbWU7CiAgICAgICAgICAgICAvL1N5c3RlbS5vdXQucHJpbnRsbigiUmV0dXJuaW5nIHZhbHVlIGZvciAiICsgdmFsdWVOYW1lICsgIjogIiArIHJlcyk7CiAgICAgICAgICAgICByZXR1cm4gcmVzOworICAgICAgICB9IGVsc2UgaWYgKHRhZ05hbWUuZXF1YWxzKCJzZXQiKSkgeworICAgICAgICAgICAgcGFyc2VyLm5leHQoKTsKKyAgICAgICAgICAgIHJlcyA9IHJlYWRUaGlzU2V0WG1sKHBhcnNlciwgInNldCIsIG5hbWUpOworICAgICAgICAgICAgbmFtZVswXSA9IHZhbHVlTmFtZTsKKyAgICAgICAgICAgIC8vU3lzdGVtLm91dC5wcmludGxuKCJSZXR1cm5pbmcgdmFsdWUgZm9yICIgKyB2YWx1ZU5hbWUgKyAiOiAiICsgcmVzKTsKKyAgICAgICAgICAgIHJldHVybiByZXM7CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICB0aHJvdyBuZXcgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbigKICAgICAgICAgICAgICAg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Ul0ZW0+KCk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBDb250ZXh0IGdldENvbnRleHQoKSB7CisgICAgICAgIHJldHVybiBtQ29udGV4dDsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gYWRkKENoYXJTZXF1ZW5jZSB0aXRsZSkgeworICAgICAgICByZXR1cm4gYWRkKDAsIDAsIDAsIHRpdGxlKTsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gYWRkKGludCB0aXRsZVJlcykgeworICAgICAgICByZXR1cm4gYWRkKDAsIDAsIDAsIHRpdGxlUmVzKTsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gYWRkKGludCBncm91cElkLCBpbnQgaXRlbUlkLCBpbnQgb3JkZXIsIGludCB0aXRsZVJlcykgeworICAgICAgICByZXR1cm4gYWRkKGdyb3VwSWQsIGl0ZW1JZCwgb3JkZXIsIG1Db250ZXh0LmdldFJlc291cmNlcygpLmdldFN0cmluZyh0aXRsZVJlcykpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgTWVudUl0ZW0gYWRkKGludCBncm91cElkLCBpbnQgaXRlbUlkLCBpbnQgb3JkZXIsIENoYXJTZXF1ZW5jZSB0aXRsZSkgeworICAgICAgICBBY3Rpb25NZW51SXRlbSBpdGVtID0gbmV3IEFjdGlvbk1lbnVJdGVtKGdldENvbnRleHQoKSwKKyAgICAgICAgICAgICAgICBncm91cElkLCBpdGVtSWQsIDAsIG9yZGVyLCB0aXRsZSk7CisgICAgICAgIG1JdGVtcy5hZGQob3JkZXIsIGl0ZW0pOworICAgICAgICByZXR1cm4gaXRlbTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGFkZEludGVudE9wdGlvbnMoaW50IGdyb3VwSWQsIGludCBpdGVtSWQsIGludCBvcmRlciwKKyAgICAgICAgICAgIENvbXBvbmVudE5hbWUgY2FsbGVyLCBJbnRlbnRbXSBzcGVjaWZpY3MsIEludGVudCBpbnRlbnQsIGludCBmbGFncywKKyAgICAgICAgICAgIE1lbnVJdGVtW10gb3V0U3BlY2lmaWNJdGVtcykgeworICAgICAgICBQYWNrYWdlTWFuYWdlciBwbSA9IG1Db250ZXh0LmdldFBhY2thZ2VNYW5hZ2VyKCk7CisgICAgICAgIGZpbmFsIExpc3Q8UmVzb2x2ZUluZm8+IGxyaSA9CisgICAgICAgICAgICAgICAgcG0ucXVlcnlJbnRlbnRBY3Rpdml0eU9wdGlvbnMoY2FsbGVyLCBzcGVjaWZpY3MsIGludGVudCwgMCk7CisgICAgICAgIGZpbmFsIGludCBOID0gbHJpICE9IG51bGwgPyBscmkuc2l6ZSgpIDogMDsKKworICAgICAgICBpZiAoKGZsYWdzICYgRkxBR19BUFBFTkRfVE9fR1JPVVApID09IDApIHsKKyAgICAgICAgICAgIHJlbW92ZUdyb3VwKGdyb3VwSWQpOworICAgICAgICB9CisKKyAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgZmluYWwgUmVzb2x2ZUluZm8gcmkgPSBscmkuZ2V0KGkpOworICAgICAgICAgICAgSW50ZW50IHJpbnRlbnQgPSBuZXcgSW50ZW50KAorICAgICAgICAgICAgICAgIHJpLnNwZWNpZmljSW5kZXggPCAwID8gaW50ZW50IDogc3BlY2lmaWNzW3JpLnNwZWNpZmljSW5kZXhdKTsKKyAgICAgICAgICAgIHJpbnRlbnQuc2V0Q29tcG9uZW50KG5ldyBDb21wb25lbnROYW1lKAorICAgICAgICAgICAgICAgICAgICByaS5hY3Rpdml0eUluZm8uYXBwbGljYXRpb25JbmZvLnBhY2thZ2VOYW1lLAorICAgICAgICAgICAgICAgICAgICByaS5hY3Rpdml0eUluZm8ubmFtZSkpOworICAgICAgICAgICAgZmluYWwgTWVudUl0ZW0gaXRlbSA9IGFkZChncm91cElkLCBpdGVtSWQsIG9yZGVyLCByaS5sb2FkTGFiZWwocG0pKQorICAgICAgICAgICAgICAgICAgICAuc2V0SWNvbihyaS5sb2FkSWNvbihwbSkpCisgICAgICAgICAgICAgICAgICAgIC5zZXRJbnRlbnQocmludGVudCk7CisgICAgICAgICAgICBpZiAob3V0U3BlY2lmaWNJdGVtcyAhPSBudWxsICYmIHJpLnNwZWNpZmljSW5kZXggPj0gMCkgeworICAgICAgICAgICAgICAgIG91dFNwZWNpZmljSXRlbXNbcmkuc3BlY2lmaWNJbmRleF0gPSBpdGVtOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIE47CisgICAgfQorCisgICAgcHVibGljIFN1Yk1lbnUgYWRkU3ViTWVudShDaGFyU2VxdWVuY2UgdGl0bGUpIHsKKyAgICAgICAgLy8gVE9ETyBJbXBsZW1lbnQgc3VibWVudXMKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIFN1Yk1lbnUgYWRkU3ViTWVudShpbnQgdGl0bGVSZXMpIHsKKyAgICAgICAgLy8gVE9ETyBJbXBsZW1lbnQgc3VibWVudXMKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIFN1Yk1lbnUgYWRkU3ViTWVudShpbnQgZ3JvdXBJZCwgaW50IGl0ZW1JZCwgaW50IG9yZGVyLAorICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRpdGxlKSB7CisgICAgICAgIC8vIFRPRE8gSW1wbGVtZW50IHN1Ym1lbnVzCisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIHB1YmxpYyBTdWJNZW51IGFkZFN1Yk1lbnUoaW50IGdyb3VwSWQsIGludCBpdGVtSWQsIGludCBvcmRlciwgaW50IHRpdGxlUmVzKSB7CisgICAgICAgIC8vIFRPRE8gSW1wbGVtZW50IHN1Ym1lbnVzCisgICAgICAgIHJldHVybiBudWxsOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGNsZWFyKCkgeworICAgICAgICBtSXRlbXMuY2xlYXIoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBjbG9zZSgpIHsKKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSBpbnQgZmluZEl0ZW1JbmRleChpbnQgaWQpIHsKKyAgICAgICAgZmluYWwgQXJyYXlMaXN0PEFjdGlvbk1lbnVJdGVtPiBpdGVtcyA9IG1JdGVtczsKKyAgICAgICAgZmluYWwgaW50IGl0ZW1Db3VudCA9IGl0ZW1zLnNpemUoKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBpdGVtQ291bnQ7IGkrKykgeworICAgICAgICAgICAgaWYgKGl0ZW1zLmdldChpKS5nZXRJdGVtSWQoKSA9PSBpZCkgeworICAgICAgICAgICAgICAgIHJldHVybiBpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIGZpbmRJdGVtKGludCBpZCkgeworICAgICAgICByZXR1cm4gbUl0ZW1zLmdldChmaW5kSXRlbUluZGV4KGlkKSk7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIGdldEl0ZW0oaW50IGluZGV4KSB7CisgICAgICAgIHJldHVybiBtSXRlbXMuZ2V0KGluZGV4KTsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBoYXNWaXNpYmxlSXRlbXMoKSB7CisgICAgICAgIGZpbmFsIEFycmF5TGlzdDxBY3Rpb25NZW51SXRlbT4gaXRlbXMgPSBtSXRlbXM7CisgICAgICAgIGZpbmFsIGludCBpdGVtQ291bnQgPSBpdGVtcy5zaXplKCk7CisgICAgICAgIAorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGl0ZW1Db3VudDsgaSsrKSB7CisgICAgICAgICAgICBpZiAoaXRlbXMuZ2V0KGkpLmlzVmlzaWJsZSgpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSBBY3Rpb25NZW51SXRlbSBmaW5kSXRlbVdpdGhTaG9ydGN1dChpbnQga2V5Q29kZSwgS2V5RXZlbnQgZXZlbnQpIHsKKyAgICAgICAgLy8gVE9ETyBNYWtlIHRoaXMgc21hcnRlci4KKyAgICAgICAgZmluYWwgYm9vbGVhbiBxd2VydHkgPSBtSXNRd2VydHk7CisgICAgICAgIGZpbmFsIEFycmF5TGlzdDxBY3Rpb25NZW51SXRlbT4gaXRlbXMgPSBtSXRlbXM7CisgICAgICAgIGZpbmFsIGludCBpdGVtQ291bnQgPSBpdGVtcy5zaXplKCk7CisgICAgICAgIAorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGl0ZW1Db3VudDsgaSsrKSB7CisgICAgICAgICAgICBBY3Rpb25NZW51SXRlbSBpdGVtID0gaXRlbXMuZ2V0KGkpOworICAgICAgICAgICAgZmluYWwgY2hhciBzaG9ydGN1dCA9IHF3ZXJ0eSA/IGl0ZW0uZ2V0QWxwaGFiZXRpY1Nob3J0Y3V0KCkgOgorICAgICAgICAgICAgICAgICAgICBpdGVtLmdldE51bWVyaWNTaG9ydGN1dCgpOworICAgICAgICAgICAgaWYgKGtleUNvZGUgPT0gc2hvcnRjdXQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gaXRlbTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc1Nob3J0Y3V0S2V5KGludCBrZXlDb2RlLCBLZXlFdmVudCBldmVudCkgeworICAgICAgICByZXR1cm4gZmluZEl0ZW1XaXRoU2hvcnRjdXQoa2V5Q29kZSwgZXZlbnQpICE9IG51bGw7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gcGVyZm9ybUlkZW50aWZpZXJBY3Rpb24oaW50IGlkLCBpbnQgZmxhZ3MpIHsKKyAgICAgICAgZmluYWwgaW50IGluZGV4ID0gZmluZEl0ZW1JbmRleChpZCk7CisgICAgICAgIGlmIChpbmRleCA8IDApIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBtSXRlbXMuZ2V0KGluZGV4KS5pbnZva2UoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBwZXJmb3JtU2hvcnRjdXQoaW50IGtleUNvZGUsIEtleUV2ZW50IGV2ZW50LCBpbnQgZmxhZ3MpIHsKKyAgICAgICAgQWN0aW9uTWVudUl0ZW0gaXRlbSA9IGZpbmRJdGVtV2l0aFNob3J0Y3V0KGtleUNvZGUsIGV2ZW50KTsKKyAgICAgICAgaWYgKGl0ZW0gPT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICByZXR1cm4gaXRlbS5pbnZva2UoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCByZW1vdmVHcm91cChpbnQgZ3JvdXBJZCkgeworICAgICAgICBmaW5hbCBBcnJheUxpc3Q8QWN0aW9uTWVudUl0ZW0+IGl0ZW1zID0gbUl0ZW1zOworICAgICAgICBpbnQgaXRlbUNvdW50ID0gaXRlbXMuc2l6ZSgpOworICAgICAgICBpbnQgaSA9IDA7CisgICAgICAgIHdoaWxlIChpIDwgaXRlbUNvdW50KSB7CisgICAgICAgICAgICBpZiAoaXRlbXMuZ2V0KGkpLmdldEdyb3VwSWQoKSA9PSBncm91cElkKSB7CisgICAgICAgICAgICAgICAgaXRlbXMucmVtb3ZlKGkpOworICAgICAgICAgICAgICAgIGl0ZW1Db3VudC0tOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpKys7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCByZW1vdmVJdGVtKGludCBpZCkgeworICAgICAgICBtSXRlbXMucmV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JvdXApIHsKKyAgICAgICAgICAgICAgICBpdGVtLnNldEVuYWJsZWQoZW5hYmxlZCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRHcm91cFZpc2libGUoaW50IGdyb3VwLCBib29sZWFuIHZpc2libGUpIHsKKyAgICAgICAgZmluYWwgQXJyYXlMaXN0PEFjdGlvbk1lbnVJdGVtPiBpdGVtcyA9IG1JdGVtczsKKyAgICAgICAgZmluYWwgaW50IGl0ZW1Db3VudCA9IGl0ZW1zLnNpemUoKTsKKyAgICAgICAgCisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgaXRlbUNvdW50OyBpKyspIHsKKyAgICAgICAgICAgIEFjdGlvbk1lbnVJdGVtIGl0ZW0gPSBpdGVtcy5nZXQoaSk7CisgICAgICAgICAgICBpZiAoaXRlbS5nZXRHcm91cElkKCkgPT0gZ3JvdXApIHsKKyAgICAgICAgICAgICAgICBpdGVtLnNldFZpc2libGUodmlzaWJsZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRRd2VydHlNb2RlKGJvb2xlYW4gaXNRd2VydHkpIHsKKyAgICAgICAgbUlzUXdlcnR5ID0gaXNRd2VydHk7CisgICAgfQorCisgICAgcHVibGljIGludCBzaXplKCkgeworICAgICAgICByZXR1cm4gbUl0ZW1zLnNpemUoKTsKKyAgICB9Cit9CmRpZmYgLS1naXQgYS9jb3JlL2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdmlldy9tZW51L0FjdGlvbk1lbnVJdGVtLmphdmEgYi9jb3JlL2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdmlldy9tZW51L0FjdGlvbk1lbnVJdGVtLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMDM1ODc1YQotLS0gL2Rldi9udWxsCisrKyBiL2NvcmUvamF2YS9j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7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENIRUNLQUJMRSAgICAgID0gMHgwMDAwMDAwMTsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgQ0hFQ0tFRCAgICAgICAgPSAweDAwMDAwMDAyOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBFWENMVVNJVkUgICAgICA9IDB4MDAwMDAwMDQ7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IEhJRERFTiAgICAgICAgID0gMHgwMDAwMDAwODsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgRU5BQkxFRCAgICAgICAgPSAweDAwMDAwMDEwOworICAgIAorICAgIHB1YmxpYyBBY3Rpb25NZW51SXRlbShDb250ZXh0IGNvbnRleHQsIGludCBncm91cCwgaW50IGlkLCBpbnQgY2F0ZWdvcnlPcmRlciwgaW50IG9yZGVyaW5nLAorICAgICAgICAgICAgQ2hhclNlcXVlbmNlIHRpdGxlKSB7CisgICAgICAgIG1Db250ZXh0ID0gY29udGV4dDsKKyAgICAgICAgbUlkID0gaWQ7CisgICAgICAgIG1Hcm91cCA9IGdyb3VwOworICAgICAgICBtQ2F0ZWdvcnlPcmRlciA9IGNhdGVnb3J5T3JkZXI7CisgICAgICAgIG1PcmRlcmluZyA9IG9yZGVyaW5nOworICAgICAgICBtVGl0bGUgPSB0aXRsZTsKKyAgICB9CisgICAgCisgICAgcHVibGljIGNoYXIgZ2V0QWxwaGFiZXRpY1Nob3J0Y3V0KCkgeworICAgICAgICByZXR1cm4gbVNob3J0Y3V0QWxwaGFiZXRpY0NoYXI7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRHcm91cElkKCkgeworICAgICAgICByZXR1cm4gbUdyb3VwOworICAgIH0KKworICAgIHB1YmxpYyBEcmF3YWJsZSBnZXRJY29uKCkgeworICAgICAgICByZXR1cm4gbUljb25EcmF3YWJsZTsKKyAgICB9CisKKyAgICBwdWJsaWMgSW50ZW50IGdldEludGVudCgpIHsKKyAgICAgICAgcmV0dXJuIG1JbnRlbnQ7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRJdGVtSWQoKSB7CisgICAgICAgIHJldHVybiBtSWQ7CisgICAgfQorCisgICAgcHVibGljIENvbnRleHRNZW51SW5mbyBnZXRNZW51SW5mbygpIHsKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorCisgICAgcHVibGljIGNoYXIgZ2V0TnVtZXJpY1Nob3J0Y3V0KCkgeworICAgICAgICByZXR1cm4gbVNob3J0Y3V0TnVtZXJpY0NoYXI7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRPcmRlcigpIHsKKyAgICAgICAgcmV0dXJuIG1PcmRlcmluZzsKKyAgICB9CisKKyAgICBwdWJsaWMgU3ViTWVudSBnZXRTdWJNZW51KCkgeworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICB9CisKKyAgICBwdWJsaWMgQ2hhclNlcXVlbmNlIGdldFRpdGxlKCkgeworICAgICAgICByZXR1cm4gbVRpdGxlOworICAgIH0KKworICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0VGl0bGVDb25kZW5zZWQoKSB7CisgICAgICAgIHJldHVybiBtVGl0bGVDb25kZW5zZWQ7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaGFzU3ViTWVudSgpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzQ2hlY2thYmxlKCkgeworICAgICAgICByZXR1cm4gKG1GbGFncyAmIENIRUNLQUJMRSkgIT0gMDsgCisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNDaGVja2VkKCkgeworICAgICAgICByZXR1cm4gKG1GbGFncyAmIENIRUNLRUQpICE9IDA7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNFbmFibGVkKCkgeworICAgICAgICByZXR1cm4gKG1GbGFncyAmIEVOQUJMRUQpICE9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1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0SWNvbihEcmF3YWJsZSBpY29uKSB7CisgICAgICAgIG1JY29uRHJhd2FibGUgPSBpY29uOworICAgICAgICBtSWNvblJlc0lkID0gTk9fSUNPTjsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIHNldEljb24oaW50IGljb25SZXMpIHsKKyAgICAgICAgbUljb25SZXNJZCA9IGljb25SZXM7CisgICAgICAgIG1JY29uRHJhd2FibGUgPSBtQ29udGV4dC5nZXRSZXNvdXJjZXMoKS5nZXREcmF3YWJsZShpY29uUmVzKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIHNldEludGVudChJbnRlbnQgaW50ZW50KSB7CisgICAgICAgIG1JbnRlbnQgPSBpbnRlbnQ7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXROdW1lcmljU2hvcnRjdXQoY2hhciBudW1lcmljQ2hhcikgeworICAgICAgICBtU2hvcnRjdXROdW1lcmljQ2hhciA9IG51bWVyaWNDaGFyOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0T25NZW51SXRlbUNsaWNrTGlzdGVuZXIoT25NZW51SXRlbUNsaWNrTGlzdGVuZXIgbWVudUl0ZW1DbGlja0xpc3RlbmVyKSB7CisgICAgICAgIG1DbGlja0xpc3RlbmVyID0gbWVudUl0ZW1DbGlja0xpc3RlbmVyOworICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwdWJsaWMgTWVudUl0ZW0gc2V0U2hvcnRjdXQoY2hhciBudW1lcmljQ2hhciwgY2hhciBhbHBoYUNoYXIpIHsKKyAgICAgICAgbVNob3J0Y3V0TnVtZXJpY0NoYXIgPSBudW1lcmljQ2hhcjsKKyAgICAgICAgbVNob3J0Y3V0QWxwaGFiZXRpY0NoYXIgPSBhbHBoYUNoYXI7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXRUaXRsZShDaGFyU2VxdWVuY2UgdGl0bGUpIHsKKyAgICAgICAgbVRpdGxlID0gdGl0bGU7CisgICAgICAgIHJldHVybiB0aGlzOworICAgIH0KKworICAgIHB1YmxpYyBNZW51SXRlbSBzZXRUaXRsZShpbnQgdGl0bGUpIHsKKyAgICAgICAgbVRpdGxlID0gbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0U3RyaW5nKHRpdGxlKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIHNldFRpdGxlQ29uZGVuc2VkKENoYXJTZXF1ZW5jZSB0aXRsZSkgeworICAgICAgICBtVGl0bGVDb25kZW5zZWQgPSB0aXRsZTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIE1lbnVJdGVtIHNldFZpc2libGUoYm9vbGVhbiB2aXNpYmxlKSB7CisgICAgICAgIG1GbGFncyA9IChtRmxhZ3MgJiBISURERU4pIHwgKHZpc2libGUgPyAwIDogSElEREVOKTsKKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaW52b2tlKCkgeworICAgICAgICBpZiAobUNsaWNrTGlzdGVuZXIgIT0gbnVsbCAmJiBtQ2xpY2tMaXN0ZW5lci5vbk1lbnVJdGVtQ2xpY2sodGhpcykpIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAobUludGVudCAhPSBudWxsKSB7CisgICAgICAgICAgICBtQ29udGV4dC5zdGFydEFjdGl2aXR5KG1JbnRlbnQpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0K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UJMRSA6IFZpZXcuR09ORSk7CisgICAgICAgIHNldEVuYWJsZWQoaXRlbURhdGEuaXNFbmFibGVkKCkpOworICAgIH0KKyAgICAKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBwZXJmb3JtQ2xpY2soKSB7CisgICAgICAgIC8vIExldCB0aGUgdmlldydzIGxpc3RlbmVyIGhhdmUgdG9wIHByaW9yaXR5CisgICAgICAgIGlmIChzdXBlci5wZXJmb3JtQ2xpY2soKSkgeworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIGlmIChtSXRlbUludm9rZXIgIT0gbnVsbCAmJiBtSXRlbUludm9rZXIuaW52b2tlSXRlbShtSXRlbURhdGEpKSB7CisgICAgICAgICAgICBwbGF5U291bmRFZmZlY3QoU291bmRFZmZlY3RDb25zdGFudHMuQ0xJQ0spOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHVibGljIHZvaWQgc2V0SXRlbUludm9rZXIoTWVudUJ1aWxkZXIuSXRlbUludm9rZXIgaW52b2tlcikgeworICAgICAgICBtSXRlbUludm9rZXIgPSBpbnZva2VyOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIHByZWZlcnNDb25kZW5zZWRUaXRsZSgpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldENoZWNrYWJsZShib29sZWFuIGNoZWNrYWJsZSkgeworICAgICAgICAvLyBUT0RPIFN1cHBvcnQgY2hlY2thYmxlIGFjdGlvbiBpdGVtcworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldENoZWNrZWQoYm9vbGVhbiBjaGVja2VkKSB7CisgICAgICAgIC8vIFRPRE8gU3VwcG9ydCBjaGVja2FibGUgYWN0aW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nVWaWV3IGV4dGVuZHMgTGluZWFyTGF5b3V0IGltcGxlbWVudHMgTWVudUJ1aWxkZXIuSXRlbUludm9rZXIsIE1lbnVWaWV3IHsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEFHID0gIkFjdGlvbk1lbnVWaWV3IjsKKyAgICAKKyAgICBwcml2YXRlIE1lbnVCdWlsZGVyIG1NZW51OworCisgICAgcHJpdmF0ZSBpbnQgbUl0ZW1QYWRkaW5nOworICAgIHByaXZhdGUgaW50IG1JdGVtTWFyZ2luOworICAgIHByaXZhdGUgaW50IG1NYXhJdGVtczsKKyAgICAKKyAgICBwdWJsaWMgQWN0aW9uTWVudVZpZXcoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIHRoaXMoY29udGV4dCwgbnVsbCk7CisgICAgfQorICAgIAorICAgIHB1YmxpYyBBY3Rpb25NZW51VmlldyhDb250ZXh0IGNvbnRleHQsIEF0dHJpYnV0ZVNldCBhdHRycykgeworICAgICAgICBzdXBlcihjb250ZXh0LCBhdHRycyk7CisgICAgICAgIAorICAgICAgICBUeXBlZEFycmF5IGEgPSBjb250ZXh0Lm9idGFpblN0eWxlZEF0dHJpYnV0ZXMoYXR0cnMsCisgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuVGhlbWUpOworICAgICAgICBtSXRlbVBhZGRpbmcgPSBhLmdldERpbWVuc2lvblBpeGVsT2Zmc2V0KAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLlRoZW1lX2FjdGlvbkJ1dHRvblBhZGRpbmcsIDApOworICAgICAgICBtSXRlbU1hcmdpbiA9IG1JdGVtUGFkZGluZyAvIDI7CisgICAgICAgIGEucmVjeWNsZSgpOworICAgICAgICAKKyAgICAgICAgZmluYWwgUmVzb3VyY2VzIHJlcyA9IGdldFJlc291cmNlcygpOworICAgICAgICBmaW5hbCBpbnQgc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FtcyhMYXlvdXRQYXJhbXMuV1JBUF9DT05URU5ULAorICAgICAgICAgICAgICAgIExheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQpOworICAgICAgICBwYXJhbXMubGVmdE1hcmdpbiA9IG1JdGVtTWFyZ2luOworICAgICAgICBwYXJhbXMucmlnaHRNYXJnaW4gPSBtSXRlbU1hcmdpbjsKKyAgICAgICAgcmV0dXJuIHBhcmFtczsKKyAgICB9CisgICAgCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIExheW91dFBhcmFtcyBnZW5lcmF0ZUxheW91dFBhcmFtcyhWaWV3R3JvdXAuTGF5b3V0UGFyYW1zIHApIHsKKyAgICAgICAgcmV0dXJuIGdlbmVyYXRlRGVmYXVsdExheW91dFBhcmFtcygpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgaW50IGdldEl0ZW1NYXJnaW4oKSB7CisgICAgICAgIHJldHVybiBtSXRlbU1hcmdpbjsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpbnZva2VJdGVtKE1lbnVJdGVtSW1wbCBpdGVtKSB7CisgICAgICAgIHJldHVybiBtTWVudS5wZXJmb3JtSXRlbUFjdGlvbihpdGVtLCAwKTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldFdpbmRvd0FuaW1hdGlvbnMoKSB7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGluaXRpYWxpemUoTWVudUJ1aWxkZXIgbWVudSwgaW50IG1lbnVUeXBlKSB7CisgICAgICAgIG1lbnUuc2V0TWF4QWN0aW9uSXRlbXMobU1heEl0ZW1zKTsKKyAgICAgICAgbU1lbnUgPSBtZW51OworICAgICAgICB1cGRhdGVDaGlsZHJlbih0cnVlKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB1cGRhdGVDaGlsZHJlbihib29sZWFuIGNsZWFyZWQpIHsKKyAgICAgICAgcmVtb3ZlQWxsVmlld3MoKTsKK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1wbD4gZ2V0VmlzaWJsZUl0ZW1zKCkgewogICAgICAgICBpZiAoIW1Jc1Zpc2libGVJdGVtc1N0YWxlKSByZXR1cm4gbVZpc2libGVJdGVtczsKICAgICAgICAgCkBAIC05MzQsOSArOTc1LDY0IEBACiAgICAgICAgIH0KICAgICAgICAgCiAgICAgICAgIG1Jc1Zpc2libGVJdGVtc1N0YWxlID0gZmFsc2U7CisgICAgICAgIG1Jc0FjdGlvbkl0ZW1zU3RhbGUgPSB0cnVlOwogICAgICAgICAKICAgICAgICAgcmV0dXJuIG1WaXNpYmxlSXRlbXM7CiAgICAgfQorICAgIAorICAgIHByaXZhdGUgdm9pZCBmbGFnQWN0aW9uSXRlbXMoKSB7CisgICAgICAgIGlmICghbUlzQWN0aW9uSXRlbXNTdGFsZSkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBmaW5hbCBBcnJheUxpc3Q8TWVudUl0ZW1JbXBsPiB2aXNpYmxlSXRlbXMgPSBnZXRWaXNpYmxlSXRlbXMoKTsKKyAgICAgICAgZmluYWwgaW50IGl0ZW1zU2l6ZSA9IHZpc2libGVJdGVtcy5zaXplKCk7CisgICAgICAgIGludCBtYXhBY3Rpb25zID0gbU1heEFjdGlvbkl0ZW1zOworICAgICAgICAKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBpdGVtc1NpemU7IGkrKykgeworICAgICAgICAgICAgTWVudUl0ZW1JbXBsIGl0ZW0gPSB2aXNpYmxlSXRlbXMuZ2V0KGkpOworICAgICAgICAgICAgaWYgKGl0ZW0ucmVxdWlyZXNBY3Rpb25CdXR0b24oKSkgeworICAgICAgICAgICAgICAgIG1heEFjdGlvbnMtLTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgLy8gRmxhZyBhcyBtYW55IG1vcmUgcmVxdWVzdGVkIGl0ZW1zIGFzIHdpbGwgZml0LgorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGl0ZW1zU2l6ZTsgaSsrKSB7CisgICAgICAgICAgICBNZW51SXRlbUltcGwgaXRlbSA9IHZpc2libGVJdGVtcy5nZXQoaSk7CisgICAgICAgICAgICBpZiAoaXRlbS5yZXF1ZXN0c0FjdGlvbkJ1dHRvbigpKSB7CisgICAgICAgICAgICAgICAgaXRlbS5zZXRJc0FjdGlvbkJ1dHRvbihtYXhBY3Rpb25zID4gMCk7CisgICAgICAgICAgICAgICAgbWF4QWN0aW9ucy0tOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBtQWN0aW9uSXRlbXMuY2xlYXIoKTsKKyAgICAgICAgbU5vbkFjdGlvbkl0ZW1zLmNsZWFyKCk7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgaXRlbXNTaXplOyBpKyspIHsKKyAgICAgICAgICAgIE1lbnVJdGVtSW1wbCBpdGVtID0gdmlzaWJsZUl0ZW1zLmdldChpKTsKKyAgICAgICAgICAgIGlmIChpdGVtLmlzQWN0aW9uQnV0dG9uKCkpIHsKKyAgICAgICAgICAgICAgICBtQWN0aW9uSXRlbXMuYWRkKGl0ZW0pOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBtTm9uQWN0aW9uSXRlbXMuYWRkKGl0ZW0pOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIAorICAgICAgICBtSXNBY3Rpb25JdGVtc1N0YWxlID0gZmFsc2U7CisgICAgfQorICAgIAorICAgIEFycmF5TGlzdDxNZW51SXRlbUltcGw+IGdldEFjdGlvbkl0ZW1zKCkgeworICAgICAgICBmbGFnQWN0aW9uSXRlbXMoKTsKKyAgICAgICAgcmV0dXJuIG1BY3Rpb25JdGVtczsKKyAgICB9CisgICAgCisgICAgQXJyYXlMaXN0PE1lbnVJdGVtSW1wbD4gZ2V0Tm9uQWN0aW9uSXRlbXMoKSB7CisgICAgICAgIGZsYWdBY3Rpb25JdGVtcygpOworICA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RJT05fTkVWRVI7CiAKICAgICAvKiogVXNlZCBmb3IgdGhlIGljb24gcmVzb3VyY2UgSUQgaWYgdGhpcyBpdGVtIGRvZXMgbm90IGhhdmUgYW4gaWNvbiAqLwogICAgIHN0YXRpYyBmaW5hbCBpbnQgTk9fSUNPTiA9IDA7CkBAIC02MzAsNCArNjMzLDI5IEBACiAgICAgcHVibGljIGJvb2xlYW4gc2hvdWxkU2hvd0ljb24oaW50IG1lbnVUeXBlKSB7CiAgICAgICAgIHJldHVybiBtZW51VHlwZSA9PSBNZW51QnVpbGRlci5UWVBFX0lDT04gfHwgbU1lbnUuZ2V0T3B0aW9uYWxJY29uc1Zpc2libGUoKTsKICAgICB9CisgICAgCisgICAgcHVibGljIGJvb2xlYW4gaXNBY3Rpb25CdXR0b24oKSB7CisgICAgICAgIHJldHVybiAobUZsYWdzICYgSVNfQUNUSU9OKSA9PSBJU19BQ1RJT04gfHwgcmVxdWlyZXNBY3Rpb25CdXR0b24oKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIGJvb2xlYW4gcmVxdWVzdHNBY3Rpb25CdXR0b24oKSB7CisgICAgICAgIHJldHVybiBtU2hvd0FzQWN0aW9uID09IFNIT1dfQVNfQUNUSU9OX0lGX1JPT007CisgICAgfQorICAgIAorICAgIHB1YmxpYyBib29sZWFuIHJlcXVpcmVzQWN0aW9uQnV0dG9uKCkgeworICAgICAgICByZXR1cm4gbVNob3dBc0FjdGlvbiA9PSBTSE9XX0FTX0FDVElPTl9BTFdBWVM7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0SXNBY3Rpb25CdXR0b24oYm9vbGVhbiBpc0FjdGlvbkJ1dHRvbikgeworICAgICAgICBpZiAoaXNBY3Rpb25CdXR0b24pIHsKKyAgICAgICAgICAgIG1GbGFncyB8PSBJU19BQ1RJT047CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtRmxhZ3MgJj0gfklTX0FDVElPTjsKKyAgICAgICAgfQorICAgIH0KKworICA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0dG9uOworaW1wb3J0IGFuZHJvaWQud2lkZ2V0LkxpbmVhckxheW91dDsKK2ltcG9ydCBhbmRyb2lkLndpZGdldC5UZXh0VmlldzsKKworLyoqCisgKiBAaGlkZQorICovCitwdWJsaWMgY2xhc3MgQWN0aW9uQmFyQ29udGV4dFZpZXcgZXh0ZW5kcyBWaWV3R3JvdXAgeworICAgIC8vIFRPRE86IFRoaXMgbXVzdCBiZSBkZWZpbmVkIGluIHRoZSBkZWZhdWx0IHRoZW1lCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IENPTlRFTlRfSEVJR0hUX0RJUCA9IDUwOworICAgIAorICAgIHByaXZhdGUgaW50IG1JdGVtUGFkZGluZzsKKyAgICBwcml2YXRlIGludCBtSXRlbU1hcmdpbjsKKyAgICBwcml2YXRlIGludCBtQ29udGVudEhlaWdodDsKKyAgICAKKyAgICBwcml2YXRlIENoYXJTZXF1ZW5jZSBtVGl0bGU7CisgICAgcHJpdmF0ZSBDaGFyU2VxdWVuY2UgbVN1YnRpdGxlOworICAgIAorICAgIHByaXZhdGUgSW1hZ2VCdXR0b24gbUNsb3NlQnV0dG9uOworICAgIHByaXZhdGUgVmlldyBtQ3VzdG9tVmlldzsKKyAgICBwcml2YXRlIExpbmVhckxheW91dCBtVGl0bGVMYXlvdXQ7CisgICAgcHJpdmF0ZSBUZXh0VmlldyBtVGl0bGVWaWV3OworICAgIHByaXZhdGUgVGV4dFZpZXcgbVN1YnRpdGxlVmlldzsKKyAgICBwcml2YXRlIERyYXdhYmxlIG1DbG9zZURyYXdhYmxlOworICAgIAorICAgIHB1YmxpYyBBY3Rpb25CYXJDb250ZXh0VmlldyhDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgdGhpcyhjb250ZXh0LCBudWxsLCAwKTsKKyAgICB9CisgICAgCisgICAgcHVibGljIEFjdGlvbkJhckNvbnRleHRWaWV3KENvbnRleHQgY29udGV4dCwgQXR0cmlidXRlU2V0IGF0dHJzKSB7CisgICAgICAgIHRoaXMoY29udGV4dCwgYXR0cnMsIDApOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgQWN0aW9uQmFyQ29udGV4dFZpZXcoQ29udGV4dCBjb250ZXh0LCBBdHRyaWJ1dGVTZXQgYXR0cnMsIGludCBkZWZTdHlsZSkgeworICAgICAgICBzdXBlcihjb250ZXh0LCBhdHRycywgZGVmU3R5bGUpOworICAgICAgICAKKyAgICAgICAgVHlwZWRBcnJheSBhID0gY29udGV4dC5vYnRhaW5TdHlsZWRBdHRyaWJ1dGVzKGF0dHJzLAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLlRoZW1lKTsKKyAgICAgICAgbUl0ZW1QYWRkaW5nID0gYS5nZXREaW1lbnNpb25QaXhlbE9mZnNldCgKKyAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5UaGVtZV9hY3Rpb25CdXR0b25QYWRkaW5nLCAwKTsKKyAgICAgICAgc2V0QmFja2dyb3VuZERyYXdhYmxlKGEuZ2V0RHJhd2FibGUoCisgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuVGhlbWVfYWN0aW9uQmFyQ29udGV4dEJhY2tncm91bmQpKTsKKyAgICAgICAgbUNsb3NlRHJhd2FibGUgPSBhLmdldERyYXdhYmxlKAorICAgICAgICAgICAgICAgIGNvbS5hbmRyb2lkLmludGVybmFsLlIuc3R5bGVhYmxlLlRoZW1lX2FjdGlvbkJhckNsb3NlQ29udGV4dERyYXdhYmxlKTsKKyAgICAgICAgbUl0ZW1NYXJnaW4gPSBtSXRlbVBhZGRpbmcgLyAyOworICAgICAgICAKKyAgICAgICAgbUNvbnRlbnRIZWlnaHQgPSBDT05URU5UX0hFSUdIVF9ESVA7CisgICAgICAgIGEucmVjeWNsZSgpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBzZXRDdXN0b21WaWV3KFZpZXcgdmlldykgeworICAgICAgICBpZiAobUN1c3RvbVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgcmVtb3ZlVmlldyhtQ3VzdG9tVmlldyk7CisgICAgICAgIH0KKyAgICAgICAgbUN1c3RvbVZpZXcgPSB2aWV3OworICAgICAgICBpZiAobVRpdGxlTGF5b3V0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHJlbW92ZVZpZXcobVRpdGxlTGF5b3V0KTsKKyAgICAgICAgICAgIG1UaXRsZUxheW91dCA9IG51bGw7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgYWRkVmlldyh2aWV3KTsKKyAgICAgICAgfQorICAgICAgICByZXF1ZXN0TGF5b3V0KCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0VGl0bGUoQ2hhclNlcXVlbmNlIHRpdGxlKSB7CisgICAgICAgIG1UaXRsZSA9IHRpdGxlOworICAgICAgICBpbml0VGl0bGUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRTdWJ0aXRsZShDaGFyU2VxdWVuY2Ugc3VidGl0bGUpIHsKKyAgICAgICAgbVN1YnRpdGxlID0gc3VidGl0bGU7CisgICAgICAgIGluaXRUaXRsZSgpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0VGl0bGUoKSB7CisgICAgICAgIGlmIChtVGl0bGVMYXlvdXQgPT0gbnVsbCkgeworICAgICAgICAgICAgTGF5b3V0SW5mbGF0ZXIgaW5mbGF0ZXIgPSBMYXlvdXRJbmZsYXRlci5mcm9tKGdldENvbnRleHQoKSk7CisgICAgICAgICAgICBtVGl0bGVMYXlvdXQgPSAoTGluZWFyTGF5b3V0KSBpbmZsYXRlci5pbmZsYXRlKFIubGF5b3V0LmFjdGlvbl9iYXJfdGl0bGVfaXRlbSwgbnVsbCk7CisgICAgICAgICAgICBtVGl0bGVWaWV3ID0gKFRleHRWaWV3KSBtVGl0bGVMYXlvdXQuZmluZFZpZXdCeUlkKFIuaWQuYWN0aW9uX2Jhcl90aXRsZSk7CisgICAgICAgICAgICBtU3VidGl0bGVWaWV3ID0gKFRleHRWaWV3KSBtVGl0bGVMYXlvdXQuZmluZFZpZXdCeUlkKFIuaWQuYWN0aW9uX2Jhcl9zdWJ0aXRsZSk7CisgICAgICAgICAgICBpZiAobVRpdGxlICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtVGl0bGVWaWV3LnNldFRleHQobVRpdGxlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtU3VidGl0bGUgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1TdWJ0aXRsZVZpZXcuc2V0VGV4dChtU3VidGl0bGUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYWRkVmlldyhtVGl0bGVMYXlvdXQpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbVRpdGxlVmlldy5zZXRUZXh0KG1UaXRsZSk7CisgICAgICAgICAgICBtU3VidGl0bGVWaWV3LnNldFRleHQobVN1YnRpdGxlKTsKKyAgICAgICAgICAgIGlmIChtVGl0bGVMYXlvdXQuZ2V0UGFyZW50KCkgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGFkZFZpZXcobVRpdGxlTGF5b3V0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGluaXRGb3JNb2RlKGZpbmFsIEFjdGlvbkJhci5Db250ZXh0TW9kZSBtb2RlKSB7CisgICAgICAgIGZpbmFsIEFjdGlvbkJhckltcGwuQ29udGV4dE1vZGUgaW1wbE1vZGUgPSAoQWN0aW9uQmFySW1wbC5Db250ZXh0TW9kZSkgbW9kZTsKKyAgICAgICAgCisgICAgICAgIGlmIChtQ2xvc2VCdXR0b24gPT0gbnVsbCkgeworICAgICAgICAgICAgbUNsb3NlQnV0dG9uID0gbmV3IEltYWdlQnV0dG9uKGdldENvbnRleHQoKSk7CisgICAgICAgICAgICBtQ2xvc2VCdXR0b24uc2V0SW1hZ2VEcmF3YWJsZShtQ2xvc2VEcmF3YWJsZSk7CisgICAgICAgICAgICBtQ2xvc2VCdXR0b24uc2V0QmFja2dyb3VuZERyYXdhYmxlKG51bGwpOworICAgICAgICAgICAgbUNsb3NlQnV0dG9uLnNldE9uQ2xpY2tMaXN0ZW5lcihuZXcgT25DbGlja0xpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soVmlldyB2KSB7CisgICAgICAgICAgICAgICAgICAgIG1vZGUuZmluaXNoKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICAgICAgYWRkVmlldyhtQ2xvc2VCdXR0b24pOworCisgICAgICAgIGZpbmFsIENvbnRleHQgY29udGV4dCA9IGdldENvbnRleHQoKTsKKyAgICAgICAgZmluYWwgTWVudSBtZW51ID0gbW9kZS5nZXRNZW51KCk7CisgICAgICAgIGZpbmFsIGludCBpdGVtQ291bnQgPSBtZW51LnNpemUoKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBpdGVtQ291bnQ7IGkrKykgeworICAgICAgICAgICAgZmluYWwgTWVudUl0ZW0gaXRlbSA9IG1lbnUuZ2V0SXRlbShpKTsKKyAgICAgICAgICAgIGZpbmFsIEltYWdlQnV0dG9uIGJ1dHRvbiA9IG5ldyBJbWFnZUJ1dHRvbihjb250ZXh0LCBudWxsLAorICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmF0dHIuYWN0aW9uQnV0dG9uU3R5bGUpOworICAgICAgICAgICAgYnV0dG9uLnNldENsaWNrYWJsZSh0cnVlKTsKKyAgICAgICAgICAgIGJ1dHRvbi5zZXRGb2N1c2FibGUodHJ1ZSk7CisgICAgICAgICAgICBidXR0b24uc2V0SW1hZ2VEcmF3YWJsZShpdGVtLmdldEljb24oKSk7CisgICAgICAgICAgICBidXR0b24uc2V0SWQoaXRlbS5nZXRJdGVtSWQoKSk7CisgICAgICAgICAgICBidXR0b24uc2V0VmlzaWJpbGl0eShpdGVtLmlzVmlzaWJsZSgpID8gVklTSUJMRSA6IEdPTkUpOworICAgICAgICAgICAgYnV0dG9uLnNldEVuYWJsZWQoaXRlbS5pc0VuYWJsZWQoKSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGJ1dHRvbi5zZXRPbkNsaWNrTGlzdGVuZXIobmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgICAgICAgICBpbXBsTW9kZS5kaXNwYXRjaE9uQ29udGV4dEl0ZW1DbGlja2VkKGl0ZW0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBhZGRWaWV3KGJ1dHRvbik7CisgICAgICAgIH0KKyAgICAgICAgcmVxdWVzdExheW91dCgpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGNsb3NlTW9kZSgpIHsKKyAgICAgICAgcmVtb3ZlQWxsVmlld3MoKTsKKyAgICAgICAgbUN1c3RvbVZpZXcgPSBudWxsOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCBMYXlvdXRQYXJhbXMgZ2VuZXJhdGVEZWZhdWx0TGF5b3V0UGFyYW1zKCkgeworICAgICAgICAvLyBVc2VkIGJ5IGN1c3RvbSB2aWV3cyBpZiB0aGV5IGRvbid0IHN1cHBseSBsYXlvdXQgcGFyYW1zLiBFdmVyeXRoaW5nIGVsc2UKKyAgICAgICAgLy8gYWRkZWQgdG8gYW4gQWN0aW9uQmFyQ29udGV4dFZpZXcgc2hvdWxkIGhhdmUgdGhlbSBhbHJlYWR5LgorICAgICAgICByZXR1cm4gbmV3IExheW91dFBhcmFtcyhMYXlvdXRQYXJh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xkQXQoaSk7CisgICAgICAgICAgICBpZiAoY2hpbGQgPT0gbUNsb3NlQnV0dG9uIHx8IGNoaWxkID09IG1UaXRsZUxheW91dCB8fCBjaGlsZCA9PSBtQ3VzdG9tVmlldykgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICBhdmFpbGFibGVXaWR0aCA9IG1lYXN1cmVDaGlsZFZpZXcoY2hpbGQsIGF2YWlsYWJsZVdpZHRoLCBjaGlsZFNwZWNIZWlnaHQsIGl0ZW1NYXJnaW4pOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG1DdXN0b21WaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIExheW91dFBhcmFtcyBscCA9IG1DdXN0b21WaWV3LmdldExheW91dFBhcmFtcygpOworICAgICAgICAgICAgZmluYWwgaW50IGN1c3RvbVdpZHRoTW9kZSA9IGxwLndpZHRoICE9IExheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQgPworICAgICAgICAgICAgICAgICAgICBNZWFzdXJlU3BlYy5FWEFDVExZIDogTWVhc3VyZVNwZWMuQVRfTU9TVDsKKyAgICAgICAgICAgIGZpbmFsIGludCBjdXN0b21XaWR0aCA9IGxwLndpZHRoID49IDAgPworICAgICAgICAgICAgICAgICAgICBNYXRoLm1pbihscC53aWR0aCwgYXZhaWxhYmxlV2lkdGgpIDogYXZhaWxhYmxlV2lkdGg7CisgICAgICAgICAgICBmaW5hbCBpbnQgY3VzdG9tSGVpZ2h0TW9kZSA9IGxwLmhlaWdodCAhPSBMYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UID8KKyAgICAgICAgICAgICAgICAgICAgTWVhc3VyZVNwZWMuRVhBQ1RMWSA6IE1lYXN1cmVTcGVjLkFUX01PU1Q7CisgICAgICAgICAgICBmaW5hbCBpbnQgY3VzdG9tSGVpZ2h0ID0gbHAuaGVpZ2h0ID49IDAgPworICAgICAgICAgICAgICAgICAgICBNYX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3NpdGlvbkNoaWxkKG1UaXRsZUxheW91dCwgeCwgeSwgY29udGVudEhlaWdodCkgKyBpdGVtTWFyZ2luOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBpZiAobUN1c3RvbVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgeCArPSBwb3NpdGlvbkNoaWxkKG1DdXN0b21WaWV3LCB4LCB5LCBjb250ZW50SGVpZ2h0KSArIGl0ZW1NYXJnaW47CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHggPSByIC0gbCAtIGdldFBhZGRpbmdSaWdodCgpOworICAgICAgICAKKyAgICAgICAgZmluYWwgaW50IGNoaWxkQ291bnQgPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY2hpbGRDb3VudDsgaSsrKSB7CisgICAgICAgICAgICBmaW5hbCBWaWV3IGNoaWxkID0gZ2V0Q2hpbGRBdChpKTsKKyAgICAgICAgICAgIGlmIChjaGlsZCA9PSBtQ2xvc2VCdXR0b24gfHwgY2hpbGQgPT0gbVRpdGxlTGF5b3V0IHx8IGNoaWxkID09IG1DdXN0b21WaWV3KSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHggLT0gcG9zaXRpb25DaGlsZEludmVyc2UoY2hpbGQsIHgsIHksIGNvbnRlbnRIZWlnaHQpICsgaXRlbU1hcmdpbjsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgaW50IG1lYXN1cmVDaGlsZFZpZXcoVmlldyBjaGlsZCwgaW50IGF2YWlsYWJsZVdpZHRoLCBpbnQgY2hpbGRTcGVjSGVpZ2h0LCBpbnQgc3BhY2luZykgeworICAgICAgICBjaGlsZC5tZWFzdXJlKE1lYXN1cmVTcGVjLm1ha2VNZWFzdXJlU3BlYyhhdmFpbGFibGVXaWR0aCwgTWVhc3VyZVNwZWMuQVRfTU9TVCksCisgICAgICAgICAgICAgICAgY2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gICAgICAgIG1UaXRsZSA9IGEuZ2V0VGV4dChSLnN0eWxlYWJsZS5BY3Rpb25CYXJfdGl0bGUpOworICAgICAgICBtU3VidGl0bGUgPSBhLmdldFRleHQoUi5zdHlsZWFibGUuQWN0aW9uQmFyX3N1YnRpdGxlKTsKKyAgICAgICAgbURpc3BsYXlPcHRpb25zID0gYS5nZXRJbnQoUi5zdHlsZWFibGUuQWN0aW9uQmFyX2Rpc3BsYXlPcHRpb25zLCBESVNQTEFZX0RFRkFVTFQpOworICAgICAgICAKKyAgICAgICAgbUxvZ28gPSBhLmdldERyYXdhYmxlKFIuc3R5bGVhYmxlLkFjdGlvbkJhcl9sb2dvKTsKKyAgICAgICAgaWYgKG1Mb2dvID09IG51bGwpIHsKKyAgICAgICAgICAgIG1Mb2dvID0gaW5mby5sb2FkTG9nbyhwbSk7CisgICAgICAgIH0KKyAgICAgICAgbUljb24gPSBhLmdldERyYXdhYmxlKFIuc3R5bGVhYmxlLkFjdGlvbkJhcl9pY29uKTsKKyAgICAgICAgaWYgKG1JY29uID09IG51bGwpIHsKKyAgICAgICAgICAgIG1JY29uID0gaW5mby5sb2FkSWNvbihwbSk7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIERyYXdhYmxlIGJhY2tncm91bmQgPSBhLmdldERyYXdhYmxlKFIuc3R5bGVhYmxlLkFjdGlvbkJhcl9iYWNrZ3JvdW5kKTsKKyAgICAgICAgaWYgKGJhY2tncm91bmQgIT0gbnVsbCkgeworICAgICAgICAgICAgc2V0QmFja2dyb3VuZERyYXdhYmxlKGJhY2tncm91bmQpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICBmaW5hbCBpbnQgY3VzdG9tTmF2SWQgPSBhLmdldFJlc291cmNlSWQoUi5zdHlsZWFibGUuQWN0aW9uQmFyX2N1c3RvbU5hdmlnYXRpb25MYXlvdXQsIDApOworICAgICAgICBpZiAoY3VzdG9tTmF2SWQgIT0gMCkgeworICAgICAgICAgICAgTGF5b3V0SW5mbGF0ZXIgaW5mbGF0ZXIgPSBMYXlvdXRJbmZsYXRlci5mcm9tKGNvbnRleHQpOworICAgICAgICAgICAgbUN1c3RvbU5hdlZpZXcgPSAoVmlldykgaW5mbGF0ZXIuaW5mbGF0ZShjdXN0b21OYXZJZCwgbnVsbCk7CisgICAgICAgICAgICBtTmF2aWdhdGlvbk1vZGUgPSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX0NVU1RPTTsKKyAgICAgICAgfQorCisgICAgICAgIGEucmVjeWNsZSgpOworCisgICAgICAgIC8vIFRPRE86IFNldCB0aGlzIGluIHRoZSB0aGVtZQorICAgICAgICBpbnQgcGFkZGluZyA9IChpbnQpIChDT05URU5UX1BBRERJTkdfRElQICogbWV0cmljcy5kZW5zaXR5ICsgMC41Zik7CisgICAgICAgIHNldFBhZGRpbmcocGFkZGluZywgcGFkZGluZywgcGFkZGluZywgcGFkZGluZyk7CisKKyAgICAgICAgbVNwYWNpbmcgPSAoaW50KSAoQ09OVEVOVF9TUEFDSU5HX0RJUCAqIG1ldHJpY3MuZGVuc2l0eSArIDAuNWYpOworICAgICAgICBtQWN0aW9uU3BhY2luZyA9IChpbnQpIChDT05URU5UX0FDVElPTl9TUEFDSU5HX0RJUCAqIG1ldHJpY3MuZGVuc2l0eSArIDAuNWYpOworICAgICAgICAKKyAgICAgICAgaWYgKG1Mb2dvICE9IG51bGwgfHwgbUljb24gIT0gbnVsbCB8fCBtVGl0bGUgIT0gbnVsbCkgeworICAgICAgICAgICAgbUxvZ29OYXZJdGVtID0gbmV3IEFjdGlvbk1lbnVJdGVtKGNvbnRleHQsIDAsIGFuZHJvaWQuUi5pZC5ob21lLCAwLCAwLCBtVGl0bGUpOworICAgICAgICAgICAgbUhvbWVDbGlja0xpc3RlbmVyID0gbmV3IE9uQ2xpY2tMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdikgeworICAgICAgICAgICAgICAgICAgICBDb250ZXh0IGNvbnRleHQgPSBnZXRDb250ZXh0KCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChjb250ZXh0IGluc3RhbmNlb2YgQWN0aXZpdHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIEFjdGl2aXR5IGFjdGl2aXR5ID0gKEFjdGl2aXR5KSBjb250ZXh0OworICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZpdHkub25PcHRpb25zSXRlbVNlbGVjdGVkKG1Mb2dvTmF2SXRlbSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0Q2FsbGJhY2soTmF2aWdhdGlvbkNhbGxiYWNrIGNhbGxiYWNrKSB7CisgICAgICAgIG1DYWxsYmFjayA9IGNhbGxiYWNrOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldE1lbnUoTWVudSBtZW51KSB7CisgICAgICAgIE1lbnVCdWlsZGVyIGJ1aWxkZXIgPSAoTWVudUJ1aWxkZXIpIG1lbnU7CisgICAgICAgIG1PcHRpb25zTWVudSA9IGJ1aWxkZXI7CisgICAgICAgIGlmIChtTWVudVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgcmVtb3ZlVmlldyhtTWVudVZpZXcpOworICAgICAgICB9CisgICAgICAgIGZpbmFsIEFjdGlvbk1lbnVWaWV3IG1lbnVWaWV3ID0gKEFjdGlvbk1lbnVWaWV3KSBidWlsZGVyLmdldE1lbnVWaWV3KAorICAgICAgICAgICAgICAgIE1lbnVCdWlsZGVyLlRZUEVfQUNUSU9OX0JVVFRPTiwgbnVsbCk7CisgICAgICAgIG1BY3Rpb25TcGFjaW5nID0gbWVudVZpZXcuZ2V0SXRlbU1hcmdpbigpOworICAgICAgICBmaW5hbCBMYXlvdXRQYXJhbXMgbGF5b3V0UGFyYW1zID0gbmV3IExheW91dFBhcmFtcyhMYXlvdXRQYXJhbXMuV1JBUF9DT05URU5ULAorICAgICAgICAgICAgICAgIExheW91dFBhcmFtcy5NQVRDSF9QQVJFTlQpOworICAgICAgICBtZW51Vmlldy5zZXRMYXlvdXRQYXJhbXMobGF5b3V0UGFyYW1zKTsKKyAgICAgICAgYWRkVmlldyhtZW51Vmlldyk7CisgICAgICAgIG1NZW51VmlldyA9IG1lbnVWaWV3OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldEN1c3RvbU5hdmlnYXRpb25WaWV3KFZpZXcgdmlldykgeworICAgICAgICBtQ3VzdG9tTmF2VmlldyA9IHZpZXc7CisgICAgICAgIGlmICh2aWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHNldE5hdmlnYXRpb25Nb2RlKEFjdGlvbkJhci5OQVZJR0FUSU9OX01PREVfQ1VTVE9NKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0VGl0bGUoKSB7CisgICAgICAgIHJldHVybiBtVGl0bGU7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0VGl0bGUoQ2hhclNlcXVlbmNlIHRpdGxlKSB7CisgICAgICAgIG1UaXRsZSA9IHRpdGxlOworICAgICAgICBpZiAobVRpdGxlVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICBtVGl0bGVWaWV3LnNldFRleHQodGl0bGUpOworICAgICAgICB9CisgICAgICAgIGlmIChtTG9nb05hdkl0ZW0gIT0gbnVsbCkgeworICAgICAgICAgICAgbUxvZ29OYXZJdGVtLnNldFRpdGxlKHRpdGxlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBDaGFyU2VxdWVuY2UgZ2V0U3VidGl0bGUoKSB7CisgICAgICAgIHJldHVybiBtU3VidGl0bGU7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0U3VidGl0bGUoQ2hhclNlcXVlbmNlIHN1YnRpdGxlKSB7CisgICAgICAgIG1TdWJ0aXRsZSA9IHN1YnRpdGxlOworICAgICAgICBpZiAobVN1YnRpdGxlVmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICBtU3VidGl0bGVWaWV3LnNldFRleHQoc3VidGl0bGUpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0RGlzcGxheU9wdGlvbnMoaW50IG9wdGlvbnMpIHsKKyAgICAgICAgZmluYWwgaW50IGZsYWdzQ2hhbmdlZCA9IG9wdGlvbnMgXiBtRGlzcGxheU9wdGlvbnM7CisgICAgICAgIG1EaXNwbGF5T3B0aW9ucyA9IG9wdGlvbnM7CisgICAgICAgIGlmICgoZmxhZ3NDaGFuZ2VkICYgRElTUExBWV9SRUxBWU9VVF9NQVNLKSAhPSAwKSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgdmlzID0gKG9wdGlvbnMgJiBBY3Rpb25CYXIuRElTUExBWV9ISURFX0hPTUUpICE9IDAgPyBHT05FIDogVklTSUJMRTsKKyAgICAgICAgICAgIGlmIChtTG9nb1ZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1Mb2dvVmlldy5zZXRWaXNpYmlsaXR5KHZpcyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUljb25WaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtSWNvblZpZXcuc2V0VmlzaWJpbGl0eSh2aXMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICByZXF1ZXN0TGF5b3V0KCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbnZhbGlkYXRlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXROYXZpZ2F0aW9uTW9kZShpbnQgbW9kZSkgeworICAgICAgICBmaW5hbCBpbnQgb2xkTW9kZSA9IG1OYXZpZ2F0aW9uTW9kZTsKKyAgICAgICAgaWYgKG1vZGUgIT0gb2xkTW9kZSkgeworICAgICAgICAgICAgc3dpdGNoIChvbGRNb2RlKSB7CisgICAgICAgICAgICBjYXNlIEFjdGlvbkJhci5OQVZJR0FUSU9OX01PREVfU1RBTkRBUkQ6CisgICAgICAgICAgICAgICAgaWYgKG1UaXRsZUxheW91dCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJlbW92ZVZpZXcobVRpdGxlTGF5b3V0KTsKKyAgICAgICAgICAgICAgICAgICAgbVRpdGxlTGF5b3V0ID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgbVRpdGxlVmlldyA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIG1TdWJ0aXRsZVZpZXcgPSBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9EUk9QRE9XTl9MSVNUOgorICAgICAgICAgICAgICAgIGlmIChtU3Bpbm5lciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJlbW92ZVZpZXcobVNwaW5uZXIpOworICAgICAgICAgICAgICAgICAgICBtU3Bpbm5lciA9IG51bGw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX0NVU1RPTToKKyAgICAgICAgICAgICAgICBpZiAobUN1c3RvbU5hdlZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICByZW1vdmVWaWV3KG1DdXN0b21OYXZWaWV3KTsKKyAgICAgICAgICAgICAgICAgICAgbUN1c3RvbU5hdlZpZXcgPSBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgc3dpdGNoIChtb2RlKSB7CisgICAgICAgICAgICBjYXNlIEFjdGlvbkJhci5OQVZJR0FUSU9OX01PREVfU1RBTkRBUkQ6CisgICAgICAgICAgICAgICAgaW5pdFRpdGxlKCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEFjdGlvbkJhci5OQVZJR0FUSU9OX01PREVfRFJPUERPV05fTElTVDoKKyAgICAgICAgICAgICAgICBtU3Bpbm5lciA9IG5ldyBTcGlubmVyKG1Db250ZXh0LCBudWxsLAorICAgICAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5hdHRyLmRyb3BEb3duU3Bpbm5lclN0eWxlKTsKKyAgICAgICAgICAgICAgICBtU3Bpbm5lci5zZXRPbkl0ZW1TZWxlY3RlZExpc3RlbmVyKG1OYXZJdGVtU2VsZWN0ZWRMaXN0ZW5lcik7CisgICAgICAgICAgICAgICAgYWRkVmlldyhtU3Bpbm5lcik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEFjdGlvbkJhci5OQVZJR0FUSU9OX01PREVfQ1VTVE9NOgorICAgICAgICAgICAgICAgIGFkZFZpZXcobUN1c3RvbU5hdlZpZXcpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbU5hdmlnYXRpb25Nb2RlID0gbW9kZTsKKyAgICAgICAgICAgIHJlcXVlc3RMYXlvdXQoKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICBwdWJsaWMgdm9pZCBzZXREcm9wZG93bkFkYXB0ZXIoU3Bpbm5lckFkYXB0ZXIgYWRhcHRlcikgeworICAgICAgICBtU3Bpbm5lci5zZXRBZGFwdGVyKGFkYXB0ZXIpOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgVmlldyBnZXRDdXN0b21OYXZpZ2F0aW9uVmlldygpIHsKKyAgICAgICAgcmV0dXJuIG1DdXN0b21OYXZWaWV3OworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgaW50IGdldE5hdmlnYXRpb25Nb2RlKCkgeworICAgICAgICByZXR1cm4gbU5hdmlnYXRpb25Nb2RlOworICAgIH0KKyAgICAKKyAgICBwdWJsaWMgaW50IGdldERpc3BsYXlPcHRpb25zKCkgeworICAgICAgICByZXR1cm4gbURpc3BsYXlPcHRpb25zOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCBMYXlvdXRQYXJhbXMgZ2VuZXJhdGVEZWZhdWx0TGF5b3V0UGFyYW1zKCkgeworICAgICAgICAvLyBVc2VkIGJ5IGN1c3RvbSBuYXYgdmlld3MgaWYgdGhleSBkb24ndCBzdXBwbHkgbGF5b3V0IHBhcmFtcy4gRXZlcnl0aGluZyBlbHNlCisgICAgICAgIC8vIGFkZGVkIHRvIGFuIEFjdGlvbkJhclZpZXcgc2hvdWxkIGhhdmUgdGhlbSBhbHJlYWR5LgorICAgICAgICByZXR1cm4gbmV3IExheW91dFBhcmFtcyhMYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5ULCBMYXlvdXRQYXJhbXMuV1JBUF9DT05URU5UKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvbkZpbmlzaEluZmxhdGUoKSB7CisgICAgICAgIHN1cGVyLm9uRmluaXNoSW5mbGF0ZSgpOworCisgICAgICAgIGlmICgobURpc3BsYXlPcHRpb25zICYgQWN0aW9uQmFyLkRJU1BMQVlfSElERV9IT01FKSA9PSAwKSB7CisgICAgICAgICAgICBpZiAobUxvZ28gIT0gbnVsbCAmJiAobURpc3BsYXlPcHRpb25zICYgQWN0aW9uQmFyLkRJU1BMQVlfVVNFX0xPR08pICE9IDApIHsKKyAgICAgICAgICAgICAgICBtTG9nb1ZpZXcgPSBuZXcgSW1hZ2VWaWV3KGdldENvbnRleHQoKSk7CisgICAgICAgICAgICAgICAgbUxvZ29WaWV3LnNldEFkanVzdFZpZXdCb3VuZHModHJ1ZSk7CisgICAgICAgICAgICAgICAgbUxvZ29WaWV3LnNldExheW91dFBhcmFtcyhuZXcgTGF5b3V0UGFyYW1zKExheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQsCisgICAgICAgICAgICAgICAgICAgICAgICBMYXlvdXRQYXJhbXMuTUFUQ0hfUEFSRU5UKSk7CisgICAgICAgICAgICAgICAgbUxvZ29WaWV3LnNldEltYWdlRHJhd2FibGUobUxvZ28pOworICAgICAgICAgICAgICAgIG1Mb2dvVmlldy5zZXRDbGlja2FibGUodHJ1ZSk7CisgICAgICAgICAgICAgICAgbUxvZ29WaWV3LnNldEZvY3VzYWJsZSh0cnVlKTsKKyAgICAgICAgICAgICAgICBtTG9nb1ZpZXcuc2V0T25DbGlja0xpc3RlbmVyKG1Ib21lQ2xpY2tMaXN0ZW5lcik7CisgICAgICAgICAgICAgICAgYWRkVmlldyhtTG9nb1ZpZXcpOworICAgICAgICAgICAgfSBlbHNlIGlmIChtSWNvbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUljb25WaWV3ID0gbmV3IEltYWdlVmlldyhnZXRDb250ZXh0KCkpOworICAgICAgICAgICAgICAgIG1JY29uVmlldy5zZXRBZGp1c3RWaWV3Qm91bmRzKHRydWUpOworICAgICAgICAgICAgICAgIG1JY29uVmlldy5zZXRMYXlvdXRQYXJhbXMobmV3IExheW91dFBhcmFtcyhMYXlvdXRQYXJhbXMuV1JBUF9DT05URU5ULAorICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0UGFyYW1zLk1BVENIX1BBUkVOVCkpOworICAgICAgICAgICAgICAgIG1JY29uVmlldy5zZXRJbWFnZURyYXdhYmxlKG1JY29uKTsKKyAgICAgICAgICAgICAgICBtSWNvblZpZXcuc2V0Q2xpY2thYmxlKHRydWUpOworICAgICAgICAgICAgICAgIG1JY29uVmlldy5zZXRGb2N1c2FibGUodHJ1ZSk7CisgICAgICAgICAgICAgICAgbUljb25WaWV3LnNldE9uQ2xpY2tMaXN0ZW5lcihtSG9tZUNsaWNrTGlzdGVuZXIpOworICAgICAgICAgICAgICAgIGFkZFZpZXcobUljb25WaWV3KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHN3aXRjaCAobU5hdmlnYXRpb25Nb2RlKSB7CisgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9TVEFOREFSRDoKKyAgICAgICAgICAgIGlmIChtTG9nb1ZpZXcgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGluaXRUaXRsZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAKKyAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX0RST1BET1dOX0xJU1Q6CisgICAgICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICJJbmZsYXRpbmcgZHJvcGRvd24gbGlzdCBuYXZpZ2F0aW9uIGlzbid0IHN1cHBvcnRlZCB5ZXQhIik7CisgICAgICAgICAgICAKKyAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX1RBQlM6CisgICAgICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICJUYWIgbmF2aWdhdGlvbiBpc24ndCBzdXBwb3J0ZWQgeWV0ISIpOworICAgICAgICAgICAgCisgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9DVVNUT006CisgICAgICAgICAgICBpZiAobUN1c3RvbU5hdlZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGFkZFZpZXcobUN1c3RvbU5hdlZpZXcpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgcHJpdmF0ZSB2b2lkIGluaXRUaXRsZSgpIHsKKyAgICAgICAgTGF5b3V0SW5mbG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mIChtU3Bpbm5lciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVNwaW5uZXIubWVhc3VyZSgKKyAgICAgICAgICAgICAgICAgICAgICAgIE1lYXN1cmVTcGVjLm1ha2VNZWFzdXJlU3BlYyhhdmFpbGFibGVXaWR0aCwgTWVhc3VyZVNwZWMuQVRfTU9TVCksCisgICAgICAgICAgICAgICAgICAgICAgICBNZWFzdXJlU3BlYy5tYWtlTWVhc3VyZVNwZWMoaGVpZ2h0LCBNZWFzdXJlU3BlYy5FWEFDVExZKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX0NVU1RPTToKKyAgICAgICAgICAgIGlmIChtQ3VzdG9tTmF2VmlldyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgTGF5b3V0UGFyYW1zIGxwID0gbUN1c3RvbU5hdlZpZXcuZ2V0TGF5b3V0UGFyYW1zKCk7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IGN1c3RvbU5hdldpZHRoTW9kZSA9IGxwLndpZHRoICE9IExheW91dFBhcmFtcy5XUkFQX0NPTlRFTlQgPworICAgICAgICAgICAgICAgICAgICAgICAgTWVhc3VyZVNwZWMuRVhBQ1RMWSA6IE1lYXN1cmVTcGVjLkFUX01PU1Q7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IGN1c3RvbU5hdldpZHRoID0gbHAud2lkdGggPj0gMCA/CisgICAgICAgICAgICAgICAgICAgICAgICBNYXRoLm1pbihscC53aWR0aCwgYXZhaWxhYmxlV2lkdGgpIDogYXZhaWxhYmxlV2lkdGg7CisgICAgICAgICAgICAgICAgZmluYWwgaW50IGN1c3RvbU5hdkhlaWdodE1vZGUgPSBscC5oZWlnaHQgIT0gTGF5b3V0UGFyYW1zLldSQVBfQ09OVEVOVCA/CisgICAgICAgICAgICAgICAgICAgICAgICBNZWFzdXJlU3BlYy5FWEFDVExZIDogTWV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KworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uTGF5b3V0KGJvb2xlYW4gY2hhbmdlZCwgaW50IGwsIGludCB0LCBpbnQgciwgaW50IGIpIHsKKyAgICAgICAgaW50IHggPSBnZXRQYWRkaW5nTGVmdCgpOworICAgICAgICBmaW5hbCBpbnQgeSA9IGdldFBhZGRpbmdUb3AoKTsKKyAgICAgICAgZmluYWwgaW50IGNvbnRlbnRIZWlnaHQgPSBiIC0gdCAtIGdldFBhZGRpbmdUb3AoKSAtIGdldFBhZGRpbmdCb3R0b20oKTsKKworICAgICAgICBpZiAobUxvZ29WaWV3ICE9IG51bGwgJiYgbUxvZ29WaWV3LmdldFZpc2liaWxpdHkoKSAhPSBHT05FKSB7CisgICAgICAgICAgICB4ICs9IHBvc2l0aW9uQ2hpbGQobUxvZ29WaWV3LCB4LCB5LCBjb250ZW50SGVpZ2h0KSArIG1TcGFjaW5nOworICAgICAgICB9CisgICAgICAgIGlmIChtSWNvblZpZXcgIT0gbnVsbCAmJiBtSWNvblZpZXcuZ2V0VmlzaWJpbGl0eSgpICE9IEdPTkUpIHsKKyAgICAgICAgICAgIHggKz0gcG9zaXRpb25DaGlsZChtSWNvblZpZXcsIHgsIHksIGNvbnRlbnRIZWlnaHQpICsgbVNwYWNpbmc7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHN3aXRjaCAobU5hdmlnYXRpb25Nb2RlKSB7CisgICAgICAgIGNhc2UgQWN0aW9uQmFyLk5BVklHQVRJT05fTU9ERV9TVEFOREFSRDoKKyAgICAgICAgICAgIGlmIChtVGl0bGVMYXlvdXQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHggKz0gcG9zaXRpb25DaGlsZChtVGl0bGVMYXlvdXQsIHgsIHksIGNvbnRlbnRIZWlnaHQpICsgbVNwYWNpbmc7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBBY3Rpb25CYXIuTkFWSUdBVElPTl9NT0RFX0RST1BET1dOX0xJU1Q6CisgICAgICAgICAgICBpZiAobVNwaW5uZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHggKz0gcG9zaXRpb25DaGlsZChtU3Bpbm5lciwgeCwgeSwgY29udGVudEhlaWdodCkgKyBtU3BhY2luZzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIEFjdGlvbkJhci5OQVZJR0FUSU9OX01PREVfQ1VTVE9NOgorICAgICAgICAgICAgaWYgKG1DdXN0b21OYXZWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICB4ICs9IHBvc2l0aW9uQ2hpbGQobUN1c3RvbU5hdlZpZXcsIHgsIHksIGNvbnRlbnRIZWlnaHQpICsgbVNwYWNpbmc7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIHggPSByIC0gbCAtIGdldFBhZGRpbmdSaWdodCgpOworCisgICAgICAgIGlmIChtTWVudVZpZXcgIT0gbnVsbCkgeworICAgICAgICAgICAgeCAtPSBwb3NpdGlvbkNoaWxkSW52ZXJzZShtTWVudVZpZXcsIHggKyBtQWN0aW9uU3BhY2luZywgeSwgY29udGVudEhlaWdodCkKKyAgICAgICAgICAgICAgICAgICAgLSBtQWN0aW9uU3BhY2luZzsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgaW50IHBvc2l0aW9uQ2hpbGQoVmlldyBjaGlsZCwgaW50IHgsIGludCB5LCBpbnQgY29udGVudEhlaWdodCkgeworICAgICAgICBpbnQgY2hpbGRXaWR0aCA9IGNoaWxkLmdldE1lYXN1cmVkV2lkdGgoKTsKKyAgICAgICAgaW50IGNoaWxkSGVpZ2h0ID0gY2hpbGQuZ2V0TWVhc3VyZWRIZWlnaHQoKTsKKyAgICAgICAgaW50IGNoaWxkVG9wID0geSArIChjb250ZW50SGVpZ2h0IC0gY2hpbGRIZWlnaHQpIC8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VmlldyB2aWV3KTsKLSAgICAgICAgcHVibGljIHZvaWQgb25EaXNwbGF5TmFtZUNsaWNrKFZpZXcgdmlldyk7Ci0gICAgfQotCi0gICAgcHJpdmF0ZSBDb250YWN0SGVhZGVyTGlzdGVuZXIgbUxpc3RlbmVyOwotCi0KLSAgICBwcml2YXRlIGludGVyZmFjZSBDb250YWN0UXVlcnkgewotICAgICAgICAvL1Byb2plY3Rpb24gdXNlZCBmb3IgdGhlIHN1bW1hcnkgaW5mbyBpbiB0aGUgaGVhZGVyLgotICAgICAgICBTdHJpbmdbXSBDT0xVTU5TID0gbmV3IFN0cmluZ1tdIHsKLSAgICAgICAgICAgIENvbnRhY3RzLl9JRCwKLSAgICAgICAgICAgIENvbnRhY3RzLkxPT0tVUF9LRVksCi0gICAgICAgICAgICBDb250YWN0cy5QSE9UT19JRCwKLSAgICAgICAgICAgIENvbnRhY3RzLkRJU1BMQVlfTkFNRSwKLSAgICAgICAgICAgIENvbnRhY3RzLlBIT05FVElDX05BTUUsCi0gICAgICAgICAgICBDb250YWN0cy5TVEFSUkVELAotICAgICAgICAgICAgQ29udGFjdHMuQ09OVEFDVF9QUkVTRU5DRSwKLSAgICAgICAgICAgIENvbnRhY3RzLkNPTlRBQ1RfU1RBVFVTLAotICAgICAgICAgICAgQ29udGFjdHMuQ09OVEFDVF9TVEFUVVNfVElNRVNUQU1QLAotICAgICAgICAgICAgQ29udGFjdHMuQ09OVEFDVF9TVEFUVVNfUkVTX1BBQ0tBR0UsCi0gICAgICAgICAgICBDb250YWN0cy5DT05UQUNUX1NUQVRVU19MQUJFTCwKLSAgICAgICAgfTsKLSAgICAgICAgaW50IF9JRCA9IDA7Ci0gICAgICAgIGludCBMT09LVVBfS0VZID0gMTsKLSAgICAgICAgaW50IFBIT1RPX0lEID0gMjsKLSAgICAgICAgaW50IERJU1BMQVlfTkFNRSA9IDM7Ci0gICAgICAgIGludCBQSE9ORVRJQ19OQU1FID0gNDsKLSAgICAgICAgLy9UT0RPOiB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HMgQXN5bmNRdWVyeUhhbmRsZXIgewotCi0gICAgICAgIHB1YmxpYyBRdWVyeUhhbmRsZXIoQ29udGVudFJlc29sdmVyIGNyKSB7Ci0gICAgICAgICAgICBzdXBlcihjcik7Ci0gICAgICAgIH0KLQotICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgcHJvdGVjdGVkIHZvaWQgb25RdWVyeUNvbXBsZXRlKGludCB0b2tlbiwgT2JqZWN0IGNvb2tpZSwgQ3Vyc29yIGN1cnNvcikgewotICAgICAgICAgICAgdHJ5ewotICAgICAgICAgICAgICAgIGlmICh0aGlzICE9IG1RdWVyeUhhbmRsZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAib25RdWVyeUNvbXBsZXRlOiBkaXNjYXJkIHJlc3VsdCwgdGhlIHF1ZXJ5IGhhbmRsZXIgaXMgcmVzZXQhIik7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzd2l0Y2ggKHRva2VuKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgVE9LRU5fUEhPVE9fUVVFUlk6IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vU2V0IHRoZSBwaG90bwotICAgICAgICAgICAgICAgICAgICAgICAgQml0bWFwIHBob3RvQml0bWFwID0gbnVsbDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCAmJiBjdXJzb3IubW92ZVRvRmlyc3QoKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAhY3Vyc29yLmlzTnVsbChQaG90b1F1ZXJ5LlBIT1RPKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVbXSBwaG90b0RhdGEgPSBjdXJzb3IuZ2V0QmxvYihQaG90b1F1ZXJ5LlBIT1RPKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaG90b0JpdG1hcCA9IEJpdG1hcEZhY3RvcnkuZGVjb2RlQnl0ZUFycmF5KHBob3RvRGF0YSwgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBob3RvRGF0YS5sZW5ndGgsIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocGhvdG9CaXRtYXAgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBob3RvQml0bWFwID0gbG9hZFBsYWNlaG9sZGVyUGhvdG8obnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBtUGhvdG9WaWV3LnNldEltYWdlQml0bWFwKHBob3RvQml0bWFwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb29raWUgIT0gbnVsbCAmJiBjb29raWUgaW5zdGFuY2VvZiBVcmkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUGhvdG9WaWV3LmFzc2lnbkNvbnRhY3RVcmkoKFVyaSkgY29va2llKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgVE9LRU5fQ09OVEFDVF9JTkZPOiB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3Vyc29yICE9IG51bGwgJiYgY3Vyc29yLm1vdmVUb0ZpcnN0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaW5kQ29udGFjdEluZm8oY3Vyc29yKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBVcmkgbG9va3VwVXJpID0gQ29udGFjdHMuZ2V0TG9va3VwVXJpKGN1cnNvci5nZXRMb25nKENvbnRhY3RRdWVyeS5fSUQpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yLmdldFN0cmluZyhDb250YWN0UXVlcnkuTE9PS1VQX0tFWSkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluYWwgbG9uZyBwaG90b0lkID0gY3Vyc29yLmdldExvbmcoQ29udGFjdFF1ZXJ5LlBIT1RPX0lEKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwaG90b0lkID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBob3RvVmlldy5zZXRJbWFnZUJpdG1hcChsb2FkUGxhY2Vob2xkZXJQaG90byhudWxsKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb29raWUgIT0gbnVsbCAmJiBjb29raWUgaW5zdGFuY2VvZiBVcmkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QaG90b1ZpZXcuYXNzaWduQ29udGFjdFVyaSgoVXJpKSBjb29raWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludmFsaWRhdGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydFBob3RvUXVlcnkocGhvdG9JZCwgbG9va3VwVXJpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlIC8qIGRvbid0IHJlc2V0IHF1ZXJ5IGhhbmRsZXIgKi8pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2hvdWxkbid0IHJlYWxseSBoYXBwZW4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXREaXNwbGF5TmFtZShudWxsLCBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTb2NpYWxTbmlwcGV0KG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFBob3RvKGxvYWRQbGFjZWhvbGRlclBob3RvKG51bGwpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgVE9LRU5fUEhPTkVfTE9PS1VQOiB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3Vyc29yICE9IG51bGwgJiYgY3Vyc29yLm1vdmVUb0ZpcnN0KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nIGNvbnRhY3RJZCA9IGN1cnNvci5nZXRMb25nKFBIT05FX0xPT0tVUF9DT05UQUNUX0lEX0NPTFVNTl9JTkRFWCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGxvb2t1cEtleSA9IGN1cnNvci5nZXRTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQSE9ORV9MT09LVVBfQ09OVEFDVF9MT09LVVBfS0VZX0NPTFVNTl9JTkRFWCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmluZEZyb21Db250YWN0VXJpSW50ZXJuYWwoQ29udGFjdHMuZ2V0TG9va3VwVXJpKGNvbnRhY3RJZCwgbG9va3VwS2V5KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlIC8qIGRvbid0IHJlc2V0IHF1ZXJ5IGhhbmRsZXIgKi8pOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcGhvbmVOdW1iZXIgPSAoU3RyaW5nKSBjb29raWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0RGlzcGxheU5hbWUocGhvbmVOdW1iZXIsIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFNvY2lhbFNuaXBwZXQobnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0UGhvdG8obG9hZFBsYWNlaG9sZGVyUGhvdG8obnVsbCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QaG90b1ZpZXcuYXNzaWduQ29udGFjdEZyb21QaG9uZShwaG9uZU51bWJlciwgdHJ1ZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBjYXNlIFRPS0VOX0VNQUlMX0xPT0tVUDogewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnNvciAhPSBudWxsICYmIGN1cnNvci5tb3ZlVG9GaXJzdCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZyBjb250YWN0SWQgPSBjdXJzb3IuZ2V0TG9uZyhFTUFJTF9MT09LVVBfQ09OVEFDVF9JRF9DT0xVTU5fSU5ERVgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBsb29rdXBLZXkgPSBjdXJzb3IuZ2V0U3RyaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU1BSUxfTE9PS1VQX0NPTlRBQ1RfTE9PS1VQX0tFWV9DT0xVTU5fSU5ERVgpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpbmRGcm9tQ29udGFjdFVyaUludGVybmFsKENvbnRhY3RzLmdldExvb2t1cFVyaShjb250YWN0SWQsIGxvb2t1cEtleSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSAvKiBkb24ndCByZXNldCBxdWVyeSBoYW5kbGVyICovKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGVtYWlsQWRkcmVzcyA9IChTdHJpbmcpIGNvb2tpZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXREaXNwbGF5TmFtZShlbWFpbEFkZHJlc3MsIG51bGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFNvY2lhbFNuaXBwZXQobnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0UGhvdG8obG9hZFBsYWNlaG9sZGVyUGhvdG8obnVsbCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QaG90b1ZpZXcuYXNzaWduQ29udGFjdEZyb21FbWFpbChlbWFpbEFkZHJlc3MsIHRydWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgICAgIGlmIChjdXJzb3IgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBjdXJzb3IuY2xvc2UoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBUdXJuIG9uL29mZiBzaG93aW5nIG9mIHRoZSBhZ2dyZWdhdGUgYmFkZ2UgZWxlbWVudC4KLSAgICAgKi8KLSAgICBwdWJsaWMgdm9pZCBzaG93QWdncmVnYXRlQmFkZ2UoYm9vbGVhbiBzaG93QmFnZGUpIHsKLSAgICAgICAgbUFnZ3JlZ2F0ZUJhZGdlLnNldFZpc2liaWxpdHkoc2hvd0JhZ2RlID8gVmlldy5WSVNJQkxFIDogVmlldy5HT05FKTsKLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBUdXJuIG9uL29mZiBzaG93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0cmluZyBsYWJlbCA9IG51bGw7Ci0KLSAgICAgICAgICAgIGlmICghYy5pc051bGwoQ29udGFjdFF1ZXJ5LkNPTlRBQ1RfU1RBVFVTX0xBQkVMKSkgewotICAgICAgICAgICAgICAgIFN0cmluZyByZXNQYWNrYWdlID0gYy5nZXRTdHJpbmcoQ29udGFjdFF1ZXJ5LkNPTlRBQ1RfU1RBVFVTX1JFU19QQUNLQUdFKTsKLSAgICAgICAgICAgICAgICBpbnQgbGFiZWxSZXNvdXJjZSA9IGMuZ2V0SW50KENvbnRhY3RRdWVyeS5DT05UQUNUX1NUQVRVU19MQUJFTCk7Ci0gICAgICAgICAgICAgICAgUmVzb3VyY2VzIHJlc291cmNlczsKLSAgICAgICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkocmVzUGFja2FnZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VzID0gZ2V0UmVzb3VyY2VzKCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgUGFja2FnZU1hbmFnZXIgcG0gPSBnZXRDb250ZXh0KCkuZ2V0UGFja2FnZU1hbmFnZXIoKTsKLSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc291cmNlcyA9IHBtLmdldFJlc291cmNlc0ZvckFwcGxpY2F0aW9uKHJlc1BhY2thZ2UpOwotICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChOYW1lTm90Rm91bmRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQ29udGFjdCBzdGF0dXMgdXBkYXRlIHJlc291cmNlIHBhY2thZ2Ugbm90IGZvdW5kOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgcmVzUGFja2FnZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXNvdXJjZXMgPSBudWxsOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHJlc291cmNlcyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsYWJlbCA9IHJlc291cmNlcy5nZXRTdHJpbmcobGFiZWxSZXNvdXJjZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKE5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkNvbnRhY3Qgc3RhdHVzIHVwZGF0ZSByZXNvdXJjZSBub3QgZm91bmQ6ICIgKyByZXNQYWNrYWdlICsgIkAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbGFiZWxSZXNvdXJjZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIENoYXJTZXF1ZW5jZSBhdHRyaWJ1dGlvbjsKLSAgICAgICAgICAgIGlmICh0aW1lc3RhbXAgIT0gbnVsbCAmJiBsYWJlbCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgYXR0cmlidXRpb24gPSBnZXRDb250ZXh0KCkuZ2V0U3RyaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgUi5zdHJpbmcuY29udGFjdF9zdGF0dXNfdXBkYXRlX2F0dHJpYnV0aW9uX3dpdGhfZGF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVzdGFtcCwgbGFiZWwpOwotICAgICAgICAgICAgfSBlbHNlIGlmICh0aW1lc3RhbXAgPT0gbnVsbCAmJiBsYWJlbCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgYXR0cmlidXRpb24gPSBnZXRDb250ZXh0KCkuZ2V0U3RyaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgUi5zdHJpbmcuY29udGFjdF9zdGF0dXNfdXBkYXRlX2F0dHJpYnV0aW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWwpOwotICAgICAgICAgICAgfSBlbHNlIGlmICh0aW1lc3RhbXAgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGF0dHJpYnV0aW9uID0gdGltZXN0YW1wOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBhdHRyaWJ1dGlvbiA9IG51bGw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoYXR0cmlidXRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1TdGF0dXNBdHRyaWJ1dGlvblZpZXcuc2V0VGV4dChhdHRyaWJ1dGlvbik7Ci0gICAgICAgICAgICAgICAgbVN0YXR1c0F0dHJpYnV0aW9uVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuVklTSUJMRSk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG1TdGF0dXNBdHRyaWJ1dGlvblZpZXcuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbVN0YXR1c1ZpZXcuc2V0VmlzaWJpbGl0eShWaWV3LkdPTkUpOwotICAgICAgICAgICAgbVN0YXR1c0F0dHJpYnV0aW9uVmlldy5zZXRWaXNpYmlsaXR5KFZpZXcuR09ORSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCBvbkNsaWNrKFZpZXcgdmlldykgewotICAgICAgICBzd2l0Y2ggKHZpZXcuZ2V0SWQoKSkgewotICAgICAgICAgICAgY2FzZSBSLmlkLnN0YXI6IHsKLSAgICAgICAgICAgICAgICAvLyBUb2dnbGUgInN0YXJyZWQiIHN0YXRlCi0gICAgICAgICAgICAgICAgLy8gTWFrZSBzdXJlIHRoZXJlIGlzIGEgY29udGFjdAotICAgICAgICAgICAgICAgIGlmIChtQ29udGFjdFVyaSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIENvbnRlbnRWYWx1ZXMgdmFsdWVzID0gbmV3IENvbnRlbnRWYWx1ZXMoMSk7Ci0gICAgICAgICAgICAgICAgICAgIHZhbHVlcy5wdXQoQ29udGFjdHMuU1RBUlJFRCwgbVN0YXJyZWRWaWV3LmlzQ2hlY2tlZCgpKTsKLSAgICAgICAgICAgICAgICAgICAgbUNvbnRlbnRSZXNvbHZlci51cGRhdGUobUNvbnRhY3RVcmksIHZhbHVlcywgbnVsbCwgbnVsbCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBSLmlkLnBob3RvOiB7Ci0gICAgICAgICAgICAgICAgcGVyZm9ybVBob3RvQ2xpY2soKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgUi5pZC5uYW1lOiB7Ci0gICAgICAgICAgICAgICAgcGVyZm9ybURpc3BsYXlOYW1lQ2xpY2soKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHByaXZhdGUgQml0bWFwIGxvYWRQbGFjZWhvbGRlclBob3RvKEJpdG1hcEZhY3RvcnkuT3B0aW9ucyBvcHRpb25zKSB7Ci0gICAgICAgIGlmIChtTm9QaG90b1Jlc291cmNlID09IDApIHsKLSAgICAgICAgICAgIHJldHVybiBudWxsOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBCaXRtYXBGYWN0b3J5LmRlY29kZVJlc291cmNlKG1Db250ZXh0LmdldFJlc291cmNlcygpLAotICAgICAgICAgICAgICAgIG1Ob1Bob3RvUmVzb3VyY2UsIG9wdGlvbnMpOwotICAgIH0KLX0KZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9jb20vYW5kcm9pZC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W1lCiAgICAgICogQHJldHVybiB0cnVlIGlmIGZpbGUgZXhpc3RzIGFuZCBpcyBub24tZW1wdHkuCiAgICAgICovCkBAIC0yNzQsNiArMzMxLDExIEBACiAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZVBhc3N3b3JkUXVhbGl0eSA9IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9BTFBIQU5VTUVSSUM7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfQ09NUExFWDoKKyAgICAgICAgICAgICAgICBpZiAoaXNMb2NrUGFzc3dvcmRFbmFibGVkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgYWN0aXZlUGFzc3dvcmRRdWFsaXR5ID0gRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX0NPTVBMRVg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9CiAgICAgICAgIHJldHVybiBhY3RpdmVQYXNzd29yZFF1YWxpdHk7CiAgICAgfQpAQCAtMjgyLDggKzM0NCw2IEBACiAgICAgICogQ2xlYXIgYW55IGxvY2sgcGF0dGVybiBvciBwYXNzd29yZC4KICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBjbGVhckxvY2soKSB7Ci0gICAgICAgIGdldERldmljZVBvbGljeU1hbmFnZXIoKS5zZXRBY3RpdmVQYXNzd29yZFN0YXRlKAotICAgICAgICAgICAgICAgIERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9VTlNQRUNJRklFRCwgMCk7CiAgICAgICAgIHNhdmVMb2NrUGFzc3dvcmQobnVsbCwgRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX1NPTUVUSElORyk7CiAgICAgICAgIHNldExvY2t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yArNDM3LDU5IEBACiAgICAgICAgICAgICBEZXZpY2VQb2xpY3lNYW5hZ2VyIGRwbSA9IGdldERldmljZVBvbGljeU1hbmFnZXIoKTsKICAgICAgICAgICAgIGlmIChwYXNzd29yZCAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgaW50IGNvbXB1dGVkUXVhbGl0eSA9IGNvbXB1dGVQYXNzd29yZFF1YWxpdHkocGFzc3dvcmQpOwotICAgICAgICAgICAgICAgIHNldExvbmcoUEFTU1dPUkRfVFlQRV9LRVksIGNvbXB1dGVkUXVhbGl0eSk7CisgICAgICAgICAgICAgICAgc2V0TG9uZyhQQVNTV09SRF9UWVBFX0tFWSwgTWF0aC5tYXgocXVhbGl0eSwgY29tcHV0ZWRRdWFsaXR5KSk7CiAgICAgICAgICAgICAgICAgaWYgKGNvbXB1dGVkUXVhbGl0eSAhPSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfVU5TUEVDSUZJRUQpIHsKLSAgICAgICAgICAgICAgICAgICAgZHBtLnNldEFjdGl2ZVBhc3N3b3JkU3RhdGUoY29tcHV0ZWRRdWFsaXR5LCBwYXNzd29yZC5sZW5ndGgoKSk7CisgICAgICAgICAgICAgICAgICAgIGludCBsZXR0ZXJzID0gMDsKKyAgICAgICAgICAgICAgICAgICAgaW50IHVwcGVyY2FzZSA9IDA7CisgICAgICAgICAgICAgICAgICAgIGludCBsb3dlcmNhc2UgPSAwOworICAgICAgICAgICAgICAgICAgICBpbnQgbnVtYmVycyA9IDA7CisgICAgICAgICAgICAgICAgICAgIGludCBzeW1ib2xzID0gMDsKKyAgICAgICAgICAgICAgICAgICAgaW50IG5vbmxldHRlciA9IDA7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgcGFzc3dvcmQubGVuZ3RoKCk7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgY2hhciBjID0gcGFzc3dvcmQuY2hhckF0KGkpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGMgPj0gJ0EnICYmIGMgPD0gJ1onKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0dGVycysrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwcGVyY2FzZSsrOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjID49ICdhJyAmJiBjIDw9ICd6JykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldHRlcnMrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb3dlcmNhc2UrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYyA+PSAnMCcgJiYgYyA8PSAnOScpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1iZXJzKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9ubGV0dGVyKys7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN5bWJvbHMrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBub25sZXR0ZXIrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBkcG0uc2V0QWN0aXZlUGFzc3dvcmRTdGF0ZShNYXRoLm1heChxdWFsaXR5LCBjb21wdXRlZFF1YWxpdHkpLCBwYXNzd29yZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5sZW5ndGgoKSwgbGV0dGVycywgdXBwZXJjYXNlLCBsb3dlcmNhc2UsIG51bWJlcnMsIHN5bWJvbHMsIG5vbmxldHRlcik7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIHBhc3N3b3JkIGlzIG5vdCBhbnl0aGluZy4KICAgICAgICAgICAgICAgICAgICAgZHBtLnNldEFjdGl2ZVBhc3N3b3JkU3RhdGUoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX1VOU1BFQ0lGSUVELCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfVU5TUEVDSUZJRUQsIDAsIDAsIDAsIDAsIDAsIDAsIDApOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBBZGQgdGhlIHBhc3N3b3JkIHRvIHRoZSBwYXNzd29yZCBoaXN0b3J5LiBXZSBhc3N1bWUgYWxsCisgICAgICAgICAgICAgICAgLy8gcGFzc3dvcmQKKyAgICAgICAgICAgICAgICAvLyBoYXNoZXMgaGF2ZSB0aGUgc2FtZSBsZW5ndGggZm9yIHNpbXBsaWNpdHkgb2YgaW1wbGVtZW50YXRpb24uCisgICAgICAgICAgICAgICAgU3RyaW5nIHBhc3N3b3JkSGlzdG9yeSA9IGdldFN0cmluZyhQQVNTV09SRF9ISVNUT1JZX0tFWSk7CisgICAgICAgICAgICAgICAgaWYgKHBhc3N3b3JkSGlzdG9yeSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHBhc3N3b3JkSGlzdG9yeSA9IG5ldyBTdHJpbmcoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaW50IHBhc3N3b3JkSGlzdG9yeUxlbmd0aCA9IGdldFJlcXVlc3RlZFBhc3N3b3JkSGlzdG9yeUxlbmd0aCgpOworICAgICAgICAgICAgICAgIGlmIChwYXNzd29yZEhpc3RvcnlMZW5ndGggPT0gMCkgeworICAgICAgICAgICAgICAgICAgICBwYXNzd29yZEhpc3RvcnkgPSAiIjsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBwYXNzd29yZEhpc3RvcnkgPSBuZXcgU3RyaW5nKGhhc2gpICsgIiwiICsgcGFzc3dvcmRIaXN0b3J5OworICAgICAgICAgICAgICAgICAgICAvLyBDdXQgaXQgdG8gY29udGFpbiBwYXNzd29yZEhpc3RvcnlMZW5ndGggaGFzaGVzCisgICAgICAgICAgICAgICAgICAgIC8vIGFuZCBwYXNzd29yZEhpc3RvcnlMZW5ndGggLTEgY29tbWFzLgorICAgICAgICAgICAgICAgICAgICBwYXNzd29yZEhpc3RvcnkgPSBwYXNzd29yZEhpc3Rvcnkuc3Vic3RyaW5nKDAsIE1hdGgubWluKGhhc2gubGVuZ3RoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBwYXNzd29yZEhpc3RvcnlMZW5ndGggKyBwYXNzd29yZEhpc3RvcnlMZW5ndGggLSAxLCBwYXNzd29yZEhpc3RvcnkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAubGVuZ3RoKCkpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2V0U3RyaW5nKFBBU1NXT1JEX0hJU1RPUllfS0VZLCBwYXNzd29yZEhpc3RvcnkpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBkcG0uc2V0QWN0aXZlUGFzc3dvcmRTdGF0ZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9VTlNQRUNJRklFRCwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfVU5TUEVDSUZJRUQsIDAsIDAsIDAsIDAsIDAsIDAsIDApOwogICAgICAgICAgICAgfQogICAgICAgICB9IGNhdGNoIChGaWxlTm90Rm91bmRFeGNlcHRpb24gZm5mZSkgewogICAgICAgICAgICAgLy8gQ2FudCBkbyBtdWNoLCB1bmxlc3Mgd2Ugd2FudCB0byBmYWlsIG92ZXIgdG8gdXNpbmcgdGhlIHNldHRpbmdzIHByb3ZpZGVyCkBAIC01MjYsNyArNjI5LDggQEAKICAgICAgICAgcmV0dXJuIHNhdmVkUGFzc3dvcmRFeGlzdHMoKSAmJgogICAgICAgICAgICAgICAgIChtb2RlID09IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9BTFBIQUJFVElDCiAgICAgICAgICAgICAgICAgICAgICAgICB8fCBtb2RlID09IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9OVU1FUklDCi0gICAgICAgICAgICAgICAgICAgICAgICB8fCBtb2RlID09IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9BTFBIQU5VTUVSSUMpOworICAgICAgICAgICAgICAgICAgICAgICAgfHwgbW9kZSA9PSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfQUxQSEFOVU1FUklDCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBtb2RlID09IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9DT01QTEVYKTsKICAgICB9CiAKICAgICAvKioKQEAgLTY1MCwxMiArNzU0LDIxIEBACiAgICAgICAgIGFuZHJvaWQucHJvdmlkZXIuU2V0dGluZ3MuU2VjdXJlLnB1dExvbmcobUNvbnRlbnRSZXNvbHZlciwgc2VjdXJlU2V0dGluZ0tleSwgdmFsdWUpOwogICAgIH0KIAorICAgIHByaXZhdGUgU3RyaW5nIGdldFN0cmluZyhTdHJpbmcgc2VjdXJlU2V0dGluZ0tleSkgeworICAgICAgICByZXR1cm4gYW5kcm9pZC5wcm92aWRlci5TZXR0aW5ncy5TZWN1cmUuZ2V0U3RyaW5nKG1Db250ZW50UmVzb2x2ZXIsIHNlY3VyZVNldHRpbmdLZXkpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzZXRTdHJpbmcoU3RyaW5nIHNlY3VyZVNldHRpbmdLZXksIFN0cmluZyB2YWx1ZSkgeworICAgICAgICBhbmRyb2lkLnByb3ZpZGVy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ICogTGlzdGVuZXIgdXNlZCB0byByZXNldCB0aGUgdmlldyB3aGVuIHRoZSBjdXJyZW50IGFuaW1hdGlvbiBjb21wbGV0ZXMuCkBAIC02MDgsMTQgKzYwNyw3IEBACiAKICAgICAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9VUDoKICAgICAgICAgICAgICAgICBjYXNlIE1vdGlvbkV2ZW50LkFDVElPTl9DQU5DRUw6Ci0gICAgICAgICAgICAgICAgICAgIG1UcmFja2luZyA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBtVHJpZ2dlcmVkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIG1PdGhlclNsaWRlci5zaG93KHRydWUpOwotICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFNsaWRlci5yZXNldChmYWxzZSk7Ci0gICAgICAgICAgICAgICAgICAgIG1DdXJyZW50U2xpZGVyLmhpZGVUYXJnZXQoKTsKLSAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRTbGlkZXIgPSBudWxsOwotICAgICAgICAgICAgICAgICAgICBtT3RoZXJTbGlkZXIgPSBudWxsOwotICAgICAgICAgICAgICAgICAgICBzZXRHcmFiYmVkU3RhdGUoT25UcmlnZ2VyTGlzdGVuZXIuTk9fSEFORExFKTsKKyAgICAgICAgICAgICAgICAgICAgY2FuY2VsR3JhYigpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtNjIzLDYgKzYxNSwxNyBAQAogICAgICAgICByZXR1cm4gbVRyYWNraW5nIHx8IHN1cGVyLm9uVG91Y2hFdmVudChldmVudCk7CiAgICAgfQogCisgICAgcHJpdmF0ZSB2b2lkIGNhbmNlbEdyYWIoKSB7CisgICAgICAgIG1UcmFja2luZyA9IGZhbHNlOworICAgICAgICBtVHJpZ2dlcmVkID0gZmFsc2U7CisgICAgICAgIG1PdGhlclNsaWRlci5zaG93KHRydWUpOworICAgICAgICBtQ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gfTsKKwogICAgIHN0YXRpYyB2b2lkIGZpbmFsaXplcihKTklFbnYqIGVudiwgam9iamVjdCBjbGF6eiwgU2tDYW52YXMqIGNhbnZhcykgewogICAgICAgICBjYW52YXMtPnVucmVmKCk7CiAgICAgfQpAQCAtNzQzLDQ1ICs3NjcsMjE4IEBACiAgICAgICAgIGNhbnZhcy0+ZHJhd1ZlcnRpY2VzKG1vZGUsIHB0Q291bnQsIHZlcnRzLCB0ZXhzLCBjb2xvcnMsIE5VTEwsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGljZXMsIGluZGV4Q291bnQsICpwYWludCk7CiAgICAgfQotICAgIAotICAgIHN0YXRpYyB2b2lkIGRyYXdUZXh0X19fQ0lJRkZQYWludChKTklFbnYqIGVudiwgam9iamVjdCwgU2tDYW52YXMqIGNhbnZhcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamNoYXJBcnJheSB0ZXh0LCBpbnQgaW5kZXgsIGludCBjb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0IHgsIGpmbG9hdCB5LCBTa1BhaW50KiBwYWludCkgewotICAgICAgICBqY2hhciogdGV4dEFycmF5ID0gZW52LT5HZXRDaGFyQXJyYXlFbGVtZW50cyh0ZXh0LCBOVUxMKTsKLSAgICAgICAganNpemUgdGV4dENvdW50ID0gZW52LT5HZXRBcnJheUxlbmd0aCh0ZXh0KTsKLSAgICAgICAgU2tTY2FsYXIgeF8gPSBTa0Zsb2F0VG9TY2FsYXIoeCk7Ci0gICAgICAgIFNrU2NhbGFyIHlfID0gU2tGbG9hdFRvU2NhbGFyKHkpOwotICAgICAgICBjYW52YXMtPmRyYXdUZXh0KHRleHRBcnJheSArIGluZGV4LCBjb3VudCA8PCAxLCB4XywgeV8sICpwYWludCk7Ci0gICAgICAgIGVudi0+UmVsZWFzZUNoYXJBcnJheUVsZW1lbnRzKHRleHQsIHRleHRBcnJheSwgMCk7Ci0gICAgfQotIAotICAgIHN0YXRpYyB2b2lkIGRyYXdUZXh0X19TdHJpbmdJSUZGUGFpbnQoSk5JRW52KiBlbnYsIGpvYmplY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU2tDYW52YXMqIGNhbnZhcywganN0cmluZyB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeCwgamZsb2F0IHksIFNrUGFpbnQqIHBhaW50KSB7Ci0gICAgICAgIGNvbnN0IHZvaWQqIHRleHRfID0gZW52LT5HZXRTdHJpbmdDaGFycyh0ZXh0LCBOVUxMKTsKLSAgICAgICAgU2tTY2FsYXIgeF8gPSBTa0Zsb2F0VG9TY2FsYXIoeCk7Ci0gICAgICAgIFNrU2NhbGFyIHlfID0gU2tGbG9hdFRvU2NhbGFyKHkpOwotICAgICAgICBjYW52YXMtPmRyYXdUZXh0KChjb25zdCB1aW50MTZfdCopdGV4dF8gKyBzdGFydCwgKGVuZCAtIHN0YXJ0KSA8PCAxLAotICAgICAgICAgICAgICAgICAgICAgICAgIHhfLCB5XywgKnBhaW50KTsKLSAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nQ2hhcnModGV4dCwgKGNvbnN0IGpjaGFyKikgdGV4dF8pOwotICAgIH0KLSAgICAKLSAgICBzdGF0aWMgdm9pZCBkcmF3U3RyaW5nKEpOSUVudiogZW52LCBqb2JqZWN0IGNhbnZhcywganN0cmluZyB0ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0IHgsIGpmbG9hdCB5LCBqb2JqZWN0IHBhaW50KSB7Ci0gICAgICAgIE5QRV9DSEVDS19SRVRVUk5fVk9JRChlbnYsIGNhbnZhcyk7Ci0gICAgICAgIE5QRV9DSEVDS19SRVRVUk5fVk9JRChlbnYsIHBhaW50KTsKLSAgICAgICAgTlBFX0NIRUNLX1JFVFVSTl9WT0lEKGVudiwgdGV4d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gIHVfc2hhcGVBcmFiaWMoY29udGV4dCwgY29udGV4dENvdW50LCBidWZmZXIsIGNvbnRleHRDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgVV9TSEFQRV9MRU5HVEhfRklYRURfU1BBQ0VTX05FQVIgfAorICAgICAgICAgICAgICAgICAgICAgICBVX1NIQVBFX1RFWFRfRElSRUNUSU9OX0xPR0lDQUwgfCBVX1NIQVBFX0xFVFRFUlNfU0hBUEUgfAorICAgICAgICAgICAgICAgICAgICAgICBVX1NIQVBFX1hfTEFNQUxFRl9TVUJfQUxURVJOQVRFLCAmc3RhdHVzKTsKKworICAgICAgICBpZiAoIVVfU1VDQ0VTUyhzdGF0dXMpKSB7CisgICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICAgfQotICAgICAgICBjb25zdCBqY2hhciogdGV4dF8gPSBlbnYtPkdldFN0cmluZ0NoYXJzKHRleHQsIE5VTEwpOwotICAgICAgICBTa0NhbnZhcyogYyA9IEdyYXBoaWNzSk5JOjpnZXROYXRpdmVDYW52YXMoZW52LCBjYW52YXMpOwotICAgICAgICBjLT5kcmF3VGV4dCh0ZXh0XywgY291bnQgPDwgMSwgU2tGbG9hdFRvU2NhbGFyKHgpLCBTa0Zsb2F0VG9TY2FsYXIoeSksCi0gICAgICAgICAgICAgICAgICAgICpHcmFwaGljc0pOSTo6Z2V0TmF0aXZlUGFpbnQoZW52LCBwYWludCkpOwotICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdDaGFycyh0ZXh0LCB0ZXh0Xyk7CisKKyAgICAgICAgLy8gdHJpbSBvdXQgMHhmZmZmIGZvbGxvd2luZyBsaWdhdHVyZXMsIGlmIGFueQorICAgICAgICBpbnQgZW5kID0gMDsKKyAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0LCBlID0gc3RhcnQgKyBjb3VudDsgaSA8IGU7ICsraSkgeworICAgICAgICAgICAgaWYgKGJ1ZmZlcltpXSA9PSAweGZmZmYpIHsKKyAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBidWZmZXJbZW5kKytdID0gYnVmZmVyW2ldOworICAgICAgICB9CisgICAgICAgIGNvdW50ID0gZW5kOworICAgICAgICAvLyBMT0coTE9HX0lORk8sICJDU1JUTCIsICJzdGFydCAlZCBjb3VudCAlZCBjY291bnQgJWRcbiIsIHN0YXJ0LCBjb3VudCwgY29udGV4dENvdW50KTsKKyAgICAgICAgdWJpZGlfd3JpdGVSZXZlcnNlKGJ1ZmZlciwgY291bnQsIHNoYXBlZCwgY291bnQsIFVCSURJX0RPX01JUlJPUklORyB8IFVCSURJX09VVFBVVF9SRVZFUlNFCisgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFVCSURJX0tFRVBfQkFTRV9DT01CSU5JTkcsICZzdGF0dXMpOworICAgICAgICByZXR1cm4gY291bnQ7CiAgICAgfQotICAgIAorCisgICAgc3RhdGljIHZvaWQgZHJhd1RleHRfXyhKTklFbnYqIGVudiwgU2tDYW52YXMqIGNhbnZhcywgY29uc3QgamNoYXIqIHRleHQsIGpzaXplIGxlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4LCBqZmxvYXQgeSwgaW50IGZsYWdzLCBTa1BhaW50KiBwYWludCkgeworICAgICAgICBTa1NjYWxhciB4XyA9IFNrRmxvYXRUb1NjYWxhcih4KTsKKyAgICAgICAgU2tTY2FsYXIgeV8gPSBTa0Zsb2F0VG9TY2FsYXIoeSk7CisKKyAgICAgICAgU2tQYWludDo6QWxpZ24gaG9yaXogPSBwYWludC0+Z2V0VGV4dEFsaWduKCk7CisKKyAgICAgICAgYm9vbCBuZWVkQmlkaSA9IChmbGFncyA9PSBrQmlkaV9SVEwpIHx8IChmbGFncyA9PSBrQmlkaV9EZWZhdWx0X1JUTCk7CisgICAgICAgIGlmICghbmVlZEJpZGkgJiYgZmxhZ3MgPCBrQmlkaV9Gb3JjZV9MVFIpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuOyArK2kpIHsKKyAgICAgICAgICAgICAgICBpZiAodGV4dFtpXSA+PSAweDA1OTApIHsKKyAgICAgICAgICAgICAgICAgICAgbmVlZEJpZGkgPSBUUlVFOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpbnQgZGlyID0gKGZsYWdzID09IGtCaWRpX0ZvcmNlX1JUTCkgPyBrRGlyZWN0aW9uX1JUTCA6IGtEaXJlY3Rpb25fTFRSOyAvLyB3aWxsIGJlIHJlc2V0IGlmIHdlIHJ1biBiaWRpCisgICAgICAgIFVFcnJvckNvZGUgc3RhdHVzID0gVV9aRVJPX0VSUk9SOworICAgICAgICBqY2hhciAqc2hhcGVkID0gTlVMTDsKKyAgICAgICAgaW50MzJfdCBzbGVuID0gMDsKKyAgICAgICAgaWYgKG5lZWRCaWRpIHx8IChmbGFncyA9PSBrQmlkaV9Gb3JjZV9SVEwpKSB7CisgICAgICAgICAgICBzaGFwZWQgPSAoamNoYXIgKiltYWxsb2MobGVuICogc2l6ZW9mKGpjaGFyKSk7CisgICAgICAgICAgICBpZiAoIXNoYXBlZCkgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IFVfTUVNT1JZX0FMTE9DQVRJT05fRVJST1I7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChuZWVkQmlkaSkgeworICAgICAgICAgICAgICAgICAgICBzdGF0aWMgaW50IFJUTF9PUFRTID0gVUJJRElfRE9fTUlSUk9SSU5HIHwgVUJJRElfS0VFUF9CQVNFX0NPTUJJTklORyB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUJJRElfUkVNT1ZFX0JJRElfQ09OVFJPTFMgfCBVQklESV9PVVRQVVRfUkVWRVJTRTsKKyAgICAgICAgICAgICAgICAgICAgamludCBsaW5lRGlyID0gMDsKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChmbGFncykgeworICAgICAgICAgICAgICAgICAgICBjYXNlIGtCaWRpX0xUUjogbGluZURpciA9IDA7IGJyZWFrOyAvLyBubyBJQ1UgY29uc3RhbnQsIGNhbm9uaWNhbCBMVFIgbGV2ZWwKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBrQmlkaV9SVEw6IGxpbmVEaXIgPSAxOyBicmVhazsgLy8gbm8gSUNVIGNvbnN0YW50LCBjYW5vbmljYWwgUlRMIGxldmVsCisgICAgICAgICAgICAgICAgICAgIGNhc2Uga0JpZGlfRGVmYXVsdF9MVFI6IGxpbmVEaXIgPSBVQklESV9ERUZBVUxUX0xUUjsgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2Uga0JpZGlfRGVmYXVsdF9SVEw6IGxpbmVEaXIgPSBVQklESV9ERUZBVUxUX1JUTDsgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBVQmlEaSogYmlkaSA9IHViaWRpX29wZW4oKTsKKyAgICAgICAgICAgICAgICAgICAgdWJpZGlfc2V0UGFyYShiaWRpLCB0ZXh0LCBsZW4sIGxpbmVEaXIsIE5VTEwsICZzdGF0dXMpOworICAgICAgICAgICAgICAgICAgICBpZiAoVV9TVUNDRVNTKHN0YXR1cykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpciA9IHViaWRpX2dldFBhcmFMZXZlbChiaWRpKSAmIDB4MTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaW50IHJjID0gdWJpZGlfY291bnRSdW5zKGJpZGksICZzdGF0dXMpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFVfU1VDQ0VTUyhzdGF0dXMpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBzdGFydDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMl90IGxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBVQmlEaURpcmVjdGlvbiBkaXI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgamNoYXIgKmJ1ZmZlciA9IE5VTEw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCByYzsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpciA9IHViaWRpX2dldFZpc3VhbFJ1bihiaWRpLCBpLCAmc3RhcnQsICZsZW5ndGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYWtlIHNoYXBpbmcsIGV4Y2VwdCBpdCBkb2Vzbid0IHNoYXBlLCBqdXN0IG1pcnJvcnMgYW5kIHJldmVyc2VzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVzZSBoYXJmYnV6eiB3aGVuIGF2YWlsYWJsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlyID09IFVCSURJX1JUTCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xlbiArPSB1YmlkaV93cml0ZVJldmVyc2UodGV4dCArIHN0YXJ0LCBsZW5ndGgsIHNoYXBlZCArIHNsZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGgsIFJUTF9PUFRTLCAmc3RhdHVzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyArK2kpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFwZWRbc2xlbiArIGldID0gdGV4dFtzdGFydCArIGldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xlbiArPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB1YmlkaV9jbG9zZShiaWRpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICBsZW4gPSBzaGFwZVJ0bFRleHRfXyh0ZXh0LCAwLCBsZW4sIGxlbiwgc2hhcGVkLCBzdGF0dXMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmICghVV9TVUNDRVNTKHN0YXR1cykpIHsKKyAgICAgICAgICAgIGNoYXIgYnVmZmVyWzM1XTsKKyAgICAgICAgICAgIHNwcmludGYoYnVmZmVyLCAiRHJhd1RleHQgYmlkaSBlcnJvciAlZCIsIHN0YXR1cyk7CisgICAgICAgICAgICBkb1Rocm93SUFFKGVudiwgYnVmZmVyKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGJvb2wgdHJpbUxlZnQgPSBmYWxzZTsKKyAgICAgICAgICAgIGJvb2wgdHJpbVJpZ2h0ID0gZmFsc2U7CisKKyAgICAgICAgICAgIHN3aXRjaCAoaG9yaXopIHsKKyAgICAgICAgICAgIGNhc2UgU2tQYWludDo6a0xlZnRfQWxpZ246IHRyaW1MZWZ0ID0gZGlyICYga0RpcmVjdGlvbl9NYXNrOyBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2tQYWludDo6a0NlbnRlcl9BbGlnbjogdHJpbUxlZnQgPSB0cmltUmlnaHQgPSB0cnVlOyBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU2tQYWludDo6a1JpZ2h0X0FsaWduOiB0cmltUmlnaHQgPSAhKGRpciAmIGtEaXJlY3Rpb25fTWFzayk7CisgICAgICAgICAgICBkZWZhdWx0OiBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNvbnN0IGpjaGFyKiB3b3JrVGV4dCA9IHNoYXBlZCA/IHNoYXBlZCA6IHRleHQ7CisgICAgICAgICAgICBjb25zdCBqY2hhciogd29ya0xpbWl0ID0gd29ya1RleHQgKyBsZW47CisKKyAgICAgICAgICAgIGlmICh0cmltTGVmdCkgeworICAgICAgICAgICAgICAgIHdoaWxlICh3b3JrVGV4dCA8IHdvcmtMaW1pdCAmJiAqd29ya1RleHQgPT0gJyAnKSB7CisgICAgICAgICAgICAgICAgICAgICsrd29ya1RleHQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHRyaW1SaWdodCkgeworICAgICAgICAgICAgICAgIHdoaWxlICh3b3JrTGltaXQgPiB3b3JrVGV4dCAmJiAqKHdvcmtMaW1pdCAtIDEpID09ICcgJykgeworICAgICAgICAgICAgICAgICAgICAtLXdvcmtMaW1pdDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpbnQzMl90IHdvcmtCeXRlcyA9ICh3b3JrTGltaXQgLSB3b3JrVGV4dCkgPDwgMTsKKworICAgICAgICAgICAgY2FudmFzLT5kcmF3VGV4dCh3b3JrVGV4dCwgd29ya0J5dGVzLCB4XywgeV8sICpwYWludCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoc2hhcGVkKSB7CisgICAgICAgICAgICBmcmVlKHNoYXBlZCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzdGF0aWMgdm9pZCBkcmF3VGV4dF9fX0NJSUZGSVBhaW50KEpOSUVudiogZW52LCBqb2JqZWN0LCBTa0NhbnZhcyogY2FudmFzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqY2hhckFycmF5IHRleHQsIGludCBpbmRleCwgaW50IGNvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeCwgamZsb2F0IHksIGludCBmbGFncywgU2tQYWludCogcGFpbnQpIHsKKyAgICAgICAgamNoYXIqIHRleHRBcnJheSA9IGVudi0+R2V0Q2hhckFycmF5RWxlbWVudHModGV4dCwgTlVMTCk7CisgICAgICAgIGRyYXdUZXh0X18oZW52LCBjYW52YXMsIHRleHRBcnJheSArIGluZGV4LCBjb3VudCwgeCwgeSwgZmxhZ3MsIHBhaW50KTsKKyAgICAgICAgZW52LT5SZWxlYXNlQ2hhckFycmF5RWxlbWVudHModGV4dCwgdGV4dEFycmF5LCBKTklfQUJPUlQpOworICAgIH0KKworICAgIHN0YXRpYyB2b2lkIGRyYXdUZXh0X19TdHJpbmdJSUZGSVBhaW50KEpOSUVudiogZW52LCBqb2JqZWN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2tDYW52YXMqIGNhbnZhcywganN0cmluZyB0ZXh0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LCBpbnQgZW5kLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0IHgsIGpmbG9hdCB5LCBpbnQgZmxhZ3MsIFNrUGFpbnQqIHBhaW50KSB7CisgICAgICAgIGNvbnN0IGpjaGFyKiB0ZXh0QXJyYXkgPSBlbnYtPkdldFN0cmluZ0NoYXJzKHRleHQsIE5VTEwpOworICAgICAgICBkcmF3VGV4dF9fKGVudiwgY2FudmFzLCB0ZXh0QXJyYXkgKyBzdGFydCwgZW5kIC0gc3RhcnQsIHgsIHksIGZsYWdzLCBwYWludCk7CisgICAgICAgIGVudi0+UmVsZWFzZVN0cmluZ0NoYXJzKHRleHQsIHRleHRBcnJheSk7CisgICAgfQorCisgICAgLy8gRHJhd3MgYSB1bmlkaXJlY3Rpb25hbCBydW4gb2YgdGV4dC4KKyAgICBzdGF0aWMgdm9pZCBkcmF3VGV4dFJ1bl9fKEpOSUVudiogZW52LCBTa0NhbnZhcyogY2FudmFzLCBjb25zdCBqY2hhciogY2hhcnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IHN0YXJ0LCBqaW50IGNvdW50LCBqaW50IGNvbnRleHRDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4LCBqZmxvYXQgeSwgaW50IGZsYWdzLCBTa1BhaW50KiBwYWludCkgeworCisgICAgICAgIFNrU2NhbGFyIHhfID0gU2tGbG9hdFRvU2NhbGFyKHgpOworICAgICAgICBTa1NjYWxhciB5XyA9IFNrRmxvYXRUb1NjYWxhcih5KTsKKworICAgICAgICB1aW50OF90IHJ0bCA9IGZsYWdzICYgMHgxOworICAgICAgICBpZiAocnRsKSB7CisgICAgICAgICAgICBqY2hhciBjb250ZXh0W2NvbnRleHRDb3VudF07CisgICAgICAgICAgICBVRXJyb3JDb2RlIHN0YXR1cyA9IFVfWkVST19FUlJPUjsKKyAgICAgICAgICAgIGNvdW50ID0gc2hhcGVSdGxUZXh0X18oY2hhcnMsIHN0YXJ0LCBjb3VudCwgY29udGV4dENvdW50LCBjb250ZXh0LCBzdGF0dXMpOworICAgICAgICAgICAgaWYgKFVfU1VDQ0VTUyhzdGF0dXMpKSB7CisgICAgICAgICAgICAgICAgY2FudmFzLT5kcmF3VGV4dChjb250ZXh0LCBjb3VudCA8PCAxLCB4XywgeV8sICpwYWludCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGRvVGhyb3dJQUUoZW52LCAic2hhcGluZyBlcnJvciIpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgY2FudmFzLT5kcmF3VGV4dChjaGFycyArIHN0YXJ0LCBjb3VudCA8PCAxLCB4XywgeV8sICpwYWludCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzdGF0aWMgdm9pZCBkcmF3VGV4dFJ1bl9fX0NJSUlJRkZJUGFpbnQoCisgICAgICAgIEpOSUVudiogZW52LCBqb2JqZWN0LCBTa0NhbnZhcyogY2FudmFzLCBqY2hhckFycmF5IHRleHQsIGludCBpbmRleCwKKyAgICAgICAgaW50IGNvdW50LCBpbnQgY29udGV4dEluZGV4LCBpbnQgY29udGV4dENvdW50LAorICAgICAgICBqZmxvYXQgeCwgamZsb2F0IHksIGludCBmbGFncywgU2tQYWludCogcGFpbnQpIHsKKworICAgICAgICBqY2hhciogY2hhcnMgPSBlbnYtPkdldENoYXJBcnJheUVsZW1lbnRzKHRleHQsIE5VTEwpOworICAgICAgICBkcmF3VGV4dFJ1bl9fKGVudiwgY2FudmFzLCBjaGFycyArIGNvbnRleHRJbmRleCwgaW5kZXggLSBjb250ZXh0SW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgY291bnQsIGNvbnRleHRDb3VudCwgeCwgeSwgZmxhZ3MsIHBhaW50KTsKKyAgICAgICAgZW52LT5SZWxlYXNlQ2hhckFycmF5RWxlbWVudHModGV4dCwgY2hhcnMsIEpOSV9BQk9SVCk7CisgICAgfQorCisgICAgc3RhdGljIHZvaWQgZHJhd1RleHRSdW5fX1N0cmluZ0lJSUlGRklQYWludCgKKyAgICAgICAgSk5JRW52KiBlbnYsIGpvYmplY3Qgb2JqLCBTa0NhbnZhcyogY2FudmFzLCBqc3RyaW5nIHRleHQsIGppbnQgc3RhcnQsCisgICAgICAgIGppbnQgZW5kLCBqaW50IGNvbnRleHRTdGFydCwgamludCBjb250ZXh0RW5kLAorICAgICAgICBqZmxvYXQgeCwgamZsb2F0IHksIGppbnQgZmxhZ3MsIFNrUGFpbnQqIHBhaW50KSB7CisKKyAgICAgICAgamludCBjb3VudCA9IGVuZCAtIHN0YXJ0OworICAgICAgICBqaW50IGNvbnRleHRDb3VudCA9IGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQ7CisgICAgICAgIGNvbnN0IGpjaGFyKiBjaGFycyA9IGVudi0+R2V0U3RyaW5nQ2hhcnModGV4dCwgTlVMTCk7CisgICAgICAgIGRyYXdUZXh0UnVuX18oZW52LCBjYW52YXMsIGNoYXJzICsgY29udGV4dFN0YXJ0LCBzdGFydCAtIGNvbnRleHRTdGFydCwKKyAgICAgICAgICAgICAgICAgICAgICBjb3VudCwgY29udGV4dENvdW50LCB4LCB5LCBmbGFncywgcGFpbnQpOworICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdDaGFycyh0ZXh0LCBjaGFycyk7CisgICAgfQorCiAgICAgc3RhdGljIHZvaWQgZHJhd1Bvc1RleHRfX19DSUlfRlBhaW50KEpOSUVudiogZW52LCBqb2JqZWN0LCBTa0NhbnZhcyogY2FudmFzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqY2hhckFycmF5IHRleHQsIGludCBpbmRleCwgaW50IGNvdW50LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXRBcnJheSBwb3MsIFNrUGFpbnQqIHBhaW50KSB7CkBAIC04MDQsNyArMTAwMSw3IEBACiAgICAgICAgIH0KICAgICAgICAgZGVsZXRlW10gcG9zUHRyOwogICAgIH0KLSAKKwogICAgIHN0YXRpYyB2b2lkIGRyYXdQb3NUZXh0X19TdHJpbmdfRlBhaW50KEpOSUVudiogZW52LCBqb2JqZWN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNrQ2FudmFzKiBjYW52YXMsIGpzdHJpbmcgdGV4dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXRBcnJheSBwb3MsIFNrUGFpbnQqIHBhaW50KSB7CkBAIC04MjcsNyArMTAyNCw3IEBACiAgICAgICAgIH0KICAgICAgICAgZGVsZXRlW10gcG9zUHRyOwogICAgIH0KLSAKKwogICAgIHN0YXRpYyB2b2lkIGRyYXdUZXh0T25QYXRoX19fQ0lJUGF0aEZGUGFpbnQoSk5JRW52KiBlbnYsIGpvYmplY3QsCiAgICAgICAgICAgICAgICAgICAgICAgICBTa0NhbnZhcyogY2FudmFzLCBqY2hhckFycmF5IHRleHQsIGludCBpbmRleCwgaW50IGNvdW50LAogICAgICAgICAgICAgICAgIFNrUGF0aCogcGF0aCwgamZsb2F0IGhPZmZzZXQsIGpmbG9hdCB2T2Zmc2V0LCBTa1BhaW50KiBwYWludCkgewpAQCAtODM3LDcgKzEwMzQsNyBAQAogICAgICAgICAgICAgICAgICAgICBTa0Zsb2F0VG9TY2FsYXIoaE9mZnNldCksIFNrRmxvYXRUb1NjYWxhcih2T2Zmc2V0KSwgKnBhaW50KTsKICAgICAgICAgZW52LT5SZWxlYXNlQ2hhckFycmF5RWxlbWVudHModGV4dCwgdGV4dEFycmF5LCAwKTsKICAgICB9Ci0gCisKICAgICBzdGF0aWMgdm9pZCBkcmF3VGV4dE9uUGF0aF9fU3RyaW5nUGF0aEZGUGFpbnQoSk5JRW52KiBlbnYsIGpvYmplY3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2tDYW52YXMqIGNhbnZhcywganN0cmluZyB0ZXh0LCBTa1BhdGgqIHBhdGgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0IGhPZmZzZXQsIGpmbG9hdCB2T2Zmc2V0LCBTa1BhaW50KiBwYWludCkgewpAQCAtODQ3LDcgKzEwNDQsNyBAQAogICAgICAgICAgICAgICAgICAgICBTa0Zsb2F0VG9TY2FsYXIoaE9mZnNldCksIFNrRmxvYXRUb1NjYWxhcih2T2Zmc2V0KSwgKnBhaW50KTsKICAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nQ2hhcnModGV4dCwgdGV4dF8pOwogICAgIH0KLSAKKwogICAgIHN0YXRpYyBib29sIGdldENsaXBCb3VuZHMoSk5JRW52KiBlbnYsIGpvYmplY3QsIFNrQ2FudmFzKiBjYW52YXMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGJvdW5kcykgewogICAgICAgICBTa1JlY3QgICByOwpAQCAtOTQwLDE5ICsxMTM3LDIwIEBACiAgICAgICAgICh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bHVkZSAidW5pY29kZS91c2hhcGUuaCIKKworLy8gdGVtcG9yYXJ5IGZvciBkZWJ1Z2dpbmcKKyNpbmNsdWRlIDx1dGlscy9Mb2cuaD4KIAogbmFtZXNwYWNlIGFuZHJvaWQgewogCkBAIC01Nyw2ICs2MSw5IEBACiAKIGNsYXNzIFNrUGFpbnRHbHVlIHsKIHB1YmxpYzoKKyAgICBlbnVtIE1vdmVPcHQgeworICAgICAgICBBRlRFUiwgQVRfT1JfQUZURVIsIEJFRk9SRSwgQVRfT1JfQkVGT1JFLCBBVAorICAgIH07CiAKICAgICBzdGF0aWMgdm9pZCBmaW5hbGl6ZXIoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosIFNrUGFpbnQqIG9iaikgewogICAgICAgICBkZWxldGUgb2JqOwpAQCAtMzk1LDcgKzQwMiwxODQgQEAKICAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nQ2hhcnModGV4dCwgdGV4dEFycmF5KTsKICAgICAgICAgcmV0dXJuIGNvdW50OwogICAgIH0KLSAgICAKKworICAgIHN0YXRpYyBqZmxvYXQgZG9UZXh0UnVuQWR2YW5jZXMoSk5JRW52ICplbnYsIFNrUGFpbnQgKnBhaW50LCBjb25zdCBqY2hhciAqdGV4dCwgamludCBzdGFydCwgamludCBjb3VudCwgamludCBjb250ZXh0Q291bnQsIGppbnQgZmxhZ3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXRBcnJheSBhZHZhbmNlcywgamludCBhZHZhbmNlc0luZGV4KSB7CisgICAgICAgIGpmbG9hdCBhZHZhbmNlc0FycmF5W2NvdW50XTsKKyAgICAgICAgamNoYXIgYnVmZmVyW2NvbnRleHRDb3VudF07CisKKyAgICAgICAgU2tTY2FsYXIqIHNjYWxhckFycmF5ID0gKFNrU2NhbGFyICopYWR2YW5jZXNBcnJheTsKKyAgICAgICAgamZsb2F0IHRvdGFsQWR2YW5jZSA9IDA7CisKKyAgICAgICAgLy8gdGhpcyBpcyB3aGVyZSB3ZSdkIGNhbGwgaGFyZmJ1enoKKyAgICAgICAgLy8gZm9yIG5vdyB3ZSBqdXN0IHVzZSB1c2hhcGUuYworCisgICAgICAgIGludCB3aWR0aHM7CisgICAgICAgIGlmIChmbGFncyAmIDB4MSkgeyAvLyBydGwsIGNhbGwgYXJhYmljIHNoYXBpbmcgaW4gY2FzZQorICAgICAgICAgICAgVUVycm9yQ29kZSBzdGF0dXMgPSBVX1pFUk9fRVJST1I7CisgICAgICAgICAgICAvLyBVc2UgZml4ZWQgbGVuZ3RoIHNpbmNlIHdlIG5lZWQgdG8ga2VlcCBzdGFydCBhbmQgY291bnQgdmFsaWQKKyAgICAgICAgICAgIHVfc2hhcGVBcmFiaWModGV4dCwgY29udGV4dENvdW50LCBidWZmZXIsIGNvbnRleHRDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgVV9TSEFQRV9MRU5HVEhfRklYRURfU1BBQ0VTX05FQVIgfAorICAgICAgICAgICAgICAgICAgICAgICAgICBVX1NIQVBFX1RFWFRfRElSRUNUSU9OX0xPR0lDQUwgfCBVX1NIQVBFX0xFVFRFUlNfU0hBUEUgfAorICAgICAgICAgICAgICAgICAgICAgICAgICBVX1NIQVBFX1hfTEFNQUxFRl9TVUJfQUxURVJOQVRFLCAmc3RhdHVzKTsKKyAgICAgICAgICAgIC8vIHdlIHNob3VsZG4ndCBmYWlsIHVubGVzcyB0aGVyZSdzIGFuIG91dCBvZiBtZW1vcnkgY29uZGl0aW9uLAorICAgICAgICAgICAgLy8gaW4gd2hpY2ggY2FzZSB3ZSdyZSBob3NlZCBhbnl3YXkKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSBzdGFydCwgZSA9IGkgKyBjb3VudDsgaSA8IGU7ICsraSkgeworICAgICAgICAgICAgICBpZiAoYnVmZmVyW2ldID09IDB4ZmZmZikgeworICAgICAgICAgICAgICAgIGJ1ZmZlcltpXSA9IDB4MjAwYjsgLy8gemVyby13aWR0aC1zcGFjZSBmb3Igc2tpYQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICB3aWR0aHMgPSBwYWludC0+Z2V0VGV4dFdpZHRocyhidWZmZXIgKyBzdGFydCwgY291bnQgPDwgMSwgc2NhbGFyQXJyYXkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgd2lkdGhzID0gcGFpbnQtPmdldFRleHRXaWR0aHModGV4dCArIHN0YXJ0LCBjb3VudCA8PCAxLCBzY2FsYXJBcnJheSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAod2lkdGhzIDwgY291bnQpIHsKKyAgICAgICAgICAgIC8vIFNraWEgb3BlcmF0ZXMgb24gY29kZSBwb2ludHMsIG5vdCBjb2RlIHVuaXRzLCBzbyBzdXJyb2dhdGUgcGFpcnMgcmV0dXJuIG9ubHkKKyAgICAgICAgICAgIC8vIG9uZSB2YWx1ZS4gRXhwYW5kIHRoZSByZXN1bHQgc28gd2UgaGF2ZSBvbmUgdmFsdWUgcGVyIFVURi0xNiBjb2RlIHVuaXQuCisKKyAgICAgICAgICAgIC8vIE5vdGUsIHNraWEncyBnZXRUZXh0V2lkdGggZ2V0cyBjb25mdXNlZCBpZiBpdCBlbmNvdW50ZXJzIGEgc3Vycm9nYXRlIHBhaXIsCisgICAgICAgICAgICAvLyBsZWF2aW5nIHRoZSByZW1haW5pbmcgd2lkdGhzIHplcm8uICBOb3QgbmljZS4KKyAgICAgICAgICAgIGNvbnN0IGpjaGFyICpjaGFycyA9IHRleHQgKyBzdGFydDsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwLCBwID0gMDsgaSA8IHdpZHRoczsgKytpKSB7CisgICAgICAgICAgICAgICAgdG90YWxBZHZhbmNlICs9IGFkdmFuY2VzQXJyYXlbcCsrXSA9IFNrU2NhbGFyVG9GbG9hdChzY2FsYXJBcnJheVtpXSk7CisgICAgICAgICAgICAgICAgaWYgKHAgPCBjb3VudCAmJiBjaGFyc1twXSA+PSAweGRjMDAgJiYgY2hhcnNbcF0gPCAweGUwMDAgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJzW3AtMV0gPj0gMHhkODAwICYmIGNoYXJzW3AtMV0gPCAweGRjMDApIHsKKyAgICAgICAgICAgICAgICAgICAgYWR2YW5jZXNBcnJheVtwKytdID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICB0b3RhbEFkdmFuY2UgKz0gYWR2YW5jZXNBcnJheVtpXSA9IFNrU2NhbGFyVG9GbG9hdChzY2FsYXJBcnJheVtpXSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoYWR2YW5jZXMgIT0gTlVMTCkgeworICAgICAgICAgICAgZW52LT5TZXRGbG9hdEFycmF5UmVnaW9uKGFkdmFuY2VzLCBhZHZhbmNlc0luZGV4LCBjb3VudCwgYWR2YW5jZXNBcnJheSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRvdGFsQWR2YW5jZTsKKyAgICB9CisKKyAgICBzdGF0aWMgZmxvYXQgZ2V0VGV4dFJ1bkFkdmFuY2VzX19fQ0lJSUlJX0ZJKEpOSUVudiogZW52LCBqb2JqZWN0IGNsYXp6LCBTa1BhaW50KiBwYWludCwKKyAgICAgICAgICAgIGpjaGFyQXJyYXkgdGV4dCwgamludCBpbmRleCwgamludCBjb3VudCwgamludCBjb250ZXh0SW5kZXgsIGppbnQgY29udGV4dENvdW50LAorICAgICAgICAgICAgamludCBmbGFncywgamZsb2F0QXJyYXkgYWR2YW5jZXMsIGppbnQgYWR2YW5jZXNJbmRleCkgeworICAgICAgICBqY2hhciogdGV4dEFycmF5ID0gZW52LT5HZXRDaGFyQXJyYXlFbGVtZW50cyh0ZXh0LCBOVUxMKTsKKyAgICAgICAgamZsb2F0IHJlc3VsdCA9IGRvVGV4dFJ1bkFkdmFuY2VzKGVudiwgcGFpbnQsIHRleHRBcnJheSArIGNvbnRleHRJbmRleCwKKyAgICAgICAgICAgIGluZGV4IC0gY29udGV4dEluZGV4LCBjb3VudCwgY29udGV4dENvdW50LCBmbGFncywgYWR2YW5jZXMsIGFkdmFuY2VzSW5kZXgpOworICAgICAgICBlbnYtPlJlbGVhc2VDaGFyQXJyYXlFbGVtZW50cyh0ZXh0LCB0ZXh0QXJyYXksIEpOSV9BQk9SVCk7CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgc3RhdGljIGZsb2F0IGdldFRleHRSdW5BZHZhbmNlc19fU3RyaW5nSUlJSUlfRkkoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosIFNrUGFpbnQqIHBhaW50LAorICAgICAgICAgICAganN0cmluZyB0ZXh0LCBqaW50IHN0YXJ0LCBqaW50IGVuZCwgamludCBjb250ZXh0U3RhcnQsIGppbnQgY29udGV4dEVuZCwgamludCBmbGFncywKKyAgICAgICAgICAgIGpmbG9hdEFycmF5IGFkdmFuY2VzLCBqaW50IGFkdmFuY2VzSW5kZXgpIHsKKyAgICAgICAgY29uc3QgamNoYXIqIHRleHRBcnJheSA9IGVudi0+R2V0U3RyaW5nQ2hhcnModGV4dCwgTlVMTCk7CisgICAgICAgIGpmbG9hdCByZXN1bHQgPSBkb1RleHRSdW5BZHZhbmNlcyhlbnYsIHBhaW50LCB0ZXh0QXJyYXkgKyBjb250ZXh0U3RhcnQsCisgICAgICAgICAgICBzdGFydCAtIGNvbnRleHRTdGFydCwgZW5kIC0gc3RhcnQsIGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQsIGZsYWdzLCBhZHZhbmNlcywKKyAgICAgICAgICAgIGFkdmFuY2VzSW5kZXgpOworICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdDaGFycyh0ZXh0LCB0ZXh0QXJyYXkpOworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0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3MgYW4gb3V0IG9mIG1lbW9yeSBjb25kaXRpb24sCisgICAgICAgICAgICAvLyBpbiB3aGljaCBjYXNlIHdlJ3JlIGhvc2VkIGFueXdheQorICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgKytpKSB7CisgICAgICAgICAgICAgIGlmIChidWZmZXJbaV0gPT0gMHhmZmZmKSB7CisgICAgICAgICAgICAgICAgYnVmZmVyW2ldID0gMHgyMDBiOyAvLyB6ZXJvLXdpZHRoLXNwYWNlIGZvciBza2lhCisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHdpZHRocyA9IHBhaW50LT5nZXRUZXh0V2lkdGhzKGJ1ZmZlciwgY291bnQgPDwgMSwgc2NhbGFyQXJyYXkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgd2lkdGhzID0gcGFpbnQtPmdldFRleHRXaWR0aHModGV4dCArIHN0YXJ0LCBjb3VudCA8PCAxLCBzY2FsYXJBcnJheSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAod2lkdGhzIDwgY291bnQpIHsKKyAgICAgICAgICAgIC8vIFNraWEgb3BlcmF0ZXMgb24gY29kZSBwb2ludHMsIG5vdCBjb2RlIHVuaXRzLCBzbyBzdXJyb2dhdGUgcGFpcnMgcmV0dXJuIG9ubHkgb25lCisgICAgICAgICAgICAvLyB2YWx1ZS4gRXhwYW5kIHRoZSByZXN1bHQgc28gd2UgaGF2ZSBvbmUgdmFsdWUgcGVyIFVURi0xNiBjb2RlIHVuaXQuCisKKyAgICAgICAgICAgIC8vIE5vdGUsIHNraWEncyBnZXRUZXh0V2lkdGggZ2V0cyBjb25mdXNlZCBpZiBpdCBlbmNvdW50ZXJzIGEgc3Vycm9nYXRlIHBhaXIsCisgICAgICAgICAgICAvLyBsZWF2aW5nIHRoZSByZW1haW5pbmcgd2lkdGhzIHplcm8uICBOb3QgbmljZS4KKyAgICAgICAgICAgIGNvbnN0IGpjaGFyICpjaGFycyA9IHRleHQgKyBzdGFydDsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSBjb3VudCwgcCA9IHdpZHRocyAtIDE7IC0taSA+IHA7KSB7CisgICAgICAgICAgICAgICAgaWYgKGNoYXJzW2ldID49IDB4ZGMwMCAmJiBjaGFyc1tpXSA8IDB4ZTAwMCAmJgorICAgICAgICAgICAgICAgICAgICAgICAgY2hhcnNbaS0xXSA+PSAweGQ4MDAgJiYgY2hhcnNbaS0xXSA8IDB4ZGMwMCkgeworICAgICAgICAgICAgICAgICAgICBzY2FsYXJBcnJheVtpXSA9IDA7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgIHNjYWxhckFycmF5W2ldID0gc2NhbGFyQXJyYXlbLS1wXTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBqaW50IHBvcyA9IG9mZnNldCAtIHN0YXJ0OworICAgICAgICBzd2l0Y2ggKG9wdCkgeworICAgICAgICBjYXNlIEFGVEVSOgorICAgICAgICAgIGlmIChwb3MgPCBjb3VudCkgeworICAgICAgICAgICAgcG9zICs9IDE7CisgICAgICAgICAgfQorICAgICAgICAgIC8vIGZhbGwgdGhyb3VnaAorICAgICAgICBjYXNlIEFUX09SX0FGVEVSOgorICAgICAgICAgIHdoaWxlIChwb3MgPCBjb3VudCAmJiBzY2FsYXJBcnJheVtwb3NdID09IDApIHsKKyAgICAgICAgICAgICsrcG9zOworICAgICAgICAgIH0KKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBCRUZPUkU6CisgICAgICAgICAgaWYgKHBvcyA+IDApIHsKKyAgICAgICAgICAgIC0tcG9zOworICAgICAgICAgIH0KKyAgICAgICAgICAvLyBmYWxsIHRocm91Z2gKKyAgICAgICAgY2FzZSBBVF9PUl9CRUZPUkU6CisgICAgICAgICAgd2hpbGUgKHBvcyA+IDAgJiYgc2NhbGFyQXJyYXlbcG9zXSA9PSAwKSB7CisgICAgICAgICAgICAtLXBvczsKKyAgICAgICAgICB9CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgQVQ6CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgaWYgKHNjYWxhckFycmF5W3Bvc10gPT0gMCkgeworICAgICAgICAgICAgcG9zID0gLTE7CisgICAgICAgICAgfQorICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHBvcyAhPSAtMSkgeworICAgICAgICAgIHBvcyArPSBzdGFydDsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBwb3M7CisgICAgfQorCisgICAgc3RhdGljIGppbnQgZ2V0VGV4dFJ1bkN1cnNvcl9fX0MoSk5JRW52KiBlbnYsIGpvYmplY3QgY2xhenosIFNrUGFpbnQqIHBhaW50LCBqY2hhckFycmF5IHRleHQsCisgICAgICAgICAgICBqaW50IGNvbnRleHRTdGFydCwgamludCBjb250ZXh0Q291bnQsIGppbnQgZmxhZ3MsIGppbnQgb2Zmc2V0LCBqaW50IGN1cnNvck9wdCkgeworICAgICAgICBqY2hhciogdGV4dEFycmF5ID0gZW52LT5HZXRDaGFyQXJyYXlFbGVtZW50cyh0ZXh0LCBOVUxMKTsKKyAgICAgICAgamludCByZXN1bHQgPSBkb1RleHRSdW5DdXJzb3IoZW52LCBwYWludCwgdGV4dEFycmF5LCBjb250ZXh0U3RhcnQsIGNvbnRleHRDb3VudCwgZmxhZ3MsCisgICAgICAgICAgICAgICAgb2Zmc2V0LCBjdXJzb3JPcHQpOworICAgICAgICBlbnYtPlJlbGVhc2VDaGFyQXJyYXlFbGVtZW50cyh0ZXh0LCB0ZXh0QXJyYXksIEpOSV9BQk9SVCk7CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgc3RhdGljIGppbnQgZ2V0VGV4dFJ1bkN1cnNvcl9fU3RyaW5nKEpOSUVudiogZW52LCBqb2JqZWN0IGNsYXp6LCBTa1BhaW50KiBw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CiAKLXN0YXRpYyBqYm9vbGVhbiBpc051bGxfbmF0aXZlKEpOSUVudiogZW52LCBqb2JqZWN0IG9iamVjdCwgamludCByb3csIGppbnQgY29sdW1uKQorYm9vbCBpc051bGxfbmF0aXZlKEN1cnNvcldpbmRvdyAqd2luZG93LCBqaW50IHJvdywgamludCBjb2x1bW4pCiB7Ci0gICAgQ3Vyc29yV2luZG93ICogd2luZG93ID0gR0VUX1dJTkRPVyhlbnYsIG9iamVjdCk7Ci1MT0dfV0lORE9XKCJDaGVja2luZyBmb3IgTlVMTCBhdCAlZCwlZCBmcm9tICVwIiwgcm93LCBjb2x1bW4sIHdpbmRvdyk7CisgICAgTE9HX1dJTkRPVygiQ2hlY2tpbmcgZm9yIE5VTEwgYXQgJWQsJWQgZnJvbSAlcCIsIHJvdywgY29sdW1uLCB3aW5kb3cpOwogCiAgICAgYm9vbCBpc051bGw7CiAgICAgaWYgKHdpbmRvdy0+Z2V0TnVsbChyb3csIGNvbHVtbiwgJmlzTnVsbCkpIHsKQEAgLTY1Miw2ICs1ODcsMjYgQEAKICAgICB3aW5kb3ctPmZyZWVMYXN0Um93KCk7CiB9CiAKK3N0YXRpYyBqaW50IGdldFR5cGVfbmF0aXZlKEpOSUVudiogZW52LCBqb2JqZWN0IG9iamVjdCwgamludCByb3csIGppbnQgY29sdW1uKQoreworICAgIGludDMyX3QgZXJyOworICAgIEN1cnNvcldpbmRvdyAqIHdpbmRvdyA9IEdFVF9XSU5ET1coZW52LCBvYmplY3QpOworICAgIExPR19XSU5ET1coInJldHVybmluZyBjb2x1bW4gdHlwZSBhZmZpbml0eSBmb3IgJWQsJWQgZnJvbSAlcCIsIHJvdywgY29sdW1uLCB3aW5kb3cpOworCisgICAgaWYgKGlzTnVsbF9uYXRpdmUod2luZG93LCByb3csIGNvbHVtbikpIHsKKyAgICAgIHJldHVybiBGSUVMRF9UWVBFX05VTEw7CisgICAgfQorCisgICAgZmllbGRfc2xvdF90IGZpZWxkOworICAgIGVyciA9IH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lcnR5Q2hhbmdlZDsKKwogdHlwZWRlZiBldmVudF9sb29wX25hdGl2ZV9kYXRhX3QgbmF0aXZlX2RhdGFfdDsKIAogI2RlZmluZSBFVkVOVF9MT09QX1JFRlMgMTAKQEAgLTExNiw2ICsxMTgsOSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0kpViIpOwogICAgIG1ldGhvZF9vbkRpc3BsYXlQYXNza2V5ID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgIm9uRGlzcGxheVBhc3NrZXkiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0lJKVYiKTsKKyAgICBtZXRob2Rfb25JbnB1dERldmljZVByb3BlcnR5Q2hhbmdlZCA9IGVudi0+R2V0TWV0aG9kSUQoY2xhenosICJvbklucHV0RGV2aWNlUHJvcGVydHlDaGFuZ2VkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIoTGphdmEvbGFuZy9TdHJpbmc7W0xqYXZhL2xhbmcvU3RyaW5nOylWIik7CisKIAogICAgIGZpZWxkX21OYXRpdmVEYXRhID0gZW52LT5HZXRGaWVsZElEKGNsYXp6LCAibU5hdGl2ZURhdGEiLCAiSSIpOwogI2VuZGlmCkBAIC04NTMsNiArODU4LDIyIEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uRGV2aWNlRGlzY29ubmVjdFJlcXVlc3RlZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYtPk5ld1N0cmluZ1VURihyZW1vdGVfZGV2aWNlX3BhdGgpKTsKICAgICAgICAgZ290byBzdWNjZXNzOworICAgIH0gZWxzZSBpZiAoZGJ1c19tZXNzYWdlX2lzX3NpZ25hbChtc2csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmcuYmx1ZXouSW5wdXQiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUHJvcGVydHlDaGFuZ2VkIikpIHsKKworICAgICAgICBqb2JqZWN0QXJyYXkgc3RyX2FycmF5ID0KKyAgICAgICAgICAgICAgICAgICAgcGFyc2VfaW5wdXRfcHJvcGVydHlfY2hhbmdlKGVudiwgbXNnKTsKKyAgICAgICAgaWYgKHN0cl9hcnJheSAhPSBOVUxMKSB7CisgICAgICAgICAgICBjb25zdCBjaGFyICpjX3BhdGggPSBkYnVzX21lc3NhZ2VfZ2V0X3BhdGgobXNnKTsKKyAgICAgICAgICAgIGVudi0+Q2FsbFZvaWRNZXRob2QobmF0LT5tZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kX29uSW5wdXREZXZpY2VQcm9wZXJ0eUNoYW5nZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+TmV3U3RyaW5nVVRGKGNfcGF0aCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cl9hcnJheSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBMT0dfQU5EX0ZSRUVfREJVU19FUlJPUl9XSVRIX01TRygmZXJyLCBtc2cpOworICAgICAgICB9CisgICAgICAgIGdvdG8gc3VjY2VzczsKICAgICB9CiAKICAgICByZXQgPSBhMmRwX2V2ZW50X2ZpbHRlcihtc2csIGVudik7CmRpZmYgLS1naXQgYS9jb3JlL2puaS9hbmRyb2lkX3NlcnZlcl9CbHVldG9vdGhTZXJ2aWNlLmNwcCBiL2NvcmUvam5pL2FuZHJvaWRfc2VydmVyX0JsdWV0b290aFNlcnZpY2UuY3BwCmluZGV4IDQ0MjBhY2EuLmE1MmE3NGMgMTAwNjQ0Ci0tLSBhL2NvcmUvam5pL2FuZHJvaWRfc2VydmVyX0JsdWV0b290aFNlcnZpY2UuY3BwCisrKyBiL2NvcmUvam5pL2FuZ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5WQUxJRCk7CisKKyAgICAgICAgZW52LT5SZWxlYXNlU3RyaW5nVVRGQ2hhcnMocGF0aCwgY19wYXRoKTsKKyAgICAgICAgcmV0dXJuIHJldCA/IEpOSV9UUlVFIDogSk5JX0ZBTFNFOworICAgIH0KKyNlbmRpZgorICAgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK3N0YXRpYyBqYm9vbGVhbiBkaXNjb25uZWN0SW5wdXREZXZpY2VOYXRpdmUoSk5JRW52ICplbnYsIGpvYmplY3Qgb2JqZWN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgcGF0aCkgeworICAgIExPR1YoX19GVU5DVElPTl9fKTsKKyNpZmRlZiBIQVZFX0JMVUVUT09USAorICAgIG5hdGl2ZV9kYXRhX3QgKm5hdCA9IGdldF9uYXRpdmVfZGF0YShlbnYsIG9iamVjdCk7CisgICAgaWYgKG5hdCkgeworICAgICAgICBjb25zdCBjaGFyICpjX3BhdGggPSBlbnYtPkdldFN0cmluZ1VURkNoYXJzKHBhdGgsIE5VTEwpOworCisgICAgICAgIGJvb2wgcmV0ID0gZGJ1c19mdW5jX2FyZ3NfYXN5bmMoZW52LCBuYXQtPmNvbm4sIC0xLCBOVUxMLCBOVUxMLCBuYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjX3BhdGgsIERCVVNfSU5QVVRfSUZBQ0UsICJEaXNjb25uZWN0IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCVVNfVFlQRV9JTlZBTElEKTsKKworICAgICAgICBlbnYtPlJlbGVhc2VTdHJpbmdVVEZDaGFycyhwYXRoLCBjX3BhdGgpOworICAgICAgICByZXR1cm4gcmV0ID8gSk5JX1RSVUUgOiBKTklfRkFMU0U7CisgICAgfQorI2VuZGlmCisgICAgcmV0dXJuIEpOSV9GQUxTRTsKK30KKwogc3RhdGljIEpOSU5hdGl2ZU1ldGhvZCBzTWV0aG9kc1tdID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wgICAgICAgICAgICAgICIoSUkpSSIsICAgICAgICAgICAgICAodm9pZCopIGFuZHJvaWRfdmlld19HTEVTMjBDYW52YXNfc2F2ZSB9LAorICAgIHsgICAiblJlc3RvcmUiLCAgICAgICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMENhbnZhc19yZXN0b3JlIH0sCisgICAgeyAgICJuUmVzdG9yZVRvQ291bnQiLCAgICAiKElJKVYiLCAgICAgICAgICAgICAgKHZvaWQqKSBhbmRyb2lkX3ZpZXdfR0xFUzIwQ2FudmFzX3Jlc3RvcmVUb0NvdW50IH0sCisgICAgeyAgICJuR2V0U2F2ZUNvdW50IiwgICAgICAiKEkpSSIsICAgICAgICAgICAgICAgKHZvaWQqKSBhbmRyb2lkX3ZpZXdfR0xFUzIwQ2FudmFzX2dldFNhdmVDb3VudCB9LAorCisgICAgeyAgICJuU2F2ZUxheWVyIiwgICAgICAgICAiKElGRkZGSUkpSSIsICAgICAgICAgKHZvaWQqKSBhbmRyb2lkX3ZpZXdfR0xFUzIwQ2FudmFzX3NhdmVMYXllciB9LAorICAgIHsgICAiblNhdmVMYXllckFscGhhIiwgICAgIihJRkZGRklJKUkiLCAgICAgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMENhbnZhc19zYXZlTGF5ZXJBbHBoYSB9LAorCisgICAgeyAgICJuUXVpY2tSZWplY3QiLCAgICAgICAiKElGRkZGSSlaIiwgICAgICAgICAgKHZvaWQqKSBhbmRyb2lkX3ZpZXdfR0xFUzIwQ2FudmFzX3F1aWNrUmVqZWN0IH0sCisgICAgeyAgICJuQ2xpcFJlY3QiLCAgICAgICAgICAiKElGRkZGKVoiLCAgICAgICAgICAgKHZvaWQqKSBhbmRyb2lkX3ZpZXdfR0xFUzIwQ2FudmFzX2NsaXBSZWN0RiB9LAorICAgIHsgICAibkNsaXBSZWN0IiwgICAgICAgICAgIihJSUlJSSlaIiwgICAgICAgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMENhbnZhc19jbGlwUmVjdCB9LAorCisgICAgeyAgICJuVHJhbnNsYXRlIiwgICAgICAgICAiKElGRilWIiwgICAgICAgICAgICAgKHZvaWQqKSBhbmRyb2lkX3ZpZXdfR0xFUzIwQ2FudmFzX3RyYW5zbGF0ZSB9LAorICAgIHsgICAiblJvdGF0ZSIsICAgICAgICAgICAgIihJRilWIiwgICAgICAgICAgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMENhbnZhc19yb3RhdGUgfSwKKyAgICB7ICAgIm5TY2FsZSIsICAgICAgICAgICAgICIoSUZGKVYiLCAgICAgICAgICAgICAodm9pZCopIGFuZHJvaWRfdmlld19HTEVTMjBDYW52YXNfc2NhbGUgfSwKKworICAgIHsgICAiblNldE1hdHJpeCIsICAgICAgICAgIihJSSlWIiwgICAgICAgICAgICAgICh2b2lkKikgYW5kcm9pZF92aWV3X0dMRVMyMENhbnZhc19zZXRNYXRyaXggfSwKKyAgICB7ICAgIm5HZXRNYXRyaXgiLCAgICAgICAgICIoSUkpViIsICAgICAgICAgICAgICAodm9pZCopIGFuZHJvaWRfdmlld19HTEVTMjBDYW52YXNfZ2V0TWF0cml4IH0sCisgICAgeyAgICJuQ29uY2F0TWF0cml4IiwgICAgICAiKElJKVYiLCAgICAgICAgICAgICAgKHZvaWQqKSBhbmRyb2lkX3ZpZXdfR0xFUzIwQ2FudmFzX2NvbmNhdE1hdHJpeCB9LAorCisgICAgeyAgICJuRHJhd0JpdG1hcCIsICAgICAgICAiKElJRkZJSUlJKVYiLCAgICAgICAgKHZvaWQqKSBhbmRyb2lkX3ZpZXdfR0xFUzIwQ2FudmFzX2RyYXdCaXRtYXAgfSwKKyAgICB7ICAgIm5EcmF3Qml0bWFwIiwgICAgICAgICIoSUlGRkZGRkZGRklJSUlJKVYiLCAodm9pZCopIGFuZHJvaWRfdmlld19HTEVTMjBDYW52YXNfZHJhd0JpdG1hcFJlY3QgfSw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XI1dGkKKy5tMmEycgorLm1lMgorLm1lcjNjCisubWU1dGVyCisubWUxdGUKKy5tMmlzMQorLm1pczR0NWkKKy5tb24zZQorLjFtbworLm1vMm4KKy5tbzNybworLm1vMnIKKy5tdTV0YQorLjFtdQorLm11MnRhNWIKKy5uaTRjCisub2QyCisub2QxZDUKKy5vZjV0ZQorLm8yZnQKKy5vcjVhMXRvCisubzFyYQorLm9yM2MKKy5vcjFkCisub3IzdAorLm9zMworLm9zNHRsCisuNG90aDMKKy5vdXQzCisub3UyCisucGVkNWFsCisuMnAyZWQKKy5wMmUyZDJhCisucGU1dGUKKy5wZTJ0CisucGU1dGl0CisucDJpNGU0CisucGlvNW40CisuM3AyaTFvCisucGkydAorLnByZTNtCisucHIyCisucmE0YworLnJhbjR0CisucmEybgorLnJhdGlvNW4xYQorLnJhdGlvMm40CisucmExdDJpbworLnJlZTIKKy5yZTVtaXQKKy5yZXMyCisucmU1c3RhdAorLnJlczJ0CisucmVzMXRhCisucjJpNGcKKy5yaTJ0NXUKKy5ybzRxCisucm9zNXQKKy5yb3c1ZAorLnJ1NGQKKy4zczRjMmkzZTQKKy5zMWNpCisuNXNlMmwyZjUKKy5zZWwxbDUKKy5zZTJuCisuc2U1cjJpZTQKKy5zZXIxaQorLnMyaDIKKy5zaTIKKy5zM2luZzQKKy4yczFpbgorLnN0NAorLnN0YTViMmwyCisuczF0YQorLnMydGFiCisuczR5MgorLjF0YTQKKy50ZTQKKy4zdGVuNWEybgorLnRlMW5hCisudGgyCisudGkyCisudGlsNAorLnRpMW01bzUKKy4xdGltCisudGluZzQKKy4ydDFpbgorLnQ0aTRuNWsyCisudG8xbjRhCisuMXRvCisudG8ybgorLnRvNHAKKy50b3A1aQorLnRvMnU1cworLnRvdTIKKy50cmliNXV0CisudHI0aWIKKy51MW4xYQorLnVuM2NlCisudW5kZXI1CisudW4xZGUKKy51Mm4xZQorLnU0bjVrMgorLnVuNW8KKy51bjN1NAorLnVwMworLnVyZTMKKy51czVhMgorLjJ1cworLnZlbjRkZQorLnZlNXIxYQorLndpbDVpCisud2kyCisud2lsMgorLnllNAorNGFiLgorYTViYWwKK2E1YmEybgorYWJlMgorYWI1ZXJkCithYjJpNWEKK2FiNWkydDVhYgorYWJpMnQKK2FiaTF0YQorYWI1bGF0CithYjJsMgorYWI1bzVsMWl6CithYm9sMmkKKzRhYnIKK2FiNXJvZworYWIzdWwKK2E0YzJhMnIKK2ExY2EKK2FjNWFyZAorYWM1YXJvCithNWNlb3UyCithYzFlcgorYTVjaGU0dAorYTJjaAorYWNoZTIKKzRhMmNpCithM2MyaWU0CithMmMxaW4KK2EzYzJpbworYWM1cm9iCithY3Q1aWYyCithMmMxdAorYWMzdWwKK2FjNHVtCithMmQKK2FkNGQxaW4KK2FkMWQ0CithZDVlci4KKzJhZGkKK2EzZDRpM2EKK2FkM2kxY2EKK2FkaTRlcgorYWQyaWU0CithM2QyaW8KK2EzZGl0CithNWRpMXUKK2FkNGxlCithZDNvdworYTFkbworYWQ1cmEybgorYTFkcgorYWQ0c3UKK2EyZDFzMgorNGExZHUKK2EzZHUyYworYWQ1dW0KK2FlNHIKK2FlcjJpNGU0CithZXIxaQorYTJmCithNGYxZjQKK2E0Z2FiCithMWdhCithZ2E0bgorYWc1ZWwxbAorYTFnZTRvCis0YWc0ZXUKK2FnMWkKKzRhZzRsMgorYWcxbgorYTJnbworM2EzZzRvNGcKK2FnM28zbmkKK2FnbzJuMgorYTVndWVyCithMmd1ZQorYWc1dWwKK2E0Z3kKK2EzaGEKK2EzaGUKK2E0aDRsNAorYTNobworYWkyCithNWkxYQorYTNpYy4KK2FpNWx5CithNGk0bgorYWluNWluCithMmluaQorYTJpMW41bworYWl0NWVuCithMml0ZQorYTFqCithazFlbgorYWw1YWIKK2FsM2EyZAorYTRsMmEycgorNGFsZGk0CithMmxkCisyYWxlCithbDNlbmQKK2E0bGVudDJpCithMWxlbjF0CithNWxlNW8KK2FsMWkKK2FsNGlhLgorYWwyaTFhCithbDJpNGU0CithbDVsZXYKK2FsMWwKK2FsMmxlCis0YWxsaWMKK2FsbDJpCis0YTJsbQorYTVsb2cuCithNGx5LgorYTFseQorNGEybHlzNAorNWE1bHlzMXQKKzVhbHl0CiszYWx5egorNGExbWEKK2EybTVhYgorYW0zYWcKK2FtYTVyYQorYW0yYTJyCithbTVhc2MKK2E0bWEzdGlzCithNG01YTF0bworYW01ZXIxYQorYW0zaWMKK2FtNWlmCithbTVpMWx5CithbTFpbgorYW0yaTRubworYTJtbworYTVtbzJuCithbW9yNWkKK2FtbzJyCithbXA1ZW4KK2E0bTFwCithMm4KK2FuM2FnZQorYTFuYQorM2FuYTFseQorYTNuMmEycgorYW4zYXIzYworYW5hcjRpCithM25hdGkKK2FuMmF0Cis0YW5kCithbmRlNHMyCithbjFkZQorYW4zZGlzMQorYW4xZGwKK2FuNGRvdworYW4xZG8KK2E1bmVlCithM25lbgorYW41ZTJzdC4KK2ExbmVzCithMm5lc3QKK2EzbjRldQorMmFuZworYW5nNWllNAorYW4xZ2wyCithNG4xaWMKK2EzbmllcworYW4yaWU0CithbjNpM2YKK2FuNGltZQorYW4xaW0KK2E1bmltMWkKK2E1bjJpbmUKK2FuMWluCithbjNpNG8KK2EzbjJpcAorYW4zaXMyaAorYW4zaXQKK2EzbmkxdQorYW40a2xpCithNG5rMgorYW4xazFsCis1YW5uaXoKK2E0bjFuMgorYW5vNAorYW41b3QKK2FuNG90aDUKK2FuMnNhMgorYTJuMXMyCithbjRzMWNvCithbnM0YworYW40czFuNAorYW4yc3AKK2FuczNwbworYW40c3QKK2FuNHN1MnIKK2FuMXN1CithbnRhMmw0CithbjF0CithbjF0YQorYW40dDJpZTQKK2FudDJpCis0YW4xdG8KK2FuMnRyCithbjR0dzQKK2FuM3UxYQorYW4zdWwKK2E1bnVyCis0YW8KK2FwMmEycjQKK2ExcGEKK2FwNWF0CithcDVlcjNvCithM3BoNGVyCis0YXBoaQorYTRwaWxsYQorYXBpbDFsCithcDVpbGwyYTJyCithcDNpMm4KK2FwM2kxdGEKK2EzcGkydHUKK2EycDJsMgorYXBvNGM1CithcDVvMWxhCithcG9yNWkKK2ExcDRvcgorYXBvczN0CithMXBvcworYXBzNWU0cworYTJwMXMyCithcDJzZQorYTNwdQorYXF1ZTUKK2FxdTIKKzJhMnIKK2FyM2EyYzF0CithNXJhZGUKK2FyYTJkCithcjVhZGlzMQorYXIyYWRpCithcjNhbAorYTVyYW1lMXRlCithcmFtM2V0CithcjJhbjRnCithcmEybgorYXJhM3AKK2FyNGF0CithNXJhMXQyaW8KK2FyNWExdDJpdgorYTVyYXUKK2FyNWF2NAorYXJhdzQKK2FyYmFsNAorYXIxYgorYXI0Y2hhMm4KK2FyMWMKK2FyM2NoYQorYXIyY2gKK2FyNWQyaW5lCithcmQyaQorYXJkMWluNAorYXI0ZHIKK2FyNWVhcworYTNyZWUKK2FyM2VuMXQKK2E1cjJlMnNzCithcjRmaQorYXIxZgorYXI0ZjRsMgorYXIxaQorYXI1aTJhbAorYXIyaTNhCithcjNpMmEybgorYTNyaTVldAorYXIyaWU0CithcjRpbQorYXI1aW4yYXQKK2FyMmkxbmEKK2FyM2kxbworYXIyaXoKK2FyMm1pCithcjFtCithcjVvNWQKK2E1cm9uaQorYXJvMm4KK2Ezcm9vMgorYXIycAorYXIzcQorYXJyZTQKK2FyMXI0CithcjRzYTIKK2E0cnMyCithcjJzMmgKKzRhcy4KK2EyczRhYgorYXNhMgorYXMzYW4xdAorYXNhMm4KK2FzaGk0CithczJoCithNXNpYS4KK2FzMmkxYQorYTNzaTFiCithM3NpYworNWE1c2k0dAorYXNrM2kKK2FzazIKK2FzNGwyCithNHNvYworYTFzbworYXM1cGgKK2FzNHMyaAorYTJzcworYXMzdGVuCithczF0NHIKK2FzdTFyNWEKK2Exc3UKK2FzdTJyCithMnRhCithdDNhYjJsMgorYTJ0YWIKK2F0NWFjCithdDNhbG8KK2F0YTJsCithdDVhcAorYXRlNWMKK2F0NWUyY2gKK2F0M2UxZ28KK2F0ZWc0CithdD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pCitiZTNnaQorYmU1Z3UKKzFiZWwKK2JlMWwyaQorYmUzbG8KKzRiZTVtCitiZTVuMmlnCitiZTVudQorNGJlczQKK2JlM3NwCitiMmU1c3Q0cgorM2JldAorYmUxdDVpegorYmU1dHIKK2JlM3R3NAorYmUzdworYmU1eTFvNAorMmJmCis0YjNoCitiaTJiCitiMmk0ZAorM2IyaWU0CitiaTVlbgorYmk0ZXIKKzJiM2lmCisxYmlsCitiaTNsMml6CitiaWwxaQorYmluMmE1cjQKK2JpMW5hCitiNGluNGQKK2JpNW5ldAorYjJpbmUKK2JpM28yZ3IKK2IyaW8KK2JpNW91MgorYmkydAorM2IyaTN0MmlvCitiaTF0aQorYmkzdHIKKzNiaXQ1dTFhCitiaTF0dQorYjVpNHR6CitiMWoKK2JrNAorYjJsMgorYmw0YXRoNQorYjRsZS4KK2JsZW40Cis1YmxlMXNwCitibGVzMgorYjNsaXMKK2I0bG8KK2JsdW40dAorNGIxbQorNGIzbgorYm5lNWcKKzNib2QKK2JvZDNpCitibzRlCitib2wzaWMKK2JvbDJpCitib200YmkKK2JvNG0xYgorYm8xbjRhCitibzJuCitib241YXQKKzNib28yCis1Ym9yLgorNGIxbzFyYQorYm9yNWQKKzVib3JlCis1Ym9yaQorNWJvczQKK2I1bzF0YQorYjRvdGg1CitibzR0bworYm91bjJkMworYm91MgorNGJwCis0YnJpdAorYnI0b3RoMworMmI1czIKK2Jzb3I0CitiMXNvCisyYnQKK2IydDRsCitiNHRvCitiM3RyCitidWY0ZmVyMQorYnU0ZjFmCitidTRnYQorYnUzbDJpCitidTFtaTQKK2J1NG4KK2J1bnQ0aQorYnVuMXQKK2J1M3JlCitidXM1aWU0CitiMnVzCitidXNzNGUKK2J1MnNzCis1YnVzdAorNGJ1MXRhCiszYnUxdDJpbworYjR1MXQyaQorYjV1MXRvCitiMXYKKzRiNXcKKzVieS4KK2J5czQKKzFjYQorY2FiM2luCitjYTFiMmwyCitjYTJjaDQKK2NhNWRlbgorY2EyZAorNG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zVjMmkxbm8KK2NpbzJuNAorYzJpbworNGNpcGU0CitjMmlwCitjaTNwaAorNGNpcDRpYworY2lwM2kKKzRjaXMxdGEKKzRjaXMxdDJpCisyYzFpdAorY2kxdDNpegorY2kxdGkKKzVjaXoKK2NrMQorY2szaQorMWM0bDQKKzRjbDJhMnIKK2M1bGE1cmExdDJpbworY2xhcjRhdAorNWNsYXJlCitjbGU0bQorNGNsaWMKK2NsaW00CitjMWx5NAorYzVuCisxY28KK2NvNWFnCitjNG9hCitjb2UyCisyY29nCitjbzRncgorY29pNAorY28zaW5jCitjb2w1aQorNWNvbG8KK2NvbDNvNHIKK2NvbTVlcgorY28ybWUKK2NvMW40YQorY28ybgorYzRvbmUKK2NvbjNnCitjb241dAorY28zcGEKK2NvcDNpYworY280cDJsMgorNGNvcjFiCitjb3JvM24KK2NvczRlCitjb3YxCitjb3ZlNAorY293NWEKK2NvMno1ZQorY281ejFpCitjMXEKK2NyYXM1dAorY3IyYXMKKzVjcmF0LgorNWNyYXQxaWMKK2NyZTNhMnQKKzVjMnIyZWQKKzRjM3JlMXRhCitjcmU0djIKK2NyaTIKK2NyaTVmCitjNHJpbgorY3IyaXM0Cis1Y3JpMXRpCitjcm80cDJsMgorY3JvcDVvCitjcm9zNGUKK2NydTRkCis0YzNzMgorMmMxdAorYzJ0YTRiCitjMXRhCitjdDVhbmcKK2N0YTJuCitjNXRhbjF0CitjMnRlCitjM3RlcgorYzR0NGljMXUKK2N0aW0zaQorYzF0aW0KK2N0dTRyCitjMXR1CitjNHR3NAorY3VkNQorYzR1ZgorYzR1aTIKK2N1NWkxdHkKKzVjdWwyaQorY3VsNHRpczQKK2N1bDF0aQorY3U0bHQKKzNjNHVsMXR1MgorY3UybWEKK2MzdW1lCitjdTRtaQorM2N1bgorY3UzcGkKK2N1NXB5CitjdTJyNWE0YgorY3UxcmEKK2N1NXIyaTNhCisxYzJ1cworY3VzMXM0aQorY3Uyc3MKKzNjNHV0CitjdTR0MmllNAorYzR1MXQya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aGsKKzRoMWw0CitobGEybjQKK2gybG8KK2hsbzNyaQorNGgxbQoraG1ldDQKKzJoMW4KK2g1b2RpegoraDVvMmQxczIKK2hvNGcKK2hvMWdlNAoraG9sNWEycgoraG8xbGEKKzNob2w0ZQoraG80bWEKK2hvMm1lMworaG8xbjRhCitobzJuCitobzVueQorM2hvb2QKK2hvbzIKK2hvbzJuNAoraG9yNWF0CitobzFyYQoraG81cjJpcworaG9ydDNlCitobzVydQoraG9zNGUKK2hvNXNlbgoraG9zMXAKKzFobzJ1cworaG91MgoraG91c2UzCitob3Y1ZWwKKzRoNXAKKzRocjQKK2hyZWU1Citocm81bml6Citocm8ybgoraHJvM3BvCis0aDFzMgoraDRzMmgKK2g0dDJhMnIKK2gxdGEKK2h0MWVuCitodDVlcworaDR0eQoraHU0ZworaHU0bWluCitodTFtaQoraHVuNWtlCitodTRuazIKK2h1bjR0CitodXMzdDQKK2gydXMKK2h1NHQKK2gxdworaDR3YXI0dAoraHcyYTJyCitoeTNwZQoraHkzcGgKK2h5MnMKKzJpMWEKK2kyYWwKK2lhbTQKK2lhbTVlMXRlCitpMmEybgorNGlhbmMKK2lhbjNpCis0aWFuNHQKK2lhNXBlCitpYTJzczQKK2k0YTF0Mml2CitpYTR0cmljCitpYTF0cgoraTRhMnR1CitpYmU0CitpYjNlcjFhCitpYjVlcnQKK2liNWkxYQoraWIzaW4KK2liNWl0LgoraWJpMnQKK2liNWl0ZQoraTFiMmwyCitpYjNsaQoraTVibworaTFicgoraTJiNXJpCitpNWJ1NG4KKzRpY2FtCitpMWNhCis1aWNhcAorNGljMmEycgoraTRjYXIuCitpNGNhcmEKK2ljYXM1CitpNGNheQoraWNjdTQKK2ljM2MKKzRpY2VvCis0aTJjaAorMmkxY2kKK2k1YzJpZAoraWM1aTFuYQoraTJjaW4KK2kyYzJpcAoraWMzaTFwYQoraTRjMWx5NAoraTFjNGw0CitpMmM1b2MKK2kxY28KKzRpMWNyCis1aWNyYQoraTRjcnkKK2ljNHRl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2ltNWkxZDRhCitpbTJpZAoraW1pNWxlCitpNW0yaW5pCis0aW1pdAoraW00bmkKK2k0bTFuCitpM21vMm4KK2kxbW8KK2kybXUKK2ltM3UxbGEKKzJpbi4KK2k0bjNhdQoraTFuYQorNGluYXYKK2luY2VsNAoraW4zY2VyCis0aW5kCitpbjVkbGluZworMmluZQoraTNuZWUKK2luNGVyNGEycgoraW4xZXIKK2luZXIxYQoraTVuMmUyc3MKK2kxbmVzCis0aW4xZ2EKKzRpbmdlCitpbjVnZW4KKzRpbmdpCitpbjVnbGluZworaW5nbDIKKzRpbjFnbworNGluMWd1CisyaW5pCitpNW5pLgoraTRuNGkxYQoraW4zaTRvCitpbjFpcworaTVuaTR0ZS4KK2luMml0CitpbjJpdGUKKzVpM24yaTF0MmlvCitpbmkxdGkKK2luM2kxdHkKKzRpNG5rMgorNGk0bjFsCisyaTRuMW4yCisyaTFubworaTRubzRjCitpbm80cworaTRub3QKKzJpMm4xczIKK2luM3NlCitpbnN1MXI1YQoraW4xc3UKK2luc3UycgorMmludC4KK2luMXQKKzJpbjR0aAoraW4xdQoraTVuMnVzCis0aW55CisyaW8KKzRpby4KK2lvMWdlNAoraW8yZ3IKK2kxb2wKK2lvNG0KK2lvbjNhdAoraW8ybgoraW8xbjFhCitpb240ZXJ5Citpb24xZXIKK2lvbjNpCitpMm81cGgKK2lvcjNpCitpNG9zCitpNG81dGgKK2k1b3RpCitpbzR0bworaTRvdXIKK2lvdTIKKzJpcAoraXBlNAoraXBocjJhczQKK2lwNGhyNAoraXAzaQoraXA0aWMKK2lwNHJlNAoraXByMgoraXAzdWwKK2kzcXVhCitpcXUyCitpcTV1ZTFmCitpcTN1MmlkCitpcTJ1aTIKK2lxM3VpM3QKKzRpcgoraTFyYQoraTJyYTRiCitpNHJhYworaXJkNWUKK2lyZTRkZQoraTJyMmVkCitpNHJlMWYKK2k0cmVsNAoraTRyZXMKK2lyNWdpCitpcmcyCitpcjFpCitpcmk1ZGUKK2lyMmlkCitpcj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b3QKKzRpNXcKK2l4NG8KKzRpeQorNGl6MmEycjIKK2l6YTEKK2kyejFpNAorNWl6b24xdAoraTF6bworaXpvMm4KKzVqYQoramFjNHEKK2phNHAKKzFqZQoramU0cjVzMgorNGplczR0MmllNAoramVzdDJpCis0amVzMnR5CitqZXczCitqbzRwCis1anVkZworM2thLgorazNhYgorazVhZwora2FpczQKK2thaTIKK2thbDQKK2sxYgorazJlZAorMWtlZQora2U0Zwora2U1bDJpCitrM2VuNGQKK2sxZXIKK2tlczQKK2szZTJzdC4KK2tlNHR5CitrM2YKK2toNAorazFpCis1a2kuCis1azJpYworazRpbDFsCitraWxvNQorazRpbQorazRpbi4KK2tpbjRkZQorazRpbmQKK2s1aTVuMmUyc3MKK2syaW5lCitraTFuZXMKK2tpbjRnCitrMmk0cAora2lzNAorazVpczJoCitrazQKK2sxbAorNGszbGV5Cis0azFseQorazFtCitrNW5lcworMWsybm8KK2tvNXIKK2tvczJoNAorazNvdTIKK2tybzVuCis0azFzMgorazRzYwora3M0bDIKK2s0czR5CitrNXQKK2sxdworbGFiM2ljCitsNGFibworbDRhMmNpNAorbDRhZGUKK2xhMmQKK2xhM2QyeQorbGFnNG4KK2xhMm0zbworM2w0YW5kCitsYTJuCitsYW40ZGwKK2xhbjVldAorbGFuNHRlCitsYW4xdAorbGFyNGcyCitsMmEycgorbGFyM2kKK2xhczRlCitsYTV0YTJuCitsYTJ0YQorNGxhdGVsMmk0Cis0bGExdDJpdgorNGxhdgorbGE0djRhCisybDFiCitsYmluNAorNGwxYzIKK2xjZTQKK2wzY2kKKzJsZAorbDJkZQorbGQ0ZXJlCitsZDRlcjFpCitsZGk0CitsZDVpczEKK2wzZHIKK2w0ZHJpCitsZTJhCitsZTRiaQorbDJlMWIKK2xlMmZ0NQorbGUxZgorNWxlZy4KKzVsZTRnMWcyCitsZTRtYXQKK2xlMW1hCitsZW01YXQxaWMKKzRsZW4uCiszbGVuYworNWxlMm5lLgorMWxlbjF0CitsZTNwaAorbGU0c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KK2xtM2luZworbDRtbzJkMQorbDFtbworbG1vMm40CisybDFuMgorM2xvLgorbG9iNWFsCitsbzRjaQorNGxvZgorM2xvZzFpYworbDVvMWdvCiszbG9ndQorbG9tM2VyCitsbzJtZQorNWxvbmcKK2xvMm4KK2xvbjRpCitsM28zbml6Citsb29kNQorbG9vMgorNWxvNHBlLgorbG9wM2kKK2wzbzRwMW0KK2xvMXJhNAorbG80cmExdG8KK2xvNXIyaWU0Citsb3I1b3UyCis1bG9zLgorbG9zNWV0Cis1bG9zNW8zcGhpegorbG8yc28KK2xvczRvcAorbG9zMm9waAorNWxvczVvMXBoeQorbG9zNHQKK2xvNHRhCitsb3VuNWQKK2xvdTIKKzJsb3V0Cis0bG92CisybHAKK2xwYTViCitsMXBhCitsM3BoYQorbDVwaGkKK2xwNWluZworbHBpMm4KK2wzcGl0CitsNHAybDIKK2w1cHIyCis0bDFyCisybDFzMgorbDRzYworbDJzZQorbDRzMmllNAorNGx0CitsdDVhZworbDF0YQorbHRhbmU1CitsdGEybgorbDF0ZQorbHRlbjQKK2x0ZXIxYTQKK2x0aDNpCitsNXRpZXMuCitsdDJpZTQKK2x0aXM0CitsMXRyCitsMXR1MgorbHR1MXIzYQorbHU1YQorbHUzYnIKK2x1MmNoNAorbHUzY2kKK2x1M2VuCitsdWY0CitsdTVpZAorbDJ1aTIKK2x1NG1hCis1bHUxbWkKK2w1dW1uLgorbHU0bTFuCis1bHVtM240aTFhCitsdTNvCitsdW8zcgorNGx1cAorbHUyc3M0CitsMnVzCitsdXMzdGUKKzFsdXQKK2w1dmVuCitsNXZldDQKKzJsMXcKKzFseQorNGx5YQorNGx5MWIKK2x5NW1lNAorbHkzbm8KKzJseXM0CitsNXkzczJlCisxbWEKKzJtYWIKK21hMmNhCittYTVjaDJpbmUKK21hMmNoCittYTRjaDFpbgorbWE0YzRsNAorbWFnNWluCittYWcxaQorNW1hZzFuCisybWFoCittYTJpZDUKK21haTIKKzRtYTJsZAorbWEzbDJpZworbWFsMWkKK21hNWxpbgorbWFsNGwyaQorbWFsMWwKK21hbDR0eQorbWE0bHQKKzVtYTNuNGkxYQorbWEybgorbWFuNWlzCittYW4zaXoKKzRtYXAKK21hNXJpMm5lLgorbTJhMnIKK21hcjFpCittYXIyaW40ZQorbWE1cjJpegorbWFyNGx5CittYXIxbAorbWFyM3YKK21hNXNjZQorbWFzNGUKK21hczF0Cis1bWF0ZQorbTRhdGgzCittYTN0aXMKKzRtYXRpM3phMQorbWExdGl6Cis0bTFiCittMWJhNHQ1CittNWJpbAorbTRiM2luZworbWIyaTR2Cis0bTVjCis0bWUuCisybWVkCis0bWVkLgorNW1lM2Q0aTNhCittNGVkaQorbWUzZDJpZTQKK201ZTVkMnkKK21lMmcKK21lbDVvMm4KK21lNGw0dAorbWUybQorbWUxbTFvMworMW1lbgorbWUxbjRhCittZW41YWMKK21lbjRkZQorNG1lbmUKK21lbjRpCittZTJuMXM0CittZW4xc3U1CiszbWVuMXQKK21lbjR0ZQorbWU1bzJuCittNWVyMXNhMgorbWU0cjFzMgorMm1lcworM21lc3QyaQorbWU0dGEKK21ldDNhMmwKK21lMXRlCittZTV0aGkKK200ZXRyCis1bWV0M3JpYworbWU1dHIyaWU0CittZTN0cnkKK21lNHYKKzRtMWYKKzJtaAorNW1pLgorbTJpM2EKK21pMWQ0YQorbTJpZAorbWlkNGcKK20yaWc0CiszbWlsM2kxYQorbWlsMWkKK201aTVsMmllNAorbTRpbDFsCittaTFuNGEKKzNtNGluZAorbTVpM25lZQorbTJpbmUKK200aW5nbDIKK21pbjVnbGkKK201aW5nMWx5CittaW40dAorbTRpbjF1CittaW90NAorbTJpbworbTJpcworbWk0czRlci4KK200aXNlCittaXMzZXIKK21pczVsMgorbWlzNHQyaQorbTVpNHN0cnkKK21pc3Q0cgorNG0yaXRoCittMml6Cis0bWsKKzRtMWwKK20xbQorbW1hNXJ5CittMW1hCittbTJhMnIKKzRtMW4KK20xbjRhCittNG4xaW4KK21uNG8KKzFtbworNG1vY3IKKzVtb2M1cmExdGl6CittbzJkMQorbW80Z28KK21vaXMyCittb2kyCittbzRpNXNlCis0bTJvaworbW81bGVzdAorbW9sZXMyCittbzNtZQorbW9uNWV0CittbzJuCittb241Z2UKK21vM240aTNhCittb240aTJzMW0KK21vbjFpcworbW9uNGlzdAorbW8zbml6Cittb25vbDQKK21vM255LgorbW8ycgorNG1vNXJhLgorbW8xcmEKK21vczIKK21vNXNleQorbW8zc3AKK200b3RoMworbTVvdWYKK21vdTIKKzNtbzJ1cworbW8ydgorNG0xcAorbXBhcmE1CittMXBhCittcDJhMnIKK21wYTVyYWIKK21wNGE0cjVpCittM3BlMnQKK21waGFzNAorbTJwaQorbXAyaTRhCittcDVpZXMKK21wMmllNAorbTRwMWkybgorbTVwNGlyCittcDVpcworbXBvM3JpCittMXA0b3IKK21wb3M1aXRlCittMXBvcworbTRwbzJ1cworbXBvdTIKK21wb3Y1CittcDR0cgorbTJwMXQKK20ycHkKKzRtM3IKKzRtMXMyCittNHMyaAorbTVzaQorNG10CisxbXUKK211bDJhNXI0CittdTFsYQorNW11NGx0CittdWwxdGkzCiszbXVtCittdW4yCis0bXVwCittdTR1Cis0bXcKKzFuYQorMm4xYTJiCituNGFidQorNG5hYy4KK25hNGNhCituNWEyYzF0CituYWc1ZXIuCituYWs0CituYTRsMWkKK25hNWwyaTFhCis0bmE0bHQKK25hNW1pdAorbjJhMm4KK25hbjFjaTQKK25hbjRpdAorbmE0bms0CituYXIzYworbjJhMnIKKzRuYXJlCituYXIzaQorbmFyNGwKK241YXIxbQorbjRhcworbmFzNGMKK25hczV0MmkKK24yYXQKK25hM3RhMmwKK25hMnRhCituYXQ1bzVtMml6CituYTJ0b20KK25hMXRvCituMmF1CituYXUzc2UKK25hMnVzCiszbmF1dAorbmF2NGUKKzRuMWI0CituYzJhMnI1CituMWNhCituNGNlcy4KK24zY2hhCituMmNoCituNWNoZW8KK25jaGUyCituNWNoNGlsMgorbjNjaGlzCituMmMxaW4KK24xY2kKK24yYzRpdAorbmNvdTFyNWEKK24xY28KK25jb3UyCituMWNyCituMWN1CituNGRhaTIKK24xZDJhCituNWRhMm4KK24xZGUKK25kNWUyc3QuCituZGVzMgorbmRpNGIKK241ZDJpZgorbjFkaXQKK24zZGl6CituNWR1MmMKK24xZHUKK25kdTRyCituZDJ3ZQorbmQxdworMm5lLgorbjNlMmEycgorbjJlMmIKK25lYjN1CituZTJjCis1bmVjazEKKzJuZWQKK25lNGdhdAorbmUxZ2EKK25lNGc1YTF0Mml2Cis1bmVnZQorbmU0bGEKK25lbDVpegorbmVsMmkKK25lNW1pCituZTRtbworMW5lbgorNG5lbmUKKzNuZW8KK25lNHBvCituZTJxCituMWVyCituZTJyYTViCituZXIxYQorbjRlcjNhMnIKK24yZXJlCituNGVyNWkKK25lcjRyNAorMW5lcworMm5lcy4KKzRuZTFzcAorMm5lc3QKKzRuZXM0dzIKKzNuZXQxaWMKK25lNHYKK241ZXZlCituZTR3CituM2YKK240Z2FiCituMWdhCituM2dlbAorbmdlNG40ZQorbjFnZW4KK241Z2VyZQorbjNnZXIxaQorbmc1aGEKK24zZ2liCituZzFpbgorbjVnaXQKK240Z2xhNAorbmdsMgorbmdvdjQKK24xZ28KK25nNXMyaAorbmdzMgorbjFndQorbjRndW0KK24yZ3kKKzRuMWg0CituaGE0CituaGFiMworbmhlNAorM240aTFhCituaTNhMm4KK25pNGFwCituaTNiYQorbmk0YjJsMgorbjJpNGQKK25pNWRpCituaTRlcgorbjJpZTQKK25pMmZpCituaTVmaWNhdAorbmlmaTFjYQorbjVpMWdyCituMmlnCituNGlrNAorbjFpbQorbmkzbTJpegorbmltMWkKK24xaW4KKzVuaTJuZS4KK24yaW5lCituaW40ZworbjJpNG8KKzVuMmlzLgorbmlzNHRhCituMml0CituNGl0aAorM24yaTF0MmlvCituaTF0aQorbjNpdG9yCituaTF0bworbmkzdHIKK24xagorNG5rMgorbjVrMmVybworbmsxZXIKK24za2V0CituazNpbgorbmsxaQorbjFrMWwKKzRuMWwKK241bQorbm1lNAorbm1ldDQKKzRuMW4yCitubmU0CitubmkzYWwKK24zbjRpMWEKK25uMmk0dgorbm9iNGwyCitubzNibGUKK241bzFjNGw0Cis0bjNvMmQKKzNub2UKKzRub2cKK25vMWdlNAorbm9pczVpCitub2kyCitubzVsNGkKKzVub2wxbzFnaXMKKzNub21pYworbjVvNW0yaXoKK25vNG1vCitubzNteQorbm80bgorbm9uNGFnCitubzFuMWEKK25vbjVpCituNW9uaXoKKzRub3AKKzVub3A1bzVsMmkKK25vMnI1YWIKK25vMXJhCitubzRyYXJ5Citub3IyYTJyCis0bm9zMmMKK25vczRlCitub3M1dAorbm81dGEKKzFub3UyCiszbm91bgorbm92M2VsMworbm93bDMKK24xcDQKK25waTQKK25wcmU0YworbnByMgorbjFxCituMXIKK25ydTQKKzJuMXMyCituMnM1YWIKK25zYTIKK25zYXRpNAorbnM0YworbjJzZQorbjRzM2U0cworbnMyaWQxCituczJpZzQKK24yczFsMgorbjJzM20KK240c29jCituMXNvCituczRwZQorbjVzcGkKK25zdGE1YjJsMgorbnMxdGEKK25zMnRhYgorbjF0CituMnRhNGIKK24xdGEKK250ZTRyM3MyCitudDJpCituNXRpMmIKK250aTRlcgorbnQyaWU0CitudGkyZjIKK24zdDJpbmUKK24ydDFpbgorbjR0M2luZworbnQyaTRwCitudHJvbDVsMmkKK250cm9sMWwKK240dDRzMgorbnR1M21lCituMXR1CituM3R1bQorbnUxYQorbnU0ZAorbnU1ZW4KK251ZjRmZQorbnU0ZjFmCituM3VpNG4KK24ydWkyCiszbnUzaXQKK240dW0KK251MW1lCituNXUxbWkKKzNudTRuCituM3VvCitudTN0cgorbjF2MgorbjF3NAorbnltNAorbnlwNAorNG56CituM3phMQorNG9hCitvYTJkMworbzVhNWxlczIKK28yYWxlCitvYXJkMworbzJhMnIKK29hczRlCitvYXN0NWUKK29hdDVpCitvYjNhM2IKK281YjJhMnIKK28xYmU0bAorbzFiaQorbzJiaW4KK29iNWluZworbzNicgorb2IzdWwKK28xY2UKK28yY2g0CitvM2NoZTR0CitvY2hlMgorb2NpZjMKK28xY2kKK280Y2lsCitvNGNsYW0KK28xYzRsNAorbzRjb2QKK28xY28KK29jM3JhYworb2M1cmExdGl6CitvY3JlMworNW9jcml0CitvY3JpMgorb2N0bzJyNWEKK28yYzF0CitvYzF0bworb2MzdTFsYQorbzVjdXJlCitvZDVkMWVkCitvZDFkNAorb2QzaWMKK28xZDJpM28KK28yZG80CitvZDRvcjMKK280ZDV1Y3QuCitvMWR1CitvZHUyYworb2R1MmMxdAorbzRkNXVjNHQxczIKK280ZWwKK281ZW5nCitvM2VyCitvZTR0YQorbzNldgorbzJmaQorb2Y1aXRlCitvZjRpNHQ0dDIKK28yZzVhNXIKK28xZ2EKK280ZzVhMXQyaXYKK280Z2ExdG8KK28xZ2UKK281Z2VuZQorbzFnZW4KK281Z2VvCitvNGdlcgorbzNnMmllNAorMW8xZ2lzCitvZzNpdAorbzRnbDIKK281ZzJseQorM29nbml6CitvZzFuaQorbzRnNHJvCitvMWdyCitvZzJ1NWkyCisxbzFneQorMm8yZzV5M24KK28xaDIKK29oYWI1CitvaTIKK29pYzNlcworb2kzZGVyCitvMmlkCitvaTRmMWY0CitvMmlnNAorb2k1bGV0CitvM2luZworb2ludDVlcgorb2luMXQKK281aTJzMW0KK29pNXNvMm4KK29pMnNvCitvaXN0NWVuCitvaXMxdGUKK29pM3RlcgorbzJpdGUKK281agorMm9rCitvM2tlbgorb2s1aWU0CitvazFpCitvMWxhCitvNGxhMm4KK29sYTJzczQKK28ybDJkCitvbDJkMWUKK29sM2VyCitvM2xlczJjCitvbGVzMgorbzNsZXQKK29sNGZpCitvMmxmCitvbDJpCitvM2wyaTFhCitvM2xpY2UKK29sNWlkLgorb2wyaWQKK28zbGk0ZgorbzVsNGk0bAorb2wzaW5nCitvNWwyaW8KK281bDJpcy4KK29sM2lzMmgKK281bDJpdGUKK29sMWl0CitvNWwyaTF0MmlvCitvbGkxdGkKK281bDJpdgorb2xsMmk0ZTQKK29sMWwKK29sbDJpCitvbDVvM2dpegorb2xvNHIKK29sNXAybDIKK28ybHAKK280bDJ0CitvbDN1Ygorb2wzdW1lCitvbDN1bgorbzVsMnVzCitvbDJ2CitvMmx5CitvMm01YWgKK28xbWEKK29tYTVsCitvbTVhMXRpegorb20yYmUKK280bTFiCitvbTRiMmwyCitvMm1lCitvbTNlMW40YQorbzFtZW4KK29tNWVyMnNlCitvbWU0cjFzMgorbzRtZXQKK29tNWUzdHJ5CitvbTRldHIKK28zbTJpM2EKK29tM2ljLgorb20zaTFjYQorbzVtMmlkCitvbTFpbgorbzVtMmluaQorNW9tbWVuZAorb20xbQorb20xbWVuCitvbW80Z2UKK28xbW8KK280bW8ybgorb20zcGkKK280bTFwCitvbXBybzUKK29tcHIyCitvMm4KK28xbjFhCitvbjRhYworbzNuMmEybgorb24xYworM29uY2lsCitvbjFjaQorMm9uZAorb241ZG8KK28zbmVuCitvMm41ZXN0CitvMW5lcworb240Z3UKK29uMWljCitvM24yaTRvCitvbjFpcworbzVuaTF1CitvbjNrZXkKK280bmsyCitvbjRvZGkKK280bjNvMmQKK29uM28zbXkKK28ybjNzMgorb241c3BpNAorb25zcGkxcjVhCitvbnNwNGlyCitvbjFzdTQKK29udGVuNAorb24xdAorb24zdDRpCitvbnRpMmY1CitvbjV1bQorb24xdmE1CitvbjF2Mgorb28yCitvb2Q1ZQorb29kNWkKK28ybzRrCitvb3AzaQorbzNvcmQKK29vc3Q1CitvMnBhCitvMnAyZTVkCitvcDFlcgorM29wZXIxYQorNG9wNGVyYWcKKzJvcGgKK281cGhhMm4KK281cGg0ZXIKK29wM2luZworb3BpMm4KK28zcGl0CitvNXBvMm4KK280cG9zaQorbzFwb3MKK28xcHIyCitvcDF1CitvcHk1CitvMXEKK28xcmEKK281cmEuCitvNHIzYWcKK29yNWFsMWl6CitvcmFsMWkKK29yNWFuNGdlCitvcmEybgorb3IyYW5nCitvcmU1YQorbzVyZTFhNGwKK29yM2VpMgorb3I0ZTVzMmgKK29yNWUyc3QuCitvcmVzMnQKK29yZXc0CitvcjRndQorb3JnMgorNG81cjJpM2EKK29yM2kxY2EKK281cmlsCitvcjFpbgorbzFyMmkxbworb3IzaTF0eQorbzNyaTF1CitvcjJtaQorb3IxbQorb3JuMmUKK281cm9mCitvcjNvdWcKK29yb3UyCitvcjVwZQorb3IxcAorM29ycmg0CitvcjFyNAorb3I0c2UKK280cnMyCitvcnM1ZW4KK29yc3Q0CitvcjN0aGkKK29yM3RoeQorb3I0dHkKK281cnVtCitvMXJ5CitvczNhbAorb3NhMgorb3MyYworb3M0Y2UKK28zc2NvcAorb3MxY28KKzRvc2NvcGkKK281c2NyCitvczRpNGU0CitvczVpMXQyaXYKK29zaTF0aQorb3MzaTF0bworb3MzaTF0eQorbzVzaTR1CitvczRsMgorbzJzbworbzJzNHBhCitvczRwbworb3MydGEKK281c3RhdGkKK29zNXRpbAorb3N0MmkKK29zNXRpdAorbzR0YTJuCitvMXRhCitvdGVsZTRnCitvdDNlci4KK290NWU0cjFzMgorbzR0ZXMKKzRvdGgKK290aDVlMXNpCitvdGgyZQorb3RoMWVzCitvdGgzaTQKK290M2ljLgorb3Q1aTFjYQorbzN0aWNlCitvM3RpZjIKK28zdGlzCitvdG81czIKK28xdG8KK291Mgorb3UzYjJsMgorb3VjaDVpCitvdTJjaAorb3U1ZXQKK291NGwKK291bmM1ZXIKK291bjJkCitvdTV2Mgorb3Y0ZW4KK292ZXI0bmUKK292ZTRyM3MyCitvdjRlcnQKK28zdmlzCitvNHZpMXRpNAorbzV2NG9sCitvdzNkZXIKK293M2VsCitvdzVlc3QzCitvdzFpMgorb3duNWkKK280d28yCitveTFhCisxcGEKK3BhNGNhCitwYTRjZQorcGEyYzR0CitwNGEyZAorNXBhZ2E0bgorcGExZ2EKK3AzYWdhdAorcDRhaTIKK3BhNGk0bjQKK3A0YWwKK3BhMW40YQorcGEybgorcGFuM2VsCitwYW40dHkKK3BhbjF0CitwYTNueQorcGExcAorcGE0cHUKK3Bhc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yCityYTJjaAorcjVhMWM0bDQKK3JhZjVmaQorcmEyZgorcmE0ZjFmNAorcmEyZjR0CityMmFpMgorcmE0bG8KK3JhbTNldAorcjJhbWkKK3JhM25lNW8KK3JhMm4KK3JhbjRnZQorcjJhbmcKK3I0YW5pCityYTVubzQKK3JhcDNlcgorM3JhMXBoeQorcmFyNWMKK3IyYTJyCityYXJlNAorcmFyNWUxZgorNHJhcmlsCityYXIxaQorcjJhcworcmF0aW8ybjQKK3JhMXQyaW8KK3JhdTR0CityYTV2YWkyCityYTJ2YQorcmF2M2VsCityYTV6MmllNAorcmEyejFpCityMWIKK3I0YmFiCityNGJhZworcmJpMgorcjJiM2k0ZgorcjJiaW4KK3I1YjJpbmUKK3JiNWluZy4KK3JiNG8KK3IxYworcjJjZQorcjFjZW40CityM2NoYQorcjJjaAorcmNoNGVyCityY2hlMgorcjRjaTRiCityMWNpCityMmM0aXQKK3JjdW0zCityNGRhbAorcjFkMmEKK3JkMmkKK3IxZDRpNGEKK3JkaTRlcgorcmQyaWU0CityZDFpbjQKK3JkM2luZworMnJlLgorcmUxYTRsCityZTNhMm4KK3JlNWFyMXI0CityZTJhMnIKKzVyZWEydgorcmU0YXcKK3I1ZWJyYXQKK3IyZTFiCityZTNicgorcmVjNW9sMWwKK3JlMmNvbAorcmUxY28KK3JlNGM1b21wZQorcmVjbzRtMXAKK3JlNGNyZQorcmUxY3IKKzJyMmVkCityZTFkZQorcmUzZGlzMQorcjRlZGkKK3JlZDVpdAorcmU0ZmFjCityZTFmCityZTFmYQorcmUyZmUKK3JlNWZlci4KK3JlZmVyMQorcmUzZmkKK3JlNGZ5CityZWczaXMKK3JlNWl0CityZWkyCityZTFsMmkKK3JlNWx1CityNGVuNHRhCityZW4xdAorcmVuNHRlCityZTFvCityZTVwaTJuCityZTRwb3NpCityZTFwbworcmUxcG9zCityZTFwdQorcjFlcjQKK3I0ZXIxaQorcjJlcm80CityNGU1cnUKK3I0ZXMuCityZTRzcGkKK3JlMXNwCityZXM0czVpNGIKK3IyZTJzcworcmVzMXNpCityZXMydAorcmU1czJ0YTJsCityZXMxdGEKK3IyZTNzdDRyCityZTR0ZXIKK3JlNHRpNHoKK3JlM3RyaQorcjRldTIKK3JlNXUxdDJpCityZXYyCityZTR2YWwKK3JlMXZhCityZXYzZWwKK3I1ZXY1ZXIuCityZXYxZXIKK3JlNXZlNHIxczIKK3JlNXZlcnQKK3JlNXZpNGwKK3JlMXZpCityZXY1b2x1CityZTR3aAorcjFmCityM2Z1NAorcjRmeQorcmcyCityZzNlcgorcjNnZXQKK3IzZzFpYworcmdpNG4KK3JnM2luZworcjVnaXMKK3I1Z2l0CityMWdsMgorcmdvNG4yCityMWdvCityM2d1CityaDQKKzRyaC4KKzRyaGFsCityMmkzYQorcmlhNGIKK3JpNGFnCityNGliCityaWIzYQorcmljNWFzNQorcmkxY2EKK3I0aWNlCis0cjJpMWNpCis1cmk1YzJpZAorcmk0YzJpZTQKK3I0aTFjbworcmlkNWVyCityMmlkCityaTNlbmMKK3IyaWU0CityaTNlbjF0CityaTFlcgorcmk1ZXQKK3JpZzVhMm4KK3IyaWcKK3JpMWdhCis1cjRpZ2kKK3JpbDNpegorcmlsMWkKKzVyaW1hMm4KK3JpMW1hCityaW01aQorM3JpMW1vCityaW00cGUKK3JpNG0xcAorcjJpMW5hCis1cmluYS4KK3I0aW40ZAorcjJpbjRlCityaW40ZworcjJpMW8KKzVyaXBoCityMmlwCityaXBoNWUKK3JpMnAybDIKK3JpcDVsaWMKK3I0aXEKK3IyaXMKK3I0aXMuCityMmlzNGMKK3IzaXMyaAorcmlzNHAKK3JpM3RhM2IKK3JpMXRhCityNWl0ZWQuCityMml0ZQorcmkydDFlZAorcml0NWVyLgorcml0NWU0cjFzMgorcjRpMnQzaWMKK3JpMXRpCityaTJ0dQorcml0NXVyCityaXY1ZWwKK3IyaXYKK3JpdjNldAorcml2M2kKK3IzagorcjNrZXQKK3JrNGxlCityazFsCityazRsaW4KK3IxbAorcmxlNAorcjJsZWQKK3I0bDJpZworcjRsaXMKK3JsNWlzMmgKK3IzbG80CityMW0KK3JtYTVjCityMW1hCityMm1lCityM21lbgorcm01ZTRyMXMyCitybTNpbmcKK3I0bWluZy4KK3I0bTJpbworcjNtaXQKK3I0bXkKK3I0bjJhMnIKK3IxbmEKK3IzbmVsCityNG4xZXIKK3I1bmV0CityM25leQorcjVuaWMKK3IxbmlzNAorcjNuMml0CityM24yaXYKK3JubzQKK3I0bm91MgorcjNudQorcm9iM2wyCityMm9jCitybzNjcgorcm80ZQorcm8xZmUKK3JvNWZpbAorcm8yZmkKK3Iyb2syCitybzVrMWVyCis1cm9sZS4KK3JvbTVlMXRlCitybzJtZQorcm80bWV0Cityb200aQorcm80bTRwCityb240YWwKK3JvMm4KK3JvMW4xYQorcm9uNGUKK3JvNW40aXMKK3JvbjR0YQorcm9uMXQKKzFyb29tCityb28yCis1cm9vdAorcm8zcGVsCityb3AzaWMKK3JvcjNpCitybzVybworcm8yczVwZXIKK3JvMnM0cworcm80dGgyZQorcjRvdGgKK3JvNHR5CitybzR2YQorcm92NWVsCityb3g1CityMXAKK3I0cGU0YQorcjVwZW4xdAorcnA1ZXIuCityM3BlMnQKK3JwNGg0CitycDNpbmcKK3JwaTJuCityM3BvCityMXI0CitycmU0YworcnJlNGYKK3I0cmUxbworcnJlNHMydAorcnIyaTRvCitycjJpNHYKK3JybzJuNAorcnJvczQKK3JyeXM0Cis0cnMyCityMXNhMgorcnNhNXRpCityczRjCityMnNlCityM3NlYworcnNlNGNyCityNHM1ZXIuCityczNlNHMKK3I1c2U1djIKK3IxczJoCityNXNoYQorcjFzaQorcjRzaTRiCityc28ybjMKK3Ixc28KK3Ixc3AKK3I1c3cyCitydGEyY2g0CityMXRhCityNHRhZworcjN0MmUxYgorcjN0ZW40ZAorcjF0ZTVvCityMXRpCityMnQ1aTJiCitydDJpNGQKK3I0dGllcgorcnQyaWU0CityM3QyaWcKK3J0aWwzaQorcnRpbDRsCityNHRpMWx5CityNHRpc3QKK3I0dDJpdgorcjN0cmkKK3J0cjJvcGg0CitydDRzMmg0CityNHQxczIKK3J1M2EKK3J1M2U0bAorcnUzZW4KK3J1NGdsMgorcnUzaTRuCityMnVpMgorcnVtM3AybDIKK3J1NG0ycAorcnUybgorcnU0bms1CitydW40dHkKK3J1bjF0CityNXVzYzIKK3IydXMKK3J1MnQxaTVuCityNHUxdDJpCitydjRlCitydmVsNGkKK3IzdmVuCitydjVlci4KK3I1dmVzdAorcnY0ZTJzCityM3ZleQorcjN2aWMKK3IzdjJpNHYKK3Izdm8KK3Ixdworcnk0YworNXJ5bmdlCityeW41ZworcnkzdAorc2EyCisyczFhYgorNXNhY2sxCitzYWMzcmkyCitzM2EyYzF0Cis1c2FpMgorc2E0bDJhMnI0CitzNGEybDRtCitzYTVsbworc2E0bDR0Ciszc2FuYworc2Eybgorc2FuNGRlCitzNGFuZAorczFhcAorc2E1dGEKKzVzYTN0MmlvCitzYTJ0M3UKK3NhdTQKK3NhNXZvcgorNXNhdworNHM1Ygorc2NhbjR0NQorczFjYQorc2NhMm4KK3NjYTRwCitzY2F2NQorczRjZWQKKzRzM2NlaTIKK3M0Y2VzCitzMmNoMgorczRjaG8yCiszczRjMmllNAorczFjaQorNXNjNGluNGQKK3MyY2luCitzY2xlNQorczFjNGw0CitzNGNsaQorc2NvZjQKK3MxY28KKzRzY29weTUKK3Njb3UxcjVhCitzY291MgorczFjdQorNHM1ZAorNHNlLgorc2U0YQorc2VhczQKK3NlYTV3CitzZTJjM28KKzNzZTJjMXQKKzRzNGVkCitzZTRkNGUKK3M1ZWRsCitzZTJnCitzZTFnM3IKKzVzZWkyCitzZTFsZQorNXNlMmwyZgorNXNlbHYKKzRzZTFtZQorc2U0bW9sCitzZTFtbworc2VuNWF0CitzZTFuYQorNHNlbmMKK3NlbjRkCitzNWUybmVkCitzZW41ZworczVlbjFpbgorNHNlbjR0MWQKK3NlbjF0Cis0c2VuMnRsCitzZTJwM2EzCis0czFlci4KK3M0ZXIxbAorczJlcjRvCis0c2VyM3ZvCitzMWU0cworczRlNXMyaAorc2VzNXQKKzVzZTV1bQorczRldQorNXNldgorc2V2M2VuCitzZXc0aTIKKzVzZXgKKzRzM2YKKzJzM2cKK3MyaAorMnNoLgorc2gxZXIKKzVzaGV2CitzaDFpbgorc2gzaW8KKzNzaDJpNHAKK3NoMmkydjUKK3NobzQKK3NoNW8ybDJkCitzaG8ybjMKK3Nob3I0CitzaG9ydDUKKzRzaDF3CitzaTFiCitzNWljM2MKKzNzaTJkZS4KK3MyaWQKKzVzaWRlNHMyCis1c2kyZGkKK3NpNWRpegorNHNpZzFuNGEKK3MyaWcKK3NpbDRlCis0c2kxbHkKKzJzMWluCitzMmkxbmEKKzVzaTJuZS4KK3MyaW5lCitzM2luZworMXMyaW8KKzVzaW8ybgorc2lvMW41YQorczRpMnIKK3NpMXI1YQorMXNpcworM3MyaTF0MmlvCitzaTF0aQorNXNpMXUKKzFzMml2Cis1c2l6CitzazIKKzRza2UKK3Mza2V0CitzazVpbmUKK3NrMWkKK3NrNWluNGcKK3MxbDIKK3MzbGF0CitzMmxlCitzbDJpdGg1CitzbDFpdAorMnMxbQorczNtYQorc21hbDFsMworc21hMm4zCitzbWVsNAorczVtZW4KKzVzNG0yaXRoCitzbW8ybDVkNAorczFtbworczFuNAorMXNvCitzbzRjZQorc28yZnQzCitzbzRsYWIKK3NvMWxhCitzbzJsM2QyCitzbzNsaWMKK3NvbDJpCis1c29sMnYKKzNzb20KKzNzNG9uLgorc28ybgorc28xbjFhNAorc29uNGcKK3M0b3AKKzVzb3BoMWljCitzMm9waAorczVvM3BoaXoKK3M1bzFwaHkKK3NvcjVjCitzb3I1ZAorNHNvdgorc281dmkKKzJzMXBhCis1c3A0YWkyCitzcGE0bgorc3BlbjRkCisyczVwZW8KKzJzcGVyCitzMnBoZQorM3NwaDRlcgorc3BobzUKK3NwaWw0CitzcDVpbmcKK3NwaTJuCis0czNwMmkxbworczRwMWx5CitzMXAybDIKK3M0cG8ybgorczFwNG9yNAorNHNwNG90CitzcXVhbDRsCitzcXUyCitzMXIKKzJzcworczFzYTIKK3NzYXMzCitzMnM1YworczNzZWwKK3M1c2VuNWcKK3M0c2VzLgorc3MxZTRzCitzNXNldAorczFzaQorczRzMmllNAorc3NpNGVyCitzNHM1aTFseQorczRzMWwyCitzczRsaQorczRzMW40Citzc3BlbjRkNAorc3MydAorc3N1MXI1YQorczFzdQorc3N1MnIKK3NzNXcyCisyc3QuCitzMnRhZworczF0YQorczJ0YTJsCitzdGFtNGkKKzVzdDRhbmQKK3N0YTJuCitzNHRhNHAKKzVzdGF0LgorczR0MWVkCitzdGVybjVpCitzNXQyZXJvCitzdGUydworc3RlMXc1YQorczN0aDJlCitzdDJpCitzNHRpLgorczV0MmkxYQorczF0aWMKKzVzNHRpY2sxCitzNHQyaWU0CitzM3RpZjIKK3N0M2luZworczJ0MWluCis1c3Q0aXIKK3MxdGxlCitzMnRsCis1c3RvY2sxCitzMXRvCitzdG8ybTNhCis1c3RvbmUKK3N0bzJuCitzNHRvcAorM3N0b3JlCitzdDRyCitzNHRyYTJkCitzMXRyYQorNXN0cmEydHUKK3M0dHJheQorczR0cjJpZAorNHN0cnkKKzRzdDN3NAorczJ0eQorMXN1CitzdTFhbAorc3U0YjMKK3N1MmczCitzdTVpcworczJ1aTIKK3N1aXQzCitzNHVsCitzdTJtCitzdTFtM2kKK3N1Mm4KK3N1MnIKKzRzdgorc3cyCis0czF3bzIKK3M0eQorNHN5MWMKKzNzeWwKK3N5bjVvCitzeTVyaW4KKzF0YQorM3RhLgorMnRhYgordGE1YmxlczIKK3RhYjJsMgorNXRhYjVvNWwxaXoKK3RhYm9sMmkKKzR0NGEyY2kKK3RhNWRvCit0YTJkCis0dGEyZjQKK3RhaTVsbwordGFpMgordGEybAordGE1bGEKK3RhbDVlbgordDJhbGUKK3RhbDNpCis0dGFsawordGFsNGxpcwordGFsMWwKK3RhbGwyaQordGE1bG9nCit0YTVtbwordGFuNGRlCit0YTJuCit0NGFuZA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KK3RpbDFsCit0aWxsMmkKKzF0aW0KKzR0aTRtMXAKK3RpbTV1bAordGkybXUKKzJ0MWluCit0MmkxbmEKKzN0aTJuZS4KK3QyaW5lCiszdDJpbmkKKzF0MmlvCit0aTVvYwordGlvbjVlZQordGlvMm4KKzV0aXEKK3RpM3NhMgorM3Q0aXNlCit0aTJzNG0KK3RpNXNvCit0aXM0cAorNXRpc3RpMWNhCit0aXMxdDJpCit0aXMxdGljCit0aTN0bAordGk0dQorMXQyaXYKK3RpMXY0YQorMXRpegordGkzemExCit0aTN6ZTRuCit0aTJ6ZQorMnRsCit0NWxhCit0bGEybjQKKzN0bGUuCiszdGxlZAorM3RsZXMuCit0bGVzMgordDVsZXQuCit0NWxvCis0dDFtCit0bWU0CisydDFuMgorMXRvCit0bzNiCit0bzVjcmF0Cis0dG8yZG80CisydG9mCit0bzJncgordG81aWMKK3RvaTIKK3RvMm1hCit0bzRtNGIKK3RvM215Cit0b240YTRsMWkKK3RvMm4KK3RvMW4xYQordG8zbjJhdAorNHRvbm8KKzR0b255Cit0bzJyYQordG8zcjJpZTQKK3RvcjVpegordG9zMgorNXRvdXIKK3RvdTIKKzR0b3V0Cit0bzN3MmEycgorNHQxcAorMXRyYQordDJyYTNiCit0cmE1Y2gKK3RyNGEyY2k0Cit0cmEyYzRpdAordHJhYzR0ZQordHJhMmMxdAordHIyYXM0Cit0cmE1dmVuCit0cmF2NWUyczUKK3RyZTVmCit0cmU0bQordHJlbTVpCis1dHIyaTNhCit0cmk1Y2VzCit0cjRpY2UKKzV0cmkzYzJpMWEKK3Q0cjJpMWNpCis0dHJpNGMzczIKKzJ0cmltCit0cjJpNHYKK3RybzVtNGkKK3Ryb241aQordHJvMm4KKzR0cm9ueQordHJvNXBoZQordHIyb3BoCit0cm8zc3AKK3RybzN2Cit0cjJ1NWkyCit0cjJ1czQKKzR0MXMyCit0NHNjCit0czJoNAordDRzdzIKKzR0M3QyCit0NHRlcwordDV0bwordDF0dTQKKzF0dQordHUxYQord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sMmkKK3VsNGxpcworNHUybDNtCit1MWw0bworNHUybDFzMgordWxzNWU0cwordWwyc2UKK3VsMXRpCit1NGx0Cit1bDF0cmEzCit1bDF0cgorNHVsMXR1MgordTNsdQordWw1dWwKK3VsNXYKK3UybTVhYgordTFtYQordW00YmkKK3U0bTFiCit1bTRiMWx5Cit1bWIybDIKK3UxbWkKK3U0bTNpbmcKK3Vtb3I1bwordTFtbwordW1vMnIKK3U0bTJwCit1bjJhdDQKK3UxbmEKK3UybmUKK3VuNGVyCit1MW5pCit1bjRpbQordTJuMWluCit1bjVpczJoCit1bjJpM3YKK3UybjNzNAordW40c3cyCit1bjJ0M2E0YgordW4xdAordW4xdGEKK3VuNHRlci4KK3VuNHRlcwordW51NAordW41eQordTRuNXoKK3U0bzRyczIKK3U1b3MKK3Uxb3UyCit1MXBlCit1cGU0cjVzMgordTVwMmkzYQordXAzaW5nCit1cGkybgordTNwMmwyCit1NHAzcAordXBwb3J0NQordXAxcDRvcgordXAydDVpMmIKK3UycDF0Cit1cDF0dTQKK3UxcmEKKzR1cmEuCit1NHJhZwordTRyMmFzCit1cjRiZQordXIxYgordXIxYzQKK3VyMWQKK3VyZTVhMnQKK3VyNGZlcjEKK3VyMWYKK3VyNGZyCit1M3JpZgordXJpNGZpYwordXJpMWZpCit1cjFpbgordTNyMmkxbwordTFyaXQKK3VyM2l6Cit1cjJsCit1cmw1aW5nLgordXI0bm80Cit1cm9zNAordXI0cGUKK3VyMXAKK3VyNHBpCit1cnM1ZXIKK3U0cnMyCit1cjJzZQordXI1dGVzCit1cjN0aDJlCit1cjF0aTQKK3VyNHQyaWU0Cit1M3J1CisydXMKK3U1c2EyZAordXNhMgordTVzYTJuCit1czRhcAordXNjMgordXMzY2kKK3VzZTVhCit1NXMyaTFhCit1M3NpYwordXM0bGluCit1czFsMgordXMxcAordXM1czFsMgordTJzcwordXM1dGVyZQordXMxdDRyCit1MnN1Cit1c3UycjQKK3UydGE0YgordTF0YQordTN0YXQKKzR1NHRl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MXMyCisubWk4bDhsOWE4ZzhlLgorLm00aWwxbAorLm1pOGw5bDhpOWw4aTh0OGU4ci4KKy5taWxsMmkKKy5taWw0bDRpNGwKKy5taWxsaWwxaQorLm1pbGwyaWwxaXQKKy5taWxsaWwyaXRlCisubWk4bThlOG85ZzhyOGE4cDhoOGU4ZC4KKy5taW1lbzJnCisubWltZW8xZ3IKKy5taW1lb2dyYXBoNGVkCisubWk4bThlOG85ZzhyOGE4cDhoOHMuCisubWltZW9ncmE0cDRoMXMyCisubWk4bTlpOGM5cjhpOGU4cy4KKy5taW0xaQorLm1pbTRpMWNyCisubWltaWNyaTIKKy5taW1pY3IyaWU0CisubWk4bjlpOHMuCisubTJpbmkKKy5taW4xaXMKKy5taThuOGk5czh5OG05cDhvOXM4aTh1OG0uCisubWluaXM0eQorLm1pbmlzeTRtMXAKKy5taW5pc3ltMXBvcworLm1pbmlzeW1wbzVzaTR1CisubWk4bjhpOXM4eThtOXA4bzlzOGk4YS4KKy5taW5pc3ltcG9zMmkxYQorLm1pOW44dTh0OWU4ci4KKy5tNGluMXUKKy5taTluOHU4dDllOHM4dC4KKy5taThzOWM4aDhpOGU5djhvOHU4czlsOHkuCisubTJpczFjCisubWlzM2NoMgorLm1pc2NoMmllNAorLm1pc2NoaWV2b3UyCisubWlzY2hpZXZvMnVzCisubWlzY2hpZXZvdXMxbDIKKy5taXNjaGlldm91czFseQorLm1pOXM4ZThyOHMuCisubTRpc2UKKy5taXMzZXIKKy5taXNlNHIxczIKKy5taTlzOG84ZzlhOW04eS4KKy5taTJzbworLm1pc28xZ2EKKy5taXNvMmdhbQorLm1vOGQ5ZThsOWw4aThuOGcuCisubW8yZDEKKy5tb2RlbDFsCisubW9kZWxsMmkKKy5tb2RlbDJsaW40CisubW84bDllOWM4dThsOGUuCisubW9sZTFjdQorLm1vbGU0Y3VsCisubW9sZWN1bDRlCisubW84bDllOWM4dThsOGU4cy4KKy5tb2xlY3VsZXMyCisubW84bjlhOHI4YzhoOHMuCisubW8xbjFhCisubW9uYXIzYworLm1vbjJhMnIKKy5tb25hcjJjaAorLm1vbmFyYzRoMXMyCisubW84bjhlOHk5bDhlOG45ZDhlOHIuCisubW9uZXlsZW4xZGUKKy5tbzhuOGU4eTlsOGU4bjlkOGU4cjhzLgorLm1vbmV5bGVuZGU0cjVzMgorLm1vOG44bzljOGg4cjhvOG04ZS4KKy5tb25vMmNoNAorLm1vbm9jNGhyNAorLm1vbm9jaHJvMm1lCisubW84bjhvOWU4bjllOHI5ZzhlOHQ4aThjLgorLm1vM25vZQorLm1vbm9lbjFlcgorLm1vbm9lbmVyZzIKKy5tb25vZW5lcjNnZXQKKy5tb25vZW5lcmdldDFpYworLm1vOG45bzhpOGQuCisubW9ub2kyCisubW9ubzJpZAorLm1vOG44bzlwOG84bDhlLgorLm1vNG5vcAorLm1vOG44bzlwOG84bDhlOHMuCisubW9ub3BvbGVzMgorLm1vOW44bzhwOW84bDh5LgorLm1vbm9wbzJseQorLm1vOG44bzlzOHA4bDhpOG44ZS4KKy5tb25vczFwMmwyCisubW9ub3NwbGk0bgorLm1vbm9zcDFsNGluZQorLm1vOG44bzlzOHA4bDhpOG44ZThzLgorLm1vbm9zcGxpMW5lcworLm1vOG44bzlzOHQ4cjhvOGY4aThjLgorLm1vbm9zNXQKKy5tb25vc3Q0cgorLm1vbm9zdHJvMmZpCisubW85bjhvOHQ5bzluOGk4ZThzLgorLm1vbm8xdG8KKy5tbzJub3RvMm4KKy5tb25vdG9uMmllNAorLm1vOW44bzh0OW85bjhvOHU4cy4KKy5tb25vNHRvbm8KKy5tb25vdG8xbm91MgorLm1vbm90b25vMnVzCisubW85cjhvOG45aThzOG0uCisubW9ybzVuNGlzCisubW9ybzJuCisubW9yb25pMnMxbQorLm1vOHM5cTh1OGk5dDhvLgorLm1vczIKKy5tb3NxdTIKKy5tb3NxMnVpMgorLm1vc3F1aTF0bworLm1vOHM5cTh1OGk5dDhvOHMuCisubW9zcXVpdG9zMgorLm1vOHM5cTh1OGk5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m4yCisucGU4bjl0OGE5ZzhvOG44cy4KKy5wZW50YWdvMm4zczIKKy5wZTl0OHI4bzlsOGU5dThtLgorLnBldHJvbDRldQorLnBoOGU5bjhvOG05ZTluOG84bi4KKy5waDRlM25vCisucGhlMm4KKy5waGVubzJtZQorLnBoZW5vMW1lbgorLnBoZW5vbTRlbm8KKy5waGVub21lbm80bgorLnBoOGU4bjh5OGw5YThsOGE5bjhpOG44ZS4KKy5waGVueTNsYQorLnBoZW55bGFsYTJuCisucGhlbnlsYWxhNW4yaW5lCisucGhlbnlsYWxhbjFpbgorLnBoOGk5bDhhOHQ5ZTlsOGk4czh0LgorLnBoaTRsYXRlbDJpNAorLnBoaWxhdGUybGlzCisucGg4aTlsOGE4dDllOWw4aThzOHQ4cy4KKy5waGlsYXRlbGlzNHQxczIKKy5waDhvOW44ZThtOGUuCisuM3Bob25lCisucGhvMm4KKy5waG9uZTFtZQorLnBoOG85bjhlOG04ZThzLgorLnBob25lMm1lcworLnBoOG85bjhlOW04aThjLgorLnBob25lNW1pCisucGg4bzhzOXA4aDhvOHI5aThjLgorLnBob3MxcAorLnBob3NwaG81CisucGhvc3BobzRyCisucGg4bzl0OG85ZzhyOGE4cDhoOHMuCisucGhvMXRvCisucGhvdG8yZ3IKKy5waG90b2dyYTRwNGgxczIKKy5waDhvOXQ4bzlvOGY4ZjlzOGU4dC4KKy5waG90b28yCisucGhvdG9vNGYxZgorLnBob3Rvb2YyZjNzCisucGk4YzlhOWQ4bzhyLgorLnBpMWNhCisucGljYTJkCisucGljYTFkbworLnBpY2FkNG9yCisucGk4YzlhOWQ4bzhyOHMuCisucGljYWRvNHJzMgorLnBpOHA4ZTlsOGk4bjhlLgorLnAyaXAKKy5waXBlNAorLnBpcGVsMmkKKy5waXBlMWw0aW5lCisucGk4cDhlOWw4aThuOGU4cy4KKy5waXBlbGkxbmVzCisucGk4cDhlOWw4aThuOWk4bjhnLgorLnBpcGVsMmluM2kKKy5waXBlbGluMWluCisucGlwZWxpbmlu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orLnByOGU5cDhyOG84YzhlOHM5czhvOHIuCisucHJlM3BybworLnByZXByMm9jCisucHJlcHJvMWNlCisucHJlcHJvYzJlMnNzCisucHJlcHJvY2VzMXNvCisucHI4ZTlwOHI4bzhjOGU4czlzOG84cjhzLgorLnByZXByb2Nlc3NvNHJzMgorLnByOGU5czhwOGw4aTh0OXQ4aThuOGcuCisucHJlMXNwCisucHJlczFwMmwyCisucHJlc3BsMWl0CisucHJlc3BsNGk0dDN0MgorLnByZXNwbGl0MnQxaW4KKy5wcjhlOXc4cjhhOHAuCisucHJld3JhNAorLnByOGU5dzhyOGE4cDhwOGU4ZC4KKy5wcmV3cmE0cDFwCisucHJld3JhcDJwZQorLnByZXdyYXA0cDJlZAorLnByOGk4ZThzOHQ5ZThzOHM4ZThzLgorLjVwcjJpNGU0CisucHJpMWVzdAorLnByaWVzNHQyZTJzcworLnByaWVzdGVzczFlNHMKKy5wcjhlOHQ5dDh5OXA4cjhpOG45dDhlOHIuCisucHJlNHQzdDIKKy5wcmV0MXR5CisucHIyZXR0eXByMgorLnByZXR0eXByaW40dDMKKy5wcjhlOHQ5dDh5OXA4cjhpOG45dDhpOG44Zy4KKy5wcmV0dHlwcmludDJpCisucHJldHR5cHJpbjR0M2luZworLnByZXR0eXByaW4ydDFpbgorLnByOG85YzhlOWQ4dThyOWE4bC4KKy5wcjJvYworLnBybzFjZQorLnByb2NlMWR1CisucHJvY2VkdTFyYQorLnByOG84YzhlOHM4cy4KKy5wcm9jMmUyc3MKKy5wcjhvOWM4dThyOWE4bjhjOGUuCisucHJvY3UxcmEKKy5wcm9jdXJhMm4KKy5wcjhvOGc5ZTluOGk4ZThzLgorLnBybzFnZQorLnBybzFnZW4KKy5wcm9nZTVuMmllNAorLnByOG84ZzllOW44eS4KKy5wcm80Z2VueQorLnByOG85ZzhyOGE4bTltOGE4YjhsOGUuCisucHJvMWdyCisucHJvZ3JhbTFtCisucHJvZ3JhbTFtYQorLnByb2dyYW0ybWFiCisucHJvZ3JhbW1hYjJsMgorLnByOG84bTlpOW44ZThuOHQuCisucHJvbTRpCisucHJvbTFpbgorLnByb20yaW5lCisucHJvbWkxbmVuCisucHJvbWluZW4xdAorLnByOG85bThpOHM5Yzh1OW84dThzLgorLnByb20yaXMKKy5wcm9tMmlzMWMKKy5wcm9taXMxY3UKKy5wcm9taXNjdTFvdTIKKy5wcm9taXNjdW8ydXMKKy5wcjhvOG05aThzOXM4bzhyOHkuCisucHJvbTRpMnMxcworLnByb21pczFzbworLnByb21pc3NvMXJ5CisucHI4bzhtOWk4czhlLgorLnByb200aXNlCisucHI4bzhtOWk4czhlOHMuCisucHJvbWlzMWU0cworLnByOG85cDhlOGw5bDhlOHIuCisucHJvM3BlbAorLnByb3BlbDFsCisucHJvcGVsMmxlCisucHI4bzlwOGU4bDlsOGU4cjhzLgorLnByb3BlbGxlNHIxczIKKy5wcjhvOXA4ZThsOWw4aThuOGcuCisucHJvcGVsbDJpCisucHJvcGVsMmxpbjQKKy5wcjhvOWg4aThiOWk5dDhpOHY4ZS4KKy5wcm8xaDIKKy5wcm9oaWJpMnQKKy5wcm9oaWJpMXRpCisucHJvaGliaTF0Mml2CisucHI4bzloOGk4YjlpOXQ4aTh2OGU5bDh5LgorLnByb2hpYml0aXY0ZTFseQorLnByOG85czhjOGk4dTh0OXQ4by4KKy5wcm9zMmMKKy5wcm9zMWNpCisucHJvc2NpMXUKKy5wcm9zY2l1NHQzdDIKKy5wcm9zY2l1dDV0bworLnByOG85dDhlOHM4dDllOHIuCisucHJvMXQKKy5wcm80dGVzCisucHI4bzl0OGU4czh0OWU4cjhzLgorLnByb3Rlc3RlNHIxczIKKy5wcjhvOXQ4ZThzOXQ4bzhyLgorLnByb3Q0ZXMydG8KKy5wcjhvOXQ4ZThzOXQ4bzhyOHMuCisucHJvdGVzdG80cnMyCisucHI4bzl0OG85bDhhOG45Zzh1OGE4ZzhlLgorLnBybzF0bworLnByb3RvMWxhCisucHJvdG80bGEybgorLnByb3RvbDJhbmcKKy5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bjhkLgorLnR1cjRuMmEycgorLnR1cjFuYQorLnR1cm5hcm91MgorLnR1cm5hcm91bjJkCisudHU4cjhuOWE4cjhvOHU4bjhkOHMuCisudHVybmFyb3VuMmQxczIKKy50eThwOWE4bC4KKy4xdHkKKy50eTFwYQorLnR5cDRhbAorLnVuOWE4dDl0OGE4YzhoOGU4ZC4KKy51bjJhdDQKKy51bmE0dDN0MgorLnVuYXQxdGEKKy51bmF0dGEyY2gKKy51bmF0dGFjaGUyCisudW5hdHRhNGNoNGVkCisudW45ZThyOHI5aThuOGc5bDh5LgorLnVuNGVyCisudW5lcjRyNAorLnVuZXJyaW40ZworLnVuZXJyaW5nbDIKKy51bmVycmluZzFseQorLnVuOWY4cjhpOGU4bjhkOWw4eS4KKy51bjNmCisudW5mcmkyCisudW5mcjJpZTQKKy51bmZyaWVuMmQxbHkKKy51bjlmOHI4aThlOG44ZDlsOGk5ZThyLgorLnVuZnJpZW5kbDJpZTQKKy52YThnOHU4ZThyLgorLjF2YQorLnZhZzQKKy52YTVndWVyCisudmEyZ3VlCisudmE4dThkOGU5djhpOGw4bDhlLgorLnZhdWRlMXY0CisudmF1ZGUydjNpNGwKKy52YXVkZTF2aQorLnZhdWRldmlsMWwKKy52YXVkZXZpbDJsZQorLnZpOGM5YThyOHMuCisudjRpYzJhMnIKKy52aTFjYQorLnZpY2E0cnMyCisudmk4bDlsOGE4aThuOWU4czhzLgorLjJ2aWwKKy52aWwxbAorLnZpbGxhaTIKKy52aWxsYTRpNG4KKy52aWxsYTJpbmUKKy52aWxsYWk1bjJlMnNzCisudmlsbGFpMW5lcworLnZpOHM5dThhOGwuCisudmkzc3UKKy52aXN1MWFsCisudmk4czl1OGE4bDlsOHkuCisudmlzdWFsMWwKKy52aXN1YWwxbHkKKy52aTl2OGk4cDlhOXI4bzh1OHMuCisuM3YyaXYKKy52aXYyaTRwCisudml2aTFwYQorLnZpdmlwMmEycgorLnZpdmlwYXJvdTIKKy52aXZpcGFybzJ1cworLnZvOGk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KKy53aGl0ZXNpMmQxZWQKKy53aDhpOHQ4ZTlzOHA4YThjOGUuCisud2hpdGUxc3AKKy53aGl0ZTJzMXBhCisud2hpdGVzcGE0Y2UKKy53aDhpOHQ4ZTlzOHA4YThjOGU4cy4KKy53aThkOGU5czhwOHI4ZThhOGQuCisudzJpZAorLndpZGU0czIKKy53aWRlMXNwCisud2lkZXM0cHJlCisud2lkZXNwcjIKKy53aWRlc3ByZWEyZDEKKy53aThuOGc5czhwOGE4bi4KKy53aW40ZworLndpbmdzMgorLndpbmcyczFwYQorLndpbmdzcGE0bgorLndpOG44ZzlzOHA4YThuOHMuCisud2luZ3NwYTJuMXMyCisud2k4bjhnOXM4cDhyOGU4YThkLgorLndpbmdzcHIyCisud2luZ3NwcmVhMmQxCisud2k4dDhjOGg5YzhyOGE4Zjh0LgorLndpNHRjCisud2l0NGNoCisud2l0Y2hjcmEyZjR0Cisud2l0Y2hjcmEyZgorLndvOHI4ZDlzOHA4YThjOWk4bjhnLgorLjF3bzIKKy53b3IyZDFzMgorLndvcmRzNHAKKy53b3JkMnMxcGEKKy53b3Jkc3A0YTJjaQorLndvcmRzcGEyYzFpbgorLndvcmRzcGFjMWluZworLndvOHI4azlhOHI4bzh1OG44ZC4KKy53b3JrMmEycgorLndvcmthcm91MgorLndvcmthcm91bjJkCisud284cjhrOWE4cjhvOHU4bjhkOHMuCisud29ya2Fyb3VuMmQxczIKKy53bzhyOGs5aDhvOHI4czhlLgorLndvcmtoNAorLndvcmtob3I0c2UKKy53b3JraG80cnMyCisud284cjhrOWg4bzhyOHM4ZThzLgorLndvcmtob3JzM2U0cworLndyOGE4cDlhOHI4bzh1OG44ZC4KKy53cmE0Cisud3JhcDJhMnI0Cisud3JhMXBhCisud3JhcGFyb3UyCisud3JhcGFyb3VuMmQKKy53cjhlOHQ4YzhoOWU4ZC4KKy53cmU0dGMKKy53cmV0NGNoCisud3JldGNoZTIKKy53cmV0NGNoNGVkCisud3I4ZTh0OGM4aDllOGQ5bDh5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4azhpLgorLjVqYQorLmphY2sxCisuamFja293c2syCisuamFja293c2sxaQorLmphOG45dTlhOHI4eS4KKy5qYTJuCisuamFuM3UxYQorLmphbnUyYTJyCisuamE5cDhhOW44ZThzOGUuCisuamE0cAorLmphMXBhCisuamFwYTJuCisuamFwYTFuZXMKKy5qYXBhbmUxczJlCisua2E4ZDlvOG05dDhzOGU4di4KKy5rYTJkCisua2ExZG8KKy5rYWRvNG10Cisua2Fkb200dDFzMgorLmthZG9tdDVzZXYKKy5rYThuOXM4YThzLgorLmthMm4KKy5rYW4yc2EyCisua2EybjFzMgorLmthOHI4bDhzOXI4dThoOGUuCisuazJhMnIKKy5rYXIxbAorLmthcjJsMXMyCisua2FybHMxcgorLmtvOHI5dDhlOXc4ZThnLgorLmtvNXIKKy5rcjhpOHM4aDhuOGEuCisua3IyaXMKKy5rcjNpczJoCisua3JpczJoMW4KKy5rcmlzaDFuYQorLmtyOGk4czhoOW44YTlpOHM4bS4KKy5rcmlzaG5haTIKKy5rcmlzaG5haTJzMW0KKy5rcjhpOHM4aDluOGE4bi4KKy5rcmlzaG4yYTJuCisubGE4bjljOGE4czl0OGU4ci4KKy5sYW4xY2EKKy5sYW5jYXN0NWVyCisubGU5ZzhlOG44ZDhyOGUuCisubGUxZ2VuCisubGVnZW4xZHIKKy5sZWdlbmRyZTQKKy5sZThpOGM4ZThzOXQ4ZThyLgorLmxlaTIKKy5sZTVpYworLmxlaWNlczV0CisubGk4cDlzOGM4aDhpOHQ4ei4KKy5sMmlwCisubGkycDFzMgorLmxpcHMyY2gyCisubGlwczNjaGl0CisubGlwc2NoaTR0egorLmxpOHA5czhjOGg4aTh0OHo5aThhOG4uCisubGlwc2NoaXQyejFpCisubGlwc2NoaXR6MmkxYQorLmxpcHNjaGl0emkyYTJuCisubG84ajliOGE4bi4KKy5sbzVqCisubG9qYmEybgorLmxvOHU5aTlzOGk5YThuOGEuCisubG91MgorLmxvMnVpMgorLmxvdWlzMmkxYQorLmxvdWlzaTJhMm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5uaWptZTJnCisubmlqbWUxZ2VuCisubm84ZTl0OGg4ZThyOWk4YThuLgorLjNub2UKKy5ub2V0aDJlCisubm9ldGhlcjFpCisubm9ldGhlMXIyaTNhNAorLm5vZXRoZXJpMmEybgorLm5vOG84cjhkOXc4aThqOGs4ZThyOWg4bzh1OHQuCisubm9vMgorLm5vM29yZAorLm5vb3JkMXcKKy5ub29yZHdpMgorLm5vb3Jkd2kzagorLm5vb3Jkd2lqazFlcgorLm5vb3Jkd2lqa2VyMWg0Cisubm9vcmR3aWprZXJob3UyCisubm85djhlOG05YjhlOHIuCisubm92ZTRtNWIKKy5vcDhlOG45YjhzOGQuCisub3BlNG4xYjQKKy5vcGVuMmI1czIKKy5vcGVuYjRzNWQKKy5vcDhlOG45bzhmOGY4aThjOGUuCisub3A0ZW5vCisub3Blbm80ZjFmCisub3Blbm9mMWZpCisucGE4bDhhOXQ4aThuOG8uCisucGFsYTJ0MWluCisucGFsYXQyaTFubworLnBhOWw4ZThyOW04by4KKy5wYWxlcjNtNAorLnBhbGVyMW1vCisucGU5dDhyOG84djlzOGs4aS4KKy5wZXRybzN2CisucGV0cm92c2syCisucGV0cm92c2sxaQorLnBmOGE4ZjhmOWk4YThuLgorLjRwZgorLnAxZmEKKy5wZmEyZgorLnBmYTRmMWY0CisucGZhZjFmaQorLnBmYWZmMmkzYQorLnBmYWZmaTJhMm4KKy5waDhpOGw5YTlkOGU4bDlwOGg4aThhLgorLnBoaTRsNGFkZQorLnBoaWxhMmQKKy5waGlsYWRlMmxwCisucGhpbGFkZWw1cGhpCisucGhpbGFkZWxwaDJpMWEKKy5waDhpOGw5bzlzOG84cDhoOWk5czhjOGg4ZS4KKy5waGlsbzJzbworLnBoaWxvczRvcAorLnBoaWxvczJvcGgKKy5waGlsb3NvcGgyaXMxYworLnBoaWxvc29waGlzM2NoMgorLnBoaWxvc29waGlzY2hlMgorLnBvOGk4bjljOGE4cjhlLgorLnBvaW4yCisucG9pMgorLnBvaW5jMmEycjUKKy5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pbmcgcGVybWlzc2lvbnMgYW5kCisgICAgIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorLS0+CisKKzxMaW5lYXJMYXlvdXQgeG1sbnM6YW5kcm9pZD0iaHR0cDovL3NjaGVtYXMuYW5kcm9pZC5jb20vYXBrL3Jlcy9hbmRyb2lkIgorICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgICAgICAgYW5kcm9pZDpvcmllbnRhdGlvbj0idmVydGljYWwiID4KKyAgICA8VGV4dFZpZXcgYW5kcm9pZDppZD0iQCtpZC9hY3Rpb25fYmFyX3RpdGxlIgorICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgorICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgYW5kcm9pZDpzaW5nbGVMaW5lPSJ0cnVlIgorICAgICAgICBhbmRyb2lkOmVsbGlwc2l6ZT0iZW5kIgorICAgICAgICBhbmRyb2lkOnRleHRBcHBlYXJhbmNlPSI/YW5kcm9pZDphdHRyL3RleHRBcHBlYXJhbmNlTWVkaXVtSW52ZXJzZSIgLz4KKyAgICA8VGV4dFZpZXcgYW5kcm9pZDppZD0iQCtpZC9hY3Rpb25fYmFyX3N1YnRpdGxlIgorICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgorICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKKyAgICAgICAgYW5kcm9pZDpzaW5nbGVMaW5lPSJ0cnVlIgorICAgICAgICBhbmRyb2lkOmVsbGlwc2l6ZT0iZW5kIgorICAgICAgICBhbmRyb2lkOnRleHRBcHBlYXJhbmNlPSI/YW5kcm9pZDphdHRyL3RleHRBcHBlYX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XRfYWxpZ25QYXJlbnRMZWZ0PSJ0cnVlIgogICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luVG9wPSI4ZGlwIgorICAgICAgICAgICAgYW5kcm9pZDpsYXlvdXRfbWFyZ2luQm90dG9tPSI4ZGlwIgogICAgICAgICAgICAgPgogCiAgICAgICAgICAgICA8VGV4dFZpZXcgYW5kcm9pZDppZD0iQCtpZC90aW1lRGlzcGxheSIKICAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgogICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgotICAgICAgICAgICAgICAgIGFuZHJvaWQ6Z3Jhdml0eT0iYm90dG9tIgogICAgICAgICAgICAgICAgIGFuZHJvaWQ6c2luZ2xlTGluZT0idHJ1ZSIKICAgICAgICAgICAgICAgICBhbmRyb2lkOmVsbGlwc2l6ZT0ibm9uZSIKICAgICAgICAgICAgICAgICBhbmRyb2lkOnRleHRTaXplPSI3MnNwIgpAQCAtODQsOCArODUsOSBAQAogCiAgICAgICAgICAgICA8VGV4dFZpZXcgYW5kcm9pZDppZD0iQCtpZC9hbV9wbSIKICAgICAgICAgICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgotICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0ibWF0Y2hfcGFyZW50IgotICAgICAgICAgICAgICAgIGFuZHJvaWQ6Z3Jhdml0eT0iYm90dG9tIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X3RvUmlnaHRPZj0iQGlkL3RpbWVEaXNwbGF5IgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bGF5b3V0X2FsaWduQmFzZWxpbmU9IkBpZC90aW1lRGlzcGxheSI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JsaWMgdHlwZT0iYXR0ciIgbmFtZT0icXVpY2tDb250YWN0QmFkZ2VTdHlsZVNtYWxsV2luZG93U21hbGwiIGlkPSIweDAxMDEwMmIxIiAvPgogICA8cHVibGljIHR5cGU9ImF0dHIiIG5hbWU9InF1aWNrQ29udGFjdEJhZGdlU3R5bGVTbWFsbFdpbmRvd01lZGl1bSIgaWQ9IjB4MDEwMTAyYjIiIC8+CiAgIDxwdWJsaWMgdHlwZT0iYXR0ciIgbmFtZT0icXVpY2tDb250YWN0QmFkZ2VTdHlsZVNtYWxsV2luZG93TGFyZ2UiIGlkPSIweDAxMDEwMmIzIiAvPgotICAKKwogPCEtLSA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgICAgUmVzb3VyY2VzIGFkZGVkIGluIHZlcnNpb24gNyBvZiB0aGUgcGxhdGZvcm0gKEVjbGFpciBNUjEpLgogICAgICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gLS0+CkBAIC0xMjE1LDcgKzEyMTUsNyBAQAogICA8cHVibGljIHR5cGU9ImF0dHIiIG5hbWU9ImF1dGhvciIgaWQ9IjB4MDEwMTAyYjQiIC8+CiAgIDxwdWJsaWMgdHlwZT0iYXR0ciIgbmFtZT0iYXV0b1N0YXJ0IiBpZD0iMHgwMTAxMDJiNSIgLz4KIAotICAgIAorCiA8IS0tID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgICBSZXNvdXJjZXMgYWRkZWQgaW4gdmVyc2lvbiA4IG9mIHRoZSBwbGF0Zm9ybSAoRWNsYWlyIE1SMikuCiAgICAgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAtLT4KQEAgLTEyMzYsMTggKzEyMzYsMTggQEAKICAgPHB1Ym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gSU5URUdFUiwgcyBJTlRFR0VSKTsiKTsKLSAgICAgICAgZm9yKGludCBpID0gMDsgaSA8IDIwOyBpKyspIHsKLSAgICAgICAgICAgIG1EYXRhYmFzZS5leGVjU1FMKCJJTlNFUlQgSU5UTyB0ZXN0IChkLCBzKSBWQUxVRVMgKCIgKyBpICsgCi0gICAgICAgICAgICAgICAgIiwiICsgaSUyICsgIik7Iik7Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIEN1cnNvciBjID0gbURhdGFiYXNlLnF1ZXJ5KCJ0ZXN0IiwgbnVsbCwgInMgPSAwIiwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCk7Ci0gICAgICAgIGludCBkQ29sID0gYy5nZXRDb2x1bW5JbmRleE9yVGhyb3coImQiKTsKLSAgICAgICAgaW50IHNDb2wgPSBjLmdldENvbHVtbkluZGV4T3JUaHJvdygicyIpOwotICAgICAgICAKLSAgICAgICAgaW50IGNvdW50ID0gMDsKLSAgICAgICAgd2hpbGUgKGMubW92ZVRvTmV4dCgpKSB7Ci0gICAgICAgICAgICBhc3NlcnRUcnVlKGMudXBkYXRlSW50KGRDb2wsIDMpKTsKLSAgICAgICAgICAgIGNvdW50Kys7Ci0gICAgICAgIH0KLSAgICAgICAgYXNzZXJ0RXF1YWxzKDEwLCBjb3VudCk7Ci0gICAgICAgIAotICAgICAgICBhc3NlcnRUcnVlKGMuY29tbWl0VXBkYXRlcygpKTsKLSAgICAgICAgCi0gICAgICAgIGFzc2VydFRydWUoYy5yZXF1ZXJ5KCkpOwotICAgICAgICAKLSAgICAgICAgY291bnQgPSAwOwotICAgICAgICB3aGlsZSAoYy5tb3ZlVG9OZXh0KCkpIHsKLSAgICAgICAgICAgIGFzc2VydEVxdWFscygzLCBjLmdldEludChkQ29sKSk7Ci0gICAgICAgICAgICBjb3VudCsrOwotICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICBhc3NlcnRFcXVhbHMoMTAsIGNvdW50KTsKLSAgICAgICAgYX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bURhdGFiYXNlLmV4ZWNTUUwoImluc2VydCBpbnRvIEIgdmFsdWVzKDIwMik7Iik7CisgICAgICAgIG1EYXRhYmFzZS5leGVjU1FMKCJpbnNlcnQgaW50byBCIHZhbHVlcygyMDMpOyIpOworICAgICAgICBtRGF0YWJhc2UuZXhlY1NRTCgiaW5zZXJ0IGludG8gQyB2YWx1ZXMoOTAxKTsiKTsKKyAgICAgICAgbURhdGFiYXNlLmV4ZWNTUUwoImluc2VydCBpbnRvIEMgdmFsdWVzKDkwMik7Iik7CisgICAgICAgIFN0cmluZyBzID0gInNlbGVjdCBpIGZyb20gQSB3aGVyZSBpID4gMiAiICsKKyAgICAgICAgICAgICAgICAiVU5JT04gc2VsZWN0IGsgZnJvbSBCIHdoZXJlIGsgPiAyMDEgIiArCisgICAgICAgICAgICAgICAgIlVOSU9OIHNlbGVjdCBuIGZyb20gQyB3aGVyZSBuICE9OTAwOyI7CisgICAgICAgIEN1cnNvciBjID0gbURhdGFiYXNlLnJhd1F1ZXJ5KHMsIG51bGwpOworICAgICAgICBpbnQgbiA9IGMuZ2V0Q291bnQoKTsKKyAgICAgICAgYy5jbG9zZSgpOworICAgICAgICBTdHJpbmcgczEgPSAic2VsZWN0IGkgZnJvbSBBIHdoZXJlIGkgPiA/ICIgKworICAgICAgICAgICAgICAgICJVTklPTiBzZWxlY3QgayBmcm9tIEIgd2hlcmUgayA+ID8gIiArCisgICAgICAgICAgICAgICAgIlVOSU9OIHNlbGVjdCBuIGZyb20gQyB3aGVyZSBuICE9ID87IjsKKyAgICAgICAgQ3Vyc29yIGMxID0gbURhdGFiYXNlLnJhd1F1ZXJ5KHMxLCBuZXcgU3RyaW5nW117IjIiLCAiMjAxIiwgIjkwMCJ9KTsKKyAgICAgICAgYXNzZXJ0RXF1YWxzKG4sIGMxLmdldENvdW50KCkpOworICAgICAgICBjMS5jbG9zZSgpOworICAgIH0KKwogICAgIC8qKgogICAgICAqIFRoaXMgdGVzdCBpcyBhdmFpbGFibGUgb25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ICAgICAgICAgU1FMaXRlU3RhdGVtZW50IGMgPSBtRGF0YWJhc2UuY29tcGlsZVN0YXRlbWVudCgic2VsZWN0ICogZnJvbSB0ZXN0IHdoZXJlIGkgPSAiICsgaSk7CisgICAgICAgICAgICBjLmNsb3NlKCk7CisgICAgICAgICAgICBzdG10T2Jqcy5hZGQoaSwgYyk7CisgICAgICAgIH0KKworICAgICAgICBhc3NlcnRFcXVhbHMoMCwgc3RtdE9ianMuZ2V0KDApLmdldFVuaXF1ZUlkKCkpOworICAgICAgICBmb3IgKGludCBpID0gMTsgaSA8IE4rMTsgaSsrKSB7CisgICAgICAgICAgICBhc3NlcnRUcnVlKHN0bXRPYmpzLmdldChpKS5nZXRVbmlxdWVJZCgpID4gMCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAU21hbGxUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdFNldE1heENhaGVzaXplKCkgeworICAgICAgICBtRGF0YWJhc2UuZXhlY1NRTCgiQ1JFQVRFIFRBQkxFIHRlc3QgKGkgaW50LCBqIGludCk7Iik7CisgICAgICAgIG1EYXRhYmFzZS5leGVjU1FMKCJpbnNlcnQgaW50byB0ZXN0IHZhbHVlcygxLDEpOyIpOworICAgICAgICAvLyBzZXQgY2FjaGUgc2l6ZQorICAgICAgICBpbnQgTiA9IFNRTGl0ZURhdGFiYXNlLk1BWF9TUUxfQ0FDSEVfU0laRTsKKyAgICAgICAgbURhdGFiYXNlLnNldE1heFNxbENhY2hlU2l6ZShOKTsKKworICAgICAgICAvLyB0cnkgcmVkdWNlIGNhY2hlc2l6ZQorICAgICAgICB0cnkgeworICAgICAgICAgICAgbURhdGFiYXNlLnNldE1heFNxbENhY2hlU2l6ZSgxKTsKKyAgICAgICAgfSBjYXRjaCAoSWxsZWdhbFN0YXRlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIGFzc2VydFRydWUoZS5nZXRNZXNzYWdlKCkuY29udGFpbnMoImNhbm5vdCBzZXQgY2FjaGVTaXplIHRvIGEgdmFsdWUgbGVzcyB0aGFuIikpOworICAgICAgICB9CisgICAgfQorCisgICAgQExhcmdlVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3REZWZhdWx0RGF0YWJhc2VFcnJvckhhbmRsZXIoKSB7CisgICAgICAgIERlZmF1bHREYXRhYmFzZUVycm9ySGFuZGxlciBlcnJvckhhbmRsZXIgPSBuZXcgRGVmYXVsdERhdGFiYXNlRXJyb3JIYW5kbGVyKCk7CisKKyAgICAgICAgLy8gY2xvc2UgdGhlIGRhdGFiYXNlLiBhbmQgY2FsbCBjb3JydXB0aW9uIGhhbmRsZXIuCisgICAgICAgIC8vIGl0IHNob3VsZCBkZWxldGUgdGhlIGRhdGFiYXNlIGZpbGUuCisgICAgICAgIEZpbGUgZGJmaWxlID0gbmV3IEZpbGUobURhdGFiYXNlLmdldFBhdGgoKSk7CisgICAgICAgIG1EYXRhYmFzZS5jbG9zZSgpOworICAgICAgICBhc3NlcnRGYWxzZShtRGF0YWJhc2UuaXNPcGVuKCkpOworICAgICAgICBhc3NlcnRUcnVlKGRiZmlsZS5leGlzdHMoKSk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBlcnJvckhhbmRsZXIub25Db3JydXB0aW9uKG1EYXRhYmFzZSk7CisgICAgICAgICAgICBhc3NlcnRGYWxzZShkYmZpbGUuZXhpc3RzKCkpOworICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgZmFpbCgidW5leHBlY3RlZCIpOworICAgICAgICB9CisKKyAgICAgICAgLy8gY3JlYXRlIGFuIGluLW1lbW9yeSBkYXRhYmFzZS4gYW5kIGNvcnJ1cHRpb24gaGFuZGxlciBzaG91bGRuJ3QgdHJ5IHRvIGRlbGV0ZSBpdAorICAgICAgICBTUUxpdGVEYXRhYmFzZSBtZW1vcnlEYiA9IFNRTGl0ZURhdGFiYXNlLm9wZW5PckNyZWF0ZURhdGFiYXNlKCI6bWVtb3J5OiIsIG51bGwp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PSAwOyBpIDwgTjsgaSsrKSB7CisgICAgICAgICAgICBhc3NlcnRUcnVlKG5ldyBGaWxlKGF0dGFjaGVkRGJGaWxlcy5nZXQoaSkpLmV4aXN0cygpKTsKKyAgICAgICAgfQorICAgICAgICBhc3NlcnROb3ROdWxsKGRiT2JqKTsKKyAgICAgICAgYXNzZXJ0VHJ1ZShkYk9iai5pc09wZW4oKSk7CisgICAgICAgIGF0dGFjaGVkRGJzID0gZGJPYmouZ2V0QXR0YWNoZWREYnMoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGVycm9ySGFuZGxlci5vbkNvcnJ1cHRpb24oZGJPYmopOworICAgICAgICAgICAgYXNzZXJ0RmFsc2UoZGJmaWxlLmV4aXN0cygpKTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgTjsgaSsrKSB7CisgICAgICAgICAgICAgICAgYXNzZXJ0RmFsc2UobmV3IEZpbGUoYXR0YWNoZWREYkZpbGVzLmdldChpKSkuZXhpc3RzKCkpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgZmFpbCgidW5leHBlY3RlZCIpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogdGVzdCB0byBtYWtlIHN1cmUgdGhlIHN0YXRlbWVudCBmaW5hbGl6YXRpb25zIGFyZSBub3QgZG9uZSByaWdodCBhd2F5IGJ1dAorICAgICAqIHBpZ2d5YmFja2VkIG9udG8gdGhlIG5leHQgc3FsIHN0YXRlbWVudCBleGVjdXRpb24gb24gdGhlIHNhbWUgZGF0YWJhc2UuCisgICAgICovCisgICAgQFNtYWxsVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3RTdGF0ZW1lbnRDbG9zZSgpIHsKKyAgICAgICAgbURhdGFiYXNlLmV4ZWNTUUwoIkNSRUFURSBUQUJMRSB0ZXN0IChpIGludCk7Iik7CisgICAgICAgIC8vIGZpbGwgdXAgc3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aWQgcnVuKCkgeworICAgICAgICAgICAgICAgIGludCBOID0gMjY7CisgICAgICAgICAgICAgICAgbURhdGFiYXNlLnNldE1heFNxbENhY2hlU2l6ZShOKTsKKyAgICAgICAgICAgICAgICBTUUxpdGVTdGF0ZW1lbnQgc3RtdDsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47IGkgKyspIHsKKyAgICAgICAgICAgICAgICAgICAgc3RtdCA9IG1EYXRhYmFzZS5jb21waWxlU3RhdGVtZW50KCJpbnNlcnQgaW50byB0ZXN0IHZhbHVlcygiICsgaSArICIpOyIpOworICAgICAgICAgICAgICAgICAgICBzdG10LmV4ZWN1dGVJbnNlcnQoKTsKKyAgICAgICAgICAgICAgICAgICAgLy8ga2VlcCB0cmFjayBvZiAwdGggZW50cnkKKyAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RtdDBJZChzdG10LmdldFVuaXF1ZUlkKCkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHN0bXQuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIHQxLnN0YXJ0KCk7CisgICAgICAgIC8vIHdhaXQgZm9yIHRoZSB0aHJlYWQgdG8gZmluaXNoCisgICAgICAgIHQxLmpvaW4oKTsKKworICAgICAgICAvLyBhZGQgb25lIG1vcmUgdG8gdGhlIGNhY2hlIC0gYW5kIHRoZSBhYm92ZSAnc3RtdDBJZCcgc2hvdWxkIGZhbGwgb3V0IG9mIGNhY2hlCisgICAgICAgIC8vIGp1c3QgZm9yIHRoZSBoZWNrIG9mIGl0LCBkbyBpdCBpbiBhIHNlcGFyYXRlIHRocmVhZAorICAgICAgICBUaHJlYWQgdDIgPSBuZXcgVGhyZWFkKCkgeworICAgICAgICAgICAgQE92ZXJyaWRlIHB1YmxpYyB2b2lkIHJ1bigpIHs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kIHJ1bigpIHsKKyAgICAgICAgICAgICAgICBpbnQgTiA9IDI2OworICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5zZXRNYXhTcWxDYWNoZVNpemUoTik7CisgICAgICAgICAgICAgICAgU1FMaXRlU3RhdGVtZW50IHN0bXQ7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBOOyBpICsrKSB7CisgICAgICAgICAgICAgICAgICAgIHN0bXQgPSBtRGF0YWJhc2UuY29tcGlsZVN0YXRlbWVudCgiaW5zZXJ0IGludG8gdGVzdCB2YWx1ZXMoIiArIGkgKyAiKTsiKTsKKyAgICAgICAgICAgICAgICAgICAgc3RtdC5leGVjdXRlSW5zZXJ0KCk7CisgICAgICAgICAgICAgICAgICAgIC8vIGtlZXAgdHJhY2sgb2YgMHRoIGVudHJ5CisgICAgICAgICAgICAgICAgICAgIGlmIChpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldFN0bXQwSWQoc3RtdC5nZXRVbmlxdWVJZCgpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzdG10LmNsb3NlKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgICB0MS5zdGFydCgpOworICAgICAgICAvLyB3YWl0IGZvciB0aGUgdGhyZWFkIHRvIGZpbmlzaAorICAgICAgICB0MS5qb2luKCk7CisKKyAgICAgICAgLy8gYWRkIG9uZSBtb3JlIHRvIHRoZSBjYWNoZSAtIGFuZCB0aGUgYWJvdmUgJ3N0bXQwSWQnIHNob3VsZCBmYWxsIG91dCBvZiBjYWNoZQorICAgICAgICAvLyBqdXN0IGZvciB0aGUgaGVjayBvZiBpdCwgZG8gaXQgaW4gYSBzZXBhcmF0ZSB0aHJlYWQKKyAgICAgICAgVGhyZWFkIHQyID0gbmV3IFRocmVhZCgpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZSBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgU1FMaXRlU3RhdGVtZW50IHN0bXQxID0gbURhdGFiYXNlLmNvbXBpbGVTdGF0ZW1lbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAic2VsZWN0ICogZnJvbSB0ZXN0IHdoZXJlIGkgPSAxOyIpOworICAgICAgICAgICAgICAgIHN0bXQxLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIHQyLnN0YXJ0KCk7CisgICAgICAgIHQyLmpvaW4oKTsKKworICAgICAgICAvLyBjbG9zZSgpIGluIHRoZSBhYm92ZSB0aHJlYWQgc2hvdWxkIGhhdmUgcXVldWVkVXAgdGhlIHN0YXRlbWVudCBmb3IgZmluYWxpemF0aW9uCisgICAgICAgIEFycmF5TGlzdDxJbnRlZ2VyPiBzdGF0ZW1lbnRJZHMgPSBtRGF0YWJhc2UuZ2V0UXVldWVkVXBTdG10TGlzdCgpOworICAgICAgICBhc3NlcnRUcnVlKGdldFN0bXQwSWQoKSA+IDApOworICAgICAgICBhc3NlcnRUcnVlKHN0YXRlbWVudElkcy5jb250YWlucyhzdG10MElkKSk7CisgICAgICAgIGFzc2VydEVxdWFscygxLCBzdGF0ZW1lbnRJZHMuc2l6ZSgpKTsKKworICAgICAgICAvLyBjbG9zZSB0aGUgZGF0YWJhc2UuIGV2ZXJ5dGhpbmcgZnJvbSBtQ2xvc2VkU3RhdGVtZW50SWRzIGluIG1EYXRhYmFzZQorICAgICAgICAvLyBzaG91bGQgYmUgZmluYWxpemVkIGFuZCBjbGVhcmVkIGZyb20gdGhlIGxpc3QKKyAgICAgICAgLy8gYWdhaW4gZG8gaXQgaW4gYSBzZXBhcmF0ZSB0aHJlYWQKKyAgICAgICAgVGhyZWFkIHQzID0gbmV3IFRocmVhZCgpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZSBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAgICAgbURhdGFiYXNlLmNsb3NlKCk7Cis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VdyaXRlQWhlYWRMb2dnaW5nKCk7CisgICAgICAgICAgICAgICAgbURhdGFiYXNlLnNldENvbm5lY3Rpb25Qb29sU2l6ZShpICsgMSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtRGF0YWJhc2UuZXhlY1NRTCgiQ1JFQVRFIFRBQkxFIHQxIChpIGludCwgaiBpbnQpOyIpOworICAgICAgICAgICAgbURhdGFiYXNlLmV4ZWNTUUwoIkNSRUFURSBUQUJMRSB0MiAoaSBpbnQsIGogaW50KTsiKTsKKyAgICAgICAgICAgIG1EYXRhYmFzZS5iZWdpblRyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICBmb3IgKGludCBrID0gMDsgayA8IDU7IGsrKykgeworICAgICAgICAgICAgICAgIG1EYXRhYmFzZS5leGVjU1FMKCJpbnNlcnQgaW50byB0MSB2YWx1ZXMoPyw/KTsiLCBuZXcgU3RyaW5nW10ge2srIiIsIGsrIiJ9KTsKKyAgICAgICAgICAgICAgICBtRGF0YWJhc2UuZXhlY1NRTCgiaW5zZXJ0IGludG8gdDIgdmFsdWVzKD8sPyk7IiwgbmV3IFN0cmluZ1tdIHtrKyIiLCBrKyIifSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtRGF0YWJhc2Uuc2V0VHJhbnNhY3Rpb25TdWNjZXNzZnVsKCk7CisgICAgICAgICAgICBtRGF0YWJhc2UuZW5kVHJhbnNhY3Rpb24oKTsKKworICAgICAgICAgICAgLy8gc3RhcnQgYSB3cml0ZXIKKyAgICAgICAgICAgIFdyaXRlciB3ID0gbmV3IFdyaXRlcihtRGF0YWJhc2UpOworCisgICAgICAgICAgICAvLyBpbml0aWFsaXplIGFuIGFycmF5IG9mIGNvdW50ZXJzIHRvIGJlIHBhc3NlZCB0byB0aGUgcmVhZGVycworICAgICAgICAgICAgUmVhZGVyIHIxID0gbmV3IFJlYWRlcihtRGF0YWJhc2UsICJ0MSIsIHcsIDApOworICAgICAgICAgICAgUmVhZGVyIHIyID0gbmV3IFJlYWRlcihtRGF0YWJhc2UsICJ0MiIsIHcsIDEpOworICAgICAgICAgICAgdy5zdGFydCgpOworICAgICAgICAgICAgcjEuc3RhcnQoKTsKKyAgICAgICAgICAgIHIyLnN0YXJ0KCk7CisKKyAgICAgICAgICAgIC8vIHdhaXQgZm9yIGFsbCB0aHJlYWRzIHRvIGRpZQorICAgICAgICAgICAgdy5qb2luKCk7CisgICAgICAgICAgICByMS5qb2luKCk7CisgICAgICAgICAgICByMi5qb2luKCk7CisKKyAgICAgICAgICAgIC8vIHByaW50IHRoZSBzdGF0cworICAgICAgICAgICAgaW50W11bXSBjb3VudHMgPSBnZXRDb3VudHMoKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0gPSBuZXcgU3RyaW5nQnVpbGRlcigpOworICAgICAgICAgICAgYnVmZltpXS5hcHBlbmQoImNvbm5wb29sLXNpemUgPSAiKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0uYXBwZW5kKGkgKyAxKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0uYXBwZW5kKCIsIG51bSB4YWN0cyBieSB3cml0ZXIgPSAiKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0uYXBwZW5kKGdldE51bVhhY3RzKCkpOworICAgICAgICAgICAgYnVmZltpXS5hcHBlbmQoIiwgbnVtLXJlYWRzLWluLXhhY3QvTk9ULWluLXhhY3QgYnkgcmVhZGVyMSA9ICIpOworICAgICAgICAgICAgYnVmZltpXS5hcHBlbmQoY291bnRzWzBdWzFdICsgIi8iICsgY291bnRzWzBdWzBdKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0uYXBwZW5kKCIsIGJ5IHJlYWRlcjIgPSAiKTsKKyAgICAgICAgICAgIGJ1ZmZbaV0uYXBwZW5kKGNvdW50c1sxXVsxXSArICIvIiArIGNvdW50c1sxXVswXSk7CisKKyAgICAgICAgICAgIExvZy5pKFRBRywgImRvbmUgdGVzdGluZyBmb3IgY29ubi1wb29sLXNpemUgb2YgIiArIChpKzEpKTsKKworICAgICAgICAgICAgZGJUZWFyZG93bigpOworICAgICAgICAgICAgZGJTZXRVcCgpOworICAgICAgICB9CisgICAgICAgIExvZy5pKFRBRywgImR1cmF0aW9uIG9mIHRlc3QgIiArIFRJTUVfVE9fUlVOX1dBTF9URVNUX0ZPUiArICIgc2VjIik7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgTTsgaSsrKSB7CisgICAgICAgICAgICBMb2cuaShUQUcsIGJ1ZmZbaV0udG9TdHJpbmcoKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gaW5YYWN0ID0gZmFsc2U7CisgICAgcHJpdmF0ZSBpbnQgbnVtWGFjdHM7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IFRJTUVfVE9fUlVOX1dBTF9URVNUX0ZPUiA9IDE1OyAvLyBudW0gc2VjIHRoaXMgdGVzdCBzaG91ZGwgcnVuCisgICAgcHJpdmF0ZSBpbnRbXVtdIGNvdW50cyA9IG5ldyBpbnRbMl1bMl07CisKKyAgICBwcml2YXRlIHN5bmNocm9uaXplZCBib29sZWFuIGluWGFjdCgpIHsKKyAgICAgICAgcmV0dXJuIGluWGFjdDsKKyAgICB9CisKKyAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIHNldEluWGFjdEZsYWcoYm9vbGVhbiBmbGFnKSB7CisgICAgICAgIGluWGFjdCA9IGZsYWc7CisgICAgfQorCisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgdm9pZCBzZXRDb3VudHMoaW50IHJlYWRlck51bSwgaW50W10gbnVtUmVhZHMpIHsKKyAgICAgICAgY291bnRzW3JlYWRlck51bV1bMF0gPSBudW1SZWFkc1swXTsKKyAgICAgICAgY291bnRzW3JlYWRlck51bV1bMV0gPSBudW1SZWFkc1sxXTsKKyAgICB9CisKKyAgICBwcml2YXRlIHN5bmNocm9uaXplZCBpbnRbXVtdIGdldENvdW50cygpIHsKKyAgICAgICAgcmV0dXJuIGNvdW50czsKKyAgICB9CisKKyAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIHNldE51bVhhY3RzKGludCBudW0pIHsKKyAgICAgICAgbnVtWGFjdHMgPSBudW07CisgICAgfQorCisgICAgcHJpdmF0ZSBzeW5jaHJvbml6ZWQgaW50IGdldE51bVhhY3RzKCkgeworICAgICAgICByZXR1cm4gbnVtWGFjdHM7CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBXcml0ZXIgZXh0ZW5kcyBUaHJlYWQgeworICAgICAgICBwcml2YXRlIFNRTGl0ZURhdGFiYXNlIGRiID0gbnVsbDsKKyAgICAgICAgcHVibGljIFdyaXRlcihTUUxpdGVEYXRhYmFzZSBkYikgeworICAgICAgICAgICAgdGhpcy5kYiA9IGRiOworICAgICAgICB9CisgICAgICAgIEBPdmVycmlkZSBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgICAgICAvLyBpbiBhIGxvb3AsIGZvciBOIHNlYywgZG8gdGhlIGZvbGxvd2luZworICAgICAgICAgICAgLy8gICAgQkVHSU4gdHJhbnNhY3Rpb24KKyAgICAgICAgICAgIC8vICAgIGluc2VydCBpbnRvIHRhYmxlIHQxLCB0MgorICAgICAgICAgICAgLy8gICAgQ29tbWl0CisgICAgICAgICAgICBsb25nIG5vdyA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOworICAgICAgICAgICAgaW50IGs7CisgICAgICAgICAgICBmb3IgKGsgPSAwOyhTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAtIG5vdykgLyAxMDAwIDwgVElNRV9UT19SVU5fV0FMX1RFU1RfRk9SOyBrKyspIHsKKyAgICAgICAgICAgICAgICBkYi5iZWdpblRyYW5zYWN0aW9uTm9uRXhjbHVzaXZlKCk7CisgICAgICAgICAgICAgICAgc2V0SW5YYWN0RmxhZyh0cnVlKTsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDEwOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgZGIuZXhlY1NRTCgiaW5zZXJ0IGludG8gdDEgdmFsdWVzKD8sPyk7IiwgbmV3IFN0cmluZ1tdIHtpKyIiLCBpKyIifSk7CisgICAgICAgICAgICAgICAgICAgIGRiLmV4ZWNTUUwoImluc2VydCBpbnRvIHQyIHZhbHVlcyg/LD8pOyIsIG5ldyBTdHJpbmdbXSB7aSsiIiwgaSsiIn0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkYi5zZXRUcmFuc2FjdGlvblN1Y2Nlc3NmdWwoKTsKKyAgICAgICAgICAgICAgICBzZXRJblhhY3RGbGFnKGZhbHNlKTsKKyAgICAgICAgICAgICAgICBkYi5lbmRUcmFuc2FjdGlvbigpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2V0TnVtWGFjdHMoayk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIFJlYWRlciBleHRlbmRzIFRocmVhZCB7CisgICAgICAgIHByaXZhdGUgU1FMaXRlRGF0YWJhc2UgZGIgPSBudWxsOworICAgICAgICBwcml2YXRlIFN0cmluZyB0YWJsZSA9IG51bGw7CisgICAgICAgIHByaXZhdGUgV3JpdGVyIHcgPSBudWxsOworICAgICAgICBwcml2YXRlIGludCByZWFkZXJOdW07CisgICAgICAgIHByaXZhdGUgaW50W10gbnVtUmVhZHMgPSBuZXcgaW50WzJdOworICAgICAgICBwdWJsaWMgUmVhZGVyKFNRTGl0ZURhdGFiYXNlIGRiLCBTdHJpbmcgdGFibGUsIFdyaXRlciB3LCBpbnQgcmVhZGVyTnVtKSB7CisgICAgICAgICAgICB0aGlzLmRiID0gZGI7CisgICAgICAgICAgICB0aGlzLnRhYmxlID0gdGFibGU7CisgICAgICAgICAgICB0aGlzLncgPSB3OworICAgICAgICAgICAgdGhpcy5yZWFkZXJOdW0gPSByZWFkZXJOdW07CisgICAgICAgIH0KKyAgICAgICAgQE92ZXJyaWRlIHB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FuIG1vdmVUb0ZpcnN0KCkgewotICAgICAgICAgICAgICAgIG1DdXJyZW50UG9zaXRpb24gPSAwOwotICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIG1vdmVUb05leHQoKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1DdXJyZW50UG9zaXRpb24gPCBtQ29udGFjdEVudHJ5TGlzdC5zaXplKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgbUN1cnJlbnRQb3NpdGlvbisrOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIGlzQmVmb3JlRmlyc3QoKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG1DdXJyZW50UG9zaXRpb24gPCAwOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyBib29sZWFuIGlzQWZ0ZXJMYXN0KCkgewotICAgICAgICAgICAgICAgIHJldHVybiBtQ3VycmVudFBvc2l0aW9uID49IG1Db250YWN0RW50cnlMaXN0LnNpemUoKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgICAgICBwdWJsaWMgaW50IGdldENvbHVtbkluZGV4KFN0cmluZyBjb2x1bW5OYW1lKSB7Ci0gICAgICAgICAgICAgICAgbVRlc3RDYXNlLmFzc2VydEVxdWFscyhDb250YWN0cy5fSUQsIGNvbHVtbk5hbWUpOwotICAgICAgICAgICAgICAgIHJldHVybiAwOwotICAgICAgICAgICAgf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AgICAgICBTZXQ8U3RyaW5nPiBrZXlUb0JlUmVtb3ZlZCA9IG5ldyBIYXNoU2V0PFN0cmluZz4oKTsKLSAgICAgICAgICAgICAgICBmb3IgKEVudHJ5PFN0cmluZywgT2JqZWN0PiBlbnRyeSA6IGFjdHVhbENvbnRlbnRWYWx1ZXMudmFsdWVTZXQoKSkgewotICAgICAgICAgICAgICAgICAgICBPYmplY3QgdmFsdWUgPSBlbnRyeS5nZXRWYWx1ZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT0gbnVsbCB8fCBUZXh0VXRpbHMuaXNFbXB0eSh2YWx1ZS50b1N0cmluZygpKSkgewotICAgICAgICAgICAgICAgICAgICAgICAga2V5VG9CZVJlbW92ZWQuYWRkKGVudHJ5LmdldEtleSgpKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBrZXk6IGtleVRvQmVSZW1vdmVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIGFjdHVhbENvbnRlbnRWYWx1ZXMucmVtb3ZlKGtleSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8qIGZvciB0ZXN0aW5nCi0gICAgICAgICAgICAgICAgTG9nLmQoIkBAQCIsCi0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcuZm9ybWF0KCJNaW1lVHlwZTogJXMsIGRhdGE6ICVzIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWltZVR5cGUsIGFjdHVhbENvbnRlbnRWYWx1ZXMudG9TdHJpbmcoKSkpOyAqLwotICAgICAgICAgICAgICAgIC8vIFJlbW92ZSBSQVdfQ09OVEFDVF9JRCBlbnRyeSBqdXN0IGZvciBzYWZldHksIHNpbmNlIHdlIGRvIG5vdCBjYXJlCi0gICAgICAgICAgICAgICAgLy8gaG93IHJlc29sdmVyLXJlbGF0ZWQgY29kZSBoYW5kbGVzIHRoZSBlbnRyeSBpbiB0aGlzIHVuaXQgdGVzdCwKLSAgICAgICAgICAgICAgICBpZiAoYWN0dWFsQ29udGVudFZhbHVlcy5jb250YWluc0tleShEYXRhLlJBV19DT05UQUNUX0lEKSkgewotICAgICAgICAgICAgICAgICAgICBhY3R1YWxDb250ZW50VmFsdWVzLnJlbW92ZShEYXRhLlJBV19DT05UQUNUX0lEKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZmluYWwgQ29sbGVjdGlvbjxDb250ZW50VmFsdWVzPiBjb250ZW50VmFsdWVzQ29sbGVjdGlvbiA9Ci0gICAgICAgICAgICAgICAgICAgIG1NaW1lVHlwZVRvRXhwZWN0ZWRDb250ZW50VmFsdWVzLmdldChtaW1lVHlwZSk7Ci0gICAgICAgICAgICAgICAgaWYgKGNvbnRlbnRWYWx1ZXNDb2xsZWN0aW9uLmlzRW1wdHkoKSkgewotICAgICAgICAgICAgICAgICAgICBtVGVzdENhc2UuZmFpbCgiQ29udGVudFZhbHVlcyBmb3IgTWltZVR5cGUgIiArIG1pbWVUeXBlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGlzIG5vdCBleHBlY3RlZCBhdCBhbGwgKCIgKyBhY3R1YWxDb250ZW50VmFsdWVzICsgIikiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYm9vbGVhbiBjaGVja2VkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgZm9yIChDb250ZW50VmFsdWVzIGV4cGVjdGVkQ29udGVudFZhbHVlcyA6IGNvbnRlbnRWYWx1ZXNDb2xsZWN0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8qZm9yIHRlc3RpbmcKLSAgICAgICAgICAgICAgICAgICAgTG9nLmQoIkBAQCIsICJleHBlY3RlZDogIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgY29udmVydFRvRWFzaWx5UmVhZGFibGVTdHJpbmcoZXhwZWN0ZWRDb250ZW50VmFsdWVzKSk7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5kKCJAQEAiLCAiYWN0dWFsICA6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGNvbnZlcnRUb0Vhc2lseVJlYWRhYmxlU3RyaW5nKGFjdHVhbENvbnRlbnRWYWx1ZXMpKTsqLwotICAgICAgICAgICAgICAgICAgICBpZiAoZXF1YWxzRm9yQ29udGVudFZhbHVlcyhleHBlY3RlZENvbnRlbnRWYWx1ZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0dWFsQ29udGVudFZhbHVlcykpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1UZXN0Q2FzZS5hc3NlcnRUcnVlKGNvbnRlbnRWYWx1ZXNDb2xsZWN0aW9uLnJlbW92ZShleHBlY3RlZENvbnRlbnRWYWx1ZXMpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKCFjaGVja2VkKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCJVbmV4cGVjdGVkOiAiKTsKLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY29udmVydFRvRWFzaWx5UmVhZGFibGVTdHJpbmcoYWN0dWFsQ29udGVudFZhbHVlcykpOwotICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXG5FeHBlY3RlZDogIik7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoQ29udGVudFZhbHVlcyBleHBlY3RlZENvbnRlbnRWYWx1ZXMgOiBjb250ZW50VmFsdWVzQ29sbGVjdGlvbikgewotICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoY29udmVydFRvRWFzaWx5UmVhZGFibGVTdHJpbmcoZXhwZWN0ZWRDb250ZW50VmFsdWVzKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbVRlc3RDYXNlLmZhaWwoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG1UZXN0Q2FzZS5mYWlsKCJVbmV4cGVjdGVkIFVyaSBoYXMgY29tZTogIiArIHVyaSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gIC8vIGZvciAoaW50IGkgPSAwOyBpIDwgc2l6ZTsgaSsrKSB7Ci0gICAgICAgIHJldHVybiBmYWtlUmVzdWx0QXJyYXk7Ci0gICAgfQotCi0gICAgcHVibGljIHZvaWQgdmVyaWZ5KCkgewotICAgICAgICBTdHJpbmdCdWlsZGVyIGJ1aWxkZXIgPSBuZXcgU3RyaW5nQnVpbGRlcigpOwotICAgICAgICBmb3IgKENvbGxlY3Rpb248Q29udGVudFZhbHVlcz4gY29udGVudFZhbHVlc0NvbGxlY3Rpb24gOgotICAgICAgICAgICAgICAgIG1NaW1lVHlwZVRvRXhwZWN0ZWRDb250ZW50VmFsdWVzLnZhbHVlcygpKSB7Ci0gICAgICAgICAgICBmb3IgKENvbnRlbnRWYWx1ZXMgZXhwZWN0ZWRDb250ZW50VmFsdWVzOiBjb250ZW50VmFsdWVzQ29sbGVjdGlvbikgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGNvbnZlcnRUb0Vhc2lseVJlYWRhYmxlU3RyaW5nKGV4cGVjdGVkQ29udGVudFZhbHVlcykpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCJcbiIpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGlmIChidWlsZGVyLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGZhaWxNc2cgPQotICAgICAgICAgICAgICAgICJUaGVyZSBpcyhhcmUpIHJlbWFpbmluZyBleHBlY3RlZCBDb250ZW50VmFsdWVzIGluc3RhbmNlKHMpOiBcbiIKLSAgICAgICAgICAgICAgICAgICAgKyBidWlsZGVyLnRvU3RyaW5nKCk7Ci0gICAgICAgICAgICBtVGVzdENhc2UuZmFpbChmYWlsTXNnKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIFV0aWxpdHkgbWV0aG9kIHRvIHByaW50IENvbnRlbnRWYWx1ZXMgd2hvc2UgY29udGVudCBpcyBwcmludGVkIHdpdGggc29ydGVkIGtleXMuCi0gICAgICovCi0gICAgcHJpdmF0ZSBTdHJpbmcgY29udmVydFRvRWFzaWx5UmVhZGFibGVTdHJpbmcoQ29udGVudFZhbHVlcyBjb250ZW50VmFsdWVzKSB7Ci0gICAgICAgIGlmIChjb250ZW50VmFsdWVzID09IG51bGwpIHsKLSAgICAgICAgICAgIHJldHVybiAibnVsbCI7Ci0gICAgICAgIH0KLSAgICAgICAgU3RyaW5nIG1pbWVUeXBlVmFsdWUgPSAiIjsKLSAgICAgICAgU29ydGVkTWFwPFN0cmluZywgU3RyaW5nPiBzb3J0ZWRNYXAgPSBuZXcgVHJlZU1hcDxTdHJpbmcsIFN0cmluZz4oKTsKLSAgICAgICAgZm9yIChFbnRyeTxTdHJpbmcsIE9iamVjdD4gZW50cnkgOiBjb250ZW50VmFsdWVzLnZhbHVlU2V0KCkpIHsKLSAgICAgICAgICAgIGZpbmFsIFN0cmluZyBrZXkgPSBlbnRyeS5nZXRLZXkoKTsKLSAgICAgICAgICAgIGZpbmFsIE9iamVjdCB2YWx1ZSA9IGVudHJ5LmdldFZhbHVlKCk7Ci0gICAgICAgICAgICBmaW5hbCBTdHJpbmcgdmFsdWVTdHJpbmcgPSAodmFsdW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HVybiB0aGlzOwotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIHZlcmlmeShmaW5hbCBTdHJpbmcgdmNhcmQpIHsKLSAgICAgICAgZmluYWwgU3RyaW5nW10gbGluZUFycmF5ID0gdmNhcmQuc3BsaXQoIlxccj9cXG4iKTsKLSAgICAgICAgZmluYWwgaW50IGxlbmd0aCA9IGxpbmVBcnJheS5sZW5ndGg7Ci0gICAgICAgIGJvb2xlYW4gYmVnaW5FeGlzdHMgPSBmYWxzZTsKLSAgICAgICAgYm9vbGVhbiBlbmRFeGlzdHMgPSBmYWxzZTsKLSAgICAgICAgYm9vbGVhbiB2ZXJzaW9uRXhpc3RzID0gZmFsc2U7Ci0KLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgewotICAgICAgICAgICAgZmluYWwgU3RyaW5nIGxpbmUgPSBsaW5lQXJyYXlbaV07Ci0gICAgICAgICAgICBpZiAoVGV4dFV0aWxzLmlzRW1wdHkobGluZSkpIHsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKCJCRUdJTjpWQ0FSRCIuZXF1YWxzSWdub3JlQ2FzZShsaW5lKSkgewotICAgICAgICAgICAgICAgIGlmIChiZWdpbkV4aXN0cykgewotICAgICAgICAgICAgICAgICAgICBtVGVzdENhc2UuZmFpbCgiTXVsdGlwbGUgXCJCRUdJTjpWQ0FSRFwiIGxpbmUgZm91bmQiKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBiZWdpbkV4aXN0cyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSBpZiAoIkVORDpWQ0FSRCIuZXF1YWxzSWdub3JlQ2FzZShsaW5lKSkgewotICAgICAgICAgICAgICAgIGlmIChlbmRFeGlzdHMpIHsKLSAgICAgICAgICAgICAgICAgICAgbVRlc3RDYXNlLmZhaWwoIk11bHRpcGxlIFwiRU5EOlZDQVJEXCIgbGluZSBmb3VuZCIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGVuZEV4aXN0cyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSBpZiAoKG1Jc1YzMCA/ICJWRVJTSU9OOjMuMCIgOiAiVkVSU0lPTjoyLjEiKS5lcXVhbHNJZ25vcmVDYXNlKGxpbmUpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKHZlcnNpb25FeGlzdHMpIHsKLSAgICAgICAgICAgICAgICAgICAgbVRlc3RDYXNlLmZhaWwoIk11bHRpcGxlIFZFUlNJT04gbGluZSArIGZvdW5kIik7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgdmVyc2lvbkV4aXN0cyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKCFiZWdpbkV4aXN0cykgewotICAgICAgICAgICAgICAgIG1UZXN0Q2FzZS5mYWlsKCJQcm9wZXJ0eSBvdGhlciB0aGFuIEJFR0lOIGNhbWUgYmVmb3JlIEJFR0lOIHByb3BlcnR5OiAiCi0gICAgICAgICAgICAgICAgICAgICAgICArIGxpbmUpOwotICAgICAgICAgICAgfSBlbHNlIGlmIChlbmRFeGlzdHMpIHsKLSAgICAgICAgICAgICAgICBtVGVzdENhc2UuZmFpbCgiUHJvcGVydHkgb3RoZXIgdGhhbiBFTkQgY2FtZSBhZnRlciBFTkQgcHJvcGVydHk6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICsgbGluZSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgI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gICBib29sZWFuIGZpcnN0ID0gdHJ1ZTsKLSAgICAgICAgZm9yIChTdHJpbmcgZWxlbSA6IHBhcmFtTWFwX1RZUEUpIHsKLSAgICAgICAgICAgIGlmIChmaXJzdCkgewotICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIsICIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJyInKTsKLSAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGVsZW0pOwotICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQoJyInKTsKLSAgICAgICAgfQotICAgICAgICBidWlsZGVyLmFwcGVuZCgiXSIpOwotICAgICAgICBpZiAoIXByb3BHcm91cFNldC5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIsIHByb3BHcm91cFNldDogWyIpOwotICAgICAgICAgICAgZmlyc3QgPSB0cnVlOwotICAgICAgICAgICAgZm9yIChTdHJpbmcgZWxlbSA6IHByb3BHcm91cFNldCkgewotICAgICAgICAgICAgICAgIGlmIChmaXJzdCkgewotICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCIsICIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgnIicpOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKGVsZW0pOwotICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kKCciJyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBidWlsZGVyLmFwcGVuZCgiXSIpOwotICAgICAgICB9Ci0gICAgICAgIGlmIChwcm9wVmFsdWVfdmVjdG9yICE9IG51bG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jdGVkUHJvcHMuY29udGFpbnMobm9kZS5wcm9wTmFtZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGV4cGVjdGVkUHJvcHMuYWRkKG5vZGUucHJvcE5hbWUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZm9yIChQcm9wZXJ0eU5vZGUgbm9kZSA6IG1Vbm9yZGVyZWROb2RlTGlzdCkgewotICAgICAgICAgICAgICAgIGlmICghZXhwZWN0ZWRQcm9wcy5jb250YWlucyhub2RlLnByb3BOYW1lKSkgewotICAgICAgICAgICAgICAgICAgICBleHBlY3RlZFByb3BzLmFkZChub2RlLnByb3BOYW1lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtVGVzdENhc2UuZmFpbCgiRXhwZWN0ZWQgcHJvcGVydHkgIiArIEFycmF5cy50b1N0cmluZyhleHBlY3RlZFByb3BzLnRvQXJyYXkoKSkKLSAgICAgICAgICAgICAgICAgICAgKyAiIHdhcyBub3QgZm91bmQuIik7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwcml2YXRlIHZvaWQgdmVyaWZ5Tm9kZShmaW5hbCBTdHJpbmcgcHJvcE5hbWUsIGZpbmFsIFByb3BlcnR5Tm9kZSBhY3R1YWxOb2RlKSB7Ci0gICAgICAgIExpc3Q8UHJvcGVydHlOb2RlPiBleHBlY3RlZE5vZGVMaXN0ID0gbU9yZGVyZWROb2RlTWFwLmdldChwcm9wTmFtZSk7Ci0gICAgICAgIGZpbmFsIGludCBzaXplID0gKGV4cGVjdGVkTm9kZUxpc3QgIT0gbnVsbCA/IGV4cGVjdGVkTm9kZUxpc3Quc2l6ZSgpIDogMCk7Ci0gICAgICAgIGlmIChzaXplID4gMCkgewotICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzaXplOyBpKyspIHsKLSAgICAgICAgICAgICAgICBQcm9wZXJ0eU5vZGUgZXhwZWN0ZWROb2RlID0gZXhwZWN0ZWROb2RlTGlzdC5nZXQoaSk7Ci0gICAgICAgICAgICAgICAgTGlzdDxQcm9wZXJ0eU5vZGU+IGV4cGVjdGVkQnV0RGlmZmVyZW50VmFsdWVMaXN0ID0gbmV3IEFycmF5TGlzdDxQcm9wZXJ0eU5vZGU+KCk7Ci0gICAgICAgICAgICAgICAgaWYgKGV4cGVjdGVkTm9kZS5wcm9wTmFtZS5lcXVhbHMocHJvcE5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChleHBlY3RlZE5vZGUuZXF1YWxzKGFjdHVhbE5vZGUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBleHBlY3RlZE5vZGVMaXN0LnJlbW92ZShpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChleHBlY3RlZE5vZGVMaXN0LnNpemUoKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbU9yZGVyZWROb2RlTWFwLnJlbW92ZShwcm9wTmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBleHBlY3RlZEJ1dERpZmZlcmVudFZhbHVlTGlzdC5hZGQoZXhwZWN0ZWROb2RlKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8vICJhY3R1YWxOb2RlIiBpcyBub3QgaW4gb3JkZXJlZCBleHBlY3RlZCBsaXN0LgotICAgICAgICAgICAgICAgIC8vIFRyeSBsb29raW5nIG92ZXIgdW5vcmRlcmVkIGV4cGVjdGVkIGxpc3QuCi0gICAgICAgICAgICAgICAgaWYgKHRyeUZvdW5kRXhwZWN0ZWROb2RlRnJvbVVub3JkZXJlZExpc3QoYWN0dWFs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AgICAgcmV0dXJuOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAoIWV4cGVjdGVkQnV0RGlmZmVyZW50VmFsdWVMaXN0LmlzRW1wdHkoKSkgewotICAgICAgICAgICAgICAgICAgICAvLyBTYW1lIHByb3BOYW1lIGV4aXN0cyBidXQgd2l0aCBkaWZmZXJlbnQgdmFsdWUocykuCi0gICAgICAgICAgICAgICAgICAgIGZhaWxXaXRoRXhwZWN0ZWROb2RlTGlzdChwcm9wTmFtZSwgYWN0dWFsTm9kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHBlY3RlZEJ1dERpZmZlcmVudFZhbHVlTGlzdCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gVGhlcmUncyBubyBleHBlY3RlZCBub2RlIHdpdGggc2FtZSBwcm9wTmFtZS4KLSAgICAgICAgICAgICAgICAgICAgbVRlc3RDYXNlLmZhaWwoIlVuZXhwZWN0ZWQgcHJvcGVydHkgXCIiICsgcHJvcE5hbWUgKyAiXCIgZXhpc3RzLiIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHByaXZhdGUgU3RyaW5nIGNvbmNhdGluYXRlTGlzdFdpdGhTZW1pQ29sb24oTGlzdDxTdHJpbmc+IGFycmF5KSB7Ci0gICAgICAgIFN0cmluZ0J1ZmZlciBidWZmZXIgPSBuZXcgU3RyaW5nQnVmZmVyKCk7Ci0gICAgICAgIGJvb2xlYW4gZmlyc3QgPSB0cnVlOwotICAgICAgICBmb3IgKFN0cmluZyBwcm9wVmFsdWVFbGVtIDogYXJyYXkpIHsKLSAgICAgICAgICAgIGlmIChmaXJzdCkgewotICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQoJzs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Bwcm9wcmlhdGVQcmVmaXgiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuU1VGRklYLCAiQXBwcm9wcmlhdGVTdWZmaXgiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfRkFNSUxZX05BTUUsICJBcHByb3ByaWF0ZVBob25ldGljRmFtaWx5IikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLlBIT05FVElDX0dJVkVOX05BTUUsICJBcHByb3ByaWF0ZVBob25ldGljR2l2ZW4iKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuUEhPTkVUSUNfTUlERExFX05BTUUsICJBcHByb3ByaWF0ZVBob25ldGljTWlkZGxlIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLklTX1BSSU1BUlksIDEpOwotCi0gICAgICAgIC8vIFdpdGggIklTX1BSSU1BUlk9MSIsIGJ1dCB3ZSBzaG91bGQgaWdub3JlIHRoaXMgdGltZSwgc2luY2UgdGhpcyBpcyBzZWNvbmQsIG5vdCBmaXJzdC4KLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhTdHJ1Y3R1cmVkTmFtZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLkZBTUlMWV9OQU1FLCAiRG9Ob3RFbWl0RmFtaWx5TmFtZTIiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuR0lWRU5fTkFNRSwgIkRvTm90RW1pdEdpdmVuTmFtZTIiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuTUlERExFX05BTUUsICJEb05vdEVtaXRNaWRkbGVOYW1lMiIpCi0gICAgICAgICAgICAgICAgLnB1dChTdHJ1Y3R1cmVkTmFtZS5QUkVGSVgsICJEb05vdEVtaXRQcmVma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gQ29udGFjdEVudHJ5IGVudHJ5ID0gbVZlcmlmaWVyLmFkZElucHV0RW50cnkoKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjEwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfSE9NRSk7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIyMCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX1dPUkspOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMzAiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9GQVhfSE9NRSk7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICI0MCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0ZBWF9XT1JLKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjUwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfTU9CSUxFKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjYwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfUEFHRVIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiNzAiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9PVEhFUik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICI4MCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0NBUik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICI5MCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0NPTVBBTllfTUFJTik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIxMDAiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9JU0ROKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjExMCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX01BSU4pOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTIwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfT1RIRVJfRkFYKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjEzMCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX1RFTEVYKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjE0MCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX1dPUktfTU9CSUxFKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjE1MCIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX1dPUktfUEFHRVIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTYwIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfTU1TKTsKLQotICAgICAgICBtVmVyaWZpZXIuYWRkUHJvcGVydHlOb2Rlc1ZlcmlmaWVyRWxlbVdpdGh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AgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjEiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9IT01FKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjIiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9XT1JLKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuSVNfUFJJTUFSWSwgMSk7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIzIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfRkFYX0hPTUUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5JU19QUklNQVJZLCAxKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjQiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9GQVhfV09SSyk7Ci0KLSAgICAgICAgbVZlcmlmaWVyLmFkZFByb3BlcnR5Tm9kZXNWZXJpZmllckVsZW1XaXRoRW1wdHlOYW1lKCkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlKCJURUwiLCAiNCIsIG5ldyBUeXBlU2V0KCJXT1JLIiwgIkZBWCIpKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGUoIlRFTCIsICIzIiwgbmV3IFR5cGVTZXQoIkhPTUUiLCAiRkFYIiwgIlB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mUuVFlQRSwgUGhvbmUuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5MQUJFTCwgIk1TRyIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMyIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0NVU1RPTSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLkxBQkVMLCAiQkJTIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICI0IikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTEFCRUwsICJWSURFTyIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiNSIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0NVU1RPTSk7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICI2IikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTEFCRUwsICJfQVVUT19DRUxMIik7ICAvLyBUaGUgb2xkIGluZGljYXRvciBmb3IgdGhlIHR5cGUgbW9ia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fTkFNRSwgIlBob25ldGljTmFtZSEiKSAgLy8gSWdub3JlZAotICAgICAgICAgICAgICAgIC5wdXQoT3JnYW5pemF0aW9uLlNZTUJPTCwgIiheb14pL35+Iik7ICAvLyBJZ25vcmUgaGltIChoZXIpLgotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKE9yZ2FuaXphdGlvbi5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0TnVsbChPcmdhbml6YXRpb24uQ09NUEFOWSkKLSAgICAgICAgICAgICAgICAucHV0KE9yZ2FuaXphdGlvbi5ERVBBUlRNRU5ULCAiRGVwYXJ0bWVudFhYIikKLSAgICAgICAgICAgICAgICAucHV0TnVsbChPcmdhbml6YXRpb24uVElUTEUpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKE9yZ2FuaXphdGlvbi5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KE9yZ2FuaXphdGlvbi5DT01QQU5ZLCAiQ29tcGFueVhZWiIpCi0gICAgICAgICAgICAgICAgLnB1dE51bGwoT3JnYW5pemF0aW9uLkRFUEFSVE1FTlQpCi0gICAgICAgICAgICAgICAgLnB1dChPcmdhbml6YXRpb24uVElUTEUsICJUaXRsZVhZWllYIik7Ci0gICAgICAgIC8vIEN1cnJlbnRseSB3ZSBkbyBub3QgdXNlIGdyb3VwIGJ1dCBkZXBlbmQgb24gdGhlIG9yZGVyLgotICAgICAgICBtVmVyaWZpZXIuYWRkUHJvcGVydHlOb2Rlc1ZlcmlmaWVyRWxlbVdpdGhFbXB0eU5hbWUoKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIk9SRyIsICJDb21wYW55WDtEZXBhcnRtZW50WSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KCJDb21wYW55WCIsICJEZXBhcnRtZW50WSIpKQotICAgICAgICAgICAgICAgIC5hZGR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JPVE9DT0xfTVNOKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uREFUQSwgIm1zbiIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKEltLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uUFJPVE9DT0wsIEltLlBST1RPQ09MX1lBSE9PKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uREFUQSwgInlhaG9vIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoSW0uQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChJbS5QUk9UT0NPTCwgSW0uUFJPVE9DT0xfU0tZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChJbS5EQVRBLCAic2t5cGUiKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhJbS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KEltLlBST1RPQ09MLCBJbS5QUk9UT0NPTF9RUSkKLSAgICAgICAgICAgICAgICAucHV0KEltLkRBVEEsICJxcSIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKEltLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uUFJPVE9DT0wsIEltLlBST1RPQ09MX0dPT0dMRV9UQUxLKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uREFUQSwgImdvb2dsZSB0YWxrIik7Ci0gICAgICAgIGVudHJ5LmFkZENvbnRlbnRWYWx1ZXMoSW0uQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChJbS5QUk9UT0NPTCwgSW0uUFJPVE9DT0xfSUNRKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uREFUQSwgImljcSIpOwotICAgICAgICBlbnRyeS5hZGRDb250ZW50VmFsdWVzKEltLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uUFJPVE9DT0wsIEltLlBST1RPQ09MX0pBQkJFUikKLSAgICAgICAgICAgICAgICAucHV0KEltLkRBVEEsICJqYWJiZXIiKTsKLSAgICAgICAgZW50cnkuYWRkQ29udGVudFZhbHVlcyhJbS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KEltLlBST1RPQ09MLCBJbS5QUk9UT0NPTF9ORVRNRUVUSU5HKQotICAgICAgICAgICAgICAgIC5wdXQoSW0uREFUQSwgIm5ldG1lZXRpbmciKTsKLQotICAgICAgICAvLyBObyBkZXRlcm1pbmVkIHdheSB0byBleHByZXNzIHVua25vd24gdHlwZS4uLgotICAgICAgICBtVmVyaWZpZXIuYWRkUHJvcGVydHlOb2Rlc1ZlcmlmaWVyRWxlbVdpdGhFbXB0eU5hbWUoKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGUoIlgtSkFCQkVSIiwgImphYmJlciIpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZSgiWC1JQ1EiLCAiaWNxIikKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlKCJYLUdPT0dMRS1UQUxLIiwgImdvb2dsZSB0YWxrIikKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlKCJYLVFRIiwgInFxIikKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlKCJYLVNLWVBFLVVTRVJOQU1FIiwgInNreXBlIikKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlKCJYLVlBSE9PIiwgInlhaG9vIikKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlKCJYLU1TTiIsICJtc24iKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGUoIlgtTkVUTUVFVElORyIsICJuZXRtZWV0aW5nIikKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2R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ljIGZpbmFsIGludFtdIHNQaG90b0ludEFycmF5Rm9yQ29tcGxpY2F0ZWRDYXNlID0gewotICAgICAgICAweGZmLCAweGQ4LCAweGZmLCAweGUxLCAweDBhLCAweDBmLCAweDQ1LCAweDc4LCAweDY5LCAweDY2LCAweDAwLAotICAgICAgICAweDAwLCAweDRkLCAweDRkLCAweDAwLCAweDJhLCAweDAwLCAweDAwLCAweDAwLCAweDA4LCAweDAwLCAweDBkLAotICAgICAgICAweDAxLCAweDBlLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDBmLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweGFhLCAweDAxLCAweDBmLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDA3LCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweGJhLCAweDAxLCAweDEwLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDA2LCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweGMyLCAweDAxLCAweDEyLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAxLCAweDFhLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweGM4LCAweDAxLCAweDFiLCAweDAwLCAweDA1LCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweGQwLCAweDAxLCAweDI4LCAweDAwLCAweDAzLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAxLCAweDMxLCAweDAwLCAweDAyLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDBlLCAweDAwLCAweDAwLCAweDAwLCAweGQ4LCAweDAxLCAweDMyLCAweDAwLAotICAgICAgICAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDE0LCAweDAwLCAweDAwLCAweDAwLCAweGU2LCAweDAyLCAweDEzLAotICAgICAgICAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDgyLAotICAgICAgICAweDk4LCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDBlLCAweDAwLCAweDAwLCAweDAwLCAweGZhLAotICAgICAgICAweDg3LCAweDY5LCAweDAwLCAweDA0LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDg0LCAweGM0LCAweGE1LCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDdjLCAweDAwLCAweDAwLAotICAgICAgICAweDAxLCAweDA4LCAweDAwLCAweDAwLCAweDA0LCAweDFlLCAweDMyLCAweDMwLCAweDMwLCAweDM4LCAweDMxLAotICAgICAgICAweDMwLCAweDMyLCAweDM5LCAweDMxLCAweDMzLCAweDM1LCAweDM1LCAweDMzLCAweDMxLCAweDAwLCAweDAwLAotICAgICAgICAweDQ0LCAweDZmLCAweDQzLCAweDZmLCAweDRkLCAweDZmLCAweDAwLCAweDAwLCAweDQ0LCAweDM5LCAweDMwLAotICAgICAgICAweDM1LCAweDY5LCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDQ4LCAweDAwLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDQ4LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDQ0LCAweDM5LCAweDMwLAotICAgICAgICAweDM1LCAweDY5LCAweDIwLCAweDU2LCAweDY1LCAweDcyLCAweDMxLCAweDJlLCAweDMwLCAweDMwLCAweDAwLAotICAgICAgICAweDMyLCAweDMwLCAweDMwLCAweDM4LCAweDNhLCAweDMxLCAweDMwLCAweDNhLCAweDMyLCAweDM5LCAweDIwLAotICAgICAgICAweDMxLCAweDMzLCAweDNhLCAweDM1LCAweDM1LCAweDNhLCAweDM0LCAweDM3LCAweDAwLCAweDIwLCAweDIwLAotICAgICAgICAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLCAweDIwLAotICAgICAgICAweDAwLCAweDUwLCAweDcyLCAweDY5LCAweDZlLCAweDc0LCAweDQ5LCAweDRkLCAweDAwLCAweDMwLCAweDMzLAotICAgICAgICAweDMwLCAweDMwLCAweDAwLCAweDAwLCAweDAwLCAweDA2LCAweDAwLCAweDAxLCAweDAwLCAweDE0LCAweDAwLAotICAgICAgICAweDE0LCAweDAwLCAweDAyLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAzLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDM0LCAweDAxLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAxLCAweDAxLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDEwLCAweDgwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDExLCAweDA5LCAweDAwLCAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDBmLCAweDBiLCAweDAwLAotICAgICAgICAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDA1LCAweDk3LCAweDAwLCAweDAwLCAweDI3LCAweDEwLAotICAgICAgICAweDAwLCAweDAwLCAweDA4LCAweGIwLCAweDAwLCAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDFjLAotICAgICAgICAweDAxLCAweDAwLCAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDAyLCAweDVlLCAweDAwLCAweDAwLAotICAgICAgICAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDAwLCAweDhiLCAweDAwLCAweDAwLCAweDI3LCAweDEwLCAweDAwLAotICAgICAgICAweDAwLCAweDAzLCAweGNiLCAweDAwLCAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDFiLCAweGU1LAotICAgICAgICAweDAwLCAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDI4LCAweDgyLCAweDlhLCAweDAwLCAweDA1LCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweDZhLCAweDgyLCAweDlkLCAweDAwLCAweDA1LAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweDcyLCAweDg4LCAweDIyLCAweDAwLAotICAgICAgICAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDkwLCAweDAwLAotICAgICAgICAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDA0LCAweDMwLCAweDMyLCAweDMyLCAweDMwLCAweDkwLAotICAgICAgICAweDAzLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDE0LCAweDAwLCAweDAwLCAweDAzLCAweDdhLAotICAgICAgICAweDkwLCAweDA0LCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLCAweDE0LCAweDAwLCAweDAwLCAweDAzLAotICAgICAgICAweDhlLCAweDkxLCAweDAxLCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDA0LCAweDAxLCAweDAyLAotICAgICAgICAweDAzLCAweDAwLCAweDkxLCAweDAyLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLAotICAgICAgICAweDAwLCAweDAzLCAweGEyLCAweDkyLCAweDAxLCAweDAwLCAweDBhLCAweDAwLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDAwLCAweDAwLCAweDAzLCAweGFhLCAweDkyLCAweDAyLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGIyLCAweDkyLCAweDA0LCAweDAwLCAweDBhLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGJhLCAweDkyLCAweDA1LCAweDAwLCAweDA1LCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGMyLCAweDkyLCAweDA3LCAweDAwLCAweDAzLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDkyLCAweDA4LCAweDAwLAotICAgICAgICAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDkyLCAweDA5LAotICAgICAgICAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDkyLAotICAgICAgICAweDBhLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGNhLAotICAgICAgICAweDkyLCAweDdjLCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDkyLCAweDg2LCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDE2LCAweDAwLCAweDAwLAotICAgICAgICAweDAzLCAweGQyLCAweGEwLCAweDAwLCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDA0LCAweDMwLAotICAgICAgICAweDMxLCAweDMwLCAweDMwLCAweGEwLCAweDAxLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweGEwLCAweDAyLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAxLCAweDAwLCAweDYwLCAweDAwLCAweDAwLCAweGEwLCAweDAzLCAweDAwLCAweDAzLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDQ4LCAweDAwLCAweDAwLCAweGEwLCAweDA1LCAweDAwLCAweDA0LCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDA0LCAweDAwLCAweGEyLCAweDBlLCAweDAwLCAweDA1LAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGU4LCAweGEyLCAweDBmLCAweDAwLAotICAgICAgICAweDA1LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGYwLCAweGEyLCAweDEwLAotICAgICAgICAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweGEyLAotICAgICAgICAweDE3LCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLAotICAgICAgICAweGEzLCAweDAwLCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAzLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweGEzLCAweDAxLCAweDAwLCAweDA3LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAxLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweGE0LCAweDAxLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweGE0LCAweDAyLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweGE0LCAweDAzLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweGE0LCAweDA0LCAweDAwLCAweDA1LCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAzLCAweGY4LCAweGE0LCAweDA1LCAweDAwLCAweDAzLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDFkLCAweDAwLCAweDAwLCAweGE0LCAweDA2LCAweDAwLCAweDAzLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweGE0LCAweDA3LCAweDAwLAotICAgICAgICAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweGE0LCAweDA4LAotICAgICAgICAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweGE0LAotICAgICAgICAweDA5LCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweGE0LCAweDBhLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweGE0LCAweDBjLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAyLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDUzLCAweDAwLAotICAgICAgICAweDAwLCAweDI3LCAweDEwLCAweDAwLCAweDAwLCAweDAxLCAweDVlLCAweDAwLCAweDAwLCAweDAwLCAweDY0LAotICAgICAgICAweDMyLCAweDMwLCAweDMwLCAweDM4LCAweDNhLCAweDMxLCAweDMwLCAweDNhLCAweDMyLCAweDM5LCAweDIwLAotICAgICAgICAweDMxLCAweDMzLCAweDNhLCAweDM1LCAweDM1LCAweDNhLCAweDMzLCAweDMxLCAweDAwLCAweDMyLCAweDMwLAotICAgICAgICAweDMwLCAweDM4LCAweDNhLCAweDMxLCAweDMwLCAweDNhLCAweDMyLCAweDM5LCAweDIwLCAweDMxLCAweDMzLAotICAgICAgICAweDNhLCAweDM1LCAweDM1LCAweDNhLCAweDM0LCAweDM3LCAweDAwLCAweDAwLCAweDAwLCAweDI5LCAweDg4LAotICAgICAgICAweDAwLCAweDAwLCAweDFiLCAweDAwLCAweDAwLCAweDAwLCAweDAyLCAweGIyLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDY0LCAweDAwLCAweDAwLCAweDAxLCAweDVlLCAweDAwLCAweDAwLCAweDAwLCAweDY0LCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDY0LCAweDAwLCAweDAwLCAweDAwLCAweDI1LCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDBhLCAweDAwLCAweDAwLCAweDBlLCAweDkyLCAweDAwLCAweDAwLCAweDAzLCAweGU4LAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDMyLCAweDMwLCAweDMwLAotICAgICAgICAweDM4LCAweDMxLCAweDMwLCAweDMyLCAweDM5LCAweDMxLCAweDMzLCAweDM1LCAweDM1LCAweDMzLCAweDMxLAotICAgICAgICAweDAwLCAweDAwLCAweDIwLCAweDJhLCAweDAwLCAweDAwLCAweDAwLCAweDBhLCAweDAwLCAweDAwLCAweDJhLAotICAgICAgICAweGUyLCAweDAwLCAweDAwLCAweDAwLCAweDBhLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDA0LCAweDUyLCAweDM5LCAweDM4LCAweDAwLCAweDAwLCAweDAyLCAweDAwLCAweDA3LCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDA0LCAweDMwLCAweDMxLCAweDMwLCAweDMwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDA2LCAweDAxLCAweDAzLCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDA2LAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDFhLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLAotICAgICAgICAweDAwLCAweDA0LCAweDZjLCAweDAxLCAweDFiLCAweDAwLCAweDA1LCAweDAwLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDAwLCAweDAwLCAweDA0LCAweDc0LCAweDAxLCAweDI4LCAweDAwLCAweDAzLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAxLCAweDAwLCAweDAyLCAweDAwLCAweDAwLCAweDAyLCAweDAxLCAweDAwLCAweDA0LCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDA0LCAweDdjLCAweDAyLCAweDAyLCAweDAwLCAweDA0LCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDA1LCAweDhiLCAweDAwLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDQ4LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDQ4LCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweGZmLCAweGQ4LCAweGZmLCAweGRiLCAweDAwLCAweDg0LAotICAgICAgICAweDAwLCAweDIwLCAweDE2LCAweDE4LCAweDFjLCAweDE4LCAweDE0LCAweDIwLCAweDFjLCAweDFhLCAweDFjLAotICAgICAgICAweDI0LCAweDIyLCAweDIwLCAweDI2LCAweDMwLCAweDUwLCAweDM0LCAweDMwLCAweDJjLCAweDJjLCAweDMwLAotICAgICAgICAweDYyLCAweDQ2LCAweDRhLCAweDNhLCAweDUwLCAweDc0LCAweDY2LCAweDdhLCAweDc4LCAweDcyLCAweDY2LAotICAgICAgICAweDcwLCAweDZlLCAweDgwLCAweDkwLCAweGI4LCAweDljLCAweDgwLCAweDg4LCAweGFlLCAweDhhLCAweDZlLAotICAgICAgICAweDcwLCAweGEwLCAweGRhLCAweGEyLCAweGFlLCAweGJlLCAweGM0LCAweGNlLCAweGQwLCAweGNlLCAweDdjLAotICAgICAgICAweDlhLCAweGUyLCAweGYyLCAweGUwLCAweGM4LCAweGYwLCAweGI4LCAweGNhLCAweGNlLCAweGM2LCAweDAxLAotICAgICAgICAweDIyLCAweDI0LCAweDI0LCAweDMwLCAweDJhLCAweDMwLCAweDVlLCAweDM0LCAweDM0LCAweDVlLCAweGM2LAotICAgICAgICAweDg0LCAweDcwLCAweDg0LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LAotICAgICAgICAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LAotICAgICAgICAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LAotICAgICAgICAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LAotICAgICAgICAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGM2LCAweGZmLCAweGMwLAotICAgICAgICAweDAwLCAweDExLCAweDA4LCAweDAwLCAweDc4LCAweDAwLCAweGEwLCAweDAzLCAweDAxLCAweDIxLCAweDAwLAotICAgICAgICAweDAyLCAweDExLCAweDAxLCAweDAzLCAweDExLCAweDAxLCAweGZmLCAweGM0LCAweDAxLCAweGEyLCAweDAwLAotICAgICAgICAweDAwLCAweDAxLCAweDA1LCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAyLCAweDAzLCAweDA0LCAweDA1LAotICAgICAgICAweDA2LCAweDA3LCAweDA4LCAweDA5LCAweDBhLCAweDBiLCAweDEwLCAweDAwLCAweDAyLCAweDAxLCAweDAzLAotICAgICAgICAweDAzLCAweDAyLCAweDA0LCAweDAzLCAweDA1LCAweDA1LCAweDA0LCAweDA0LCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDdkLCAweDAxLCAweDAyLCAweDAzLCAweDAwLCAweDA0LCAweDExLCAweDA1LCAweDEyLCAweDIxLCAweDMxLAotICAgICAgICAweDQxLCAweDA2LCAweDEzLCAweDUxLCAweDYxLCAweDA3LCAweDIyLCAweDcxLCAweDE0LCAweDMyLCAweDgxLAotICAgICAgICAweDkxLCAweGExLCAweDA4LCAweDIzLCAweDQyLCAweGIxLCAweGMxLCAweDE1LCAweDUyLCAweGQxLCAweGYwLAotICAgICAgICAweDI0LCAweDMzLCAweDYyLCAweDcyLCAweDgyLCAweDA5LCAweDBhLCAweDE2LCAweDE3LCAweDE4LCAweDE5LAotICAgICAgICAweDFhLCAweDI1LCAweDI2LCAweDI3LCAweDI4LCAweDI5LCAweDJhLCAweDM0LCAweDM1LCAweDM2LCAweDM3LAotICAgICAgICAweDM4LCAweDM5LCAweDNhLCAweDQzLCAweDQ0LCAweDQ1LCAweDQ2LCAweDQ3LCAweDQ4LCAweDQ5LCAweDRhLAotICAgICAgICAweDUzLCAweDU0LCAweDU1LCAweDU2LCAweDU3LCAweDU4LCAweDU5LCAweDVhLCAweDYzLCAweDY0LCAweDY1LAotICAgICAgICAweDY2LCAweDY3LCAweDY4LCAweDY5LCAweDZhLCAweDczLCAweDc0LCAweDc1LCAweDc2LCAweDc3LCAweDc4LAotICAgICAgICAweDc5LCAweDdhLCAweDgzLCAweDg0LCAweDg1LCAweDg2LCAweDg3LCAweDg4LCAweDg5LCAweDhhLCAweDkyLAotICAgICAgICAweDkzLCAweDk0LCAweDk1LCAweDk2LCAweDk3LCAweDk4LCAweDk5LCAweDlhLCAweGEyLCAweGEzLCAweGE0LAotICAgICAgICAweGE1LCAweGE2LCAweGE3LCAweGE4LCAweGE5LCAweGFhLCAweGIyLCAweGIzLCAweGI0LCAweGI1LCAweGI2LAotICAgICAgICAweGI3LCAweGI4LCAweGI5LCAweGJhLCAweGMyLCAweGMzLCAweGM0LCAweGM1LCAweGM2LCAweGM3LCAweGM4LAotICAgICAgICAweGM5LCAweGNhLCAweGQyLCAweGQzLCAweGQ0LCAweGQ1LCAweGQ2LCAweGQ3LCAweGQ4LCAweGQ5LCAweGRhLAotICAgICAgICAweGUxLCAweGUyLCAweGUzLCAweGU0LCAweGU1LCAweGU2LCAweGU3LCAweGU4LCAweGU5LCAweGVhLCAweGYxLAotICAgICAgICAweGYyLCAweGYzLCAweGY0LCAweGY1LCAweGY2LCAweGY3LCAweGY4LCAweGY5LCAweGZhLCAweDAxLCAweDAwLAotICAgICAgICAweDAzLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAyLCAweDAzLCAweDA0LCAweDA1LCAweDA2LAotICAgICAgICAweDA3LCAweDA4LCAweDA5LCAweDBhLCAweDBiLCAweDExLCAweDAwLCAweDAyLCAweDAxLCAweDAyLCAweDA0LAotICAgICAgICAweDA0LCAweDAzLCAweDA0LCAweDA3LCAweDA1LCAweDA0LCAweDA0LCAweDAwLCAweDAxLCAweDAyLCAweDc3LAotICAgICAgICAweDAwLCAweDAxLCAweDAyLCAweDAzLCAweDExLCAweDA0LCAweDA1LCAweDIxLCAweDMxLCAweDA2LCAweDEyLAotICAgICAgICAweDQxLCAweDUxLCAweDA3LCAweDYxLCAweDcxLCAweDEzLCAweDIyLCAweDMyLCAweDgxLCAweDA4LCAweDE0LAotICAgICAgICAweDQyLCAweDkxLCAweGExLCAweGIxLCAweGMxLCAweDA5LCAweDIzLCAweDMzLCAweDUyLCAweGYwLCAweDE1LAotICAgICAgICAweDYyLCAweDcyLCAweGQxLCAweDBhLCAweDE2LCAweDI0LCAweDM0LCAweGUxLCAweDI1LCAweGYxLCAweDE3LAotICAgICAgICAweDE4LCAweDE5LCAweDFhLCAweDI2LCAweDI3LCAweDI4LCAweDI5LCAweDJhLCAweDM1LCAweDM2LCAweDM3LAotICAgICAgICAweDM4LCAweDM5LCAweDNhLCAweDQzLCAweDQ0LCAweDQ1LCAweDQ2LCAweDQ3LCAweDQ4LCAweDQ5LCAweDRhLAotICAgICAgICAweDUzLCAweDU0LCAweDU1LCAweDU2LCAweDU3LCAweDU4LCAweDU5LCAweDVhLCAweDYzLCAweDY0LCAweDY1LAotICAgICAgICAweDY2LCAweDY3LCAweDY4LCAweDY5LCAweDZhLCAweDczLCAweDc0LCAweDc1LCAweDc2LCAweDc3LCAweDc4LAotICAgICAgICAweDc5LCAweDdhLCAweDgyLCAweDgzLCAweDg0LCAweDg1LCAweDg2LCAweDg3LCAweDg4LCAweDg5LCAweDhhLAotICAgICAgICAweDkyLCAweDkzLCAweDk0LCAweDk1LCAweDk2LCAweDk3LCAweDk4LCAweDk5LCAweDlhLCAweGEyLCAweGEzLAotICAgICAgICAweGE0LCAweGE1LCAweGE2LCAweGE3LCAweGE4LCAweGE5LCAweGFhLCAweGIyLCAweGIzLCAweGI0LCAweGI1LAotICAgICAgICAweGI2LCAweGI3LCAweGI4LCAweGI5LCAweGJhLCAweGMyLCAweGMzLCAweGM0LCAweGM1LCAweGM2LCAweGM3LAotICAgICAgICAweGM4LCAweGM5LCAweGNhLCAweGQyLCAweGQzLCAweGQ0LCAweGQ1LCAweGQ2LCAweGQ3LCAweGQ4LCAweGQ5LAotICAgICAgICAweGRhLCAweGUyLCAweGUzLCAweGU0LCAweGU1LCAweGU2LCAweGU3LCAweGU4LCAweGU5LCAweGVhLCAweGYyLAotICAgICAgICAweGYzLCAweGY0LCAweGY1LCAweGY2LCAweGY3LCAweGY4LCAweGY5LCAweGZhLCAweGZmLCAweGRhLCAweDAwLAotICAgICAgICAweDBjLCAweDAzLCAweDAxLCAweDAwLCAweDAyLCAweDExLCAweDAzLCAweDExLCAweDAwLCAweDNmLCAweDAwLAotICAgICAgICAweDE0LCAweDU0LCAweGFhLCAweDJhLCAweDQ2LCAweDQ4LCAweGEyLCAweGE0LCAweDU1LCAweGE2LCAweDA0LAotICAgICAgICAweDhhLCAweDI5LCAweGUwLCAweDUzLCAweDEwLCAweGUwLCAweDI5LCAweGMwLCAweDUwLCAweDAzLCAweGIxLAotICAgICAgICAweDQ2LCAweDI5LCAweDgwLCAweDg0LCAweDUyLCAweDExLCAweDQwLCAweDBkLCAweDIyLCAweDlhLCAweDQ1LAotICAgICAgICAweDIwLCAweDIzLCAweDYxLCAweDUxLCAweDMwLCAweGEwLCAweDA4LCAweGM4LCAweGE4LCAweGQ4LCAweDUyLAotICAgICAgICAweDAyLCAweDI2LCAweDE1LCAweDBiLCAweDBhLCAweDAwLCAweGI0LCAweGEyLCAweGE1LCAweDVhLCAweDAwLAotICAgICAgICAweDkxLCAweDQ1LCAweDRhLCAweGEyLCAweDgxLCAweDkyLCAweDAxLCAweDRlLCAweDAyLCAweDk4LCAweDg3LAotICAgICAgICAweDBhLCAweDcwLCAweGEwLCAweDA3LCAweDYyLCAweDhjLCAweDUwLCAweDIxLCAweDBkLCAweDI1LCAweDAwLAotICAgICAgICAweDM0LCAweDhhLCAweDYxLCAweDE0LCAweDBjLCAweDYzLCAweDBhLCAweDg5LCAweDg1LCAweDAwLCAweDQ2LAotICAgICAgICAweGQ1LCAweDFiLCAweDUyLCAweDAyLCAweDE2LCAweGE4LCAweDk4LCAweDUwLCAweDA1LCAweDk0LCAweGE5LAotICAgICAgICAweDE2LCAweDgwLCAweDI1LCAweDVhLCAweDk1LCAweDY4LCAweDE4LCAweGYxLCAweDRmLCAweDE0LCAweGM0LAotICAgICAgICAweDNiLCAweGI1LCAweDIyLCAweGI2LCAweDM4LCAweDM0LCAweDAwLCAweGUzLCAweDIyLCAweDhlLCAweGY0LAotICAgICAgICAweDc5LCAweDhhLCAweDdiLCAweGQxLCAweDcxLCAweDAzLCAweDMwLCAweGM3LCAweDE0LCAweDgzLCAweGE1LAotICAgICAgICAweDAwLCAweDA2LCAweDk4LCAweDY4LCAweDAxLCAweDhkLCAweDUxLCAweDM1LCAweDAzLCAweDIyLCAweDZhLAotICAgICAgICAweDhkLCAweGE5LCAweDAxLCAweDEzLCAweDU0LCAweDRkLCAweDQwLCAweDEzLCAweGE1LCAweDRhLCAweDI4LAotICAgICAgICAweDAyLCAweDQ1LCAweDM1LCAweDJhLCAweDlhLCAweDAwLCAweDc4LCAweDM0LCAweGYwLCAweDY5LCAweDgwLAotICAgICAgICAweDM0LCAweDgxLCAweDQ1LCAweDQwLCAweGNlLCAweDU4LCAweGU2LCAweGEyLCAweDRjLCAweDA2LCAweGU0LAotICAgICAgICAweGZhLCAweGQxLCAweDkzLCAweDUwLCAweDIxLCAweGNhLCAweGU0LCAweDU1LCAweDg0LCAweDkwLCAweDMwLAotICAgICAgICAweGFiLCAweDhiLCAweDE4LCAweGE2LCAweDlhLCAweDZhLCAweGM0LCAweDMxLCAweGFhLCAweDI2LCAweGEwLAotICAgICAgICAweDY0LCAweDRkLCAweDUxLCAweGI1LCAweDIwLCAweDIzLCAweDZhLCAweDg5LCAweGE4LCAweDAyLCAweDQ0LAotICAgICAgICAweDM1LCAweDJhLCAweDlhLCAweDAwLCAweDk1LCAweDRkLCAweDQ4LCAweGE2LCAweDgwLCAweDI0LCAweDUzLAotICAgICAgICAweDRlLCAweGNlLCAweDA1LCAweDMwLCAweDJiLCAweDNiLCAweGVlLCAweDZhLCAweDkxLCAweDVkLCAweDc2LAotICAgICAgICAweDYzLCAweGJkLCAweDY1LCAweDdkLCAweDQwLCAweDY2LCAweDY4LCAweGE5LCAweDAyLCAweDQ1LCAweDJiLAotICAgICAgICAweGIzLCAweDllLCAweGI0LCAweGM1LCAweDZkLCAweGFkLCAweDlhLCAweGEwLCAweDJjLCAweDA2LCAweGM4LAotICAgICAgICAweGNkLCAweDA0LCAweGQ2LCAweGEyLCAweDIzLCAweDYzLCAweDUxLCAweGIxLCAweGEwLCAweDY0LCAweDRkLAotICAgICAgICAweDUxLCAweDkzLCAweDQ4LCAweDA4LCAweGRhLCAweGEyLCAweDZhLCAweDAwLCAweDcyLCAweDFhLCAweDk5LAotICAgICAgICAweDRkLCAweDAwLCAweDQ4LCAweGE2LCAweGE0LCAweDUzLCAweDRjLCAweDA3LCAweDg2LCAweDAzLCAweGJkLAotICAgICAgICAweDJiLCAweDljLCAweGE3LCAweDE0LCAweDk4LCAweDEwLCAweDg1LCAweDM0LCAweGUwLCAweGE2LCAweGIzLAotICAgICAgICAweGIwLCAweDBiLCAweGI1LCAweGE4LCAweDBhLCAweGQ0LCAweDU4LCAweDQyLCAweGVkLCAweDNlLCAweDk0LAotICAgICAgICAweGQyLCAweGE2LCAweDhiLCAweDAxLCAweDM0LCAweDQ0LCAweGVkLCAweGU2LCAweDljLCAweDRkLCAweDZhLAotICAgICAgICAweDgwLCAweDhkLCAweDhkLCAweDQ2LCAweGM2LCAweDgwLCAweDIzLCAweDYzLCAweDUxLCAweDlhLCAweDA2LAotICAgICAgICAweDQ2LCAweGQ1LCAweDEzLCAweDUyLCAweDAxLCAweDU0LCAweGQ0LCAweGFhLCAweDY4LCAweDAyLCAweDQwLAotICAgICAgICAweDZhLCAweDQwLCAweDc4LCAweGEwLCAweDA4LCAweDU5LCAweGNlLCAweGVlLCAweGI1LCAweDJhLCAweDM5LAotICAgICAgICAweGQ5LCAweDU5LCAweGE3LCAweGE4LCAweDAwLCAweDczLCAweGViLCAweDRlLCAweDBlLCAweDdkLCAweDY5LAotICAgICAgICAweDVjLCAweDA1LCAweGYzLCAweDBmLCAweGFkLCAweDFlLCAweDYxLCAweGY1LCAweGE3LCAweDcxLCAweDBiLAotICAgICAgICAweGU2LCAweDM1LCAweDIxLCAweDkwLCAweGQzLCAweGI4LCAweDBlLCAweDMyLCAweDEwLCAweDk1LCAweDEwLAotICAgICAgICAweDkxLCAweGIzLCAweGQ2LCAweDliLCAweDYwLCAweDRiLCAweDljLCAweDhhLCAweDYzLCAweDFhLCAweGIwLAotICAgICAgICAweDE4LCAweDRkLCAweDQ2LCAweGM2LCAweDgwLCAweDIyLCAweDZhLCAweDYxLCAweGE0LCAweDMxLCAweGFhLAotICAgICAgICAweDZhLCAweDU1LCAweDM0LCAweDAxLCAweDJhLCAweDlhLCAweDdlLCAweDc4LCAweGEwLCAweDA4LCAweDA5LAotICAgICAgICAweGY5LCAweGFhLCAweDU4LCAweGNmLCAweGNhLCAweDZiLCAweDNlLCAweGEwLCAweDAwLCAweGQzLCAweDgxLAotICAgICAgICAweGE5LCAweDAxLCAweDczLCAweDQ2LCAweDY5LCAweDgwLCAweGI5LCAweGE0LCAweGNkLCAweDAwLCAweDJiLAotICAgICAgICAweDFmLCAweDkyLCAweGEzLCAweDA3LCAweDlhLCAweDZmLCAweDcwLCAweDI2LCAweGNmLCAweDE0LCAweGQyLAotICAgICAgICAweDZiLCAweDUxLCAweDBjLCAweDYzLCAweDUxLCAweGIxLCAweGEwLCAweDA4LCAweGRhLCAweDk4LCAweDY5LAotICAgICAgICAweDBjLCAweDhkLCAweDRkLCAweDRhLCAweGE2LCAweDgwLCAweDI0LCAweDUzLCAweDUyLCAweDAzLCAweGM1LAotICAgICAgICAweDAyLCAweDIxLCAweDI3LCAweGU2LCAweGE5LCAweDIzLCAweDNmLCAweDI5LCAweGFjLCAweGZhLCAweDhjLAotICAgICAgICAweDAxLCAweGU2LCAweDljLCAweDBkLCAweDQ4LCAweDBhLCAweDBkLCAweDJlLCAweDY4LCAweDAxLCAweDczLAotICAgICAgICAweDQ5LCAweDlhLCAweDYwLCAweDJiLCAweDFmLCAweDkyLCAweDk4LCAweDNhLCAweGQzLCAweDdiLCAweDgxLAotICAgICAgICAweDM2LCAweDc4LCAweGE2LCAweDkzLCAweDVhLCAweDg4LCAweDhjLCAweDlhLCAweDYzLCAweDFhLCAweDAwLAotICAgICAgICAweDhjLCAweGQzLCAweDBkLCAweDIxLCAweDkxLCAweDI5LCAweGE5LCAweDE0LCAweGQwLCAweDA0LCAweDhhLAotICAgICAgICAweDY5LCAweGUwLCAweGQzLCAweDExLCAweDFiLCAweDFlLCAweDZhLCAweDQ4LCAweGNmLCAweGNhLCAweDZiLAotICAgICAgICAweDNlLCAweGEzLCAweDEwLCAweDFhLCAweDcwLCAweDM1LCAweDIwLCAweDM4LCAweDFhLCAweDVjLCAweGQyLAotICAgICAgICAweDAxLCAweDczLCAweDQ5LCAweDlhLCAweDYwLCAweDM5LCAweDhmLCAweGNhLCAweDI5LCAweDhiLCAweGY3LAotICAgICAgICAweGFhLCAweGJhLCAweDg4LCAweDk2LCAweDlhLCAweDZiLCAweDQwLCAweDE4LCAweGM2LCAweGEzLCAweDI2LAotICAgICAgICAweDgwLCAweDE4LCAweDY5LCAweGE2LCAweDkwLCAweGM4LCAweDE0LCAweGQ0LCAweDhhLCAweDY5LCAweDgwLAotICAgICAgICAweGYwLCAweDZhLCAweDQwLCAweDY4LCAweDEwLCAweGJiLCAweDQxLCAweGE3LCAweGUzLCAweDBiLCAweGM1LAotICAgICAgICAweDJiLCAweDAxLCAweDEwLCAweGE3LCAweDAzLCAweDU5LCAweDBjLCAweDc2LCAweDY5LCAweDczLCAweDQwLAotICAgICAgICAweDBiLCAweDlhLCAweDI4LCAweDExLCAweDI4LCAweDE5LCAweDVlLCAweDY5LCAweDAyLCAweDgxLCAweDVhLAotICAgICAgICAweGQ4LCAweDAwLCAweGQzLCAweDRkLCAweDUwLCAweDBjLCAweDZhLCAweDhjLCAweGQyLCAweDAxLCAweGE2LAotICAgICAgICAweDk4LCAweDY5LCAweDBjLCAweGFlLCAweGE2LCAweGE0LCAweDA2LCAweDgwLCAweDFlLCAweGE2LCAweDllLAotICAgICAgICAweDBkLCAweDMxLCAweDEyLCAweDAzLCAweDRmLCAweDA2LCAweDgwLCAweDEzLCAweDYwLCAweDM0LCAweGQzLAotICAgICAgICAweGMxLCAweGE4LCAweDkyLCAweDAxLCAweGYxLCAweDhkLCAweGRkLCAweDY5LCAweGNjLCAweGExLCAweDY5LAotICAgICAgICAweDViLCAweDRiLCAweDgwLCAweDgzLCAweDkzLCAweDUyLCAweDA0LCAweDE0LCAweGUyLCAweGFlLCAweDAzLAotICAgICAgICAweGE5LCAweDBkLCAweDY4LCAweDAzLCAweDRkLCAweDM0LCAweGQwLCAweDAzLCAweDBkLCAweDMwLCAweGQyLAotICAgICAgICAweDAxLCAweDg2LCAweDlhLCAweDY4LCAweDE5LCAweDU4LCAweDFhLCAweDc4LCAweGE0LCAweDA0LCAweDhhLAotICAgICAgICAweDY5LCAweGUwLCAweGQzLCAweDEwLCAweGUwLCAweDY5LCAweGUwLCAweGQwLCAweDAzLCAweGMxLCAweGE4LAotICAgICAgICAweGRiLCAweGFkLCAweDRjLCAweDgxLCAweDEyLCAweDQ1LCAweGQ2LCAweDlkLCAweDI1LCAweDFkLCAweDAwLAotICAgICAgICAweDZhLCAweGY1LCAweGE5LCAweGU4LCAweDgwLCAweDMxLCAweDI5LCAweDBkLCAweDU4LCAweDA4LCAweDY5LAotICAgICAgICAweDg2LCAweDgwLCAweDFhLCAweDY5LCAweDg2LCAweDkwLCAweDBjLCAweDM0LCAweGQzLCAweDQ4LCAweDY1LAotICAgICAgICAweDUxLCAweDRmLCAweDA2LCAweDk4LCAweDBmLCAweDE0LCAweGYwLCAweDY4LCAweDEwLCAweGYwLCAweDY5LAotICAgICAgICAweGUwLCAweGQwLCAweDAzLCAweDgxLCAweGE1LCAweDJiLCAweDlhLCAweDFhLCAweGI4LCAweDg3LCAweGE4LAotICAgICAgICAweGRiLCAweDRhLCAweDQ2LCAweDY4LCAweGI2LCAweDgwLCAweDJhLCAweGE4LCAweDE0LCAweGVhLCAweDEyLAotICAgICAgICAweGIwLCAweDA1LCAweDIxLCAweGE2LCAweDAyLCAweDFhLCAweDYxLCAweGEwLCAweDA2LCAweDlhLCAweDYxLAotICAgICAgICAweGE0LCAweDMxLCAweDg2LCAweDlhLCAweDY5LCAweDBjLCAweGE4LCAweDBkLCAweDNjLCAweDUzLCAweDAxLAotICAgICAgICAweGUyLCAweDllLCAweDI4LCAweDEwLCAweGYxLCAweDRlLCAweDA2LCAweDk4LCAweDBmLCAweDA2LCAweDllLAotICAgICAgICAweDBkLCAweDAyLCAweDFjLCAweDI5LCAweGMyLCAweDgwLCAweDE2LCAweDk2LCAweDgwLCAweDBhLCAweDRhLAotICAgICAgICAweDAwLCAweDQzLCAweDRkLCAweDM0LCAweDBjLCAweDYxLCAweGE2LCAweDFhLCAweDQwLCAweDM0LCAweGQzLAotICAgICAgICAweDRkLCAweDIxLCAweDgwLCAweGZmLCAweGQ5LCAweGZmLCAweGRiLCAweDAwLCAweDg0LCAweDAwLCAweDBhLAotICAgICAgICAweDA3LCAweDA3LCAweDA4LCAweDA3LCAweDA2LCAweDBhLCAweDA4LCAweDA4LCAweDA4LCAweDBiLCAweDBhLAotICAgICAgICAweDBhLCAweDBiLCAweDBlLCAweDE4LCAweDEwLCAweDBlLCAweDBkLCAweDBkLCAweDBlLCAweDFkLCAweDE1LAotICAgICAgICAweDE2LCAweDExLCAweDE4LCAweDIzLCAweDFmLCAweDI1LCAweDI0LCAweDIyLCAweDFmLCAweDIyLCAweDIxLAotICAgICAgICAweDI2LCAweDJiLCAweDM3LCAweDJmLCAweDI2LCAweDI5LCAweDM0LCAweDI5LCAweDIxLCAweDIyLCAweDMwLAotICAgICAgICAweDQxLCAweDMxLCAweDM0LCAweDM5LCAweDNiLCAweDNlLCAweDNlLCAweDNlLCAweDI1LCAweDJlLCAweDQ0LAotICAgICAgICAweDQ5LCAweDQzLCAweDNjLCAweDQ4LCAweDM3LCAweDNkLCAweDNlLCAweDNiLCAweDAxLCAweDBhLCAweDBiLAotICAgICAgICAweDBiLCAweDBlLCAweDBkLCAweDBlLCAweDFjLCAweDEwLCAweDEwLCAweDFjLCAweDNiLCAweDI4LCAweDIyLAotICAgICAgICAweDI4LCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLAotICAgICAgICAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLAotICAgICAgICAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLAotICAgICAgICAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLAotICAgICAgICAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweDNiLCAweGZmLCAweGMwLCAweDAwLCAweDExLAotICAgICAgICAweDA4LCAweDAwLCAweDQ4LCAweDAwLCAweDYwLCAweDAzLCAweDAxLCAweDIxLCAweDAwLCAweDAyLCAweDExLAotICAgICAgICAweDAxLCAweDAzLCAweDExLCAweDAxLCAweGZmLCAweGM0LCAweDAxLCAweGEyLCAweDAwLCAweDAwLCAweDAxLAotICAgICAgICAweDA1LCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAwLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAyLCAweDAzLCAweDA0LCAweDA1LCAweDA2LCAweDA3LAotICAgICAgICAweDA4LCAweDA5LCAweDBhLCAweDBiLCAweDEwLCAweDAwLCAweDAyLCAweDAxLCAweDAzLCAweDAzLCAweDAyLAotICAgICAgICAweDA0LCAweDAzLCAweDA1LCAweDA1LCAweDA0LCAweDA0LCAweDAwLCAweDAwLCAweDAxLCAweDdkLCAweDAxLAotICAgICAgICAweDAyLCAweDAzLCAweDAwLCAweDA0LCAweDExLCAweDA1LCAweDEyLCAweDIxLCAweDMxLCAweDQxLCAweDA2LAotICAgICAgICAweDEzLCAweDUxLCAweDYxLCAweDA3LCAweDIyLCAweDcxLCAweDE0LCAweDMyLCAweDgxLCAweDkxLCAweGExLAotICAgICAgICAweDA4LCAweDIzLCAweDQyLCAweGIxLCAweGMxLCAweDE1LCAweDUyLCAweGQxLCAweGYwLCAweDI0LCAweDMzLAotICAgICAgICAweDYyLCAweDcyLCAweDgyLCAweDA5LCAweDBhLCAweDE2LCAweDE3LCAweDE4LCAweDE5LCAweDFhLCAweDI1LAotICAgICAgICAweDI2LCAweDI3LCAweDI4LCAweDI5LCAweDJhLCAweDM0LCAweDM1LCAweDM2LCAweDM3LCAweDM4LCAweDM5LAotICAgICAgICAweDNhLCAweDQzLCAweDQ0LCAweDQ1LCAweDQ2LCAweDQ3LCAweDQ4LCAweDQ5LCAweDRhLCAweDUzLCAweDU0LAotICAgICAgICAweDU1LCAweDU2LCAweDU3LCAweDU4LCAweDU5LCAweDVhLCAweDYzLCAweDY0LCAweDY1LCAweDY2LCAweDY3LAotICAgICAgICAweDY4LCAweDY5LCAweDZhLCAweDczLCAweDc0LCAweDc1LCAweDc2LCAweDc3LCAweDc4LCAweDc5LCAweDdhLAotICAgICAgICAweDgzLCAweDg0LCAweDg1LCAweDg2LCAweDg3LCAweDg4LCAweDg5LCAweDhhLCAweDkyLCAweDkzLCAweDk0LAotICAgICAgICAweDk1LCAweDk2LCAweDk3LCAweDk4LCAweDk5LCAweDlhLCAweGEyLCAweGEzLCAweGE0LCAweGE1LCAweGE2LAotICAgICAgICAweGE3LCAweGE4LCAweGE5LCAweGFhLCAweGIyLCAweGIzLCAweGI0LCAweGI1LCAweGI2LCAweGI3LCAweGI4LAotICAgICAgICAweGI5LCAweGJhLCAweGMyLCAweGMzLCAweGM0LCAweGM1LCAweGM2LCAweGM3LCAweGM4LCAweGM5LCAweGNhLAotICAgICAgICAweGQyLCAweGQzLCAweGQ0LCAweGQ1LCAweGQ2LCAweGQ3LCAweGQ4LCAweGQ5LCAweGRhLCAweGUxLCAweGUyLAotICAgICAgICAweGUzLCAweGU0LCAweGU1LCAweGU2LCAweGU3LCAweGU4LCAweGU5LCAweGVhLCAweGYxLCAweGYyLCAweGYzLAotICAgICAgICAweGY0LCAweGY1LCAweGY2LCAweGY3LCAweGY4LCAweGY5LCAweGZhLCAweDAxLCAweDAwLCAweDAzLCAweDAxLAotICAgICAgICAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAxLCAweDAwLCAweDAwLCAweDAwLAotICAgICAgICAweDAwLCAweDAwLCAweDAwLCAweDAxLCAweDAyLCAweDAzLCAweDA0LCAweDA1LCAweDA2LCAweDA3LCAweDA4LAotICAgICAgICAweDA5LCAweDBhLCAweDBiLCAweDExLCAweDAwLCAweDAyLCAweDAxLCAweDAyLCAweDA0LCAweDA0LCAweDAzLAotICAgICAgICAweDA0LCAweDA3LCAweDA1LCAweDA0LCAweDA0LCAweDAwLCAweDAxLCAweDAyLCAweDc3LCAweDAwLCAweDAxLAotICAgICAgICAweDAyLCAweDAzLCAweDExLCAweDA0LCAweDA1LCAweDIxLCAweDMxLCAweDA2LCAweDEyLCAweDQxLCAweDUxLAotICAgICAgICAweDA3LCAweDYxLCAweDcxLCAweDEzLCAweDIyLCAweDMyLCAweDgxLCAweDA4LCAweDE0LCAweDQyLCAweDkxLAotICAgICAgICAweGExLCAweGIxLCAweGMxLCAweDA5LCAweDIzLCAweDMzLCAweDUyLCAweGYwLCAweDE1LCAweDYyLCAweDcyLAotICAgICAgICAweGQxLCAweDBhLCAweDE2LCAweDI0LCAweDM0LCAweGUxLCAweDI1LCAweGYxLCAweDE3LCAweDE4LCAweDE5LAotICAgICAgICAweDFhLCAweDI2LCAweDI3LCAweDI4LCAweDI5LCAweDJhLCAweDM1LCAweDM2LCAweDM3LCAweDM4LCAweDM5LAotICAgICAgICAweDNhLCAweDQzLCAweDQ0LCAweDQ1LCAweDQ2LCAweDQ3LCAweDQ4LCAweDQ5LCAweDRhLCAweDUzLCAweDU0LAotICAgICAgICAweDU1LCAweDU2LCAweDU3LCAweDU4LCAweDU5LCAweDVhLCAweDYzLCAweDY0LCAweDY1LCAweDY2LCAweDY3LAotICAgICAgICAweDY4LCAweDY5LCAweDZhLCAweDczLCAweDc0LCAweDc1LCAweDc2LCAweDc3LCAweDc4LCAweDc5LCAweDdhLAotICAgICAgICAweDgyLCAweDgzLCAweDg0LCAweDg1LCAweDg2LCAweDg3LCAweDg4LCAweDg5LCAweDhhLCAweDkyLCAweDkzLAotICAgICAgICAweDk0LCAweDk1LCAweDk2LCAweDk3LCAweDk4LCAweDk5LCAweDlhLCAweGEyLCAweGEzLCAweGE0LCAweGE1LAotICAgICAgICAweGE2LCAweGE3LCAweGE4LCAweGE5LCAweGFhLCAweGIyLCAweGIzLCAweGI0LCAweGI1LCAweGI2LCAweGI3LAotICAgICAgICAweGI4LCAweGI5LCAweGJhLCAweGMyLCAweGMzLCAweGM0LCAweGM1LCAweGM2LCAweGM3LCAweGM4LCAweGM5LAotICAgICAgICAweGNhLCAweGQyLCAweGQzLCAweGQ0LCAweGQ1LCAweGQ2LCAweGQ3LCAweGQ4LCAweGQ5LCAweGRhLCAweGUyLAotICAgICAgICAweGUzLCAweGU0LCAweGU1LCAweGU2LCAweGU3LCAweGU4LCAweGU5LCAweGVhLCAweGYyLCAweGYzLCAweGY0LAotICAgICAgICAweGY1LCAweGY2LCAweGY3LCAweGY4LCAweGY5LCAweGZhLCAweGZmLCAweGRhLCAweDAwLCAweDBjLCAweDAzLAotICAgICAgICAweDAxLCAweDAwLCAweDAyLCAweDExLCAweDAzLCAweDExLCAweDAwLCAweDNmLCAweDAwLCAweDllLCAweGQyLAotICAgICAgICAweDJlLCAweDA3LCAweDE1LCAweGFmLCAweDZkLCAweDA4LCAweGUyLCAweGIzLCAweDQ1LCAweDFhLCAweGY2LAotICAgICAgICAweGQwLCAweDAwLCAweDAxLCAweGM1LCAweDY4LCAweDQ1LCAweDE3LCAweDRhLCAweGI0LCAweDIyLCAweGU0LAotICAgICAgICAweDcwLCAweDhjLCAweDc0LCAweGE5LCAweDNjLCAweGExLCAweDhlLCAweDk1LCAweDQ4LCAweDk2LCAweDMxLAotICAgICAgICAweGUyLCAweDE4LCAweGU5LCAweDU1LCAweGE1LCAweDhjLCAweDdhLCAweDUwLCAweDA1LCAweDBiLCAweDg4LAotICAgICAgICAweDg2LCAweDBmLCAweDE1LCAweDhmLCAweDc1LCAweDFmLCAweDI2LCAweDkzLCAweDE5LCAweDkxLCAweDc3LAotICAgICAgICAweDE4LCAweGMxLCAweGFjLCAweDRiLCAweGM4LCAweGZhLCAweGQ2LCAweDYzLCAweDM3LCAweDZkLCAweDMxLAotICAgICAgICAweGI0LCAweDczLCAweDViLCAweDM2LCAweGEwLCAweDFjLCAweDUwLCAweDgwLCAweGQ3LCAweDgzLCAweGEwLAotICAgICAgICAweGFiLCAweGQxLCAweDYyLCAweGFkLCAweDA5LCAweDhmLCAweDE3LCAweDI5LCAweDAzLCAweGIyLCAweGNjLAotICAgICAgICAweGUwLCAweDc3LCAweDE0LCAweGEzLCAweDU2LCAweGIzLCAweDI3LCAweDFlLCAweDY3LCAweGU5LCAweDUyLAotICAgICAgICAweGVhLCAweGM2LCAweDNhLCAweDM2LCAweDQ4LCAweGVmLCAweDNkLCAweDI3LCAweDcwLCAweDIyLCAweDYwLAotICAgICAgICAweDQ3LCAweDUyLCAweDY5LCAweGIyLCAweGUyLCAweGFkLCAweDNiLCAweGVhLCAweDgwLCAweGEzLCAweDM4LAotICAgICAgICAweGUwLCAweGQ2LCAweDNkLCAweGQ4LCAweDFjLCAweGQwLCAweGNhLCAweDQ2LCAweDNkLCAweGQwLCAweDE4LAotICAgICAgICAweDM1LCAweDg5LCAweDc4LCAweGEzLCAweDlhLCAweGNkLCAweDhjLCAweGQyLCAweGIzLCAweDkzLCAweDJhLAotICAgICAgICAweDJiLCAweDY2LCAweGQ1LCAweGYxLCAweDhhLCAweDEwLCAweDFhLCAweGQ2LCAweGYyLCAweDAzLCAweDhhLAotICAgICAgICAweDllLCAweGU2LCAweGY0LCAweDVhLCAweGRiLCAweGVmLCAweGZlLCAweDIzLCAweGMwLCAweGE3LCAweDI3LAotICAgICAgICAweGNiLCAweDE2LCAweGM0LCAweGNjLCAweGRkLCAweGUyLCAweDc4LCAweDlhLCAweDY5LCAweDY2LCAweGNjLAotICAgICAgICAweDk5LCAweGUxLCAweDRkLCAweDQ3LCAweGJhLCAweGJjLCAweGQ5LCAweDZhLCAweGVlLCAweDI2LCAweDU5LAotICAgICAgICAweDU5LCAweDRkLCAweGFjLCAweDY5LCAweDM0LCAweDUyLCAweGU1LCAweDhmLCAweDU1LCAweGFkLCAweDU4LAotICAgICAgICAweGFlLCAweDg1LCAweGM0LCAweDIyLCAweDQxLCAweGRmLCAweGFkLCAweDc2LCAweDYxLCAweGU1LCAweDZmLAotICAgICAgICAweDc0LCAweDQ1LCAweDY5LCAweGRjLCAweDAwLCAweDc5LCAweGFjLCAweDhiLCAweGE2LCAweGM5LCAweDM1LAotICAgICAgICAweGQ0LCAweDM0LCAweDY0LCAweGRjLCAweDM3LCAweDA2LCAweGIxLCAweGFlLCAweDg4LCAweGMxLCAweGFjLAotICAgICAgICAweGQ4LCAweGM5LCAweDJjLCAweGE2LCAweGUwLCAweDczLCAweDViLCAweDM2LCAweGYzLCAweDc0LCAweGU2LAotICAgICAgICAweDg0LCAweDA1LCAweGUzLCAweGE5LCAweDQ3LCAweDZhLCAweDE0LCAweGI2LCAweDQ5LCAweDNkLCAweDg1LAotICAgICAgICAweDNhLCAweGVlLCAweGVlLCAweDJiLCAweGE4LCAweGUyLCAweDZmLCAweDMwLCAweDgxLCAweGU5LCAweDhhLAotICAgICAgICAweGNhLCAweGE0LCAweGUyLCAweGQzLCAweDhiLCAweDAxLCAweGIxLCAweGY5LCAweDA0LCAweDdmLCAweGFmLAotICAgICAgICAweDIzLCAweGYwLCAweGE5LCAweDU0LCAweDQxLCAweDljLCAweGZkLCAweGEzLCAweGY0LCAweGFlLCAweDY1LAotICAgICAgICAweDE4LCAweGY3LCAweDI1LCAweDhhLCAweGUyLCAweDAyLCAweDM4LCAweGI4LCAweGZkLCAweDJhLCAweDdiLAotICAgICAgICAweDViLCAweGE4LCAweDZkLCAweDZkLCAweDVkLCAweDlhLCAweDVkLCAweGNiLCAweGJiLCAweGQyLCAweGI2LAotICAgICAgICAweGE2LCAweGEzLCAweDE5LCAweDVlLCAweGUyLCAweDAzLCAweDdiLCAweDFkLCAweGMyLCAweDE3LCAweDhkLAotICAgICAgICAweGI4LCAweGFjLCAweGZiLCAweDg5LCAweDM5LCAweDM1LCAweGQ2LCAweDlhLCAweDZhLCAweGU4LCAweDY2LAotICAgICAgICAweDU1LCAweGNiLCAweGY1LCAweGFjLCAweDdiLCAweDk2LCAweGViLCAweDUwLCAweGM2LCAweDg4LCAweDZkLAotICAgICAgICAweDY2LCAweGU5LCAweGNkLCAweDZjLCAweGRiLCAweDRmLCAweGQzLCAweDlhLCAweDAwLCAweDJmLCAweGU2LAotICAgICAgICAweGY5LCAweGEzLCAweGU3LCAweGI1LCAweDRhLCAweDkzLCAweDdmLCAweGEyLCAweGM2LCAweDczLCAweGRjLAotICAgICAgICAweGQ3LCAweDE1LCAweDU1LCAweGVmLCAweDQ4LCAweDdkLCAweDA5LCAweDUyLCAweDZlLCAweDNhLCAweGQ0LAotICAgICAgICAweGFiLCAweDJmLCAweGJkLCAweDYxLCAweDE2LCAweDBjLCAweDczLCAweDQ5LCAweGM1LCAweDI0LCAweDkyLAotICAgICAgICAweDdmLCAweGEyLCAweDYzLCAweGZkLCAweGFhLCAweGQ2LCAweDJmLCAweDcxLCAweDBlLCAweGIxLCAweDkzLAotICAgICAgICAweGY3LCAweDJkLCAweGY1LCAweGE0LCAweDllLCAweDRlLCAweGI1LCAweGRkLCAweDRiLCAweGY4LCAweDY4LAotICAgICAgICAweDRjLCAweGNiLCAweGI5LCAweDkzLCAweGFkLCAweDY1LCAweGNlLCAweGQ5LCAweDI2LCAweGE5LCAweDhkLAotICAgICAgICAweDE5LCAweGY2LCAweGYyLCAweGY0LCAweGU2LCAweGI1LCAweGFkLCAweGU3LCAweGM2LCAweDM5LCAweGEwLAotICAgICAgICAweDE4LCAweGViLCAweGM5LCAweDc3LCAweDZjLCAweDM1LCAweDJhLCAweDRiLCAweGZlLCAweDhhLCAweDljLAotICAgICAgICAweGZmLCAweDAwLCAweDExLCAweGFlLCAweDNhLCAweDhiLCAweGRlLCAweDYxLCAweGQwLCAweDllLCAweDM5LAotICAgICAgICAweGI4LCAweGViLCAweDUzLCAweGFjLCAweGI5LCAweGFlLCAweDViLCAweDAwLCAweGYzLCAweDI3LCAweDE0LAotICAgICAgICAweDkyLCAweGM5LCAweGZlLCAweDhhLCAweDNmLCAweGRlLCAweDM1LCAweGFjLCAweDNhLCAweDg4LCAweDkyLAotICAgICAgICAweGNkLCAweGIxLCAweDZlLCAweDdkLCAweGNkLCAweDMyLCAweDY3LCAweGViLCAweGNkLCAweDdhLCAweDE0LAotICAgICAgICAweGZlLCAweDA0LCAweDI2LCAweDY2LCAweGNlLCAweGY5LCAweDI2LCAweGIzLCAweGU2LCAweDZlLCAweGI0LAotICAgICAgICAweGQ5LCAweDQ4LCAweGM4LCAweDgyLCAweDRlLCAweDA3LCAweDM1LCAweGE3LCAweDZmLCAweDJmLCAweDAyLAotICAgICAgICAweDlhLCAweDA2LCAweDVmLCAweDhjLCAweGE0LCAweDgzLCAweDBlLCAweDMyLCAweDJhLCAweDY5LCAweGUzLAotICAgICAgICAweGRkLCAweDEyLCAweDA4LCAweDk3LCAweDg1LCAweGVjLCAweDJhLCAweDJhLCAweDQyLCAweGYxLCAweDc2LAotICAgICAgICAweDI2LCAweGU0LCAweDZhLCAweDU5LCAweDBlLCAweDE4LCAweDEwLCAweDZhLCAweGQyLCAweDg5LCAweDAyLAotICAgICAgICAweDZlLCAweDJhLCAweDcxLCAweGViLCAweDVjLCAweDFjLCAweDhjLCAweGE2LCAweDQ4LCAweGJiLCAweGRjLAotICAgICAgICAweDYxLCAweDQxLCAweDM1LCAweDcyLCAweDI4LCAweDg3LCAweGQ5LCAweGY2LCAweDRhLCAweGI5LCAweGU3LAotICAgICAgICAweDM4LCAweGFlLCAweDhjLCAweDNkLCAweDM2LCAweGRkLCAweGRlLCAweGM0LCAweGIwLCAweDIxLCAweDUxLAotICAgICAgICAweDc2LCAweGE4LCAweGMwLCAweGFhLCAweDkzLCAweDMxLCAweGU2LCAweGJiLCAweDJkLCAweDY1LCAweDYxLAotICAgICAgICAweDE5LCAweGQzLCAweDFlLCAweGI1LCAweDQ2LCAweDVhLCAweDk2LCAweDVhLCAweDMwLCAweGEwLCAweDdlLAotICAgICAgICAweDA1LCAweDY5LCAweDViLCAweGM5LCAweGM2LCAweDI4LCAweDQwLCAweGNkLCAweDA4LCAweDY0LCAweDNjLAotICAgICAgICAweDczLCAweDU3LCAweGUxLCAweDk0LCAweGYxLCAweGNkLCAweDVhLCAweDIxLCAweDhjLCAweGI5LCAweDYzLAotICAgICAgICAweGU3LCAweDY3LCAweDFkLCAweGFiLCAweDQwLCAweGIxLCAweGZiLCAweDAwLCAweDFkLCAweGYwLCAweDJiLAotICAgICAgICAweDk5LCAweDJkLCAweDY2LCAweDNlLCAweDg4LCAweDc1LCAweDgxLCAweDNmLCAweDMxLCAweGY2LCAweGFiLAotICAgICAgICAweDY0LCAweGQ2LCAweGI0LCAweDE3LCAweGVlLCAweGQwLCAweDllLCAweGU0LCAweDMyLCAweDFhLCAweGE3LAotICAgICAgICAweDMxLCAweGFkLCAweDE4LCAweDE0LCAweDI2LCAweGVmLCAweDU0LCAweGE1LCAweGE4LCAweDY1LCAweGEzLAotICAgICAgICAweDljLCAweDgxLCAweGZhLCAweDU2LCAweDhjLCAweDJkLCAweGNlLCAweDY4LCAweDQwLCAweGNiLCAweGYxLAotICAgICAgICAweDM3LCAweGJkLCAweDVlLCAweDg1LCAweGVhLCAweGQxLCAweDBjLCAweGJiLCAweDE5LCAweDU2LCAweDIzLAotICAgICAgICAweDIwLCAweDFmLCAweGFkLCAweDVjLCAweDQyLCAweDA4LCAweDAzLCAweGI1LCAweDU1LCAweDkxLCAweDA0LAotICAgICAgICAweGM5LCAweDgwLCAweDM4LCAweDAwLCAweDBhLCAweDcxLCAweDM0LCAweDZjLCAweDMyLCAweDI3LCAweGU5LAotICAgICAgICAweDU1LCAweDI1LCAweDE1LCAweDJjLCAweDY4LCAweGEzLCAweDMwLCAweGViLCAweDU0LCAweGE1LCAweDE1LAotICAgICAgICAweDBjLCAweGQxLCAweDAwLCAweGZmLCAweGQ5fTsKLQotICAgIC8qIHBhY2thZ2UgKi8gc3RhdGljIGZpbmFsIGJ5dGVbXSBzUGhvdG9CeXRlQXJyYXlGb3JDb21wbGljYXRlZENhc2U7Ci0KLSAgICBzdGF0aWMgewotICAgICAgICBmaW5hbCBpbnQgbGVuZ3RoID0gc1Bob3RvSW50QXJyYXlGb3JDb21wbGljYXRlZENhc2UubGVuZ3RoOwotICAgICAgICBzUGhvdG9CeXRlQXJyYXlGb3JDb21wbGljYXRlZENhc2UgPSBuZXcgYnl0ZVtsZW5ndGhdOwotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICBzUGhvdG9CeXRlQXJyYXlGb3JDb21wbGljYXRlZENhc2VbaV0gPSAoYnl0ZSlzUGhvdG9JbnRBcnJheUZvckNvbXBsaWNhdGVkQ2FzZVtpXTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIHRlc3RWMjFTaW1wbGVDYXNlMV9QYXJzaW5nKCkgewotICAgICAgICBtV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XcudjIxX3NpbXBsZV8xKTsKLSAgICAgICAgbVZlcmlmaWVyLmFkZENvbnRlbnRWYWx1ZXNWZXJpZmllckVsZW0oKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZChTdHJ1Y3R1cmVkTmFtZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuRkFNSUxZX05BTUUsICJBbmRvIikKLSAgICAgICAgICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuR0lWRU5fTkFNRSwgIlJvaWQiKQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgbmFtZS1yZWxhdGVkIHN0cmluZ3Mgb25seSBjb250YWlucyBwcmludGFibGUgQXNjaWksCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgb3JkZXIgaXMgcmVtYWluZWQgdG8gYmUgVVMnczoKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vICJQcmVmaXggR2l2ZW4gTWlkZGxlIEZhbWlseSBTdWZmaXgiCi0gICAgICAgICAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLkRJU1BMQVlfTkFNRSwgIlJvaWQgQW5kbyIpOwotICAgIH0KLQotICAgIHB1YmxpYyB2b2lkIHRlc3RWMjFTaW1wbGVDYXNlMigpIHsKLSAgICAgICAgbVZlcmlmaWVyLmluaXRGb3JJbXBvcnRUZXN0KFZDYXJkQ29uZmlnLlZDQVJEX1RZUEVfVjIxX0pBUEFORVNFX1NKSVMsIFIucmF3LnYyMV9zaW1wbGVfMik7Ci0gICAgICAgIG1WZXJpZmllci5hZGRDb250ZW50VmFsdWVzVmVyaWZpZXJFbGVtKCkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWQoU3RydWN0dXJlZE5hbWUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW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1dChQaG9uZS5JU19QUklNQVJZLCAxKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjMiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9JU0ROKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChFbWFpbC5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KEVtYWlsLkRBVEEsICJ0ZXN0QGV4YW1wbGUuY29tIikKLSAgICAgICAgICAgICAgICAucHV0KEVtYWlsLlRZUEUsIEVtYWlsLlRZUEVfSE9NRSkKLSAgICAgICAgICAgICAgICAucHV0KEVtYWlsLklTX1BSSU1BUlksIDEpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKEVtYWlsLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoRW1haWwuREFUQSwgInRlc3QyQGV4YW1pbmF0aW9uLmNvbSIpCi0gICAgICAgICAgICAgICAgLnB1dChFbWFpbC5UWVBFLCBFbWFpbC5UWVBFX01PQklMRSkKLSAgICAgICAgICAgICAgICAucHV0KEVtYWlsLklTX1BSSU1BUlksIDEpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKE9yZ2FuaXphdGlvbi5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KE9yZ2FuaXphdGlvbi5DT01QQU5ZLCAiQ29tcGFueSIpCi0gICAgICAgICAgICAgICAgLnB1dChPcmdhbml6YXRpb24uVElUTEUsICJFbmdpbmVlciIpCi0gICAgICAgICAgICAgICAgLnB1dChPcmdhbml6YXRpb24uVFlQRSwgT3JnYW5pemF0aW9uLlRZUEVfV09SSyk7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoT3JnYW5pemF0aW9uLkNPTlRFTl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ZXQoIkNFTEwiKSkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJURUwiLCAiMDMyMjIyMjIyMiIsIG5ldyBUeXBlU2V0KCJWSURFTyIpKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIlRFTCIsICIwMzMzMzMzMzMzIiwgbmV3IFR5cGVTZXQoIlZPSUNFIikpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZVdpdGhPcmRlcigiQURSIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICI7OzEwMCBXYXRlcnMgRWRnZTtCYXl0b3duO0xBOzMwMzE0O1VuaXRlZCBTdGF0ZXMgb2YgQW1lcmljYSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KCIiLCAiIiwgIjEwMCBXYXRlcnMgRWRnZSIsICJCYXl0b3duIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkxBIiwgIjMwMzE0IiwgIlVuaXRlZCBTdGF0ZXMgb2YgQW1lcmljYSIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBuZXcgVHlwZVNldCgiV09SSyIpLCBudWxsKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIkxBQkVMIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICIxMDAgV2F0ZXJzIEVkZ2VcclxuQmF5dG93biwgTEEgMzAzMTRcclxuVW5pdGVkICBTdGF0ZXMgb2YgQW1lcmljYSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLCBtQ29udGVudFZhbHVlc0ZvclFQLCBuZXcgVHlwZVNldCgiV09SSyIpLCBudWxsKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIkFEUiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAiOzs0MiBQbGFudGF0aW9uIFN0LjtCYXl0b3duO0xBOzMwMzE0O1VuaXRlZCBTdGF0ZXMgb2YgQW1lcmljYSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KCIiLCAiIiwgIjQyIFBsYW50YXRpb24gU3QuIiwgIkJheXRvd24iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTEEiLCAiMzAzMTQiLCAiVW5pdGVkIFN0YXRlcyBvZiBBbWVyaWNhIiksIG51bGwsIG51bGwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBUeXBlU2V0KCJIT01FIiksIG51bGwpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZVdpdGhPcmRlcigiTEFCRUwiLAotICAgICAgICAgICAgICAgICAgICAgICAgIjQyIFBsYW50YXRpb24gU3QuXHJcbkJheXRvd24sIExBIDMwMzE0XHJcblVuaXRlZCAgU3RhdGVzIG9mIEFtZXJpY2EiLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbUNvbnRlbnRWYWx1ZXNGb3JRUCwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBUeXBlU2V0KCJIT01FIiksIG51bGwpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZVdpdGhPcmRlcigiRU1BSUwiLCAiZm9ycmVzdGd1bXBAd2FsbGFkYWxsYS5jb20iLAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFR5cGVTZXQoIlBSRUYiLCAiSU5URVJORVQiKSkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJFTUFJTCIsICJjZWxsQGV4YW1wbGUuY29tIiwgbmV3IFR5cGVTZXQoIkNFTEwiKSkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJOT1RFIiwgIlRoZSBmb2xsb3dpbmcgbm90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i0gICAgICAgICAgICAgICAgLnB1dChPcmdhbml6YXRpb24uQ09NUEFOWSwgIkd1bXAgU2hyaW1wIENvLiIpCi0gICAgICAgICAgICAgICAgLnB1dChPcmdhbml6YXRpb24uREVQQVJUTUVOVCwgIlNhbGVzIERlcHQuO01hbmFnZXIgRmlzaCBrZWVwZXIiKQotICAgICAgICAgICAgICAgIC5wdXQoT3JnYW5pemF0aW9uLlRJVExFLCAiU2hyaW1wIE1hbiIpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9XT1JLKQotICAgICAgICAgICAgICAgIC8vIFBob25lIG51bWJlciBpcyBleHBlY3RlZCB0byBiZSBmb3JtYXRlZCB3aXRoIE5BTVAgZm9ybWF0IGluIGRlZmF1bHQuCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIxMTEtNTU1LTEyMTIiKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfSE9NRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjQwNC01NTUtMTIxMiIpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9NT0JJTEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIwMzEtMTExLTExMTEiKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTEFCRUwsICJWSURFTyIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIwMzItMjIyLTIyMjIiKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTEFCRUwsICJWT0lDRSIpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5OVU1CRVIsICIwMzMtMzMzLTMzMzMiKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChTdHJ1Y3R1cmVkUG9zdGFsLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZFBvc3RhbC5UWVBFLCBTdHJ1Y3R1cmVkUG9zdGFsLlRZUEVfV09SSykKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWRQb3N0YWwuQ09VTlRSWSwgIlVuaXRlZCBTdGF0ZXMgb2YgQW1lcmljYSIpCi0gICAgICAgICAgICAgICAgLnB1dChTdHJ1Y3R1cmVkUG9zdGFsLlBPU1RDT0RFLCAiMzAzMTQiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZFBvc3RhbC5SRUdJT04sICJMQSIpCi0gICAgICAgICAgICAgICAgLnB1dChTdHJ1Y3R1cmVkUG9zdGFsLkNJVFksICJCYXl0b3duIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWRQb3N0YWwuU1RSRUVULCAiMTAwIFdhdGVycyBFZGdlIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWRQb3N0YWwuRk9STUFUVEVEX0FERFJFU1MsCi0gICAgICAgICAgICAgICAgICAgICAgICAiMTAwIFdhdGVycyBFZGdlIEJhe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gIG1WZXJpZmllci5hZGRQcm9wZXJ0eU5vZGVzVmVyaWZpZXJFbGVtKCkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJWRVJTSU9OIiwgIjIuMSIpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZVdpdGhPcmRlcigiTiIsICJcdTVCODlcdTg1RTQ7XHUzMEVEXHUzMEE0XHUzMEM5XHUwMDMxOzs7IiwKLSAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoIlx1NUI4OVx1ODVFNCIsICJcdTMwRURcdTMwQTRcdTMwQzlcdTAwMzEiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIiwgIiIsICIiKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG1Db250ZW50VmFsdWVzRm9yU0ppcywgbnVsbCwgbnVsbCkKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlV2l0aE9yZGVyKCJGTiIsICJcdTVCODlcdTg1RTRcdTAwMjBcdTMwRURcdTMwQTRcdTMwQzlcdTAwMjBcdTAwMzEiLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbnVsbCwgbUNvbnRlbnRWYWx1ZXNGb3JTSmlzLCBudWxsLCBudWxsKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIlNPVU5EIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdUZGNzFcdUZGOURcdUZGODRcdUZGOUVcdUZGNzM7XHVGRjlCXHVGRjcyXHVGRjg0XHVGRjlFXHUwMDMxOzs7IiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG51bGwsIG1Db250ZW50VmFsdWVzRm9yU0ppcywKLSAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBUeXBlU2V0KCJYLUlSTUMtTiIpLCBudWxsKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIkFEUiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAiO1x1Njc3MVx1NEVBQ1x1OTBGRFx1NkUwQlx1OEMzN1x1NTMzQVx1Njg1QyIgKwotICAgICAgICAgICAgICAgICAgICAgICAgIlx1NEUxOFx1NzUzQVx1MDAzMlx1MDAzNlx1MDAyRFx1MDAzMVx1MzBCQiIgKwotICAgICAgICAgICAgICAgICAgICAgICAgIlx1MzBFQlx1MzBFQVx1MzBBMlx1MzBGM1x1MzBCRlx1MzBFRlx1MzBGQ1x1MDAzNiIgKwotICAgICAgICAgICAgICAgICAgICAgICAgIlx1OTY4RTs7OzsxNTAtODUxMjsiLAotICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXlzLmFzTGlzdCgiIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlx1Njc3MVx1NEVBQ1x1OTBGRFx1NkUwQlx1OEMzN1x1NTMzQVx1Njg1QyIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiXHU0RTE4XHU3NTNBXHUwMDMyXHUwMDM2XHUwMDJEXHUwMDMxXHUzMEJCIiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJcdTMwRUJcdTMwRUFcdTMwQTJcdTMwRjNcdTMwQkZcdTMwRUZcdTMwRkMiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlx1MDAzNlx1OTY4RSIsICIiLCAiIiwgIiIsICIxNTAtODUxMiIsICIiKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG1Db250ZW50VmFsdWVzRm9yUVBBbmRTSmlzLCBuZXcgVHlwZVNldCgiSE9NRSIpLCBudWxsKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGVXaXRoT3JkZXIoIk5PVEUiLCAiXHUzMEUxXHUzMEUyIiwgbnVsbCwgbnVsbCwKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZW50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Fx1RkY5RVx1RkY3MyIpCi0gICAgICAgICAgICAgICAgLnB1dChTdHJ1Y3R1cmVkTmFtZS5QSE9ORVRJQ19HSVZFTl9OQU1FLCAiXHVGRjlCXHVGRjcyXHVGRjg0XHVGRjlFXHUwMDMxIik7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoU3RydWN0dXJlZFBvc3RhbC5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWRQb3N0YWwuUE9TVENPREUsICIxNTAtODUxMiIpCi0gICAgICAgICAgICAgICAgLnB1dChTdHJ1Y3R1cmVkUG9zdGFsLlNUUkVFVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTY3NzFcdTRFQUNcdTkwRkRcdTZFMEJcdThDMzdcdTUzM0FcdTY4NUMiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTRFMThcdTc1M0FcdTAwMzJcdTAwMzZcdTAwMkRcdTAwMzFcdTMwQkIiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTMwRUJcdTMwRUFcdTMwQTJcdTMwRjNcdTMwQkZcdTMwRUZcdTMwRkMiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTAwMzZcdTk2OEUiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZFBvc3RhbC5GT1JNQVRURURfQUREUkVTUywKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTY3NzFcdTRFQUNcdTkwRkRcdTZFMEJcdThDMzdcdTUzM0FcdTY4NUMiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTRFMThcdTc1M0FcdTAwMzJcdTAwMzZcdTAwMkRcdTAwMzFcdTMwQkIiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTMwRUJcdTMwRUFcdTMwQTJcdTMwRjNcdTMwQkZcdTMwRUZcdTMwRkMiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICJcdTAwMzZcdTk2OEUgM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otICAgICAgICAgICAgICAgICAgICAgICAgIlx1RkY3MVx1RkY5RFx1RkY4NFx1RkY5RVx1RkY3M1x1RkY5Qlx1RkY3Mlx1RkY4NFx1RkY5RVx1MDAzNCIpOwotICAgICAgICBlbGVtLmFkZEV4cGVjdGVkKFBob25lLkNPTlRFTlRfSVRFTV9UWVBFKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuVFlQRSwgUGhvbmUuVFlQRV9DVVNUT00pCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5MQUJFTCwgIk1PREVNIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjEzIik7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX1BBR0VSKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTQiKTsKLSAgICAgICAgZWxlbS5hZGRFeHBlY3RlZChQaG9uZS5DT05URU5UX0lURU1fVFlQRSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLlRZUEUsIFBob25lLlRZUEVfQ1VTVE9NKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTEFCRUwsICJORUMtRkFNSUxZIikKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLk5VTUJFUiwgIjE1Iik7Ci0gICAgICAgIGVsZW0uYWRkRXhwZWN0ZWQoUGhvbmUuQ09OVEVOVF9JVEVNX1RZUEUpCi0gICAgICAgICAgICAgICAgLnB1dChQaG9uZS5UWVBFLCBQaG9uZS5UWVBFX0NVU1RPTSkKLSAgICAgICAgICAgICAgICAucHV0KFBob25lLkxBQkVMLCAiTkVDLUdJUkwiKQotICAgICAgICAgICAgICAgIC5wdXQoUGhvbmUuTlVNQkVSLCAiMTYiKTsKLQotICAgICAgICBlbGVtID0gbVZlcmlmaWVyLmFk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X05BTUUsICJcdTMwNzVcdTMwOEJcdTMwNjkiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuR0lWRU5fTkFNRSwgIlx1MzA5MVx1MzA4QVx1MzA0QiIpCi0gICAgICAgICAgICAgICAgLnB1dChTdHJ1Y3R1cmVkTmFtZS5NSURETEVfTkFNRSwgIkIiKQotICAgICAgICAgICAgICAgIC5wdXQoU3RydWN0dXJlZE5hbWUuUFJFRklYLCAiRHIuIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLlNVRkZJWCwgIlBoLkQiKTsKLQotICAgICAgICBtVmVyaWZpZXIuYWRkUHJvcGVydHlOb2Rlc1ZlcmlmaWVyRWxlbSgpCi0gICAgICAgICAgICAgICAgLmFkZEV4cGVjdGVkTm9kZSgiRk4iLCAiRHIuIFx1MzA3NVx1MzA4Qlx1MzA2OSBCIFx1MzA5MVx1MzA4QVx1MzA0QiBQaC5EIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZW50VmFsdWVzRm9yU0ppcykKLSAgICAgICAgICAgICAgICAuYWRkRXhwZWN0ZWROb2RlKCJOIiwgIlx1MzA3NVx1MzA4Qlx1MzA2OTtcdTMwOTFcdTMwOEFcdTMwNEI7QjtEci47UGguRCIsCi0gICAgICAgICAgICAgICAgICAgICAgICBBcnJheXMuYXNMaXN0KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiXHUzMDc1XHUzMDhCXHUzMDY5IiwgIlx1MzA5MVx1MzA4QVx1MzA0QiIsICJCIiwgIkRyLiIsICJQaC5EIiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIG1Db250ZW50VmFsdWVzRm9yU0ppcywgbnVsbCwgbnVsbCk7Ci0gICAgfQotCi0gICAgLyoqCi0gICAgICogRG9Db01vIHBob25lcyByZXF1aXJlIGFsbCBuYW1lIGVsZW1lbnRzIHNob3VsZCBiZSBpbiAiZmFtaWx5IG5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5hZGRFeHBlY3RlZE5vZGUoIlgtUEhPTkVUSUMtTUlERExFLU5BTUUiLAotICAgICAgICAgICAgICAgICAgICAgICAgIlx1MzBERlx1MzBDOVx1MzBFQlx1MzBDRFx1MzBGQ1x1MzBFMCIsCi0gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50VmFsdWVzKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZE5vZGUoIlgtUEhPTkVUSUMtRklSU1QtTkFNRSIsICJcdTMwNUZcdTMwOERcdTMwNDYiLAotICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFZhbHVlcyk7Ci0gICAgICAgIGlmIChWQ2FyZENvbmZpZy5pc1YzMCh2Y2FyZFR5cGUpKSB7Ci0gICAgICAgICAgICBlbGVtLmFkZEV4cGVjdGVkTm9kZSgiU09SVC1TVFJJTkciLAotICAgICAgICAgICAgICAgICAgICAiXHUzMDg0XHUzMDdFXHUzMDYwIFx1MzBERlx1MzBDOVx1MzBFQlx1MzBDRFx1MzBGQ1x1MzBFMCBcdTMwNUZcdTMwOERcdTMwNDYiLAotICAgICAgICAgICAgICAgICAgICBjb250ZW50VmFsdWVzKTsKLSAgICAgICAgfQotICAgICAgICBDb250ZW50VmFsdWVzQnVpbGRlciBidWlsZGVyID0gbVZlcmlmaWVyLmFkZENvbnRlbnRWYWx1ZXNWZXJpZmllckVsZW0oKQotICAgICAgICAgICAgICAgIC5hZGRFeHBlY3RlZChTdHJ1Y3R1cmVkTmFtZS5DT05URU5UX0lURU1fVFlQRSk7Ci0gICAgICAgIGJ1aWxkZXIucHV0KFN0cnVjdHVyZWROYW1lLlBIT05FVElDX0ZBTUlMWV9OQU1FLCAiXHUzMDg0XHUzMDdFXHUzMDYwIikKLSAgICAgICAgICAgICAgICAucHV0KFN0cnVjdHVyZWROYW1lLlBIT05FVElDX01JRERMRV9OQU1FLCAiXHUzMERGXHUzMEM5XHUzMEVCXHUzMENEXHUzMEZDXHUzMEUwIikKLSAgICAgICAgICAgICAg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EhhbmRsZXIobUxpbmVWZXJpZmllcik7Ci0gICAgICAgIGNvbXBvc2VyLmFkZEhhbmRsZXIobVZDYXJkVmVyaWZpZXJJbnRlcm5hbCk7Ci0gICAgICAgIGlmICghY29tcG9zZXIuaW5pdChWQ2FyZENvbXBvc2VyLkNPTlRBQ1RTX1RFU1RfQ09OVEVOVF9VUkksIG51bGwsIG51bGwsIG51bGwpKSB7Ci0gICAgICAgICAgICBtVGVzdENhc2UuZmFpbCgiaW5pdCgpIGZhaWxlZC4gUmVhc29uOiAiICsgY29tcG9zZXIuZ2V0RXJyb3JSZWFzb24oKSk7Ci0gICAgICAgIH0KLSAgICAgICAgbVRlc3RDYXNlLmFzc2VydEZhbHNlKGNvbXBvc2VyLmlzQWZ0ZXJMYXN0KCkpOwotICAgICAgICB0cnkgewotICAgICAgICAgICAgd2hpbGUgKCFjb21wb3Nlci5pc0FmdGVyTGFzdCgpKSB7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgTWV0aG9kIG1vY2tHZXRFbnRpdHlJdGVyYXRvck1ldGhvZCA9IGdldE1vY2tHZXRFbnRpdHlJdGVyYXRvck1ldGhvZCgpOwotICAgICAgICAgICAgICAgICAgICBtVGVzdENhc2UuYXNzZXJ0VHJ1ZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb3Nlci5jcmVhdGVPbmVFbnRyeShnZXRNb2NrR2V0RW50aXR5SXRlcmF0b3JNZXRob2QoKSkpOwotICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGUucHJpbnRTdGFja1RyYWNlKCk7Ci0gICAgICAgICAgICAgICAgICAgIG1UZXN0Q2FzZS5mYWlsKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGZpbmFsbHkgewotICAgICAgICAgICAgY29tcG9zZXIudGVybWluYXRlKCk7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gICAgICAgICAgIC8vIEFzc3VtZSBCQVNFNjQgaXMgdXNlZCBvbmx5IHdoZW4gdGhlIG51bWJlciBvZiB2YWx1ZXMgaXMgMS4KLSAgICAgICAgICAgICAgICBtQ3VycmVudFByb3BOb2RlLnByb3BWYWx1ZV9ieXRlcyA9Ci0gICAgICAgICAgICAgICAgICAgIEJhc2U2NC5kZWNvZGVCYXNlNjQodmFsdWUuZ2V0Qnl0ZXMoKSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlOwotICAgICAgICAgICAgfSBlbHNlIGlmIChlbmNvZGluZy5lcXVhbHMoIlFVT1RFRC1QUklOVEFCTEUiKSkgewotICAgICAgICAgICAgICAgIFN0cmluZyBxdW90ZWRQcmludGFibGUgPSB2YWx1ZQotICAgICAgICAgICAgICAgIC5yZXBsYWNlQWxsKCI9ICIsICIgIikucmVwbGFjZUFsbCgiPVx0IiwgIlx0Iik7Ci0gICAgICAgICAgICAgICAgU3RyaW5nW10gbGluZXM7Ci0gICAgICAgICAgICAgICAgaWYgKG1TdHJpY3RMaW5lQnJlYWtQYXJzaW5nKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxpbmVzID0gcXVvdGVkUHJpbnRhYmxlLnNwbGl0KCJcclxuIik7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nQnVpbGRlciBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgICAgICAgICAgaW50IGxlbmd0aCA9IHF1b3RlZFByaW50YWJsZS5sZW5ndGgoKTsKLSAgICAgICAgICAgICAgICAgICAgQXJyYXlMaXN0PFN0cmluZz4gbGlzdCA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOwotICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjaGFyIGNoID0gcXVvdGVkUHJpbnRhYmxlLmNoYXJBdChpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PSAnXG4nKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5hZGQoYnVpbGRlci50b1N0cmluZygpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gJ1xyJykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QuYWRkKGJ1aWxkZXIudG9TdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPCBsZW5ndGggLSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgbmV4dENoID0gcXVvdGVkUHJpbnRhYmxlLmNoYXJBdChpICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0Q2ggPT0gJ1xuJykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSsrOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZChjaCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGZpbmFsTGluZSA9IGJ1aWxkZXIudG9TdHJpbmcoKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGZpbmFsTGluZS5sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QuYWRkKGZpbmFsTGluZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbGluZXMgPSBsaXN0LnRvQXJyYXkobmV3IFN0cmluZ1swXSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFN0cmluZ0J1aWxkZXIgYnVpbGRlciA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7Ci0gICAgICAgICAgICAgICAgZm9yIChTdHJpbmcgbGluZSA6IGxpbmVzKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChsaW5lLmVuZHNXaXRoKCI9IikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUgPSBsaW5lLnN1YnN0cmluZygwLCBsaW5lLmxlbmd0aCgpIC0gMSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmQobGluZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJ5dGVbXSBieXRlczsKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBieXRlcyA9IGJ1aWxkZXIudG9TdHJpbmcoKS5nZXRCeXRlcyhtU291cmNlQ2hhcnNldCk7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoVW5zdXBwb3J0ZWRFbmNvZGluZ0V4Y2VwdGlvbiBlMSkgewotICAgICAgICAgICAgICAgICAgICBMb2cuZShMT0dfVEFHLCAiRmFpbGVkIHRvIGVuY29kZTogY2hhcnNldD0iICsgbVNvdXJjZUNoYXJzZXQpOwotICAgICAgICAgICAgICAgICAgICBieXRlcyA9IGJ1aWxkZXIudG9TdHJpbmcoKS5nZXRCeXRlcygpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICBieXRlcyA9IFF1b3RlZFByaW50YWJsZUNvZGVjLmRlY29kZVF1b3RlZFByaW50YWJsZShieXRlcyk7Ci0gICAgICAgICAgICAgICAgfSBjYXRjaCAoRGVjb2RlckV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIExvZy5lKExPR19UQUcsICJGYWlsZWQgdG8gZGVjb2RlIHF1b3RlZC1wcmludGFibGU6ICIgKyBlKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuICIiOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU3RyaW5nKGJ5dGVzLCB0YXJnZXRDaGFyc2V0KTsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChVbnN1cHBvcnRlZEVuY29kaW5nRXhjZXB0aW9uIGUpIHsKLSAgICAgICAgICAgICAgICAgICAgTG9nLmUoTE9HX1RBRywgIkZhaWxlZCB0byBlbmNvZGU6IGNoYXJzZXQ9IiArIHRhcmdldENoYXJzZXQpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFN0cmluZyhieXRlcyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gVW5rbm93biBlbmNvZGluZy4gRmFsbCBiYWNrIHRvIGRlZmF1bHQuCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIGVuY29kZVN0cmluZyh2YWx1ZSwgdGFyZ2V0Q2hhcnNldCk7Ci0gICAgfQotICAgIAotICAgIHB1YmxpYyB2b2lkIHByb3BlcnR5VmFsdWVzKExpc3Q8U3RyaW5nPiB2YWx1ZXMpIHsKLSAgICAgICAgaWYgKHZhbHVlcyA9PSBudWxsIHx8IHZhbHVlcy5zaXplKCkgPT0gMCkgewotICAgICAgICAgICAgbUN1cnJlbnRQcm9wTm9kZS5wcm9wVmFsdWVfYnl0ZXMgPSBudWxsOwotICAgICAgICAgICAgbUN1cnJlbnRQcm9wTm9kZS5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gICAgICAgImFBMSIsCisgICAgICAgICJhQWIiLAorICAgICAgICAiYUExQiIsCisgICAgICAgICJhQTFCMiIsCisKKyAgICAgICAgLy8gcnRsCisgICAgICAgICJBIiwKKyAgICAgICAgIkExIiwKKyAgICAgICAgIkFhIiwKKyAgICAgICAgIkExQiIsCisgICAgICAgICJBMWEiLAorICAgICAgICAiQWExIiwKKyAgICAgICAgIkFhQiIKKyAgICB9OworCisgICAgLy8gRXhwZWN0ZWQgZGlyZWN0aW9ucyBhcmUgYW4gYXJyYXkgb2Ygc3RhcnQvbGVuZ3RoK2xldmVsIHBhaXJzLAorICAgIC8vIGluIHZpc3VhbCBvcmRlciBmcm9tIHRoZSBsZWFkaW5nIG1hcmdpbi4KKyAgICBwcml2YXRlIHN0YXRpYyBEaXJlY3Rpb25zW10gZXhwZWN0ZWQgPSB7CisgICAgICAgIERJUlNfQUxMX0xFRlRfVE9fUklHSFQsCisgICAgICAgIERJUlNfQUxMX0xFRlRfVE9fUklHSFQsCisgICAgICAgIERJUlNfQUxMX0xFRlRfVE9fUklHSFQsCisgICAgICAgIERJUlNfQUxMX0xFRlRfVE9fUklHSFQsCisgICAgICAgIGRpcnMoMCwgMSwgMSwgTFZMMV8xKSwKKyAgICAgICAgRElSU19BTExfTEVGVF9UT19SSUdIVCwKKyAgICAgICAgZGlycygwLCAyLCAyLCBMVkwxXzEpLAorICAgICAgICBkaXJzKDAsIDEsIDIsIExWTDJfMSwgMSwgTFZMMV8xKSwKKyAgICAgICAgZGlycygwLCAxLCAxLCBMVkwxXzEsIDIsIDEpLAorICAgICAgICBkaXJzKDAsIDEsIDMsIExWTDFfMSwgMiwgTFZMMl8xLCAxLCBMVkwxXzEpLAorICAgICAgICBkaXJzKDAsIDEsIDQsIExWTDJfMSwgMywgTFZMMV8xLCAyLCBMVkwyXzEsIDEsIExWTDFfMSksCisKKyAgICAgICAgLy8gcnRsCisgICAgICAgIERJUlNfQUxMX1JJR0hUX1RPX0xFRlQsCisgICAgICAgIGRpcnMoMCwgTFZMMV8xLCAxLCBMVkwyXzEpLAorICAgICAgICBkaXJzKDAsIExWTDFfMSwgMSwgTFZMMl8xKSwKKyAgICAgICAgZGlycygwLCBMVkwxXzEsIDEsIExWTDJfMSwgMiwgTFZMMV8xKSwKKyAgICAgICAgZGlycygwLCBMVkwxXzEsIDEsIExWTDJfMiksCisgICAgICAgIGRpcnMoMCwgTFZMMV8xLCAxLCBMVkwyXzIpLAorICAgICAgICBkaXJzKDAsIExWTDFfMSwgMSwgTFZMMl8xLCAyLCBMVkwxXzEpLAorICAgIH07CisKKyAgICBwcml2YXRlIHN0YXRpYyBTdHJpbmcgcHNldWRvQmlkaVRvUmVhbChTdHJpbmcgc3JjKSB7CisgICAgICAgIGNoYXJbXSBjaGFycyA9IHNyYy50b0NoYXJBcnJheSgpOworICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IGNoYXJzLmxlbmd0aDsgKytqKSB7CisgICAgICAgICAgICBjaGFyIGMgPSBjaGFyc1tqXTsKKyAgICAgICAgICAgIGlmIChjID49ICdBJyAmJiBjIDw9ICdEJykgeworICAgICAgICAgICAgICAgIGNoYXJzW2pdID0gKGNoYXIpKEFMRUYgKyBjIC0gJ0EnKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBuZXcgU3RyaW5nKGNoYXJzLCAwLCBjaGFycy5sZW5ndGgpOworICAgIH0KKworICAgIC8vIEBTbWFsbFRlc3QKKyAgICBwdWJsaWMgdm9pZCB0ZXN0RGlyZWN0aW9ucygpIHsKKyAgICAgICAgU3RyaW5nQnVpbGRlciBidWYgPSBuZXcgU3RyaW5nQnVpbGRlcigiXG4iKTsKKyAgICAgICAgRm9ybWF0dGVyIGYgPSBuZXcgRm9ybWF0dGVyKGJ1Zik7CisKKyAgICAgICAgTGF5b3V0QnVpbGRlciBiID0gU3RhdGljTGF5b3V0VGVzdC5idWlsZGVyKCk7CisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgdGV4dHMubGVuZ3RoOyArK2kpIHsKKyAgICAgICAgICAgIGIuc2V0VGV4dChwc2V1ZG9CaWRpVG9SZWFsKHRleHRzW2ldKSk7CisgICAgICAgICAgICBjaGVja0RpcmVjdGlvbnMoYi5idWlsZCgpLCBpLCBiLnRleHQsIGV4cGVjdGVkLCBmKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoYnVmLmxlbmd0aCgpID4gMSkgeworICAgICAgICAgICAgZmFpbChidWYudG9TdHJpbmcoKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyBAU21hbGxUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdFRyYWlsaW5nV2hpdGVzcGFjZSgpIHsKKyAgICAgICAgTGF5b3V0QnVpbGRlciBiID0gU3RhdGljTGF5b3V0VGVzdC5idWlsZGVyKCk7CisgICAgICAgIGIuc2V0VGV4dChwc2V1ZG9CaWRpVG9SZWFsKCJBYiAgIGMiKSk7CisgICAgICAgIGZsb2F0IHdpZHRoID0gYi5wYWludC5tZWFzdXJlVGV4dChiLnRleHQsIDAsIDUpOyAgLy8gZXhjbHVkZSAnYycKKyAgICAgICAgYi5zZXRXaWR0aChNYXRoLnJvdW5kKHdpZHRoKSk7CisgICAgICAgIExheW91dCBsID0gYi5idWlsZCgpOworICAgICAgICBpZiAobC5nZXRMaW5lQ291bnQoKSAhPSAyKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiZXhwZWN0ZWQgMiBsaW5lcywgZ290OiAiICsgbC5nZXRMaW5lQ291bnQoKSk7CisgICAgICAgIH0KKyAgICAgICAgRGlyZWN0aW9ucyByZXN1bHQgPSBsLmdldExpbmVEaXJlY3Rpb25zKDApOworICAgICAgICBEaXJlY3Rpb25zIGV4cGVjdGVkID0gZGlycygwLCBMVkwxXzEsIDEsIExWTDJfMSwgMiwgMyB8ICgxIDw8IExheW91dC5SVU5fTEVWRUxfU0hJRlQpKTsKKyAgICAgICAgZXhwZWN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AiICsKKyAgICAgICAgICAgICAgICAgICAgICAgIGV4cGVjdGVkW2ldICsgIiBnb3Q6ICIgKyB0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG4gPSB0OworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdE5leHRUb0xlZnRPZigpIHsKKyAgICAgICAgTGF5b3V0QnVpbGRlciBiID0gU3RhdGljTGF5b3V0VGVzdC5idWlsZGVyKCk7CisgICAgICAgIGIuc2V0VGV4dChwc2V1ZG9CaWRpVG9SZWFsKCJhQTFCMiIpKTsKKyAgICAgICAgaW50W10gZXhwZWN0ZWQgPSB7IDAsIDEsIDQsIDMsIDIsIDUgfTsKKyAgICAgICAgTGF5b3V0IGwgPSBiLmJ1aWxkKCk7CisgICAgICAgIGludCBuID0gNTsKKyAgICAgICAgZm9yIChpbnQgaSA9IGV4cGVjdGVkLmxlbmd0aCAtIDE7IC0taSA+PSAwOykgeworICAgICAgICAgICAgaW50IHQgPSBsLmdldE9mZnNldFRvTGVmdE9mKG4pOworICAgICAgICAgICAgaWYgKHQgIT0gZXhwZWN0ZWRbaV0pIHsKKyAgICAgICAgICAgICAgICBmYWlsKCJvZmZzZXRbIiArIGkgKyAiXSB0byBsZWZ0IG9mOiAiICsgbiArICIgZXhwZWN0ZWQ6ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgZXhwZWN0ZWRbaV0gKyAiIGdvdDogIiArIHQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbiA9IHQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvLyB1dGlsaXR5LCBub3QgcmVhbGx5IGEgdGVzdAorICAgIC8qCisgICAgcHVibGljIHZvaWQgdGVzdE1lYXN1cmVUZXh0MSgpIHsKKyAgICAgICAgTGF5b3V0QnVpbGRlciBiID0gU3RhdGljTGF5b3V0VGVzdC5idWlsZGVyKCk7CisgICAgICAgIFN0cmluZyB0ZXh0ID0gIkFCQyI7IC8vICJhYkFCIgorICAgICAgICBiLnNldFRleHQocHNldWRvQmlkaVRvUmVhbCh0ZXh0KSk7CisgICAgICAgIExheW91dCBsID0gYi5idWlsZCgpOworICAgICAgICBEaXJlY3Rpb25zIGRpcmVjdGlvbnMgPSBsLmdldExpbmVEaXJlY3Rpb25zKDApOworCisgICAgICAgIFRleHRQYWludCB3b3JrUGFpbnQgPSBuZXcgVGV4dFBhaW50KCk7CisKKyAgICAgICAgaW50IGRpciA9IC0xOyAvLyBMRUZUX1RPX1JJR0hUCisgICAgICAgIGJvb2xlYW4gdHJhaWxpbmcgPSB0cnVlOworICAgICAgICBib29sZWFuIGFsdCA9IHRydWU7CisgICAgICAgIGRvIHsKKyAgICAgICAgICAgIGRpciA9IC1kaXI7CisgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgdHJhaWxpbmcgPSAhdHJhaWxpbmc7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgb2Zmc2V0ID0gMCwgZW5kID0gYi50ZXh0Lmxlbmd0aCgpOyBvZmZzZXQgPD0gZW5kOyArK29mZnNldCkgeworICAgICAgICAgICAgICAgICAgICBmbG9hdCB3aWR0aCA9IExheW91dC5tZWFzdXJlVGV4dChiLnBhaW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdvcmtQYWludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBiLnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgb2Zmc2V0LCBlbmQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyLCBkaXJlY3Rpb25zLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYWlsaW5nLCBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgTG9nLmkoIkJJREkiLCAiZGlyOiAiICsgZGlyICsgIiB0cmFpbDogIiArIHRyYWlsaW5nICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIG9mZnNldDogIiArIG9mZnNldCArICIgd2lkdGg6ICIgKyB3aWR0aCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSB3aGlsZSAoIXRyYWlsaW5nKTsKKyAgICAgICAgfSB3aGlsZSAoZGlyID4gMCk7CisgICAgfQorICAgICovCisKKyAgICAvLyB1dGlsaXR5IGZvciBkaXNwbGF5aW5nIGFycmF5cyBpbiBoZXgKKyAgICBwcml2YXRlIHN0YXRpYyBTdHJpbmcgaGV4QXJyYXkoaW50W10gYXJyYXkpIHsKKyAgICAgICAgU3RyaW5nQnVpbGRlciBzYiA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CisgICAgICAgIHNiLmFwcGVuZCgneycpOworICAgICAgICBmb3IgKGludCBpIDogYXJyYXkpIHsKKyAgICAgICAgICAgIGlmIChzYi5sZW5ndGgoKSA+IDEpIHsKKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoIiwgIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzYi5hcHBlbmQoSW50ZWdlci50b0hleFN0cmluZyhpKSk7CisgICAgICAgIH0KKyAgICAgICAgc2IuYXBwZW5kKCd9Jyk7CisgICAgICAgIHJldHVybiBzYi50b1N0cmluZygpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBjaGVja0RpcmVjdGlvbnMoTGF5b3V0IGwsIGludCBpLCBTdHJpbmcgdGV4dCwKKyAgICAgICAgICAgIERpcmVjdGlvbnNbXSBleHBlY3RlZERpcnMsIEZvcm1hdHRlciBmKSB7CisgICAgICAgIERpcmVjdGlvbnMgZXhwZWN0ZWQgPSBleHBlY3RlZERpcnNbaV07CisgICAgICAgIERpcmVjdGlvbnMgcmVzdWx0ID0gbC5nZXRMaW5lRGlyZWN0aW9ucygwKTsKKyAgICAgICAgaWYgKCFBcnJheXMuZXF1YWxzKGV4cGVjdGVkLm1EaXJlY3Rpb25zLCByZXN1bHQubURpcmVjdGlvbnMpKSB7CisgICAgICAgICAgICBmLmZvcm1hdCgiJW5bJTJ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oZSBncm91cCBtdXN0IGhhdmUgYXQgbGVhc3Qgb25lIGNoaWxkLCBvciBmYWxzZQotICAgICAqICAgICAgICAgICAgaWYgdXNpbmcgbnVtQ2hpbGRyZW4uCi0gICAgICogQHJldHVybiBBIGdyb3VwIGluZGV4IHdpdGggdGhlIHJlcXVpcmVtZW50cy4KLSAgICAgKi8KLSAgICBwdWJsaWMgaW50IGZpbmRHcm91cFdpdGhOdW1DaGlsZHJlbihpbnQgbnVtQ2hpbGRyZW4sIGJvb2xlYW4gYXRMZWFzdE9uZUNoaWxkKSB7Ci0gICAgICAgIGZpbmFsIEV4cGFuZGFibGVMaXN0QWRhcHRlciBhZGFwdGVyID0gbUFkYXB0ZXI7Ci0gICAgICAgIAotICAgICAgICBmb3IgKGludCBpID0gYWRhcHRlci5nZXRHcm91cENvdW50KCkgLSAxOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgZmluYWwgaW50IGN1ck51bUNoaWxkcmVuID0gYWRhcHRlci5nZXRDaGlsZHJlbkNvdW50KGkpOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBpZiAobnVtQ2hpbGRyZW4gPT0gY3VyTnVtQ2hpbGRyZW4gfHwgYXRMZWFzdE9uZUNoaWxkICYmIGN1ck51bUNoaWxkcmVuID4gMCkgewotICAgICAgICAgICAgICAgIHJldHVybiBpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICByZXR1cm4gLTE7Ci0gICAgfQotICAgIAotICAgIHB1YmxpYyBMaXN0PE15R3JvdXA+IGdldEdyb3VwcygpIHsKLSAgICAgICAgcmV0dXJuIG1Hcm91cHM7Ci0gICAgfQotICAgIAotICAgIHB1YmxpYyBFeHBhbmRhYmxlTGlzdEFkYXB0ZXIgZ2V0QWRhcHRlcigpIHsKLSAgICAgICAgcmV0dXJuIG1BZGFwdGVyOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFNpbXBsZSBleHBhbmRhYmxlIGxpc3QgYWRhcHRlci4K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FBvc2l0aW9uLAotICAgICAgICAgICAgICAgICAgICBjaGlsZFBvc2l0aW9uKSwgY29udmVydFZpZXcsIHBhcmVudCk7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgT2JqZWN0IGdldEdyb3VwKGludCBncm91cFBvc2l0aW9uKSB7Ci0gICAgICAgICAgICByZXR1cm4gZ2V0VmFsdWVBdFBvc2l0aW9uKEV4cGFuZGFibGVMaXN0Vmlldy5nZXRQYWNrZWRQb3NpdGlvbkZvckdyb3VwKGdyb3VwUG9zaXRpb24pKTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBpbnQgZ2V0R3JvdXBDb3VudCgpIHsKLSAgICAgICAgICAgIHJldHVybiBtR3JvdXBzLnNpemUoKTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBsb25nIGdldEdyb3VwSWQoaW50IGdyb3VwUG9zaXRpb24pIHsKLSAgICAgICAgICAgIHJldHVybiBtR3JvdXBzLmdldChncm91cFBvc2l0aW9uKS5pZDsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBWaWV3IGdldEdyb3VwVmlldyhpbnQgZ3JvdXBQb3NpdGlvbiwgYm9vbGVhbiBpc0V4cGFuZGVkLCBWaWV3IGNvbnZlcnRWaWV3LAotICAgICAgICAgICAgICAgIFZpZXdHcm91cCBwYXJlbnQpIHsKLSAgICAgICAgICAgIHJldHVybiBnZXRWaWV3KEV4cGFuZGFibGVMaXN0Vmlldy5nZXRQYWNrZWRQb3NpdGlvbkZvckdyb3VwKGdyb3VwUG9zaXRpb24pLAotICAgICAgICAgICAgICAgICAgICBjb252ZXJ0VmlldywgcGFyZW50KTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBib29sZWFuIGlzQ2hpbGRTZWxlY3RhYmxlKGludCBncm91cFBvc2l0aW9uLCBpbnQgY2hpbGRQb3NpdGlvbikgewotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBoYXNTdGFibGVJZHMoKSB7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotICAgICAgICAKLSAgICB9Ci0KLSAgICBwdWJsaWMgc3RhdGljIGNsYXNzIE15R3JvdXAgewotICAgICAgICBwcml2YXRlIHN0YXRpYyBsb25nIG1OZXh0SWQgPSAxMDAwOwotICAgICAgICAKLSAgICAgICAgU3RyaW5nIG5hbWU7Ci0gICAgICAgIGxvbmcgaWQgPSBtTmV4dElkKys7Ci0gICAgICAgIExpc3Q8TXlDaGlsZD4gY2hpbGRyZW47Ci0gICAgICAgIAotICAgICAgICBwdWJsaWMgTXlHcm91cChpbnQgbnVtQ2hpbGRyZW4pIHsKLSAgICAgICAgICAgIG5hbWUgPSAiR3JvdXAgIiArIGlkOwotICAgICAgICAgICAgY2hpbGRyZW4gPSBuZXcgQXJyYXlMaXN0PE15Q2hpbGQ+KG51bUNoaWxkcmVuKTsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtQ2hpbGRyZW47IGkrKykgewotICAgICAgICAgICAgICAgIGNoaWxkcmVuLmFkZChuZXcgTXlDaGlsZCgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICAKLSAgICBwdWJsaWMgc3RhdGljIGNsYXNzIE15Q2hpbGQgewotICAgICAgICBwcml2YXRlIHN0YXRpYyBsb25nIG1OZXh0SWQgPSAyMDAwOwotICAgICAgICAKLSAgICAgICAgU3RyaW5nIG5hbWU7Ci0gICAgICAgIGxvbmcgaWQgPSBtTmV4dElkKys7Ci0gICAgICAgIAotICAgICAgICBwdWJsaWMgTXlDaGlsZCgpIHsKLSAgICAgICAgICAgIG5hbWUgPSAiQ2hpbGQgIiArIGlkOwotICAgICAgICB9Ci0gICAgfQotICAgIAotICAgIEBPdmVycmlkZQotICAgIHByb3RlY3RlZCBmaW5hbCB2b2lkIGluaXQoUGFyYW1zIHB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gIHB1YmxpYyBPYmplY3QgZ2V0R3JvdXAoaW50IGdyb3VwUG9zaXRpb24pIHsKLSAgICAgICAgICAgIHJldHVybiBncm91cHNbZ3JvdXBQb3NpdGlvbl07Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgaW50IGdldEdyb3VwQ291bnQoKSB7Ci0gICAgICAgICAgICByZXR1cm4gZ3JvdXBzLmxlbmd0aDsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBsb25nIGdldEdyb3VwSWQoaW50IGdyb3VwUG9zaXRpb24pIHsKLSAgICAgICAgICAgIHJldHVybiBncm91cFBvc2l0aW9uOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIFZpZXcgZ2V0R3JvdXBWaWV3KGludCBncm91cFBvc2l0aW9uLCBib29sZWFuIGlzRXhwYW5kZWQsIFZpZXcgY29udmVydFZpZXcsCi0gICAgICAgICAgICAgICAgVmlld0dyb3VwIHBhcmVudCkgewotICAgICAgICAgICAgVGV4dFZpZXcgdGV4dFZpZXcgPSBnZXRHZW5lcmljVmlldygpOwotICAgICAgICAgICAgdGV4dFZpZXcuc2V0VGV4dChnZXRHcm91cChncm91cFBvc2l0aW9uKS50b1N0cmluZygpKTsKLSAgICAgICAgICAgIHJldHVybiB0ZXh0VmlldzsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyBib29sZWFuIGlzQ2hpbGRTZWxlY3RhYmxlKGludCBncm91cFBvc2l0aW9uLCBpbnQgY2hpbGRQb3NpdGlvbikgewotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgYm9vbGVhbiBoYXNTdGFibGVJZHMoKSB7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgfQotICAgIAotfQpkaWZmIC0tZ2l0IGEvY29yZS90ZXN0cy9jb3JldGVzdHMvc3JjL2FuZHJvaWQvd2lkZ2V0L2V4cGFuZGFibG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SB7Ci0gICAgICAgIGVycm9yTWVzc2FnZSA9IG51bGw7Ci0gICAgICAgIGlmICh0ZXN0VHlwZSA9PSBBREFQVEVSX1RZUEUpIHsKLSAgICAgICAgICAgIGlmICghaXNUcnVlKCJNZW51SW5mbyBpcyBub3QgYW4gQWRhcHRlckNvbnRleHRNZW51SW5mbyIsCi0gICAgICAgICAgICAgICAgICAgIG1lbnVJbmZvIGluc3RhbmNlb2YgQWRhcHRlckNvbnRleHRNZW51SW5mbykpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBBZGFwdGVyQ29udGV4dE1lbnVJbmZvIGFkYXB0ZXJDb250ZXh0TWVudUluZm8gPSAoQWRhcHRlckNvbnRleHRNZW51SW5mbykgbWVudUluZm87Ci0gICAgICAgICAgICBpZiAoIWFyZUVxdWFsKCJXcm9uZyBmbGF0IHBvc2l0aW9uIiwgZ3JvdXBQb3NpdGlvbiwgYWRhcHRlckNvbnRleHRNZW51SW5mby5wb3NpdGlvbikpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoIWlzVHJ1ZSgiTWVudUluZm8gaXMgbm90IGFuIEV4cGFuZGFibGVMaXN0Q29udGV4dE1lbnVJbmZvIiwKLSAgICAgICAgICAgICAgICAgICAgbWVudUluZm8gaW5zdGFuY2VvZiBFeHBhbmRhYmxlTGlzdFZpZXcuRXhwYW5kYWJsZUxpc3RDb250ZXh0TWVudUluZm8pKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgRXhwYW5kYWJsZUxpc3RWaWV3LkV4cGFuZGFibGVMaXN0Q29udGV4dE1lbnVJbmZvIGVsdk1lbnVJbmZvID0KLSAgICAgICAgICAgICAgICAoRXhwYW5kYWJsZUxpc3RWaWV3LkV4cGFuZGFibGVMaXN0Q29ud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MuaHRtbCI+Ci0gICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9ImVuIj5Vc2luZyBXZWJWaWV3czwvc3Bhbj4KLSAgICAgICAgICAgICAgICA8L2E+PC9saT4KLSAgICAgICAgPGxpPjxhIGhyZWY9Ijw/Y3MgdmFyOnRvcm9vdCA/PnJlc291cmNlcy9hcnRpY2xlcy93aWtpbm90ZXMtbGlua2lmeS5odG1sIj4KLSAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz0iZW4iPldpa2lOb3RlczogTGlua2lmeSB5b3VyIFRleHQhPC9zcGFuPgotICAgICAgICAgICAgICAgIDwvYT48L2xpPgotICAgICAgICA8bGk+PGEgaHJlZj0iPD9jcyB2YXI6dG9yb290ID8+cmVzb3VyY2VzL2FydGljbGVzL3dpa2lub3Rlcy1pbnRlbnRzLmh0bWwiPgotICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPSJlbiI+V2lraU5vdGVzOiBSb3V0aW5nIEludGVudHM8L3NwYW4+Ci0gICAgICAgICAgICAgICAgPC9hPjwvbGk+Ci0gICAgICAgIDxsaT48YSBocmVmPSI8P2NzIHZhcjp0b3Jvb3QgPz5yZXNvdXJjZXMvYXJ0aWNsZXMvd2luZG93LWJnLXNwZWVkLmh0bWwiPgotICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPSJlbiI+V2luZG93IEJhY2tncm91bmRzICZhbXA7IFVJIFNwZWVkPC9zcGFuPgotICAgICAgICAgICAgICAgIDwvYT48L2xpPgotICAgICAgICA8bGk+PGEgaHJlZj0iPD9jcyB2YXI6dG9yb290ID8+cmVzb3VyY2VzL2FydGljbGVzL3ppcGFsaWduLmh0bWwiPgotICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPSJlbiI+WmlwYWxpZ246IEFuIEVhc3kgT3B0aW1pemF0aW9uPC9zcGFuPgotICAgICAgICAgICAgICAgIDwvYT48L2xpPgotICAgICAgICA8L3VsPgotICAgICAgPC9saT4KLSAgICA8L3VsPg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4LnRpdGxlIDwgeS50aXRsZSkgPyAtMSA6IDE7IH0pOworICB2YXIgdG9waWNQYXJlbnQgPSBudWxsOworICBmb3IgKHZhciBpID0gMDsgaSA8IHRvcGljcy5sZW5ndGg7IGkrKykgeworICAgIGlmICh0b3BpY1BhcmVudCA9PSBudWxsIHx8IGkgJSAxMCA9PSAwKSB7CisgICAgICAvLyBjcmVhdGUgYSBuZXcgY29sdW1uCisgICAgICB0b3BpY1BhcmVudCA9ICQoJ3VsJywgJCgnPHRkPjx1bD4nKS5hcHBlbmRUbygnI3Jlc291cmNlLXRvcGljLXRhYmxlIHRyJykpOworICAgIH0KKworICAgIHRvcGljUGFyZW50LmFwcGVuZCgKKyAgICAgICAgJCgnPGxpPicpLmFwcGVuZCgKKyAgICAgICAgICAkKCc8aDM+JykuYXBwZW5kKAorICAgICAgICAgICAgJCgnPGE+JykKKyAgICAgICAgICAgICAgLmF0dHIoJ2hyZWYnLCB0b1Jvb3QgKyAicmVzb3VyY2VzL2Jyb3dzZXIuaHRtbD90YWc9IiArIHRvcGljc1tpXS5uYW1lKQorICAgICAgICAgICAgICAuYXBwZW5kKCQoJzxzcGFuPicpCisgICAgICAgICAgICAgICAgLmFkZENsYXNzKCdlbicpCisgICAgICAgICAgICAgICAgLmh0bWwodG9waWNzW2ldLnRpdGxlKQorICAgICAgICAgICAgICApCisgICAgICAgICAgICApCisgICAgICAgICAgKQorICAgICAgICApOworICB9Cit9KSgpOworLy8tLT4KKzwvc2NyaXB0PgpcIE5vIG5ld2xpbmUgYXQgZW5kIG9mIGZpbGUKZGlmZiAtLWdpdCBhL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9ncmFwaGljcy9CaXRtYXAuamF2YSBiL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9ncmFwaGljcy9CaXRtYXAuamF2YQppbmRleCA3Y2EzNzQxLi41MzdkZDNhIDEwMDY0NAotLS0gYS9ncmFwaGljcy9qYXZhL2FuZHJvaWQvZ3JhcGhpY3MvQml0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ICAgVGhlIHdpZHRoIG9mIHRoZSB2aWV3cG9ydAotICAgICAqICBAcGFyYW0gaGVpZ2h0ICAgVGhlIGhlaWdodCBvZiB0aGUgdmlld3BvcnQKKyAgICAgKiAgQHBhcmFtIHdpZHRoIFRoZSB3aWR0aCBvZiB0aGUgdmlld3BvcnQKKyAgICAgKiAgQHBhcmFtIGhlaWdodCBUaGUgaGVpZ2h0IG9mIHRoZSB2aWV3cG9ydAorICAgICAqIAorICAgICAqIEBkZXByZWNhdGVkIFRoaXMgbWV0aG9kIGlzIG5vdCBzdXBwb3J0ZWQgYW5kIHNob3VsZCBub3QgYmUgaW52b2tlZC4KICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBzZXRWaWV3cG9ydChpbnQgd2lkdGgsIGludCBoZWlnaHQpIHsKICAgICAgICAgaWYgKG1HTCAhPSBudWxsKSB7CkBAIC02MjEsNyArNjU5LDExIEBACiAgICAgICAgIEVkZ2VUeXBlKGludCBuYXRpdmVJbnQpIHsKICAgICAgICAgICAgIHRoaXMubmF0aXZlSW50ID0gbmF0aXZlSW50OwogICAgICAgICB9Ci0gICAgICAgIGZpbmFsIGludCBuYXRpdmVJbnQ7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEBoaWRlCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgZmluYWwgaW50IG5hdGl2ZUludDsKICAgICB9CiAKICAgICAvKioKQEAgLTEyNDYsOCArMTI4OCw4IEBACiAgICAgICAgICAgICAodGV4dC5sZW5ndGggLSBpbmRleCAtIGNvdW50KSkgPCAwKSB7CiAgICAgICAgICAgICB0aHJvdyBuZXcgSW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbigpOwogICAgICAgICB9Ci0gICAgICAgIG5hdGl2ZV9kcmF3VGV4dChtTmF0aXZlQ2FudmFzLCB0ZXh0LCBpbmRleCwgY291bnQsIHgsIHksCi0gICAgICAgICAgICAgICAgICAgICAgICBwYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgIC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wdGlvbigpOwogICAgICAgICB9Ci0gICAgICAgIG5hdGl2ZV9kcmF3VGV4dChtTmF0aXZlQ2FudmFzLCB0ZXh0LCBzdGFydCwgZW5kLCB4LCB5LAotICAgICAgICAgICAgICAgICAgICAgICAgcGFpbnQubU5hdGl2ZVBhaW50KTsKKyAgICAgICAgbmF0aXZlX2RyYXdUZXh0KG1OYXRpdmVDYW52YXMsIHRleHQsIHN0YXJ0LCBlbmQsIHgsIHksIHBhaW50Lm1CaWRpRmxhZ3MsCisgICAgICAgICAgICAgICAgcGFpbnQubU5hdGl2ZVBhaW50KTsKICAgICB9CiAKICAgICAvKioKQEAgLTEyOTksMTYgKzEzNDQsMTA4IEBACiAgICAgICAgIGlmICh0ZXh0IGluc3RhbmNlb2YgU3RyaW5nIHx8IHRleHQgaW5zdGFuY2VvZiBTcGFubmVkU3RyaW5nIHx8CiAgICAgICAgICAgICB0ZXh0IGluc3RhbmNlb2YgU3Bhbm5hYmxlU3RyaW5nKSB7CiAgICAgICAgICAgICBuYXRpdmVfZHJhd1RleHQobU5hdGl2ZUNhbnZhcywgdGV4dC50b1N0cmluZygpLCBzdGFydCwgZW5kLCB4LCB5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50Lm1OYXRpdmVQYWludCk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAodGV4dCBpbnN0YW5jZW9mIEdyYXBoaWNzT3BlcmF0aW9ucykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50Lm1CaWRpRmxhZ3MsIHBhaW50Lm1OYXRpdmVQYWludCk7CisgICAgICAgIH0gZWxzZSBpZiAodGV4dCBpbnN0YW5jZW9mIEdyYXBoaWNzT3BlcmF0aW9ucykgewogICAgICAgICAgICAgKChHcmFwaGljc09wZXJhdGlvbnMpIHRleHQpLmRyYXdUZXh0KHRoaXMsIHN0YXJ0LCBlbmQsIHgsIHksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50KTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIHsKKyAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgIGNoYXJbXSBidWYgPSBUZW1wb3JhcnlCdWZmZXIub2J0YWluKGVuZCAtIHN0YXJ0KTsKICAgICAgICAgICAgIFRleHRVdGlscy5nZXRDaGFycyh0ZXh0LCBzdGFydCwgZW5kLCBidWYsIDApOwotICAgICAgICAgICAgZHJhd1RleHQoYnVmLCAwLCBlbmQgLSBzdGFydCwgeCwgeSwgcGFpbnQpOworICAgICAgICAgICAgbmF0aXZlX2RyYXdUZXh0KG1OYXRpdmVDYW52YXMsIGJ1ZiwgMCwgZW5kIC0gc3RhcnQsIHgsIHksIAorICAgICAgICAgICAgICAgICAgICBwYWludC5tQmlkaUZsYWdzLCBwYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICAgICAgVGVtcG9yYXJ5QnVmZmVyLnJlY3ljbGUoYnVmKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qKgorICAgICAqIFJlbmRlciBhIHJ1biBvZiBhbGwgTFRSIG9yIGFsbCBSVEwgdGV4dCwgd2l0aCBzaGFwaW5nLiBUaGlzIGRvZXMgbm90IHJ1bgorICAgICAqIGJpZGkgb24gdGhlIHByb3ZpZGVkIHRleHQsIGJ1dCByZW5kZXJzIGl0IGFzIGEgdW5pZm9ybSByaWdodC10by1sZWZ0IG9yCisgICAgICogbGVmdC10by1yaWdodCBydW4sIGFzIGluZGljYXRlZCBieSBkaXIuIEFsaWdubWVudCBvZiB0aGUgdGV4dCBpcyBhcworICAgICAqIGRldGVybWluZWQgYnkgdGhlIFBhaW50J3MgVGV4dEFsaWduIHZhbHVlLgorICAgICAqIAorICAgICAqIEBwYXJhbSB0ZXh0IHRoZSB0ZXh0IHRvIHJlbmRlcgorICAgICAqIEBwYXJhbSBpbmRleCB0aGUgc3RhcnQgb2YgdGhlIHRleHQgdG8gcmVuZGVyCisgICAgICogQHBhcmFtIGNvdW50IHRoZSBjb3VudCBvZiBjaGFycyB0byByZW5kZXIKKyAgICAgKiBAcGFyYW0gY29udGV4dEluZGV4IHRoZSBzdGFydCBvZiB0aGUgY29udGV4dCBmb3Igc2hhcGluZy4gIE11c3QgYmUKKyAgICAgKiAgICAgICAgIG5vIGdyZWF0ZXIgdGhhbiBpbmRleC4KKyAgICAgKiBAcGFyYW0gY29udGV4dENvdW50IHRoZSBudW1iZXIgb2YgY2hhcmFjdGVycyBpbiB0aGUgY29udGV4dCBmb3Igc2hhcGluZy4KKyAgICAgKiAgICAgICAgIENvbnRleEluZGV4ICsgY29udGV4dENvdW50IG11c3QgYmUgbm8gbGVzcyB0aGFuIGluZGV4CisgICAgICogICAgICAgICArIGNvdW50LgorICAgICAqIEBwYXJhbSB4IHRoZSB4IHBvc2l0aW9uIGF0IHdoaWNoIHRvIGRyYXcgdGhlIHRleHQKKyAgICAgKiBAcGFyYW0geSB0aGUgeSBwb3NpdGlvbiBhdCB3aGljaCB0byBkcmF3IHRoZSB0ZXh0CisgICAgICogQHBhcmFtIGRpciB0aGUgcnVuIGRpcmVjdGlvbiwgZWl0aGVyIHtAbGluayAjRElSRUNUSU9OX0xUUn0gb3IKKyAgICAgKiAgICAgICAgIHtAbGluayAjRElSRUNUSU9OX1JUTH0uCisgICAgICogQHBhcmFtIHBhaW50IHRoZSBwYWludAorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHZvaWQgZHJhd1RleHRSdW4oY2hhcltdIHRleHQsIGludCBpbmRleCwgaW50IGNvdW50LAorICAgICAgICAgICAgaW50IGNvbnRleHRJbmRleCwgaW50IGNvbnRleHRDb3VudCwgZmxvYXQgeCwgZmxvYXQgeSwgaW50IGRpciwKKyAgICAgICAgICAgIFBhaW50IHBhaW50KSB7CisKKyAgICAgICAgaWYgKHRleHQgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJ0ZXh0IGlzIG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WYgKHBhaW50ID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigicGFpbnQgaXMgbnVsbCIpOworICAgICAgICB9CisgICAgICAgIGlmICgoc3RhcnQgfCBlbmQgfCBlbmQgLSBzdGFydCB8IHRleHQubGVuZ3RoKCkgLSBlbmQpIDwgMCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IEluZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24oKTsKKyAgICAgICAgfQorCisgICAgICAgIGludCBmbGFncyA9IGRpciA9PSAwID8gMCA6IDE7CisKKyAgICAgICAgaWYgKHRleHQgaW5zdGFuY2VvZiBTdHJpbmcgfHwgdGV4dCBpbnN0YW5jZW9mIFNwYW5uZWRTdHJpbmcgfHwKKyAgICAgICAgICAgICAgICB0ZXh0IGluc3RhbmNlb2YgU3Bhbm5hYmxlU3RyaW5nKSB7CisgICAgICAgICAgICBuYXRpdmVfZHJhd1RleHRSdW4obU5hdGl2ZUNhbnZhcywgdGV4dC50b1N0cmluZygpLCBzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIHgsIHksIGZsYWdzLCBwYWludC5tTmF0aXZlUGFpbnQpOworICAgICAgICB9IGVsc2UgaWYgKHRleHQgaW5zdGFuY2VvZiBHcmFwaGljc09wZXJhdGlvbnMpIHsKKyAgICAgICAgICAgICgoR3JhcGhpY3NPcGVyYXRpb25zKSB0ZXh0KS5kcmF3VGV4dFJ1bih0aGlzLCBzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIHgsIHksIGZsYWdzLCBwYWludCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpbnQgY29udGV4dExlbiA9IGNvbnRleHRFbmQgLSBjb250ZXh0U3RhcnQ7CisgICAgICAgICAgICBpbnQgbGVuID0gZW5kIC0gc3RhcnQ7CisgICAgICAgICAgICBjaGFyW10gYnVmID0gVGVtcG9yYXJ5QnVmZmVyLm9idGFpbihjb250ZXh0TGVuKTsKKyAgICAgICAgICAgIFRleHRVdGlscy5nZXRDaGFycyh0ZXh0LCBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIGJ1ZiwgMCk7CisgICAgICAgICAgICBuYXRpdmVfZHJhd1RleHRSdW4obU5hdGl2ZUNhbnZhcywgYnVmLCBzdGFydCAtIGNvbnRleHRTdGFydCwgbGVuLAorICAgICAgICAgICAgICAgICAgICAwLCBjb250ZXh0TGVuLCB4LCB5LCBmbGFncywgcGFpbnQubU5hdGl2ZVBhaW50KTsKICAgICAgICAgICAgIFRlbXBvcmFyeUJ1ZmZlci5yZWN5Y2xlKGJ1Zik7CiAgICAgICAgIH0KICAgICB9CkBAIC0xNTU1LDEwICsxNjkyLDE5IEBACiAgICAgCiAgICAgcHJpdmF0ZSBzdGF0aWMgbmF0aXZlIHZvaWQgbmF0aXZlX2RyYXdUZXh0KGludCBuYXRpdmVDYW52YXMsIGNoYXJbXSB0ZXh0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXgsIGludCBjb3VudCwgZmxvYXQgeCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeSwgaW50IHBhaW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeSwgaW50IGZsYWdzLCBpbnQgcGFpbnQpOwogICAgIHByaXZhdGUgc3RhdGljIG5hdGl2ZSB2b2lkIG5hdGl2ZV9kcmF3VGV4dChpbnQgbmF0aXZlQ2FudmFzLCBTdHJpbmcgdGV4dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LCBpbnQgZW5kLCBmbG9hdCB4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB5LCBpbnQgcGFpbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB5LCBpbnQgZmxhZ3MsIGludCBwYWludCk7CisKKyAgICBwcml2YXRlIHN0YXRpYyBuYXRpdmUgdm9pZCBuYXRpdmVfZHJhd1RleHRSdW4oaW50IG5hdGl2ZUNhbnZhcywgU3RyaW5nIHRleHQsCisgICAgICAgICAgICBpbnQgc3RhcnQsIGludCBlbmQsIGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0RW5kLAorICAgICAgICAgICAgZmxvYXQgeCwgZmxvYXQgeSwgaW50IGZsYWdzLCBpbnQgcGFpbnQpOworCisgICAgcHJpdmF0ZSBzdGF0aWMgbmF0aXZlIHZvaWQgbmF0aXZlX2RyYXdUZXh0UnVuKGludCBuYXRpdmVDYW52YXMsIGNoYXJbXSB0ZXh0LAorICAgICAgICAgICAgaW50IHN0YXJ0LCBpbnQgY291bnQsIGludCBjb250ZXh0U3RhcnQsIGludCBjb250ZXh0Q291bnQsCisgICAgICAgICAgICBmbG9hdCB4LCBmbG9hdCB5LCBpbnQgZmxhZ3MsIGludCBwYWludCk7CisKICAgICBwcml2YXRlIHN0YXRpYyBuYXRpdmUgdm9pZCBuYXRpdmVfZHJhd1Bvc1RleHQoaW50IG5hdGl2ZUNhbnZhcywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhcltdIHRleHQsIGludCBpbmRleCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50LCBmbG9hdFtdIHBvcywKZGlmZiAtLWdpdCBhL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9ncmFwaGljcy9NYXRyaXguamF2YSBiL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9ncmFwaGljcy9NYXRyaXguamF2YQppbmRleCBm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ogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBERUZBVUxUX1BBSU5UX0ZMQUdTID0gREVWX0tFUk5fVEVYVF9GTEFHOwogCiAgICAgLyoqCi0gICAgICogVGhlIFN0eWxlIHNwZWNpZmllcyBpZiB0aGUgcHJpbWl0aXZlIGJlaW5nIGRyYXduIGlzIGZpbGxlZCwKLSAgICAgKiBzdHJva2VkLCBvciBib3RoIChpbiB0aGUgc2FtZSBjb2xvcikuIFRoZSBkZWZhdWx0IGlzIEZJTEwuCisgICAgICogQmlkaSBmbGFnIHRvIHNldCBMVFIgcGFyYWdyYXBoIGRpcmVjdGlvbi4KKyAgICAgKiAKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEJJRElfTFRSID0gMHgwOworCisgICAgLyoqCisgICAgICogQmlkaSBmbGFnIHRvIHNldCBSVEwgcGFyYWdyYXBoIGRpcmVjdGlvbi4KKyAgICAgKiAKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEJJRElfUlRMID0gMHgxOworCisgICAgLyoqCisgICAgICogQmlkaSBmbGFnIHRvIGRldGVjdCBwYXJhZ3JhcGggZGlyZWN0aW9uIHZpYSBoZXVyaXN0aWNzLCBkZWZhdWx0aW5nIHRvCisgICAgICogTFRSLgorICAgICAqIAorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgQklESV9ERUZBVUxUX0xUUiA9IDB4MjsKKworICAgIC8qKgorICAgICAqIEJpZGkgZmxhZyB0byBkZXRlY3QgcGFyYWdyYXBoIGRpcmVjdGlvbiB2aWEgaGV1cmlzdGljcywgZGVmYXVsdGluZyB0bworICAgICAqIFJUTC4KKyAgICAgKiAKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEJJRElfREVGQVVMVF9SVEwgPSAwe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50LiBUaGlzIG1vZGUgY2FuIGdpdmUgdW5leHBlY3RlZCByZXN1bHRzIGlmIHRoZSBnZW9tZXRyeQorICAgICAgICAgKiBpcyBvcmllbnRlZCBjb3VudGVyLWNsb2Nrd2lzZS4gVGhpcyByZXN0cmljdGlvbiBkb2VzIG5vdCBhcHBseSB0bworICAgICAgICAgKiBlaXRoZXIgRklMTCBvciBTVFJPS0UuCiAgICAgICAgICAqLwogICAgICAgICBGSUxMX0FORF9TVFJPS0UgKDIpOwogICAgICAgICAKQEAgLTIwOCw2ICszMjMsNyBAQAogICAgICAgICBtSGFzQ29tcGF0U2NhbGluZyA9IHBhaW50Lm1IYXNDb21wYXRTY2FsaW5nOwogICAgICAgICBtQ29tcGF0U2NhbGluZyA9IHBhaW50Lm1Db21wYXRTY2FsaW5nOwogICAgICAgICBtSW52Q29tcGF0U2NhbGluZyA9IHBhaW50Lm1JbnZDb21wYXRTY2FsaW5nOworICAgICAgICBtQmlkaUZsYWdzID0gcGFpbnQubUJpZGlGbGFnczsKICAgICB9CiAKICAgICAvKiogUmVzdG9yZXMgdGhlIHBhaW50IHRvIGl0cyBkZWZhdWx0IHNldHRpbmdzLiAqLwpAQCAtMjE2LDYgKzMzMiw3IEBACiAgICAgICAgIHNldEZsYWdzKERFRkFVTFRfUEFJTlRfRkxBR1MpOwogICAgICAgICBtSGFzQ29tcGF0U2NhbGluZyA9IGZhbHNlOwogICAgICAgICBtQ29tcGF0U2NhbGluZyA9IG1JbnZDb21wYXRTY2FsaW5nID0gMTsKKyAgICAgICAgbUJpZGlGbGFncyA9IEJJRElfREVGQVVMVF9MVFI7CiAgICAgfQogICAgIAogICAgIC8qKgpAQCAtMjM4LDYgKzM1NSw3IEBACiAgICAgICAgICAgICBtSGFzQ29tcGF0U2NhbGluZyA9IHNyYy5tSGFzQ29tcGF0U2NhbGluZzsKICAgICAgICAgICAgIG1Db21wYXRTY2FsaW5nICAgID0gc3JjLm1Db21wYXRTY2FsaW5nOwogICAgICAgICAgICAgbUludkNvbXBhdFNjYWxpbmcgPSBzcmMubUludkNvbXBhdFNjYWxpbmc7CisgICAgICAgICAgICBtQmlkaUZsYWdzICAgICAgPSBzcmMubUJpZGlGbGFnczsKICAgICAgICAgfQogICAgIH0KIApAQCAtMjUyLDEwICszNzAsMzMgQEAKICAgICAgICAgICAgIG1JbnZDb21wYXRTY2FsaW5nID0gMS4wZi9mYWN0b3I7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKKyAgICAvKioKKyAgICAgKiBSZXR1cm4gdGhlIGJpZGkgZmxhZ3Mgb24gdGhlIHBhaW50LgorICAgICAqIAorICAgICAqIEByZXR1cm4gdGhlIGJpZGkgZmxhZ3Mgb24gdGhlIHBhaW50CisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGdldEJpZGlGbGFncygpIHsKKyAgICAgICAgcmV0dXJuIG1CaWRpRmxhZ3M7CisgICAgfQorCisgICAgLyoqCisgICAgICogU2V0IHRoZSBiaWRpIGZsYWdzIG9uIHRoZSBwYWludC4KKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEJpZGlGbGFncyhpbnQgZmxhZ3MpIHsKKyAgICAgICAgLy8gb25seSBmbGFnIHZhbHVlIGlzIHRoZSAzLWJpdCBCSURJIGNvbnRyb2wgc2V0dGluZworICAgICAgICBmbGFncyAmPSBCSURJX0ZMQUdfTUFTSzsKKyAgICAgICAgaWYgKGZsYWdzID4gQklESV9NQVhfRkxBR19WQUxVRSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigidW5rbm93biBiaWRpIGZsYWc6ICIgKyBmbGFncyk7CisgICAgICAgIH0KKyAgICAgICAgbUJpZGlGbGFncyA9IGZsYWdzOworICAgIH0KKwogICAgIC8qKgogICAgICAqIFJldHVybiB0aGUgcGFpbnQncyBmbGFncy4gVXNlIHRoZSBGbGFnIGVudW0gdG8gdGVzdCBm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xpYyBmbG9hdCBnZXRUZXh0UnVuQWR2YW5jZXMoY2hhcltdIGNoYXJzLCBpbnQgaW5kZXgsIGludCBjb3VudCwKKyAgICAgICAgICAgIGludCBjb250ZXh0SW5kZXgsIGludCBjb250ZXh0Q291bnQsIGludCBmbGFncywgZmxvYXRbXSBhZHZhbmNlcywKKyAgICAgICAgICAgIGludCBhZHZhbmNlc0luZGV4KSB7CisKKyAgICAgICAgaWYgKChpbmRleCB8IGNvdW50IHwgY29udGV4dEluZGV4IHwgY29udGV4dENvdW50IHwgYWR2YW5jZXNJbmRleAorICAgICAgICAgICAgICAgIHwgKGluZGV4IC0gY29udGV4dEluZGV4KQorICAgICAgICAgICAgICAgIHwgKChjb250ZXh0SW5kZXggKyBjb250ZXh0Q291bnQpIC0gKGluZGV4ICsgY291bnQpKQorICAgICAgICAgICAgICAgIHwgKGNoYXJzLmxlbmd0aCAtIChjb250ZXh0SW5kZXggKyBjb250ZXh0Q291bnQpKQorICAgICAgICAgICAgICAgIHwgKGFkdmFuY2VzID09IG51bGwgPyAwIDoKKyAgICAgICAgICAgICAgICAgICAgKGFkdmFuY2VzLmxlbmd0aCAtIChhZHZhbmNlc0luZGV4ICsgY291bnQpKSkpIDwgMCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IEluZGV4T3V0T2ZCb3VuZHNFeGNlcHRpb24oKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZmxhZ3MgIT0gRElSRUNUSU9OX0xUUiAmJiBmbGFncyAhPSBESVJFQ1RJT05fUlRMKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJ1bmtub3duIGZsYWdzIHZhbHVlOiAiICsgZmxhZ3MpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCFtSGFzQ29tcGF0U2NhbGluZykgeworICAgICAgICAgICAgcmV0dXJuIG5hdGl2ZV9nZXRUZXh0UnVuQWR2YW5jZXMobU5hdGl2ZVBhaW50LCBjaGFycywgaW5kZXgsIGNvdW50LAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0SW5kZXgsIGNvbnRleHRDb3VudCwgZmxhZ3MsIGFkdmFuY2VzLCBhZHZhbmNlc0luZGV4KTsKKyAgICAgICAgfQorCisgICAgICAgIGZpbmFsIGZsb2F0IG9sZFNpemUgPSBnZXRUZXh0U2l6ZSgpOworICAgICAgICBzZXRUZXh0U2l6ZShvbGRTaXplICogbUNvbXBhdFNjYWxpbmcpOworICAgICAgICBmbG9hdCByZXMgPSBuYXRpdmVfZ2V0VGV4dFJ1bkFkdmFuY2VzKG1OYXRpdmVQYWludCwgY2hhcnMsIGluZGV4LCBjb3VudCwKKyAgICAgICAgICAgICAgICBjb250ZXh0SW5kZXgsIGNvbnRleHRDb3VudCwgZmxhZ3MsIGFkdmFuY2VzLCBhZHZhbmNlc0luZGV4KTsKKyAgICAgICAgc2V0VGV4dFNpemUob2xkU2l6ZSk7CisKKyAgICAgICAgaWYgKGFkdmFuY2VzICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSBhZHZhbmNlc0luZGV4LCBlID0gaSArIGNvdW50OyBpIDwgZTsgaSsrKSB7CisgICAgICAgICAgICAgICAgYWR2YW5jZXNbaV0gKj0gbUludkNvbXBhdFNjYWxpbmc7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJlcyAqIG1JbnZDb21wYXRTY2FsaW5nOyAvLyBhc3N1bWUgZXJyb3JzIGFyZSBub3Qgc2lnbmlmaWNhbnQKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb252ZW5pZW5jZSBvdmVybG9hZCB0aGF0IHRha2VzIGEgQ2hhclNlcXVlbmNlIGluc3RlYWQgb2YgYQorICAgICAqIFN0cmluZy4KKyAgICAgKgorICAgICAqIEBzZWUgI2dldFRleHRSdW5BZHZhbmNlcyhTdHJpbmcsIGludCwgaW50LCBpbnQsIGludCwgaW50LCBmbG9hdFtdLCBpbnQpCisgICAgICogQGhpZGUKKyAgICAgKi8KKyAgICBwdWJsaWMgZmxvYXQgZ2V0VGV4dFJ1bkFkdmFuY2VzKENoYXJTZXF1ZW5jZSB0ZXh0LCBpbnQgc3RhcnQsIGludCBlbmQsCisgICAgICAgICAgICBpbnQgY29udGV4dFN0YXJ0LCBpbnQgY29udGV4dEVuZCwgaW50IGZsYWdzLCBmbG9hdFtdIGFkdmFuY2VzLAorICAgICAgICAgICAgaW50IGFkdmFuY2VzSW5kZXgpIHsKKworICAgICAgICBpZiAodGV4dCBpbnN0YW5jZW9mIFN0cmluZykgeworICAgICAgICAgICAgcmV0dXJuIGdldFRleHRSdW5BZHZhbmNlcygoU3RyaW5nKSB0ZXh0LCBzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIGZsYWdzLCBhZHZhbmNlcywgYWR2YW5jZXNJbmRleCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHRleHQgaW5zdGFuY2VvZiBTcGFubmVkU3RyaW5nIHx8CisgICAgICAgICAgICB0ZXh0IGluc3RhbmNlb2YgU3Bhbm5hYmxlU3RyaW5nKSB7CisgICAgICAgICAgICByZXR1cm4gZ2V0VGV4dFJ1bkFkdmFuY2VzKHRleHQudG9TdHJpbmcoKSwgc3RhcnQsIGVuZCwKKyAgICAgICAgICAgICAgICAgICAgY29udGV4dFN0YXJ0LCBjb250ZXh0RW5kLCBmbGFncywgYWR2YW5jZXMsIGFkdmFuY2VzSW5kZXgpOworICAgICAgICB9CisgICAgICAgIGlmICh0ZXh0IGluc3RhbmNlb2YgR3JhcGhpY3NPcGVyYXRpb25zKSB7CisgICAgICAgICAgICByZXR1cm4gKChHcmFwaGljc09wZXJhdGlvbnMpIHRleHQpLmdldFRleHRSdW5BZHZhbmNlcyhzdGFydCwgZW5kLAorICAgICAgICAgICAgICAgICAgICBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsIGZsYWdzLCBhZH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lciBhdCBzdGFydAorICAgICAqIEByZXR1cm4gdGhlIHRvdGFsIGFkdmFuY2UKKyAgICAgKgorICAgICAqIEBoaWRlCisgICAgICovCisgICAgcHVibGljIGZsb2F0IGdldFRleHRSdW5BZHZhbmNlcyhTdHJpbmcgdGV4dCwgaW50IHN0YXJ0LCBpbnQgZW5kLCBpbnQgY29udGV4dFN0YXJ0LAorICAgICAgICAgICAgaW50IGNvbnRleHRFbmQsIGludCBmbGFncywgZmxvYXRbXSBhZHZhbmNlcywgaW50IGFkdmFuY2VzSW5kZXgpIHsKKworICAgICAgICBpZiAoKHN0YXJ0IHwgZW5kIHwgY29udGV4dFN0YXJ0IHwgY29udGV4dEVuZCB8IGFkdmFuY2VzSW5kZXggfCAoZW5kIC0gc3RhcnQpCisgICAgICAgICAgICAgICAgfCAoc3RhcnQgLSBjb250ZXh0U3RhcnQpIHwgKGNvbnRleHRFbmQgLSBlbmQpCisgICAgICAgICAgICAgICAgfCAodGV4dC5sZW5ndGgoKSAtIGNvbnRleHRFbmQpCisgICAgICAgICAgICAgICAgfCAoYWR2YW5jZXMgPT0gbnVsbCA/IDAgOgorICAgICAgICAgICAgICAgICAgICAoYWR2YW5jZXMubGVuZ3RoIC0gYWR2YW5jZXNJbmRleCAtIChlbmQgLSBzdGFydCkpKSkgPCAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSW5kZXhPdXRPZkJvdW5kc0V4Y2VwdGlvbigpOworICAgICAgICB9CisgICAgICAgIGlmIChmbGFncyAhPSBESVJFQ1RJT05fTFRSICYmIGZsYWdzICE9IERJUkVDVElPTl9SVEwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInVua25vd24gZmxhZ3MgdmFsdWU6ICIgKyBmbGFncyk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIW1IYXNDb21wYXRTY2FsaW5nKSB7CisgICAgICAgICAgICByZXR1cm4gbmF0aXZlX2dldFRleHRSd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8CisgICAgICAgICAgICAgICAgdGV4dCBpbnN0YW5jZW9mIFNwYW5uYWJsZVN0cmluZykgeworICAgICAgICAgICAgcmV0dXJuIGdldFRleHRSdW5DdXJzb3IodGV4dC50b1N0cmluZygpLCBjb250ZXh0U3RhcnQsIGNvbnRleHRFbmQsCisgICAgICAgICAgICAgICAgICAgIGZsYWdzLCBvZmZzZXQsIGN1cnNvck9wdCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHRleHQgaW5zdGFuY2VvZiBHcmFwaGljc09wZXJhdGlvbnMpIHsKKyAgICAgICAgICAgIHJldHVybiAoKEdyYXBoaWNzT3BlcmF0aW9ucykgdGV4dCkuZ2V0VGV4dFJ1bkN1cnNvcigKKyAgICAgICAgICAgICAgICAgICAgY29udGV4dFN0YXJ0LCBjb250ZXh0RW5kLCBmbGFncywgb2Zmc2V0LCBjdXJzb3JPcHQsIHRoaXMpOworICAgICAgICB9CisKKyAgICAgICAgaW50IGNvbnRleHRMZW4gPSBjb250ZXh0RW5kIC0gY29udGV4dFN0YXJ0OworICAgICAgICBjaGFyW10gYnVmID0gVGVtcG9yYXJ5QnVmZmVyLm9idGFpbihjb250ZXh0TGVuKTsKKyAgICAgICAgVGV4dFV0aWxzLmdldENoYXJzKHRleHQsIGNvbnRleHRTdGFydCwgY29udGV4dEVuZCwgYnVmLCAwKTsKKyAgICAgICAgaW50IHJlc3VsdCA9IGdldFRleHRSdW5DdXJzb3IoYnVmLCAwLCBjb250ZXh0TGVuLCBmbGFncywgb2Zmc2V0LCBjdXJzb3JPcHQpOworICAgICAgICBUZW1wb3JhcnlCdWZmZXIucmVjeWNsZShidWYpOworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFJldHVybnMgdGhlIG5leHQgY3Vyc29yIHBvc2l0aW9uIGluIHRoZSBydW4uICBUaGlzIGF2b2lkcyBwbGFjaW5nIHRoZQorICAgICAqIGN1cnNvciBiZXR3ZWVuIHN1cnJvZ2F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saXplcihpbnQgbmF0aXZlUGFpbnQpOwogfQotCmRpZmYgLS1naXQgYS9ncmFwaGljcy9qYXZhL2FuZHJvaWQvZ3JhcGhpY3MvUG9ydGVyRHVmZi5qYXZhIGIvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL2dyYXBoaWNzL1BvcnRlckR1ZmYuamF2YQppbmRleCAzOTA0MjM0Li4yZWYxNjYyIDEwMDY0NAotLS0gYS9ncmFwaGljcy9qYXZhL2FuZHJvaWQvZ3JhcGhpY3MvUG9ydGVyRHVmZi5qYXZhCisrKyBiL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9ncmFwaGljcy9Qb3J0ZXJEdWZmLmphdmEKQEAgLTUzLDExICs1MywxOCBAQAogICAgICAgICAvKiogW1NhICogRGEsIFNjICogRGNdICovCiAgICAgICAgIE1VTFRJUExZICAgICgxNCksCiAgICAgICAgIC8qKiBbU2EgKyBEYSAtIFNhICogRGEsIFNjICsgRGMgLSBTYyAqIERjXSAqLwotICAgICAgICBTQ1JFRU4gICAgICAoMTUpOworICAgICAgICBTQ1JFRU4gICAgICAoMTUpLAorICAgICAgICAvKiogU2F0dXJhdGUoUyArIEQpICovCisgICAgICAgIEFERCAgICAgICAgICgxNiksCisgICAgICAgIE9WRVJMQVkgICAgICgxNyk7CiAKICAgICAgICAgTW9kZShpbnQgbmF0aXZlSW50KSB7CiAgICAgICAgICAgICB0aGlzLm5hdGl2ZUludCA9IG5hdGl2ZUludDsKICAgICAgICAgfQotICAgICAgICBmaW5hbCBpbnQgbmF0aXZlSW50OworCisgICAgICAgIC8qKgorICAgICAgICAgKiBAaGlkZQorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIGZpbmFsIGludCBuYXRpdmVJbnQ7CiAgICAgfQogfQpkaWZmIC0tZ2l0IGEvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL2dyYXBoaWNzL2RyYXdhYmxlL0RyYXdhYmxlLmphdmEgYi9ncmFwaGljcy9qYXZhL2FuZHJvaWQv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gewogICAgICAgICAgICAgZHJhd2FibGUgPSBuZXcgTGV2ZWxMaXN0RHJhd2FibGUoKTsKKyAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFscygibWlwbWFwIikpIHsKKyAgICAgICAgICAgIGRyYXdhYmxlID0gbmV3IE1pcG1hcERyYXdhYmxlKCk7CiAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoImxheWVyLWxpc3QiKSkgewogICAgICAgICAgICAgZHJhd2FibGUgPSBuZXcgTGF5ZXJEcmF3YWJsZSgpOwogICAgICAgICB9IGVsc2UgaWYgKG5hbWUuZXF1YWxzKCJ0cmFuc2l0aW9uIikpIHsKQEAgLTc3MSw3ICs3ODQsNyBAQAogICAgICAgICB9IGVsc2UgaWYgKG5hbWUuZXF1YWxzKCJpbnNldCIpKSB7CiAgICAgICAgICAgICBkcmF3YWJsZSA9IG5ldyBJbnNldERyYXdhYmxlKCk7CiAgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoImJpdG1hcCIpKSB7Ci0gICAgICAgICAgICBkcmF3YWJsZSA9IG5ldyBCaXRtYXBEcmF3YWJsZSgpOworICAgICAgICAgICAgZHJhd2FibGUgPSBuZXcgQml0bWFwRHJhd2FibGUocik7CiAgICAgICAgICAgICBpZiAociAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAoKEJpdG1hcERyYXdhYmxlKSBkcmF3YWJsZSkuc2V0VGFyZ2V0RGVuc2l0eShyLmdldERpc3BsYXlNZXRyaWNzKCkpOwogICAgICAgICAgICAgfQpAQCAtODA2LDYgKzgxOSw5IEBACiAgICAgICAgIHJldHVybiBudWxsOwogICAgIH0KIAorICAgIC8qKgorICAgICAqIEluZmxhdGUgdGhpcyBEcmF3YWJsZSBmcm9tIGFuIFhNTCByZXNvdXJjZS4KKyAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBpbmZsYXRlKFJlc291cmNlcyByLCBYbWxQdWxsUGFyc2VyIHBhcnNlciwgQXR0c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bWxQdWxsUGFyc2VyRXhjZXB0aW9uLCBJT0V4Y2VwdGlvbiB7CisKKyAgICAgICAgc3VwZXIuaW5mbGF0ZShyLCBwYXJzZXIsIGF0dHJzKTsKKworICAgICAgICBpbnQgdHlwZTsKKworICAgICAgICBmaW5hbCBpbnQgaW5uZXJEZXB0aCA9IHBhcnNlci5nZXREZXB0aCgpICsgMTsKKyAgICAgICAgaW50IGRlcHRoOworICAgICAgICB3aGlsZSAoKHR5cGUgPSBwYXJzZXIubmV4dCgpKSAhPSBYbWxQdWxsUGFyc2VyLkVORF9ET0NVTUVOVAorICAgICAgICAgICAgICAgICYmICgoZGVwdGggPSBwYXJzZXIuZ2V0RGVwdGgoKSkgPj0gaW5uZXJEZXB0aAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgdHlwZSAhPSBYbWxQdWxsUGFyc2VyLkVORF9UQUcpKSB7CisgICAgICAgICAgICBpZiAodHlwZSAhPSBYbWxQdWxsUGFyc2VyLlNUQVJUX1RBRykgeworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZGVwdGggPiBpbm5lckRlcHRoIHx8ICFwYXJzZXIuZ2V0TmFtZSgpLmVxdWFscygiaXRlbSIpKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIFR5cGVkQXJyYXkgYSA9IHIub2J0YWluQXR0cmlidXRlcyhhdHRycywKKyAgICAgICAgICAgICAgICAgICAgY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5zdHlsZWFibGUuTWlwbWFwRHJhd2FibGVJdGVtKTsKKworICAgICAgICAgICAgaW50IGRyYXdhYmxlUmVzID0gYS5nZXRSZXNvdXJjZUlkKAorICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLnN0eWxlYWJsZS5NaXBtYXBEcmF3YWJsZUl0ZW1fZHJhd2FibGUsIDApOworCisgICAgICAgICAgICBhLnJlY3ljbGUoKTsKKworICAgICAgICAgICAgRHJhd2FibGUgZHI7CisgICAgICAgICAgICBpZiAoZHJhd2FibGVSZXMgIT0gMCkgeworICAgICAgICAgICAgICAgIGRyID0gci5nZXREcmF3YWJsZShkcmF3YWJsZVJlcyk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHdoaWxlICgodHlwZSA9IHBhcnNlci5uZXh0KCkpID09IFhtbFB1bGxQYXJzZXIuVEVYVCkgeworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAodHlwZSAhPSBYbWxQdWxsUGFyc2VyLlNUQVJUX1RBRykgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgWG1sUHVsbFBhcnNlckV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0UG9zaXRpb25EZXNjcmlwdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiOiA8aXRlbT4gdGFnIHJlcXVpcmVzIGEgJ2RyYXdhYmxlJyBhdHRyaWJ1dGUgb3IgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgImNoaWxkIHRhZyBkZWZpbmluZyBhIGRyYXdhYmxlIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGRyID0gRHJhd2FibGUuY3JlYXRlRnJvbVhtbElubmVyKHIsIHBhcnNlciwgYXR0cnMpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtTWlwbWFwQ29udGFpbmVyU3RhdGUuYWRkRHJhd2FibGUoZHIpOworICAgICAgICB9CisKKyAgICAgICAgb25EcmF3YWJsZUFkZGVkKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIERyYXdhYmxlIG11dGF0ZSgpIHsKKyAgICAgICAgaWYgKCFtTXV0YXRlZCAmJiBzdXBlci5tdXRhdGUoKSA9PSB0aGlzKSB7CisgICAgICAgICAgICBtTWlwbWFwQ29udGFpbmVyU3RhdGUubU1pcG1hcEhlaWdodHMgPSBtTWlwbWFwQ29udGFpbmVyU3RhdGUubU1pcG1hcEhlaWdodHMuY2xvbmUoKTsKKyAgICAgICAgICAgIG1NdXRhdGVkID0gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdGhpczsKKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIHN0YXRpYyBjbGFzcyBNaXBtYXBDb250YWluZXJTdGF0ZSBleHRlbmRzIERyYXdhYmxlQ29udGFpbmVyU3RhdGUgeworICAgICAgICBwcml2YXRlIGludFtdIG1NaXBtYXBIZWlnaHRzOworCisgICAgICAgIE1pcG1hcENvbnRhaW5lclN0YXRlKE1pcG1hcENvbnRhaW5lclN0YXRlIG9yaWcsIE1pcG1hcERyYXdhYmxlIG93bmVyLCBSZXNvdXJjZXMgcmVzKSB7CisgICAgICAgICAgICBzdXBlcihvcmlnLCBvd25lciwgcmVzKTsKKworICAgICAgICAgICAgaWYgKG9yaWcgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1NaXBtYXBIZWlnaHRzID0gb3JpZy5tTWlwbWFwSGVpZ2h0czsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbU1pcG1hcEhlaWdodHMgPSBuZXcgaW50W2dldENoaWxkcmVuKCkubGVuZ3RoXTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gQ2hhbmdlIHRoZSBkZWZhdWx0IHZhbHVlCisgICAgICAgICAgICBzZXRDb25zdGFudFNpemUodHJ1ZSk7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogUmV0dXJucyB0aGUgaW5kZXggb2YgdGhlIGNoaWxkIG1pcG1hcCBkcmF3YWJsZSB0aGF0IHdpbGwgYmVzdCBmaXQgdGhlIHByb3ZpZGVkIGJvdW5kcy4KKyAgICAgICAgICogVGhpcyBpbmRleCBpcyBkZXRlcm1pbmVkIGJ5IGNvbXBhcmluZyBib3VuZHMnIGhlaWdodCBhbmQgY2hpbGRyZW4gaW50cmluc2ljIGhlaWdodHMuCisgICAgICAgICAqIFRoZSByZXR1cm5lZCBtaXBtYXAgaW5kZXggaXMgdGhlIHNtYWxsZXN0IG1pcG1hcCB3aGljaCBoZWlnaHQgaXMgZ3JlYXRlciBvciBlcXVhbCB0aGFuCisgICAgICAgICAqIHRoZSBib3VuZHMnIGhlaWdodC4gSWYgdGhlIGJvdW5kcycgaGVpZ2h0IGlzIGxhcmdlciB0aGFuIHRoZSBsYXJnZXN0IG1pcG1hcCwgdGhlIGxhcmdlc3QKKyAgICAgICAgICogbWlwbWFwIGluZGV4IGlzIHJldHVybmVkLgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gYm91bmRzIFRoZSBib3VuZHMgb2YgdGhlIE1pcE1hcERyYXdhYmxlLgorICAgICAgICAgKiBAcmV0dXJuIFRoZSBpbmRleCBvZiB0aGUgY2hpbGQgRHJhd2FibGUgdGhhdCB3aWxsIGJlc3QgZml0IHRoZXNlIGJvdW5kcywgb3IgLTEgaWYgdGhlcmUKKyAgICAgICAgICogYXJlIG5vIGNoaWxkcmVuIG1pcG1hcHMuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgaW50IGluZGV4Rm9yQm91bmRzKFJlY3QgYm91bmRzKSB7CisgICAgICAgICAgICBmaW5hbCBpbnQgYm91bmRzSGVpZ2h0ID0gYm91bmRzLmhlaWdodCgpOworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47IGkrKykgeworICAgICAgICAgICAgICAgIGlmIChib3VuZHNIZWlnaHQgPD0gbU1pcG1hcEhlaWdodHNbaV0pIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBObyBtaXBtYXAgbGFyZ2VyIHRoYW4gYm91bmRzIGZvdW5kLiBVc2UgbGFyZ2VzdCBvbmUgd2hpY2ggd2lsbCBiZSBzY2FsZWQgdXAuCisgICAgICAgICAgICBpZiAoTiA+IDApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gTiAtIDE7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBObyBEcmF3YWJsZSBtaXBtYXAgYXQgYWxsCisgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQWRkcyBhIERyYXdhYmxlIHRvIHRoZSBsaXN0IG9mIGF2YWlsYWJsZSBtaXBtYXAgRHJhd2FibGVzLiBUaGlzIGxpc3QgY2FuIGJlIHJldHJpZXZlZAorICAgICAgICAgKiB1c2luZyB7QGxpbmsgRHJhd2FibGVDb250YWluZXIuRHJhd2FibGVDb250YWluZXJTdGF0ZSNnZXRDaGlsZHJlbigpfSBhbmQgdGhpcyBtZXRob2QKKyAgICAgICAgICogZW5zdXJlcyB0aGF0IGl0IGlzIGFsd2F5cyBzb3J0ZWQgYnkgaW5jcmVhc2luZyB7QGxpbmsgRHJhd2FibGUjZ2V0SW50cmluc2ljSGVpZ2h0KCl9LgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0gZHJhd2FibGUgVGhlIERyYXdhYmxlIHRoYXQgd2lsbCBiZSBhZGRlZCB0byBjaGlsZHJlbiBsaXN0CisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgdm9pZCBhZGREcmF3YWJsZShEcmF3YWJsZSBkcmF3YWJsZSkgeworICAgICAgICAgICAgLy8gSW5zZXJ0IGRyYXdhYmxlIGluIGxhc3QgcG9zaXRpb24sIGNvcnJlY3RseSByZXNldHRpbmcgY2FjaGVkIHZhbHVlcyBhbmQKKyAgICAgICAgICAgIC8vIGVzcGVjaWFsbHkgbUNvbXB1dGVkQ29uc3RhbnRTaXplCisgICAgICAgICAgICBpbnQgcG9zID0gYWRkQ2hpbGQoZHJhd2FibGUpOworCisgICAgICAgICAgICAvLyBCdWJibGUgc29ydCB0aGUgbGFzdCBkcmF3YWJsZSB0byByZXN0b3JlIHRoZSBzb3J0IGJ5IGludHJpbnNpYyBoZWlnaHQKKyAgICAgICAgICAgIGZpbmFsIGludCBkcmF3YWJsZUhlaWdodCA9IGRyYXdhYmxlLmdldEludHJpbnNpY0hlaWdodCgpOworCisgICAgICAgICAgICB3aGlsZSAocG9zID4gMCkgeworICAgICAgICAgICAgICAgIGZpbmFsIERyYXdhYmxlIHByZXZpb3VzRHJhd2FibGUgPSBtRHJhd2FibGVzW3Bvcy0xXTsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcHJldmlvdXNJbnRyaW5zaWNIZWlnaHQgPSBwcmV2aW91c0RyYXdhYmxlLmdldEludHJpbnNpY0hlaWdodCgpOworCisgICAgICAgICAgICAgICAgaWYgKGRyYXdhYmxlSGVpZ2h0IDwgcHJldmlvdXNJbnRyaW5zaWNIZWlnaHQpIHsKKyAgICAgICAgICAgICAgICAgICAgbURyYXdhYmxlc1twb3NdID0gcHJldmlvdXNEcmF3YWJsZTsKKyAgICAgICAgICAgICAgICAgICAgbU1pcG1hcEhlaWdodHNbcG9zXSA9IHByZXZpb3VzSW50cmluc2ljSGVpZ2h0OworCisgICAgICAgICAgICAgICAgICAgIG1EcmF3YWJsZXNbcG9zLTFdID0gZHJhd2FibGU7CisgICAgICAgICAgICAgICAgICAgIG1NaXBtYXBIZWlnaHRzW3Bvcy0xXSA9IGRyYXdhYmxlSGVpZ2h0OworICAgICAgICAgICAgICAgICAgICBwb3MtLTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogSW50cmluc2ljIHNpemVzIGFyZSB0aG9zZSBvZiB0aGUgbGFyZ2VzdCBhdmFpbGFibGUgbWlwbWFwLgorICAgICAgICAgKiBNaW5pbXVtIHNpemVzIGFyZSB0aG9zZSBvZiB0aGUgc21hbGxlc3QgYXZhaWxhYmxlIG1pcG1hcC4KKyAgICAgICAgICovCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBjb21wdXRlQ29uc3RhbnRTaXplKCkgeworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBnZXRDaGlsZENvdW50KCk7CisgICAgICAgICAgICBpZiAoTiA+IDApIHsKKyAgICAgICAgICAgICAgICBmaW5hbCBEcmF3YWJsZSBzbWFsbGVzdERyYXdhYmxlID0gbURyYXdhYmxlc1swXTsKKyAgICAgICAgICAgICAgICBtQ29uc3RhbnRNaW5pbXVtV2lkdGggPSBzbWFsbGVzdERyYXdhYmxlLmdldE1pbmltdW1XaWR0aCgpOworICAgICAgICAgICAgICAgIG1Db25zdGFudE1pbmltdW1IZWlnaHQgPSBzbWFsbGVzdERyYXdhYmxlLmdldE1pbmltdW1IZWlnaHQoKTsKKworICAgICAgICAgICAgICAgIGZpbmFsIERyYXdhYmxlIGxhcmdlc3REcmF3YWJsZSA9IG1EcmF3YWJsZXNbTi0xXTsKKyAgICAgICAgICAgICAgICBtQ29uc3RhbnRXaWR0aCA9IGxhcmdlc3REcmF3YWJsZS5nZXRJbnRyaW5zaWNXaWR0aCgpOworICAgICAgICAgICAgICAgIG1Db25zdGFudEhlaWdodCA9IGxhcmdlc3REcmF3YWJsZS5nZXRJbnRyaW5zaWNIZWlnaHQoKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbUNvbnN0YW50V2lkdGggPSBtQ29uc3RhbnRIZWlnaHQgPSAtMTsKKyAgICAgICAgICAgICAgICBtQ29uc3RhbnRNaW5pbXVtV2lkdGggPSBtQ29uc3RhbnRNaW5pbXVtSGVpZ2h0ID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1Db21wdXRlZENvbnN0YW50U2l6ZSA9IHRydWU7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIERyYXdhYmxlIG5ld0RyYXdhYmxlKCkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBNaXBtYXBEcmF3YWJsZSh0aGlzLCBudWxsKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgRHJhd2FibGUgbmV3RHJhd2FibGUoUmVzb3VyY2VzIHJlcykgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBNaXBtYXBEcmF3YWJsZSh0aGlzLCByZXMpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGdyb3dBcnJheShpbnQgb2xkU2l6ZSwgaW50IG5ld1NpemUpIHsKKyAgICAgICAgICAgIHN1cGVyLmdyb3dBcnJheShvbGRTaXplLCBuZXdTaXplKTsKKyAgICAgICAgICAgIGludFtdIG5ld0ludHMgPSBuZXcgaW50W25ld1NpemVdOworICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShtTWlwbWFwSGVpZ2h0cywgMCwgbmV3SW50cywgMCwgb2xkU2l6ZSk7CisgICAgICAgICAgICBtTWlwbWFwSGVpZ2h0cyA9IG5ld0ludHM7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIE1pcG1hcERyYXdhYmxlKE1pcG1hcENvbnRhaW5lclN0YXRlIHN0YXRlLCBSZXNvdXJjZXMgcmVzKSB7CisgICAgICAgIE1pcG1hcENvbnRhaW5lclN0YXRlIGFzID0gbmV3IE1pcG1hcENvbnRhaW5lclN0YXRlKHN0YXRlLCB0aGlzLCByZXMpOworICAgICAgICBtTWlwbWFwQ29udGFpbmVyU3RhdGUgPSBhczsKKyAgICAgICAgc2V0Q29uc3RhbnRTdGF0ZShhcyk7CisgICAgICAgIG9uRHJhd2FibGVBZGRlZCgpOworICAgIH0KK30KZGlmZiAtLWdpdCB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ICAgICBtUlMubkFsbG9jYXRpb25TdWJEYXRhMUQobUlELCBvZmYsIGNvdW50LCBkYXRhLCBkYXRhLmxlbmd0aCk7CisgICAgfQorCiAgICAgcHJpdmF0ZSB2b2lkIGRhdGExRENoZWNrcyhpbnQgb2ZmLCBpbnQgY291bnQsIGludCBsZW4sIGludCBkYXRhU2l6ZSkgewogICAgICAgICBtUlMudmFsaWRhdGUoKTsKLSAgICAgICAgaWYoKG9mZiA8IDApIHx8IChjb3VudCA8IDEpIHx8ICgob2ZmICsgY291bnQpID4gbVR5cGUuZ2V0RWxlbWVudENvdW50KCkpKSB7Ci0gICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJPZmZzZXQgb3IgQ291bnQgb3V0IG9mIGJvdW5kcy4iKTsKKyAgICAgICAgaWYob2ZmIDwgMCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiT2Zmc2V0IG11c3QgYmUgPj0gMC4iKTsKKyAgICAgICAgfQorICAgICAgICBpZihjb3VudCA8IDEpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIkNvdW50IG11c3QgYmUgPj0gMS4iKTsKKyAgICAgICAgfQorICAgICAgICBpZigob2ZmICsgY291bnQpID4gbVR5cGUuZ2V0RWxlbWVudENvdW50KCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIk92ZXJmbG93LCBBdmFpbGFibGUgY291bnQgIiArIG1UeXBlLmdldEVsZW1lbnRDb3VudCgpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiwgZ290ICIgKyBjb3VudCArICIgYXQgb2Zmc2V0ICIgKyBvZmYgKyAiLiIpOwogICAgICAgICB9CiAgICAgICAgIGlmKChsZW4pIDwgZGF0YVNpemUp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SU19TQU1QTEVSICgxOCwgNCksCi0gICAgICAgIFJTX1NDUklQVCAoMTksIDQpLAotICAgICAgICBSU19NRVNIICgyMCwgNCksCi0gICAgICAgIFJTX1BST0dSQU1fRlJBR01FTlQgKDIxLCA0KSwKLSAgICAgICAgUlNfUFJPR1JBTV9WRVJURVggKDIyLCA0KSwKLSAgICAgICAgUlNfUFJPR1JBTV9SQVNURVIgKDIzLCA0KSwKLSAgICAgICAgUlNfUFJPR1JBTV9TVE9SRSAoMjQsIDQpOworICAgICAgICBVTlNJR05FRF81XzZfNSAoMTMsIDIpLAorICAgICAgICBVTlNJR05FRF81XzVfNV8xICgxNCwgMiksCisgICAgICAgIFVOU0lHTkVEXzRfNF80XzQgKDE1LCAyKSwKKworICAgICAgICBSU19FTEVNRU5UICgxNiwgNCksCisgICAgICAgIFJTX1RZUEUgKDE3LCA0KSwKKyAgICAgICAgUlNfQUxMT0NBVElPTiAoMTgsIDQpLAorICAgICAgICBSU19TQU1QTEVSICgxOSwgNCksCisgICAgICAgIFJTX1NDUklQVCAoMjAsIDQpLAorICAgICAgICBSU19NRVNIICgyMSwgNCksCisgICAgICAgIFJTX1BST0dSQU1fRlJBR01FTlQgKDIyLCA0KSwKKyAgICAgICAgUlNfUFJPR1JBTV9WRVJURVggKDIzLCA0KSwKKyAgICAgICAgUlNfUFJPR1JBTV9SQVNURVIgKDI0LCA0KSwKKyAgICAgICAgUlNfUFJPR1JBTV9TVE9SRSAoMjUsIDQpOwogCiAgICAgICAgIGludCBtSUQ7CiAgICAgICAgIGludCBtU2l6ZTsKQEAgLTcyLDEyICs3NCw2IEBACiAKICAgICBwdWJsaWMgZW51bSBEYXRhS2luZCB7CiAgICAgICAgIFVTRVIgKDApLAotICAgICAgICBDT0xPUiAoMSksCi0gICAgICAgIFBPU0lUSU9OICgyKSwKLSAgICAgICAgVEVYVFVSRSAoMyksCi0gICAgICAgIE5PUk1BTCAoNCksCi0gICAgICAgIElOREVYICg1KSwKLSAgICAgICAgUE9JTlRfU0laRSg2KSwKIAogICAgICAgICBQSVhFTF9MICg3KSwKICAgICAgICAgUElYRUxfQSAoOCksCkBAIC05MSw0MSArODcsMTMzIEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgVVNFUl9VOChSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgaWYocnMubUVsZW1lbnRfVVNFUl9VOCA9PSBudWxsKSB7Ci0gICAgICAgICAgICBycy5tRWxlbWVudF9VU0VSX1U4ID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuVU5TSUdORURfOCk7CisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IEJPT0xFQU4oUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X0JPT0xFQU4gPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfQk9PTEVBTiA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLkJPT0xFQU4pOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBycy5tRWxlbWVudF9VU0VSX1U4OworICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfQk9PTEVBTjsKICAgICB9CiAKLSAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgVVNFUl9JOChSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgaWYocnMubUVsZW1lbnRfVVNFUl9JOCA9PSBudWxsKSB7Ci0gICAgICAgICAgICBycy5tRWxlbWVudF9VU0VSX0k4ID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuU0lHTkVEXzgpOworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBVOChSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfVTggPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfVTggPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5VTlNJR05FRF84KTsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfVVNFUl9JODsKKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1U4OwogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBVU0VSX1UzMihSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgaWYocnMubUVsZW1lbnRfVVNFUl9VMzIgPT0gbnVsbCkgewotICAgICAgICAgICAgcnMubUVsZW1lbnRfVVNFUl9VMzIgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5VTlNJR05FRF8zMik7CisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IEk4KFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9JOCA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9JOCA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlNJR05FRF84KTsKICAgICAgICAgfQotICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfVVNFUl9VMzI7CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9JODsKICAgICB9CiAKLSAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgVVNFUl9JMzIoUmVuZGVyU2NyaXB0IHJzKSB7Ci0gICAgICAgIGlmKHJzLm1FbGVtZW50X1VTRVJfSTMyID09IG51bGwpIHsKLSAgICAgICAgICAgIHJzLm1FbGVtZW50X1VTRVJfSTMyID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuU0lHTkVEXzMyKTsKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgVTE2KFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9VMTYgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfVTE2ID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuVU5TSUdORURfMTYpOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBycy5tRWxlbWVudF9VU0VSX0kzMjsKKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X1UxNjsKICAgICB9CiAKLSAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgVVNFUl9GMzIoUmVuZGVyU2NyaXB0IHJzKSB7Ci0gICAgICAgIGlmKHJzLm1FbGVtZW50X1VTRVJfRjMyID09IG51bGwpIHsKLSAgICAgICAgICAgIHJzLm1FbGVtZW50X1VTRVJfRjMyID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuRkxPQVRfMzIpOworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBJMTYoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X0kxNiA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9JMTYgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5TSUdORURfMTYpOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBycy5tRWxlbWVudF9VU0VSX0YzMjsKKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X0kxNjsKICAgICB9CiAKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgVTMyKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9VMzIgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfVTMyID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuVU5TSUdORURfMzIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9VMzI7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IEkzMihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfSTMyID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X0kzMiA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlNJR05FRF8zMik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X0kzMjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgRjMyKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9GMzIgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfRjMyID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuRkxPQVRfMzIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9GMzI7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IEVMRU1FTlQoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X0VMRU1FTlQgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfRUxFTUVOVCA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlJTX0VMRU1FTlQpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9FTEVNRU5UOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBUWVBFKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9UWVBFID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X1RZUEUgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5SU19UWVBFKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfVFlQRTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgQUxMT0NBVElPTihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubUVsZW1lbnRfQUxMT0NBVElPTiA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9BTExPQ0FUSU9OID0gY3JlYXRlVXNlcihycywgRGF0YVR5cGUuUlNfQUxMT0NBVElPTik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJzLm1FbGVtZW50X0FMTE9DQVRJT047CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IFNBTVBMRVIoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X1NBTVBMRVIgPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfU0FNUExFUiA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlJTX1NBTVBMRVIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9TQU1QTEVSOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBTQ1JJUFQoUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X1NDUklQVCA9PSBudWxsKSB7CisgICAgICAgICAgICBycy5tRWxlbWVudF9TQ1JJUFQgPSBjcmVhdGVVc2VyKHJzLCBEYXRhVHlwZS5SU19TQ1JJUFQpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9TQ1JJUFQ7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBFbGVtZW50IE1FU0goUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIGlmKHJzLm1FbGVtZW50X01FU0ggPT0gbnVsbCkgeworICAgICAgICAgICAgcnMubUVsZW1lbnRfTUVTSCA9IGNyZWF0ZVVzZXIocnMsIERhdGFUeXBlLlJTX01FU0gpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9NRVNIOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBQUk9HUkFNX0ZSQUdNRU5UKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9QUk9HUkFNX0ZSQUdNRU5UID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X1BST0d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gICBwdWJsaWMgc3RhdGljIEVsZW1lbnQgQVRUUklCX1RFWFRVUkVfMihSZW5kZXJTY3JpcHQgcnMpIHsKLSAgICAgICAgaWYocnMubUVsZW1lbnRfVEVYVFVSRV8yID09IG51bGwpIHsKLSAgICAgICAgICAgIHJzLm1FbGVtZW50X1RFWFRVUkVfMiA9IGNyZWF0ZUF0dHJpYihycywgRGF0YVR5cGUuRkxPQVRfMzIsIERhdGFLaW5kLlRFWFRVUkUsIDIpOworICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBVOF80KFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tRWxlbWVudF9VQ0hBUl80ID09IG51bGwpIHsKKyAgICAgICAgICAgIHJzLm1FbGVtZW50X1VDSEFSXzQgPSBjcmVhdGVWZWN0b3IocnMsIERhdGFUeXBlLlVOU0lHTkVEXzgsIDQpOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiBycy5tRWxlbWVudF9URVhUVVJFXzI7CisgICAgICAgIHJldHVybiBycy5tRWxlbWVudF9VQ0hBUl80OwogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBBVFRSSUJfTk9STUFMXzMoUmVuZGVyU2NyaXB0IHJzKSB7Ci0gICAgICAgIGlmKHJzLm1FbGVtZW50X05PUk1BTF8zID09IG51bGwpIHsKLSAgICAgICAgICAgIHJzLm1FbGVtZW50X05PUk1BTF8zID0gY3JlYXRlQXR0cmliKHJzLCBEYXRhVHlwZS5GTE9BVF8zMiwgRGF0YUtpbmQuTk9STUFMLCAzKTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gcnMubUVsZW1lbnRfTk9STUFMXzM7Ci0gICAgfQotCi0gICAgcHVibGljIHN0YXRpYyBFbGVtZW50IEFUVFJJQl9DT0xPUl9VOF80KFJlbmRlclNjcmlwdCBycykgewotICAgICAgICBpZihycy5tRWxlbWVudF9DT0xPUl9VOF80ID09IG51bGwpIHsKLSAgICAgICAgICAgIHJzLm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iAgICAgfQogCi0gICAgcHVibGljIHN0YXRpYyBFbGVtZW50IGNyZWF0ZUluZGV4KFJlbmRlclNjcmlwdCBycykgewotICAgICAgICByZXR1cm4gbmV3IEVsZW1lbnQocnMsIERhdGFUeXBlLlVOU0lHTkVEXzE2LCBEYXRhS2luZC5JTkRFWCwgZmFsc2UsIDEpOwotICAgIH0KLQotICAgIHB1YmxpYyBzdGF0aWMgRWxlbWVudCBjcmVhdGVBdHRyaWIoUmVuZGVyU2NyaXB0IHJzLCBEYXRhVHlwZSBkdCwgRGF0YUtpbmQgZGssIGludCBzaXplKSB7Ci0gICAgICAgIGlmICghKGR0ID09IERhdGFUeXBlLkZMT0FUXzMyIHx8Ci0gICAgICAgICAgICAgIGR0ID09IERhdGFUeXBlLlVOU0lHTkVEXzggfHwKLSAgICAgICAgICAgICAgZHQgPT0gRGF0YVR5cGUuVU5TSUdORURfMTYgfHwKLSAgICAgICAgICAgICAgZHQgPT0gRGF0YVR5cGUuVU5TSUdORURfMzIgfHwKLSAgICAgICAgICAgICAgZHQgPT0gRGF0YVR5cGUuU0lHTkVEXzggfHwKLSAgICAgICAgICAgICAgZHQgPT0gRGF0YVR5cGUuU0lHTkVEXzE2IHx8Ci0gICAgICAgICAgICAgIGR0ID09IERhdGFUeXBlLlNJR05FRF8zMikpIHsKLSAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlVuc3VwcG9ydGVkIERhdGFUeXBlIik7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoIShkayA9PSBEYXRhS2luZC5DT0xPUiB8fAotICAgICAgICAgICAgICBkayA9PSBEYXRhS2luZC5QT1NJVElPTiB8fAotICAgICAgICAgICAgICBkayA9PSBEYXRhS2luZC5URVhUVVJFIHx8Ci0gICAgICAgICAgICAgIGRrID09IERhdGFLaW5kLk5PUk1BTCB8fAotICAgICAgICAgICAgICBkayA9PSBEYXRhS2luZC5QT0lOVF9TSVpFIHx8Ci0gICA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gICB9CiAKLSAgICB2b2lkIHJlc2V0KCkgeworICAgIHB1YmxpYyB2b2lkIHJlc2V0KCkgewogICAgICAgICBtUG9zID0gMDsKICAgICB9CisgICAgcHVibGljIHZvaWQgcmVzZXQoaW50IGkpIHsKKyAgICAgICAgbVBvcyA9IGk7CisgICAgfQogCi0gICAgdm9pZCBhZGRJOChieXRlIHYpIHsKKyAgICBwdWJsaWMgdm9pZCBza2lwKGludCBpKSB7CisgICAgICAgIG1Qb3MgKz0gaTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhZGRJOChieXRlIHYpIHsKICAgICAgICAgbURhdGFbbVBvcysrXSA9IHY7CiAgICAgfQogCi0gICAgdm9pZCBhZGRJMTYoc2hvcnQgdikgeworICAgIHB1YmxpYyB2b2lkIGFkZEkxNihzaG9ydCB2KSB7CiAgICAgICAgIGFsaWduKDIpOwogICAgICAgICBtRGF0YVttUG9zKytdID0gKGJ5dGUpKHYgJiAweGZmKTsKICAgICAgICAgbURhdGFbbVBvcysrXSA9IChieXRlKSh2ID4+IDgpOwogICAgIH0KIAotICAgIHZvaWQgYWRkSTMyKGludCB2KSB7CisgICAgcHVibGljIHZvaWQgYWRkSTMyKGludCB2KSB7CiAgICAgICAgIGFsaWduKDQpOwogICAgICAgICBtRGF0YVttUG9zKytdID0gKGJ5dGUpKHYgJiAweGZmKTsKICAgICAgICAgbURhdGFbbVBvcysrXSA9IChieXRlKSgodiA+PiA4KSAmIDB4ZmYpOwpAQCAtNTUsNyArNjIsNyBAQAogICAgICAgICBtRGF0YVttUG9zKytdID0gKGJ5dGUpKCh2ID4+IDI0KSAmIDB4ZmYpOwogICAgIH0KIAotICAgIHZvaWQgYWRkSTY0KGxvbmcgdikgeworICAgIHB1YmxpYyB2b2lkIGFkZEk2NChsb25nIHYpIHsKICAgICAgICAgYWxpZ24oOCk7CiAgICAgICAgIG1EYXRhW21Qb3MrK10gPSAoYnl0ZSkodiAmIDB4ZmYpOwogICAgICAgICBtRGF0YVttU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ICAgICAgIG1EYXRhW21Qb3MrK10gPSAoYnl0ZSkoKHYgPj4gMjQpICYgMHhmZik7CiAgICAgfQogCi0gICAgdm9pZCBhZGRVNjQobG9uZyB2KSB7CisgICAgcHVibGljIHZvaWQgYWRkVTY0KGxvbmcgdikgewogICAgICAgICBpZiAodiA8IDApIHsKICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlNhdmluZyB2YWx1ZSBvdXQgb2YgcmFuZ2UgZm9yIHR5cGUiKTsKICAgICAgICAgfQpAQCAtMTA5LDE1ICsxMTYsMTM5IEBACiAgICAgICAgIG1EYXRhW21Qb3MrK10gPSAoYnl0ZSkoKHYgPj4gNTYpICYgMHhmZik7CiAgICAgfQogCi0gICAgdm9pZCBhZGRGMzIoZmxvYXQgdikgeworICAgIHB1YmxpYyB2b2lkIGFkZEYzMihmbG9hdCB2KSB7CiAgICAgICAgIGFkZEkzMihGbG9hdC5mbG9hdFRvUmF3SW50Qml0cyh2KSk7CiAgICAgfQogCi0gICAgdm9pZCBhZGRGNjQoZmxvYXQgdikgeworICAgIHB1YmxpYyB2b2lkIGFkZEY2NChmbG9hdCB2KSB7CiAgICAgICAgIGFkZEk2NChEb3VibGUuZG91YmxlVG9SYXdMb25nQml0cyh2KSk7CiAgICAgfQogCi0gICAgZmluYWwgYnl0ZVtdIGdldERhdGEoKSB7CisgICAgcHVibGljIHZvaWQgYWRkT2JqKEJhc2VPYmogb2JqKSB7CisgICAgICAgIGlmIChvYmogIT0gbnVsbCkgeworICAgICAgICAgICAgYWRkSTMyKG9iai5nZXRJRCgpKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGFkZEkzMigwKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFkZEYzMihGbG9hdDIgdikgeworICAgICAgICBhZGRGMzIodi54KTsKKyAgICAgICAgYWRkRjMyKHYueSk7CisgICAgfQorICAgIHB1YmxpYyB2b2lkIGFkZEYzMihGbG9hdDMgdikgeworICAgICAgICBhZGRGMzIodi54KTsKKyAgICAgICAgYWRkRjMyKHYueSk7CisgICAgICAgIGFkZEYzMih2LnopOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCBhZGRGMzIoRmxvYXQ0IHYpIHsKKyAgICAgICAgYWRkRjMyKHYueCk7CisgICAgICAgIGFkZEYzMih2LnkpOworICAgICAgICBhZGRGMzIodi56KTsKKyAgICAgICAgYWRkRjMyKHYudyk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYWRkSTgoQnl0ZTIgdikgeworICAgICAgICBhZGRJOCh2LngpOworICAgICAgICBhZGRJOCh2LnkpOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCBhZGRJOChCeXRlMyB2KSB7CisgICAgICAgIGFkZEk4KHYueCk7CisgICAgICAgIGFkZEk4KHYueSk7CisgICAgICAgIGFkZEk4KHYueik7CisgICAgfQorICAgIHB1YmxpYyB2b2lkIGFkZEk4KEJ5dGU0IHYpIHsKKyAgICAgICAgYWRkSTgodi54KTsKKyAgICAgICAgYWRkSTgodi55KTsKKyAgICAgICAgYWRkSTgodi56KTsKKyAgICAgICAgYWRkSTgodi53KTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhZGRVOChTaG9ydDIgdikgeworICAgICAgICBhZGRVOCh2LngpOworICAgICAgICBhZGRVOCh2LnkpOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCBhZGRVOChTaG9ydDMgdikgeworICAgICAgICBhZGRVOCh2LngpOworICAgICAgICBhZGRVOCh2LnkpOworICAgICAgICBhZGRVOCh2LnopOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCBhZGRVOChTaG9ydDQgdikgeworICAgICAgICBhZGRVOCh2LngpOworICAgICAgICBhZGRVOCh2LnkpOworICAgICAgICBhZGRVOCh2LnopOworICAgICAgICBhZGRVOCh2LncpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGFkZEkxNihTaG9ydDIgdikgeworICAgICAgICBhZGRJMTYodi54KTsKKyAgICAgICAgYWRkSTE2KHYueSk7CisgICAgfQorICAgIHB1YmxpYyB2b2lkIGFkZEkxNihTaG9ydDMgdikgeworICAgICAgICBhZGRJMTYodi54KTsKKyAgICAgICAgYWRkSTE2KHYueSk7CisgICAgICAgIGFkZEkxNih2LnopOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCBhZGRJMTYoU2hvcnQ0IHYpIHsKKyAgICAgICAgYWRkSTE2KHYueCk7CisgICAgICAgIGFkZEkxNih2LnkpOworICAgICAgICBhZGRJMTYodi56KTsKKyAgICAgICAgYWRkSTE2KHYudyk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYWRkVTE2KEludDIgdikgeworICAgICAgICBhZGRVMTYodi54KTsKKyAgICAgICAgYWRkVTE2KHYueSk7CisgICAgfQorICAgIHB1YmxpYyB2b2lkIGFkZFUxNihJbnQzIHYpIHsKKyAgICAgICAgYWRkVTE2KHYueCk7CisgICAgICAgIGFkZFUxNih2LnkpOworICAgICAgICBhZGRVMTYodi56KTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgYWRkVTE2KEludDQgdikgeworICAgICAgICBhZGRVMTYodi54KTsKKyAgICAgICAgYWRkVTE2KHYueSk7CisgICAgICAgIGFkZFUxNih2LnopOworICAgICAgICBhZGRVMTYodi53KTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhZGRJMzIoSW50MiB2KSB7CisgICAgICAgIGFkZEkzMih2LngpOworICAgICAgICBhZGRJMzIodi55KTsKKyAgICB9CisgICAgcHVibGljIHZvaWQgYWRkSTMyKEludDMgdikgeworICAgICAgICBhZGRJMzIodi54KTsKKyAgICAgICAgYWRkSTMyKHYueSk7CisgICAgICAgIGFkZEkzMih2LnopOworICAgIH0KKyAgICBwdWJsaWMgdm9pZCBhZGRJMzIoSW50NCB2KSB7CisgICAgICAgIGFkZEkzMih2LngpOworICAgICAgICBhZGRJMzIodi55KTsKKyAgICAgICAgYWRkST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c7CitpbXBvcnQgYW5kcm9pZC51dGlsLlR5cGVkVmFsdWU7CisKKy8qKgorICogQGhpZGUKKyAqCisgKiovCitwdWJsaWMgY2xhc3MgRmlsZUEzRCBleHRlbmRzIEJhc2VPYmogeworCisgICAgcHVibGljIGVudW0gQ2xhc3NJRCB7CisKKyAgICAgICAgVU5LTk9XTiwKKyAgICAgICAgTUVTSCwKKyAgICAgICAgU0lNUExFX01FU0gsCisgICAgICAgIFRZUEUsCisgICAgICAgIEVMRU1FTlQsCisgICAgICAgIEFMTE9DQVRJT04sCisgICAgICAgIFBST0dSQU1fVkVSVEVYLAorICAgICAgICBQUk9HUkFNX1JBU1RFUiwKKyAgICAgICAgUFJPR1JBTV9GUkFHTUVOVCwKKyAgICAgICAgUFJPR1JBTV9TVE9SRSwKKyAgICAgICAgU0FNUExFUiwKKyAgICAgICAgQU5JTUFUSU9OLAorICAgICAgICBMSUdIVCwKKyAgICAgICAgQURBUFRFUl8xRCwKKyAgICAgICAgQURBUFRFUl8yRCwKKyAgICAgICAgU0NSSVBUX0M7CisKKyAgICAgICAgcHVibGljIHN0YXRpYyBDbGFzc0lEIHRvQ2xhc3NJRChpbnQgaW50SUQpIHsKKyAgICAgICAgICAgIHJldHVybiBDbGFzc0lELnZhbHVlcygpW2ludElEXTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vIFJlYWQgb25seSBjbGFzcyB3aXRoIGluZGV4IGVudHJpZXMKKyAgICBwdWJsaWMgY2xhc3MgSW5kZXhFbnRyeSB7CisgICAgICAgIFJlbmRlclNjcmlwdCBtUlM7CisgICAgICAgIGludCBtSW5kZXg7CisgICAgICAgIGludCBtSUQ7CisgICAgICAgIFN0cmluZyBtTmFtZTsKKyAgICAgICAgQ2xhc3NJRCBtQ2xhc3NJRDsKKyAgICAgICAgQmFzZU9iaiBtTG9hZGVkT2JqOworCisgICAgICAgIHB1YmxpYyBTdHJpbmcgZ2V0TmFtZSgpIHsKKyAgICAgICAgICAgIHJldHVybiBtTmFtZTsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBDbGFzc0lEIGdldENsYXNzSUQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUNsYXNzSUQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgQmFzZU9iaiBnZXRPYmplY3QoKSB7CisgICAgICAgICAgICBpZihtTG9hZGVkT2JqICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbUxvYWRlZE9iajsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYobUNsYXNzSUQgPT0gQ2xhc3NJRC5VTktOT1dOKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGludCBvYmplY3RJRCA9IG1SUy5uRmlsZUEzREdldEVudHJ5QnlJbmRleChtSUQsIG1JbmRleCk7CisgICAgICAgICAgICBpZihvYmplY3RJRCA9PSAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHN3aXRjaCAobUNsYXNzSUQpIHsKKyAgICAgICAgICAgIGNhc2UgTUVTSDoKKyAgICAgICAgICAgICAgICBtTG9hZGVkT2JqID0gbnVsbDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU0lNUExFX01FU0g6CisgICAgICAgICAgICAgICAgbUxvYWRlZE9iaiA9IG5ldyBTaW1wbGVNZXNoKG9iamVjdElELCBtUlMpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBUWVBFOgorICAgICAgICAgICAgICAgIG1Mb2FkZWRPYmogPSBuZXcgVHlwZShvYmplY3RJRCwgbVJTKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgRUxFTUVOVDoKKyAgICAgICAgICAgICAgICBtTG9hZGVkT2JqID0gbnVsbDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQUxMT0NBVElPTjoKKyAgICAgICAgICAgICAgICBtTG9hZGVkT2JqID0gbnVsbDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgUFJPR1JBTV9WRVJURVg6CisgICAgICAgICAgICAgICAgbUxvYWRlZE9iaiA9IG5ldyBQcm9ncmFtVmVydGV4KG9iamVjdElELCBtUlMpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBQUk9HUkFNX1JBU1RFUjoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgUFJPR1JBTV9GUkFHTUVOVDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgUFJPR1JBTV9TVE9SRToKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU0FNUExFUjoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQU5JTUFUSU9OOgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBMSUdIVDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQURBUFRFUl8xRDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgQURBUFRFUl8yRDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgU0NSSVBUX0M6CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBtTG9hZGVkT2JqOworICAgICAgICB9CisKKyAgICAgICAgSW5kZXhFbnRyeShSZW5kZXJTY3JpcHQgcnMsIGludCBpbmRleCwgaW50IGlkLCBTdHJpbmcgbmFtZSwgQ2xhc3NJRCBjbGFzc0lEKSB7CisgICAgICAgICAgICBtUlMgPSByczsKKyAgICAgICAgICAgIG1JbmRleCA9IGluZGV4OworICAgICAgICAgICAgbUlEID0gaWQ7CisgICAgICAgICAgICBtTmFtZSA9IG5hbWU7CisgICAgICAgICAgICBtQ2xhc3NJRCA9IGNsYXNzSUQ7CisgICAgICAgICAgICBtTG9hZGVkT2JqID0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIEluZGV4RW50cnlbXSBtRmlsZUVudHJpZXM7CisKKyAgICBGaWxlQTNEKGludCBpZCwgUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIHN1cGVyKHJzKTsKKyAgICAgICAgbUlEID0gaWQ7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGluaXRFbnRyaWVzKCkgeworICAgICAgICBpbnQgbnVtRmlsZUVudHJpZXMgPSBtUlMubkZpbGVBM0RHZXROdW1JbmRleEVudHJpZXMobUlEKTsKKyAgICAgICAgaWYobnVtRmlsZUVudHJpZXMgPD0gMCkgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgbUZpbGVFbnRyaWVzID0gbmV3IEluZGV4RW50cnlbbnVtRmlsZUVudHJpZXNdOworICAgICAgICBpbnRbXSBpZHMgPSBuZXcgaW50W251bUZpbGVFbnRyaWVzXTsKKyAgICAgICAgU3RyaW5nW10gbmFtZXMgPSBuZXcgU3RyaW5nW251bUZpbGVFbnRyaWVzXTsKKworICAgICAgICBtUlMubkZpbGVBM0RHZXRJbmRleEVudHJpZXMobUlELCBudW1GaWxlRW50cmllcywgaWRzLCBuYW1lcyk7CisKKyAgICAgICAgZm9yKGludCBpID0gMDsgaSA8IG51bUZpbGVFbnRyaWVzOyBpICsrKSB7CisgICAgICAgICAgICBtRmlsZUVudHJpZXNbaV0gPSBuZXcgSW5kZXhFbnRyeShtUlMsIGksIG1JRCwgbmFtZXNbaV0sIENsYXNzSUQudG9DbGFzc0lEKGlkc1tpXSkpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXROdW1JbmRleEVudHJpZXMoKSB7CisgICAgICAgIGlmKG1GaWxlRW50cmllcyA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbUZpbGVFbnRyaWVzLmxlbmd0aDsKKyAgICB9CisKKyAgICBwdWJsaWMgSW5kZXhFbnRyeSBnZXRJbmRleEVudHJ5KGludCBpbmRleCkgeworICAgICAgICBpZihnZXROdW1JbmRleEVudHJpZXMoKSA9PSAwIHx8IGluZGV4IDwgMCB8fCBpbmRleCA+PSBtRmlsZUVudHJpZXMubGVuZ3RoKSB7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbUZpbGVFbnRyaWVzW2luZGV4XTsKKyAgICB9CisKKyAgICBzdGF0aWMgcHVibGljIEZpbGVBM0QgY3JlYXRlRnJvbVJlc291cmNlKFJlbmRlclNjcmlwdCBycywgUmVzb3VyY2VzIHJlcywgaW50IGlkKQorICAgICAgICB0aHJvd3MgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIHsKKworICAgICAgICBycy52YWxpZGF0ZSgpOworICAgICAgICBJbnB1dFN0cmVhbSBpcyA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBmaW5hbCBUeXBlZFZhbHVlIHZhbHVlID0gbmV3IFR5cGVkVmFsdWUoKTsKKyAgICAgICAgICAgIGlzID0gcmVzLm9wZW5SYXdSZXNvdXJjZShpZCwgdmFsdWUpOworCisgICAgICAgICAgICBpbnQgYXNzZXQgPSAoKEFzc2V0TWFuYWdlci5Bc3NldElucHV0U3RyZWFtKSBpcykuZ2V0QXNzZXRJbnQoKTsKKworICAgICAgICAgICAgaW50IGZpbGVJZCA9IHJzLm5GaWxlQTNEQ3JlYXRlRnJvbUFzc2V0U3RyZWFtKGFzc2V0KTsKKworICAgICAgICAgICAgaWYoZmlsZUlkID09IDApIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0Y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BjbGFzcyBGb250IGV4dGVuZHMgQmFzZU9iaiB7CisKKyAgICBGb250KGludCBpZCwgUmVuZGVyU2NyaXB0IHJzKSB7CisgICAgICAgIHN1cGVyKHJzKTsKKyAgICAgICAgbUlEID0gaWQ7CisgICAgfQorCisgICAgc3RhdGljIHB1YmxpYyBGb250IGNyZWF0ZShSZW5kZXJTY3JpcHQgcnMsIFJlc291cmNlcyByZXMsIFN0cmluZyBmaWxlTmFtZSwgaW50IHNpemUpCisgICAgICAgIHRocm93cyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24geworCisgICAgICAgIHJzLnZhbGlkYXRlKCk7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpbnQgZHBpID0gcmVzLmdldERpc3BsYXlNZXRyaWNzKCkuZGVuc2l0eURwaTsKKyAgICAgICAgICAgIGludCBmb250SWQgPSBycy5uRm9udENyZWF0ZUZyb21GaWxlKGZpbGVOYW1lLCBzaXplLCBkcGkpOworCisgICAgICAgICAgICBpZihmb250SWQgPT0gMCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkxvYWQgbG9hZGluZyBhIGZvbnQiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZvbnQgcnNGb250ID0gbmV3IEZvbnQoZm9udElkLCBycyk7CisKKyAgICAgICAgICAgIHJldHVybiByc0ZvbnQ7CisKKyAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIC8vIElnbm9yZQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIG51bGw7CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9WZWN0b3IyZi5qYXZhIGIvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9JbnQyLmphdmEKc2ltaWxhcml0eSBpbmRleCA4OSUKY29weS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2dyYW1GcmFnbWVudFN0b3JlQmVnaW4oaW5JRCwgb3V0SUQpOwotICAgICAgICAgICAgcnMublByb2dyYW1GcmFnbWVudFN0b3JlRGVwdGhGdW5jKGIubURlcHRoRnVuYy5tSUQpOwotICAgICAgICAgICAgcnMublByb2dyYW1GcmFnbWVudFN0b3JlRGVwdGhNYXNrKGIubURlcHRoTWFzayk7Ci0gICAgICAgICAgICBycy5uUHJvZ3JhbUZyYWdtZW50U3RvcmVDb2xvck1hc2soYi5tQ29sb3JNYXNrUiwKKyAgICAgICAgICAgIHJzLm5Qcm9ncmFtU3RvcmVCZWdpbihpbklELCBvdXRJRCk7CisgICAgICAgICAgICBycy5uUHJvZ3JhbVN0b3JlRGVwdGhGdW5jKGIubURlcHRoRnVuYy5tSUQpOworICAgICAgICAgICAgcnMublByb2dyYW1TdG9yZURlcHRoTWFzayhiLm1EZXB0aE1hc2spOworICAgICAgICAgICAgcnMublByb2dyYW1TdG9yZUNvbG9yTWFzayhiLm1Db2xvck1hc2tSLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIubUNvbG9yTWFza0csCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYi5tQ29sb3JNYXNrQiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiLm1Db2xvck1hc2tBKTsKLSAgICAgICAgICAgIHJzLm5Qcm9ncmFtRnJhZ21lbnRTdG9yZUJsZW5kRnVuYyhiLm1CbGVuZFNyYy5tSUQsIGIubUJsZW5kRHN0Lm1JRCk7Ci0gICAgICAgICAgICBycy5uUHJvZ3JhbUZyYWdtZW50U3RvcmVEaXRoZXIoYi5tRGl0aGVyKTsKKyAgICAgICAgICAgIHJzLm5Qcm9ncmFtU3RvcmVCbGVuZEZ1bmMoYi5tQmxlbmRTcmMubUlELCBiLm1CbGVuZERzdC5tSUQpOworICAgICAgICAgICAgcnMublByb2dyYW1TdG9y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nVpbGRlcihycyk7CisgICAgICAgICAgICBiLnNldE1pbihWYWx1ZS5ORUFSRVNUKTsKKyAgICAgICAgICAgIGIuc2V0TWFnKFZhbHVlLk5FQVJFU1QpOworICAgICAgICAgICAgYi5zZXRXcmFwUyhWYWx1ZS5XUkFQKTsKKyAgICAgICAgICAgIGIuc2V0V3JhcFQoVmFsdWUuV1JBUCk7CisgICAgICAgICAgICBycy5tU2FtcGxlcl9XUkFQX05FQVJFU1QgPSBiLmNyZWF0ZSgpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tU2FtcGxlcl9XUkFQX05FQVJFU1Q7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBTYW1wbGVyIFdSQVBfTElORUFSKFJlbmRlclNjcmlwdCBycykgeworICAgICAgICBpZihycy5tU2FtcGxlcl9XUkFQX0xJTkVBUiA9PSBudWxsKSB7CisgICAgICAgICAgICBCdWlsZGVyIGIgPSBuZXcgQnVpbGRlcihycyk7CisgICAgICAgICAgICBiLnNldE1pbihWYWx1ZS5MSU5FQVIpOworICAgICAgICAgICAgYi5zZXRNYWcoVmFsdWUuTElORUFSKTsKKyAgICAgICAgICAgIGIuc2V0V3JhcFMoVmFsdWUuV1JBUCk7CisgICAgICAgICAgICBiLnNldFdyYXBUKFZhbHVlLldSQVApOworICAgICAgICAgICAgcnMubVNhbXBsZXJfV1JBUF9MSU5FQVIgPSBiLmNyZWF0ZSgpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tU2FtcGxlcl9XUkFQX0xJTkVBUjsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIFNhbXBsZXIgV1JBUF9MSU5FQVJfTUlQX0xJTkVBUihSZW5kZXJTY3JpcHQgcnMpIHsKKyAgICAgICAgaWYocnMubVNhbXBsZXJfV1JBUF9MSU5FQVJfTUlQX0xJTkVBUiA9PSBudWxsKSB7CisgICAgICAgICAgICBCdWlsZGVyIGIgPSBuZXcgQnVpbGRlcihycyk7CisgICAgICAgICAgICBiLnNldE1pbihWYWx1ZS5MSU5FQVJfTUlQX0xJTkVBUik7CisgICAgICAgICAgICBiLnNldE1hZyhWYWx1ZS5MSU5FQVJfTUlQX0xJTkVBUik7CisgICAgICAgICAgICBiLnNldFdyYXBTKFZhbHVlLldSQVApOworICAgICAgICAgICAgYi5zZXRXcmFwVChWYWx1ZS5XUkFQKTsKKyAgICAgICAgICAgIHJzLm1TYW1wbGVyX1dSQVBfTElORUFSX01JUF9MSU5FQVIgPSBiLmNyZWF0ZSgpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBycy5tU2FtcGxlcl9XUkFQX0xJTkVBUl9NSVBfTElORUFSOworICAgIH0KKworCiAgICAgcHVibGljIHN0YXRpYyBjbGFzcyBCdWlsZGVyIHsKICAgICAgICAgUmVuZGVyU2NyaXB0IG1SUzsKICAgICAgICAgVmFsdWUgbU1pbjsKZGlmZiAtLWdpdCBhL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvU2NyaXB0LmphdmEgYi9ncmFwaGljcy9qYXZhL2FuZHJvaWQvcmVuZGVyc2NyaXB0L1NjcmlwdC5qYXZhCmluZGV4IDU3Y2NmYTMuLmJlYWM5OTcgMTAwNjQ0Ci0tLSBhL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvU2NyaXB0LmphdmEKKysrIGIvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9TY3JpcHQuamF2YQpAQCAtNDIsNiArNDIsMTkgQEAKICAgICAgICAgfQogICAgIH0KIAorICAgIHByb3RlY3RlZCB2b2lkIGludm9rZShpbnQgc2xvdCkgeworICAgICAgICBtUlMublNjcmlwdEludm9rZShtSUQsIHNsb3QpOworICAgIH0KKworICAgIHByb3RlY3RlZCB2b2lkIGludm9rZShpbnQgc2xvdCwgRmllbGRQYWNrZXIgdikgeworICAgICAgICBpZiAodiAhPSBudWxsKSB7CisgICAgICAgICAgICBtUlMublNjcmlwdEludm9rZVYobUlELCBzbG90LCB2LmdldERhdGEoKSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtUlMublNjcmlwdEludm9rZShtSUQsIHNsb3QpOworICAgICAgICB9CisgICAgfQorCisKICAgICBTY3JpcHQoaW50IGlkLCBSZW5kZXJTY3JpcHQgcnMpIHsKICAgICAgICAgc3VwZXIocnMpOwogICAgICAgICBtSUQgPSBpZDsKQEAgLTQ5LDIyICs2MiwyMyBAQAogCiAgICAgcHVibGljIHZvaWQgYmluZEFsbG9jYXRpb24oQWxsb2NhdGlvbiB2YSwgaW50IHNsb3QpIHsKICAgICAgICAgbVJTLnZhbGlkYXRlKCk7Ci0gICAgICAgIG1SUy5uU2NyaXB0QmluZEFsbG9jYXRpb24obUlELCB2YS5tSUQsIHNsb3QpOworICAgICAgICBpZiAodmEgIT0gbnVsbCkgeworICAgICAgICAgICAgbVJTLm5TY3JpcHRCaW5kQWxsb2NhdGlvbihtSUQsIHZhLm1JRCwgc2xvdCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtUlMublNjcmlwdEJpbmRBbGxvY2F0aW9uKG1JRCwgMCwgc2xvdCk7CisgICAgICAgIH0KICAgICB9CiAKLSAgICBwdWJsaWMgdm9pZCBzZXRDbGVhckNvbG9yKGZsb2F0IHIsIGZsb2F0IGcsIGZsb2F0IGIsIGZsb2F0IGEpIHsKLSAgICAgICAgbVJTLnZhbGlkYXRlKCk7Ci0gICAgICAgIG1SUy5uU2NyaXB0U2V0Q2xlYXJDb2xvcihtSUQsIHIsIGcsIGIsIGEpOworICAgIHB1YmxpYyB2b2lkIHNldFZhcihpbnQgaW5kZXgsIGZsb2F0IHYpIHsKKyAgICAgICAgbVJTLm5TY3JpcHRTZXRWYXJGKG1JRCwgaW5kZXgsIHYpOwogICAgIH0KIAotICAgIHB1YmxpYyB2b2lkIHNldENsZWFyRGVwdGgoZmxvYXQgZCkgewotICAgICAgICBtUlMudmFsaWRhdGUoKTsKLSAgICAgICAgbVJTLm5TY3JpcHRTZXRDbGVhckRlcHRoKG1JRCwgZCk7CisgICAgcHVibGljIHZvaWQgc2V0VmFyKGludCBpbmRleCwgaW50IHYpIHsKKyAgICAgICAgbVJTLm5TY3JpcHRTZXRWYXJJKG1JRCwgaW5kZXgsIHYpOwogICAgIH0KIAotICAgIHB1YmxpYyB2b2lkIHNldENsZWFyU3RlbmNpbChpbnQgc3RlbmNpbCkgewotICAgICAgICBtUlMudmFsaWRhdGUoKTsKLSAgICAgICAgbVJTLm5TY3JpcHRTZXRDbGVhclN0ZW5jaWwobUlELCBzdGVuY2lsKTsKKyAgICBwdWJsaWMgdm9pZCBzZXRWYXIoaW50IGluZGV4LCBGaWVsZFBhY2tlciB2KSB7CisgICAgICAgIG1SUy5uU2NyaXB0U2V0VmFyVihtSUQsIGluZGV4LCB2LmdldERhdGEoKSk7CiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgc2V0VGltZVpvbmUoU3RyaW5nIHRpbWVab25lKSB7CkBAIC03OCw3MiArOTIsNTQgQEAKIAogICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgQnVpbGRlciB7CiAgICAgICAgIFJlbmRlclNjcmlwdCBtUlM7Ci0gICAgICAgIGJvb2xlYW4gbUlzUm9vdCA9IGZhbHNlOwotICAgICAgICBUeXBlW10gbVR5cGVzOwotICAgICAgICBTdHJpbmdbXSBtTmFtZXM7Ci0gICAgICAgIGJvb2xlYW5bXSBtV3JpdGFibGU7Ci0gICAgICAgIGludCBtSW52b2thYmxlQ291bnQgPSAwOwotICAgICAgICBJbnZva2FibGVbXSBtSW52b2thYmxlczsKIAogICAgICAgICBCdWlsZGVyKFJlbmRlclNjcmlwdCBycykgewogICAgICAgICAgICAgbVJTID0gcnM7Ci0gICAgICAgICAgICBtVHlwZXMgPSBuZXcgVHlwZVtNQVhfU0xPVF07Ci0gICAgICAgICAgICBtTmFtZXMgPSBuZXcgU3RyaW5nW01BWF9TTE9UXTsKLSAgICAgICAgICAgIG1Xcml0YWJsZSA9IG5ldyBib29sZWFuW01BWF9TTE9UXTsKLSAgICAgICAgICAgIG1JbnZva2FibGVzID0gbmV3IEludm9rYWJsZVtNQVhfU0xPVF07CiAgICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgdm9pZCBzZXRUeXBlKFR5cGUgdCwgaW50IHNsb3QpIHsKLSAgICAgICAgICAgIG1UeXBlc1tzbG90XSA9IHQ7Ci0gICAgICAgICAgICBtTmFtZXNbc2xvdF0gPSBudWxsOwotICAgICAgICB9Ci0KLSAgICAgICAgcHVibGljIHZvaWQgc2V0VHlwZShUeXBlIHQsIFN0cmluZyBuYW1lLCBpbnQgc2xvdCkgewotICAgICAgICAgICAgbVR5cGVzW3Nsb3RdID0gdDsKLSAgICAgICAgICAgIG1OYW1lc1tzbG90XSA9IG5hbWU7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgSW52b2thYmxlIGFkZEludm9rYWJsZShTdHJpbmcgZnVuYykgewotICAgICAgICAgICAgSW52b2thYmxlIGkgPSBuZXcgSW52b2thYmxlKCk7Ci0gICAgICAgICAgICBpLm1OYW1lID0gZnVuYzsKLSAgICAgICAgICAgIGkubVJTID0gbVJTOwotICAgICAgICAgICAgaS5tU2xvdCA9IG1JbnZva2FibGVDb3VudDsKLSAgICAgICAgICAgIG1JbnZva2FibGVzW21JbnZva2FibGVDb3VudCsrXSA9IGk7Ci0gICAgICAgICAgICByZXR1cm4gaTsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldFR5cGUoYm9vbGVhbiB3cml0YWJsZSwgaW50IHNsb3QpIHsKLSAgICAgICAgICAgIG1Xcml0YWJsZVtzbG90XSA9IHdyaXRhYmxlOwotICAgICAgICB9Ci0KLSAgICAgICAgdm9pZCB0cmFuc2ZlckNyZWF0ZSgpIHsKLSAgICAgICAgICAgIG1SUy5uU2NyaXB0U2V0Um9vdChtSXNSb290KTsKLSAgICAgICAgICAgIGZvcihpbnQgY3Q9MDsgY3QgPCBtVHlwZXMubGVuZ3RoOyBjdCsrKSB7Ci0gICAgICAgICAgICAgICAgaWYobVR5cGVzW2N0XSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1SUy5uU2NyaXB0U2V0VHlwZShtVHlwZXNbY3RdLm1JRCwgbVdyaXRhYmxlW2N0XSwgbU5hbWVzW2N0XSwgY3QpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZvcihpbnQgY3Q9MDsgY3QgPCBtSW52b2thYmxlQ291bnQ7IGN0KyspIHsKLSAgICAgICAgICAgICAgICBtUlMublNjcmlwdFNldEludm9rYWJsZShtSW52b2thYmxlc1tjdF0ubU5hbWUsIGN0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHZvaWQgdHJhbnNmZXJPYmplY3QoU2NyaXB0IHMpIHsKLSAgICAgICAgICAgIHMubUlzUm9vdCA9IG1Jc1Jvb3Q7Ci0gICAgICAgICAgICBzLm1UeXBlcyA9IG1UeXBlczsKLSAgICAgICAgICAgIHMubUludm9rYWJsZXMgPSBuZXcgSW52b2thYmxlW21JbnZva2FibGVDb3VudF07Ci0gICAgICAgICAgICBmb3IoaW50IGN0PTA7IGN0IDwgbUludm9rYWJsZUNvdW50OyBjdCsrKSB7Ci0gICAgICAgICAgICAgICAgcy5tSW52b2thYmxlc1tjdF0gPSBtSW52b2thYmxlc1tjdF07Ci0gICAgICAgICAgICAgICAgcy5tSW52b2thYmxlc1tjdF0ubVNjcmlwdCA9IHM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzLm1JbnZva2FibGVzID0gbnVsbDsKLSAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYyB2b2lkIHNldFJvb3QoYm9vbGVhbiByKSB7Ci0gICAgICAgICAgICBtSXNSb290ID0gcjsKLSAgICAgICAgfQotCiAgICAgfQogCisKKyAgICBwdWJsaWMgc3RhdGljIGNsYXNzIEZpZWxkQmFzZSB7CisgICAgICAgIHByb3RlY3RlZCBFbGVtZW50IG1FbGVtZW50OworICAgICAgICBwcm90ZWN0ZWQgVHlwZSBtVHlwZTsKKyAgICAgICAgcHJvdGVjdGVkIEFsbG9jYXRpb24gbUFsbG9jYXRpb247CisKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgaW5pdChSZW5kZXJTY3JpcHQgcnMsIGludCBkaW14KSB7CisgICAgICAgICAgICBtQWxsb2NhdGlvbiA9IEFsbG9jYXRpb24uY3JlYXRlU2l6ZWQocnMsIG1FbGVtZW50LCBkaW14KTsKKyAgICAgICAgICAgIG1UeXBlID0gbUFsbG9jYXRpb24uZ2V0VHlwZSgpOworICAgICAgICB9CisKKyAgICAgICAgcHJvdGVjdGVkIEZpZWxkQmFzZSgpIHsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBFbGVtZW50IGdldEVsZW1lbnQoKSB7CisgICAgICAgICAgICByZXR1cm4gbUVsZW1lbnQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgVHlwZSBnZXRUeXBlKCkgeworICAgICAgICAgICAgcmV0dXJuIG1UeXBlOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEFsbG9jYXRpb24gZ2V0QWxsb2NhdGlvbigpIHsKKyAgICAgICAgICAgIHJldHVybiBtQWxsb2NhdGlvbjsKKyAgICAgICAgfQorCisgICAgICAgIC8vQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIHVwZGF0ZUFsbG9jYXRpb24oKSB7CisgICAgICAgIH0KKworCisgICAgICAgIC8vCisgICAgICAgIC8qCisgICAgICAgIHB1YmxpYyBjbGFzcyBTY3JpcHRGaWVsZF9Vc2VyRmllbGQKKyAgICAgICAgICAgIGV4dGVuZHMgYW5kcm9pZC5yZW5kZXJzY3JpcHQuU2NyaXB0LkZpZWxkQmFzZSB7CisKKyAgICAgICAgICAgIHByb3RlY3RlZAorCisgICAgICAgIH0KKworICAgICAgICA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AgICAgICB3aGlsZSh0cnVlKSB7CisgICAgICAgICAgICAgICAgICAgIGludCBieXRlc0xlZnQgPSBwZ20ubGVuZ3RoIC0gcGdtTGVuZ3RoOworICAgICAgICAgICAgICAgICAgICBpZiAoYnl0ZXNMZWZ0ID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVbXSBidWYyID0gbmV3IGJ5dGVbcGdtLmxlbmd0aCAqIDJdOworICAgICAgICAgICAgICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShwZ20sIDAsIGJ1ZjIsIDAsIHBnbS5sZW5ndGgpOworICAgICAgICAgICAgICAgICAgICAgICAgcGdtID0gYnVmMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGVzTGVmdCA9IHBnbS5sZW5ndGggLSBwZ21MZW5ndGg7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaW50IGJ5dGVzUmVhZCA9IGlzLnJlYWQocGdtLCBwZ21MZW5ndGgsIGJ5dGVzTGVmdCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChieXRlc1JlYWQgPD0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcGdtTGVuZ3RoICs9IGJ5dGVzUmVhZDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgICAgIGlzLmNsb3NlKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2goSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJlc291cmNlcy5Ob3RGb3VuZEV4Y2VwdGlvbigpOworICAgICAgICB9CisKKyAgICAgICAgcnMublNjcmlwdENCZWdpbigpOworICAgICAgICBycy5uU2NyaXB0Q1NldFNjcmlwdChwZ20sIDAsIHBnbUxlbmd0aCk7CisgICAgICAgIHJldHVybiBycy5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RklOQUwgfCBNb2RpZmllci5QVUJMSUMpLCBudWxsKTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qKgotICAgICAgICAgKiBUYWtlcyB0aGUgYWxsIHB1YmxpYyBmaWVsZHMgZm9yIGFuIG9iamVjdCwgYW5kIGFkZHMgZGVmaW5lcwotICAgICAgICAgKiBmb3IgdGhlbSwgdXNpbmcgdGhlIG5hbWUgb2YgdGhlIGZpZWxkIGFzIHRoZSBuYW1lIG9mIHRoZSBkZWZpbmUuCi0gICAgICAgICAqLwotICAgICAgICBwdWJsaWMgdm9pZCBhZGREZWZpbmVzKE9iamVjdCBvKSB7Ci0gICAgICAgICAgICBhZGREZWZpbmVzKG8uZ2V0Q2xhc3MoKS5nZXRGaWVsZHMoKSwgTW9kaWZpZXIuUFVCTElDLCBvKTsKLSAgICAgICAgfQotCi0gICAgICAgIHZvaWQgYWRkRGVmaW5lcyhGaWVsZFtdIGZpZWxkcywgaW50IG1hc2ssIE9iamVjdCBvKSB7Ci0gICAgICAgICAgICBmb3IgKEZpZWxkIGY6IGZpZWxkcykgewotICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgoZi5nZXRNb2RpZmllcnMoKSAmIG1hc2spID09IG1hc2spIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIENsYXNzIHQgPSBmLmdldFR5cGUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ID09IGludC5jbGFzcykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1JbnREZWZpbmVzLnB1dChmLmdldE5hbWUoKSwgZi5nZXRJbnQobykpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodCA9PSBmbG9hdC5jbGFzcykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GbG9hdERlZmluZXMucHV0KGYuZ2V0TmFtZSgpLCBmLmdldEZsb2F0KG8pKTsKLSAgICAgICAgIC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isgICAgcHVibGljIHNob3J0IHg7CisgICAgcHVibGljIHNob3J0IHk7CisgICAgcHVibGljIHNob3J0IHo7CisgICAgcHVibGljIHNob3J0IHc7CiB9CiAKIAogCi0KZGlmZiAtLWdpdCBhL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvU2ltcGxlTWVzaC5qYXZhIGIvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9TaW1wbGVNZXNoLmphdmEKaW5kZXggNGEyMTdhOS4uMzhkMDczNiAxMDA2NDQKLS0tIGEvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9TaW1wbGVNZXNoLmphdmEKKysrIGIvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9TaW1wbGVNZXNoLmphdmEKQEAgLTMxMywzNiArMzEzLDI2IEBACiAgICAgICAgIHB1YmxpYyBTaW1wbGVNZXNoIGNyZWF0ZSgpIHsKICAgICAgICAgICAgIEVsZW1lbnQuQnVpbGRlciBiID0gbmV3IEVsZW1lbnQuQnVpbGRlcihtUlMpOwogICAgICAgICAgICAgaW50IGZsb2F0Q291bnQgPSBtVnR4U2l6ZTsKLSAgICAgICAgICAgIGIuYWRkKEVsZW1lbnQuY3JlYXRlQXR0cmliKG1SUywKKyAgICAgICAgICAgIGIuYWRkKEVsZW1lbnQuY3JlYXRlVmVjdG9yKG1SUywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsZW1lbnQuRGF0YVR5cGUuRkxPQVRfMzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGVtZW50LkRhdGFLaW5kLlBPU0lUSU9OLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVZ0eFNpemUpLCAicG9zaXRpb24iKTsKICAgICAgICAgICAgIGlmICgobUZsYWdzICYgQ09MT1IpICE9IDApIHsKICAgICAgICAgICAgICAgICBmbG9hdENvdW50ICs9IDQ7Ci0gICAgICAgICAgICAgICAgYi5hZGQoRWxlbWVudC5jcmVhdGVBdHRyaWIobVJTLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsZW1lbnQuRGF0YVR5cGUuRkxPQVRfMzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxlbWVudC5EYXRhS2luZC5DT0xPUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0KSwgImNvbG9yIik7CisgICAgICAgICAgICAgICAgYi5hZGQoRWxlbWVudC5GMzJfNChtUlMpLCAiY29sb3IiKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmICgobUZsYWdzICYgVEVYVFVSRV8wKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgZmxvYXRDb3VudCArPSAyOwotICAgICAgICAgICAgICAgIGIuYWRkKEVsZW1lbnQuY3JlYXRlQXR0cmliKG1SUywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFbGVtZW50LkRhdGFUeXBlLkZMT0FUXzMyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsZW1lbnQuRGF0YUtpbmQuVEVYVFVSRSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyKSwgInRleHR1cmUiKTsKKyAgICAgICAgICAgICAgICBiLmFkZChFbGVtZW50LkYzMl8yKG1SUyksICJ0ZXh0dXJlMCIpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKChtRmxhZ3MgJiBOT1JNQUwpICE9IDApIHsKICAgICAgICAgICAgICAgICBmbG9hdENvdW50ICs9IDM7Ci0gICAgICAgICAgICAgICAgYi5hZGQoRWxlbWVudC5jcmVhdGVBdHRyaWIobVJTLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVsZW1lbnQuRGF0YVR5cGUuRkxPQVRfMzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRWxlbWVudC5EYXRhS2luZC5OT1JNQUwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMyksICJub3JtYWwiKTsKKyAgICAgICAgICAgICAgICBiLmFkZChFbGVtZW50LkYzMl8zKG1SUyksICJub3JtYWwiKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIG1FbGVtZW50ID0gYi5jcmVhdGUoKTsKIAogICAgICAgICAgICAgQnVpbGRlciBzbWIgPSBuZXcgQnVpbGRlcihtUlMpOwogICAgICAgICAgICAgc21iLmFkZFZlcnRleFR5cGUobUVsZW1lbnQsIG1WdHhDb3VudCAvIGZsb2F0Q291bnQpOwotICAgICAgICAgICAgc21iLnNldEluZGV4VHlwZShFbGVtZW50LmNyZWF0ZUluZGV4KG1SUyksIG1JbmRleENvdW50KTsKKyAgICAgICAgICAgIHNtYi5zZXRJbmRleFR5cGUoRWxlbWVudC5VMTYobVJTKSwgbUluZGV4Q291bnQpOwogICAgICAgICAgICAgc21iLnNldFByaW1pdGl2ZShQcmltaXRpdmUuVFJJQU5HTEUpOwogICAgICAgICAgICAgU2ltcGxlTWVzaCBzbSA9IHNtYi5jcmVhdGUoKTsKIApkaWZmIC0tZ2l0IGEvZ3JhcGhpY3MvamF2YS9hbmRyb2lkL3JlbmRlcnNjcmlwdC9UeXBlLmphdmEgYi9ncmFwaGljcy9qYXZhL2FuZHJvaWQvcmVuZGVyc2NyaXB0L1R5cGUuamF2YQppbmRleCA2MmQzODY3Li4xNDQyMmIyIDEwMDY0NAotLS0gYS9ncmFwaGljcy9qYXZhL2FuZHJvaWQvcmVuZGVyc2NyaXB0L1R5cGUuamF2YQorKysgYi9ncmFwaGljcy9qYXZhL2FuZHJvaWQvcmVuZGVyc2NyaXB0L1R5cGUuamF2YQpAQCAtMTA4LDQ4ICsxMDgsOSBAQAogICAgICAgICBzdXBlci5maW5hbGl6ZSgpOwogICAgIH0KIAotICAgIHB1YmxpYyBzdGF0aWMgVHlwZSBjcmVhdGVGcm9tQ2xhc3MoUmVuZGVyU2NyaXB0IHJzLCBDbGFzcyBjLCBpbnQgc2l6ZSkgewotICAgICAgICBFbGVtZW50IGUgPSBFbGVtZW50LmNyZWF0ZUZyb21DbGFzcyhycywgYyk7Ci0gICAgICAgIEJ1aWxkZXIgYiA9IG5ldyBCdWlsZGVyKHJzLCBlKTsKLSAgICAgICAgYi5hZGQoRGltZW5zaW9uLlgsIHNpemUpOwotICAgICAgICBUeXBlIHQgPSBiLmNyZWF0ZSgpOwotICAgICAgICBlLmRlc3Ryb3koKTsKLQotICAgICAgICAvLyBuYXRpdmUgZmllbGRzCi0gICAgICAgIHsKLSAgICAgICAgICAgIEZpZWxkW10gZmllbGRzID0gYy5nZXRGaWVsZHMoKTsKLSAgICAgICAgICAgIGludFtdIGFyVHlwZXMgPSBuZXcgaW50W2ZpZWxkcy5sZW5ndGhdOwotICAgICAgICAgICAgaW50W10gYXJCaXRzID0gbmV3IGludFtmaWVsZHMubGVuZ3RoXTsKLQotICAgICAgICAgICAgZm9yKGludCBjdD0wOyBjdCA8IGZpZWxkcy5sZW5ndGg7IGN0KyspIHsKLSAgICAgICAgICAgICAgICBGaWVsZCBmID0gZmllbGRzW2N0XTsKLSAgICAgICAgICAgICAgICBDbGFzcyBmYyA9IGYuZ2V0VHlwZSgpOwotICAgICAgICAgICAgICAgIGlmKGZjID09IGludC5jbGFzcykgewotICAgICAgICAgICAgICAgICAgICBhclR5cGVzW2N0XSA9IEVsZW1lbnQuRGF0YVR5cGUuU0lHTkVEXzMyLm1JRDsKLSAgICAgICAgICAgICAgICAgICAgYXJCaXRzW2N0XSA9IDMyOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZihmYyA9PSBzaG9ydC5jbGFzcykgewotICAgICAgICAgICAgICAgICAgICBhclR5cGVzW2N0XSA9IEVsZW1lbnQuRGF0YVR5cGUuU0lHTkVEXzE2Lm1JRDsKLSAgICAgICAgICAgICAgICAgICAgYXJCaXRzW2N0XSA9IDE2OwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZihmYyA9PSBieXRlLmNsYXNzKSB7Ci0gICAgICAgICAgICAgICAgICAgIGFyVHlwZXNbY3RdID0gRWxlbWVudC5EYXRhVHlwZS5TSUdORURfOC5tSUQ7Ci0gICAgICAgICAgICAgICAgICAgIGFyQml0c1tjdF0gPSA4OwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZihmYyA9PSBmbG9hdC5jbGFzcykgewotICAgICAgICAgICAgICAgICAgICBhclR5cGVzW2N0XSA9IEVsZW1lbnQuRGF0YVR5cGUuRkxPQVRfMzIubUlEOwotICAgICAgICAgICAgICAgICAgICBhckJpdHNbY3RdID0gMzI7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVW5rb3duIGZpZWxkIHR5cGUiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBycy5uVHlwZVNldHVwRmllbGRzKHQsIGFyVHlwZXMsIGFyQml0cywgZmllbGRzKTsKLSAgICAgICAgfQotICAgICAgICB0Lm1KYXZhQ2xhc3MgPSBjOwotICAgICAgICByZXR1cm4gdDsKLSAgICB9Ci0KICAgICBwdWJsaWMgc3RhdGljIFR5cGUgY3JlYXRlRnJvbUNsYXNzKFJlbmRlclNjcmlwdCBycywgQ2xhc3MgYywgaW50IHNpemUsIFN0cmluZyBzY3JpcHROYW1lKSB7Ci0gICAgICAgIFR5cGUgdCA9IGNyZWF0ZUZyb21DbGFzcyhycywgYywgc2l6ZSk7Ci0gICAgICAgIHQuc2V0TmFtZShzY3JpcHROYW1lKTsKLSAgICAgICAgcmV0dXJuIHQ7CisgICAgICAgIGFuZHJvaWQudXRp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dWKCJfX19fX19uRmlsZUEzRCBOdW1FbnRyaWVzICV1IiwgKHVpbnQzMl90KSBudW1FbnRyaWVzKTsKKyAgICByZXR1cm4gbnVtRW50cmllczsKK30KKworc3RhdGljIHZvaWQKK25GaWxlQTNER2V0SW5kZXhFbnRyaWVzKEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgamludCBmaWxlQTNELCBqaW50IG51bUVudHJpZXMsIGppbnRBcnJheSBfaWRzLCBqb2JqZWN0QXJyYXkgX2VudHJpZXMpCit7CisgICAgTE9HVigiX19fX19fbkZpbGVBM0QgJXUiLCAodWludDMyX3QpIGZpbGVBM0QpOworICAgIFJzQ29udGV4dCBjb24gPSAoUnNDb250ZXh0KShfZW52LT5HZXRJbnRGaWVsZChfdGhpcywgZ0NvbnRleHRJZCkpOworCisgICAgUnNGaWxlSW5kZXhFbnRyeSAqZmlsZUVudHJpZXMgPSAoUnNGaWxlSW5kZXhFbnRyeSopbWFsbG9jKCh1aW50MzJfdCludW1FbnRyaWVzICogc2l6ZW9mKFJzRmlsZUluZGV4RW50cnkpKTsKKworICAgIHJzRmlsZUEzREdldEluZGV4RW50cmllcyhjb24sIGZpbGVFbnRyaWVzLCAodWludDMyX3QpbnVtRW50cmllcywgKFJzRmlsZSlmaWxlQTNEKTsKKworICAgIGZvcihqaW50IGkgPSAwOyBpIDwgbnVtRW50cmllczsgaSArKykgeworICAgICAgICBfZW52LT5TZXRPYmplY3RBcnJheUVsZW1lbnQoX2VudHJpZXMsIGksIF9lbnYtPk5ld1N0cmluZ1VURihmaWxlRW50cmllc1tpXS5vYmplY3ROYW1lKSk7CisgICAgICAgIF9lbnYtPlNldEludEFycmF5UmVnaW9uKF9pZHMsIGksIDEsIChjb25zdCBqaW50KikmZmlsZUVudHJpZXNbaV0uY2xhc3NJRCk7CisgICAgfQorCisgICAgZnJlZShmaWxlRW50cmllcyk7Cit9CisKK3N0YXRpYyBpbnQKK25GaWxlQTNER2V0RW50cnlCeUluZGV4KEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywgamludCBmaWxlQTNELCBqaW50IGluZGV4KQoreworICAgIExPR1YoIl9fX19fX25GaWxlQTNEICV1IiwgKHVpbnQzMl90KSBmaWxlQTNEKTsKKyAgICBSc0NvbnRleHQgY29uID0gKFJzQ29udGV4dCkoX2Vudi0+R2V0SW50RmllbGQoX3RoaXMsIGdDb250ZXh0SWQpKTsKKworICAgIGppbnQgaWQgPSAoamludClyc0ZpbGVBM0RHZXRFbnRyeUJ5SW5kZXgoY29uLCAodWludDMyX3QpaW5kZXgsIChSc0ZpbGUpZmlsZUEzRCk7CisgICAgcmV0dXJuIGlkOworfQorCisvLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCitzdGF0aWMgaW50CituRm9udENyZWF0ZUZyb21GaWxlKEpOSUVudiAqX2Vudiwgam9iamVjdCBfdGhpcywganN0cmluZyBmaWxlTmFtZSwgamludCBmb250U2l6ZSwgamludCBkcGkpCit7CisgICAgUnNDb250ZXh0IGNvbiA9IChSc0NvbnRleHQpKF9lbnYtPkdldEludEZpZWxkKF90aGlzLCBnQ29udGV4dElkKSk7CisgICAgY29uc3QgY2hhciogZmlsZU5hbWVVVEYgPSBfZW52LT5HZXRTdHJpbmdVVEZDaGFycyhmaWxlTmFtZSwgTlVMTCk7CisKKyAgICBqaW50IGlkID0gKGppbnQpcnNGb250Q3JlYXRlRnJvbUZpbGUoY29uLCBmaWxlTmFtZVVURiwgZm9udFNpemUsIGRwaSk7CisgICAgcmV0dXJuIGlkOworfQorCiAKIC8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAKQEAgLTg1NCwyOSArOTI4LDMzIEBACiB9CiAKIHN0YXRpYyB2b2lkCi1uU2NyaXB0U2V0Q2xlYXJDb2xvcihKTklFbnYgKl9lbnYsIGpvYmplY3QgX3RoaXMsIGppbnQgc2NyaXB0LCBqZmxvYXQgciwgamZsb2F0IG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ICAgICAgICAgICAgICh2b2lkKiluRGV2aWNlU2V0Q29uZmlnIH0sCiB7Im5Db250ZXh0Q3JlYXRlIiwgICAgICAgICAgICAgICAgICIoSUkpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRDcmVhdGUgfSwKIHsibkNvbnRleHRDcmVhdGVHTCIsICAgICAgICAgICAgICAgIihJSVopSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dENyZWF0ZUdMIH0sCit7Im5Db250ZXh0RmluaXNoIiwgICAgICAgICAgICAgICAgICIoKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRGaW5pc2ggfSwKIHsibkNvbnRleHRTZXRQcmlvcml0eSIsICAgICAgICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dFNldFByaW9yaXR5IH0sCiB7Im5Db250ZXh0U2V0U3VyZmFjZSIsICAgICAgICAgICAgICIoSUlMYW5kcm9pZC92aWV3L1N1cmZhY2U7KVYiLCAgICAgICAgICAodm9pZCopbkNvbnRleHRTZXRTdXJmYWNlIH0sCiB7Im5Db250ZXh0RGVzdHJveSIsICAgICAgICAgICAgICAgICIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHREZXN0cm95IH0sCkBAIC0xMzc1LDYgKzE0MDgsMTIgQEAKIHsibkNvbnRleHREZWluaXRUb0NsaWVudCIsICAgICAgICAgIigpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dERlaW5pdFRvQ2xpZW50IH0sCiAKIHsibkZpbGVPcGVuIiwgICAgICAgICAgICAgICAgICAgICAgIihbQilJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluRmlsZU9wZW4gfSwKK3sibkZpbGVBM0RDcmVhdGVGcm9tQXNzZXRTdHJlYW0iLCAiKEkpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5GaWxlQTNEQ3JlYXRlRnJvbUFzc2V0U3RyZWFtIH0sCit7Im5GaWxlQTNER2V0TnVtSW5kZXhFbnRyaWVzIiwgICAgICIoSSlJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkZpbGVBM0RHZXROdW1JbmRleEVudHJpZXMgfSwKK3sibkZpbGVBM0RHZXRJbmRleEVudHJpZXMiLCAgICAgICAgIihJSVtJW0xqYXZhL2xhbmcvU3RyaW5nOylWIiwgICAgICAgICAgKHZvaWQqKW5GaWxlQTNER2V0SW5kZXhFbnRyaWVzIH0sCit7Im5GaWxlQTNER2V0RW50cnlCeUluZGV4IiwgICAgICAgICIoSUkpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkZpbGVBM0RHZXRFbnRyeUJ5SW5kZXggfSwKKworeyJuRm9udENyZWF0ZUZyb21GaWxlIiwgICAgICAgICAgICIoTGphdmEvbGFuZy9TdHJpbmc7SUkpSSIsICAgICAgICAgICAgICh2b2lkKiluRm9udENyZWF0ZUZyb21GaWxlIH0sCiAKIHsibkVsZW1lbnRDcmVhdGUiLCAgICAgICAgICAgICAgICAgIihJSVpJKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluRWxlbWVudENyZWF0ZSB9LAogeyJuRWxlbWVudENyZWF0ZTIiLCAgICAgICAgICAgICAgICAiKFtJW0xqYXZhL2xhbmcvU3RyaW5nOylJIiwgICAgICAgICAgICAgKHZvaWQqKW5FbGVtZW50Q3JlYXRlMiB9LApAQCAtMTQyMCwyOCArMTQ1OSwyNCBAQAogeyJuQWRhcHRlcjJEQ3JlYXRlIiwgICAgICAgICAgICAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5BZGFwdGVyMkRDcmVhdGUgfSwKIAogeyJuU2NyaXB0QmluZEFsbG9jYXRpb24iLCAgICAgICAgICAiKElJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRCaW5kQWxsb2NhdGlvbiB9LAoteyJuU2NyaXB0U2V0Q2xlYXJDb2xvciIsICAgICAgICAgICAiKElGRkZGKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRTZXRDbGVhckNvbG9yIH0sCi17Im5TY3JpcHRTZXRDbGVhckRlcHRoIiwgICAgICAgICAgICIoSUYpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldENsZWFyRGVwdGggfSwKLXsiblNjcmlwdFNldENsZWFyU3RlbmNpbCIsICAgICAgICAgIihJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0U2V0Q2xlYXJTdGVuY2lsIH0sCiB7Im5TY3JpcHRTZXRUaW1lWm9uZSIsICAgICAgICAgICAgICIoSVtCKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldFRpbWVab25lIH0sCi17Im5TY3JpcHRTZXRUeXBlIiwgICAgICAgICAgICAgICAgICIoSVpMamF2YS9sYW5nL1N0cmluZztJKVYiLCAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldFR5cGUgfSwKLXsiblNjcmlwdFNldFJvb3QiLCAgICAgICAgICAgICAgICAgIihaKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0U2V0Um9vdCB9LAoteyJuU2NyaXB0U2V0SW52b2thYmxlIiwgICAgICAgICAgICAiKExqYXZhL2xhbmcvU3RyaW5nO0kpViIsICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRTZXRJbnZva2UgfSwKIHsiblNjcmlwdEludm9rZSIsICAgICAgICAgICAgICAgICAgIihJSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0SW52b2tlIH0sCit7Im5TY3JpcHRJbnZva2VWIiwgICAgICAgICAgICAgICAgICIoSUlbQilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdEludm9rZVYgfSwKK3siblNjcmlwdFNldFZhckkiLCAgICAgICAgICAgICAgICAgIihJSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0U2V0VmFySSB9LAoreyJuU2NyaXB0U2V0VmFyRiIsICAgICAgICAgICAgICAgICAiKElJRilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRTZXRWYXJGIH0sCit7Im5TY3JpcHRTZXRWYXJWIiwgICAgICAgICAgICAgICAgICIoSUlbQilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdFNldFZhclYgfSwKIAogeyJuU2NyaXB0Q0JlZ2luIiwgICAgICAgICAgICAgICAgICAiKClWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRDQmVnaW4gfSwKIHsiblNjcmlwdENTZXRTY3JpcHQiLCAgICAgICAgICAgICAgIihbQklJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0Q1NldFNjcmlwdCB9LAogeyJuU2NyaXB0Q0NyZWF0ZSIsICAgICAgICAgICAgICAgICAiKClJIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5TY3JpcHRDQ3JlYXRlIH0sCi17Im5TY3JpcHRDQWRkRGVmaW5lSTMyIiwgICAgICAgICAgICIoTGphdmEvbGFuZy9TdHJpbmc7SSlWIiwgICAgICAgICAgICAgICAodm9pZCopblNjcmlwdENBZGREZWZpbmVJMzIgfSwKLXsiblNjcmlwdENBZGREZWZpbmVGIiwgICAgICAgICAgICAgIihMamF2YS9sYW5nL1N0cmluZztGKVYiLCAgICAgICAgICAgICAgICh2b2lkKiluU2NyaXB0Q0FkZERlZmluZUYgfSwKIAoteyJuUHJvZ3JhbUZyYWdtZW50U3RvcmVCZWdpbiIsICAgICAiKElJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtRnJhZ21lbnRTdG9yZUJlZ2luIH0sCi17Im5Qcm9ncmFtRnJhZ21lbnRTdG9yZURlcHRoRnVuYyIsICIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1GcmFnbWVudFN0b3JlRGVwdGhGdW5jIH0sCi17Im5Qcm9ncmFtRnJhZ21lbnRTdG9yZURlcHRoTWFzayIsICIoWilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1GcmFnbWVudFN0b3JlRGVwdGhNYXNrIH0sCi17Im5Qcm9ncmFtRnJhZ21lbnRTdG9yZUNvbG9yTWFzayIsICIoWlpaWilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1GcmFnbWVudFN0b3JlQ29sb3JNYXNrIH0sCi17Im5Qcm9ncmFtRnJhZ21lbnRTdG9yZUJsZW5kRnVuYyIsICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1GcmFnbWVudFN0b3JlQmxlbmRGdW5jIH0sCi17Im5Qcm9ncmFtRnJhZ21lbnRTdG9yZURpdGhlciIsICAgICIoWilWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1GcmFnbWVudFN0b3JlRGl0aGVyIH0sCi17Im5Qcm9ncmFtRnJhZ21lbnRTdG9yZUNyZWF0ZSIsICAgICIoKUkiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1GcmFnbWVudFN0b3JlQ3JlYXRlIH0sCit7Im5Qcm9ncmFtU3RvcmVCZWdpbiIsICAgICAgICAgICAgICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1TdG9yZUJlZ2luIH0sCit7Im5Qcm9ncmFtU3RvcmVEZXB0aEZ1bmMiLCAgICAgICAgICIoSSlWIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1TdG9yZURlcHRoRnVuYyB9LAoreyJuUHJvZ3JhbVN0b3JlRGVwdGhNYXNrIiwgICAgICAgICAiKFopViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtU3RvcmVEZXB0aE1hc2sgfSwKK3siblByb2dyYW1TdG9yZUNvbG9yTWFzayIsICAgICAgICAgIihaWlpaKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbVN0b3JlQ29sb3JNYXNrIH0sCit7Im5Qcm9ncmFtU3RvcmVCbGVuZEZ1bmMiLCAgICAgICAgICIoSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopblByb2dyYW1TdG9yZUJsZW5kRnVuYyB9LAoreyJuUHJvZ3JhbVN0b3JlRGl0aGVyIiwgICAgICAgICAgICAiKFopViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Qcm9ncmFtU3RvcmVEaXRoZXIgfSwKK3siblByb2dyYW1TdG9yZUNyZWF0ZSIsICAgICAgICAgICAgIigpSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbVN0b3JlQ3JlYXRlIH0sCiAKIHsiblByb2dyYW1CaW5kQ29uc3RhbnRzIiwgICAgICAgICAgIihJSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUJpbmRDb25zdGFudHMgfSwKIHsiblByb2dyYW1CaW5kVGV4dHVyZSIsICAgICAgICAgICAgIihJSUkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluUHJvZ3JhbUJpbmRUZXh0dXJlIH0sCkBAIC0xNDY1LDcgKzE1MDAsNyBAQAogeyJuTGlnaHRTZXRQb3NpdGlvbiIsICAgICAgICAgICAgICAiKElGRkYpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5MaWdodFNldFBvc2l0aW9uIH0sCiAKIHsibkNvbnRleHRCaW5kUm9vdFNjcmlwdCIsICAgICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkKiluQ29udGV4dEJpbmRSb290U2NyaXB0IH0sCi17Im5Db250ZXh0QmluZFByb2dyYW1GcmFnbWVudFN0b3JlIiwiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCopbkNvbnRleHRCaW5kUHJvZ3JhbUZyYWdtZW50U3RvcmUgfSwKK3sibkNvbnRleHRCaW5kUHJvZ3JhbVN0b3JlIiwgICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0QmluZFByb2dyYW1TdG9yZSB9LAogeyJuQ29udGV4dEJpbmRQcm9ncmFtRnJhZ21lbnQiLCAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0QmluZFByb2dyYW1GcmFnbWVudCB9LAogeyJuQ29udGV4dEJpbmRQcm9ncmFtVmVydGV4IiwgICAgICAiKEkpViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQqKW5Db250ZXh0QmluZFByb2dyYW1WZXJ0ZXggfSwKIHsibkNvbnRleHRCaW5kUHJvZ3JhbVJhc3RlciIsICAgICAgIihJKVYiLCAgICAgICAgICAgICAgICAgICAgICAgICA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lIG51bWJlciBvZiBjaGFycyB3cml0dGVuIHRvIHRoZSBkZXN0aW5hdGlvbiBidWZmZXIuCisgICAgICogICBJZiBhbiBlcnJvciBvY2N1cnMsIHRoZW4gbm8gb3V0cHV0IHdhcyB3cml0dGVuLCBvciBpdCBtYXkgYmUKKyAgICAgKiAgIGluY29tcGxldGUuCisgICAgICogQHRocm93cyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uIGlmIHRoZSB0ZXh0IGNhbm5vdCBiZSBjb252ZXJ0ZWQgYWNjb3JkaW5nIHRvIHRoZSBvcHRpb25zLgorICAgICAqIEBzdGFibGUgSUNVIDIuMAorICAgICAqLworICAgIHB1YmxpYyBpbnQgc2hhcGUoY2hhcltdIHNvdXJjZSwgaW50IHNvdXJjZVN0YXJ0LCBpbnQgc291cmNlTGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgY2hhcltdIGRlc3QsIGludCBkZXN0U3RhcnQsIGludCBkZXN0U2l6ZSkgdGhyb3dzIEFyYWJpY1NoYXBpbmdFeGNlcHRpb24geworICAgICAgICBpZiAoc291cmNlID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oInNvdXJjZSBjYW4gbm90IGJlIG51bGwiKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoc291cmNlU3RhcnQgPCAwIHx8IHNvdXJjZUxlbmd0aCA8IDAgfHwgc291cmNlU3RhcnQgKyBzb3VyY2VMZW5ndGggPiBzb3VyY2UubGVuZ3RoKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJiYWQgc291cmNlIHN0YXJ0ICgiICsgc291cmNlU3RhcnQgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKSBvciBsZW5ndGggKCIgKyBzb3VyY2VMZW5ndGggKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKSBmb3IgYnVmZmVyIG9mIGxlbmd0aCAiICsgc291cmNlLmxlbmd0aCk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGRlc3QgPT0gbnVsbCAmJiBkZXN0U2l6ZSAhPSAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJudWxsIGRlc3QgcmVxdWlyZXMgZGVzdFNpemUgPT0gMCIpOworICAgICAgICB9CisgICAgICAgIGlmICgoZGVzdFNpemUgIT0gMCkgJiYKKyAgICAgICAgICAgIChkZXN0U3RhcnQgPCAwIHx8IGRlc3RTaXplIDwgMCB8fCBkZXN0U3RhcnQgKyBkZXN0U2l6ZSA+IGRlc3QubGVuZ3RoKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiYmFkIGRlc3Qgc3RhcnQgKCIgKyBkZXN0U3RhcnQgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKSBvciBzaXplICgiICsgZGVzdFNpemUgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiKSBmb3IgYnVmZmVyIG9mIGxlbmd0aCAiICsgZGVzdC5sZW5ndGgpOworICAgICAgICB9CisgICAgICAgIC8qIFZhbGlkYXRlIGlucHV0IG9wdGlvbnMgKi8KKyAgICAgICAgaWYgKCAoKG9wdGlvbnMmVEFTSEtFRUxfTUFTSykgPiAwKSAmJgorICAgICAgICAgICAgICEoKChvcHRpb25zICYgVEFTSEtFRUxfTUFTSyk9PVRBU0hLRUVMX0JFR0lOKSAgfHwKKyAgICAgICAgICAgICAgICgob3B0aW9ucyAmIFRBU0hLRUVMX01BU0spPT1UQVNIS0VFTF9FTkQgKSAgIHx8CisgICAgICAgICAgICAgICAoKG9wdGlvbnMgJiBUQVNIS0VFTF9NQVNLKT09VEFTSEtFRUxfUkVTSVpFICl8fAorICAgICAgICAgICAgICAgKChvcHRpb25zICYgVEFTSEtFRUxfTUFTSyk9PVRBU0hLRUVMX1JFUExBQ0VfQllfVEFUV0VFTCkpICl7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJXcm9uZyBUYXNoa2VlbCBhcmd1bWVudCIpOworICAgICAgICB9CisKKyAgICAgICAvLy9DTE9WRVI6T0ZGCisgICAgICAgLy9BY2NvcmRpbmcgdG8gU3RldmVuIExvb21pcywgdGhlIGNvZGUgaXMgdW5yZWFjaGFibGUgd2hlbiB5b3UgT1IgYWxsIHRoZSBjb25zdGFudHMgd2l0aGluIHRoZSBpZiBzdGF0ZW1lbnRzCisgICAgICAgaWYoKChvcHRpb25zJkxBTUFMRUZfTUFTSykgPiAwKSYmCisgICAgICAgICAgICAgICEoKChvcHRpb25zICYgTEFNQUxFRl9NQVNLKT09TEFNQUxFRl9CRUdJTikgIHx8CisgICAgICAgICAgICAgICAgKChvcHRpb25zICYgTEFNQUxFRl9NQVNLKT09TEFNQUxFRl9FTkQgKSAgIHx8CisgICAgICAgICAgICAgICAgKChvcHRpb25zICYgTEFNQUxFRl9NQVNLKT09TEFNQUxFRl9SRVNJWkUgKXx8CisgICAgICAgICAgICAgICAgICgob3B0aW9ucyAmIExBTUFMRUZfTUFTSyk9PUxBTUFMRUZfQVVUTykgIHx8CisgICAgICAgICAgICAgICAgICgob3B0aW9ucyAmIExBTUFMRUZfTUFTSyk9PUxBTUFMRUZfTkVBUikpKXsKKyAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiV3JvbmcgTGFtIEFsZWYgYXJndW1lbnQiKTsKKyAgICAgICB9CisgICAgICAgLy8vQ0xPVkVSOk9OCisKKyAgICAgICAvKiBWYWxpZGF0ZSBUYXNoa2VlbCAoVGFzaGtlZWwgcmVwbGFjZW1lbnQgb3B0aW9ucyBzaG91bGQgYmUgZW5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uPGJyPgorICAgICAqICdESUdJVF9UWVBFJyBmbGFncyBjb250cm9sIHdoZXRoZXIgc3RhbmRhcmQgb3IgZXh0ZW5kZWQgQXJhYmljLUluZGljCisgICAgICogZGlnaXRzIGFyZSB1c2VkIHdoZW4gcGVyZm9ybWluZyBkaWdpdCBjb252ZXJzaW9uLgorICAgICAqIEBzdGFibGUgSUNVIDIuMAorICAgICAqLworICAgIHB1YmxpYyBBcmFiaWNTaGFwaW5nKGludCBvcHRpb25zKSB7CisgICAgICAgIHRoaXMub3B0aW9ucyA9IG9wdGlvbnM7CisgICAgICAgIGlmICgob3B0aW9ucyAmIERJR0lUU19NQVNLKSA+IDB4ODApIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImJhZCBESUdJVFMgb3B0aW9ucyIpOworICAgICAgICB9CisKKyAgICAgICAgaXNMb2dpY2FsID0gKCAob3B0aW9ucyAmIFRFWFRfRElSRUNUSU9OX01BU0spID09IFRFWFRfRElSRUNUSU9OX0xPR0lDQUwgKTsKKyAgICAgICAgLyogVmFsaWRhdGUgb3B0aW9ucyAqLworICAgICAgICBzcGFjZXNSZWxhdGl2ZVRvVGV4dEJlZ2luRW5kID0gKCAob3B0aW9ucyAmIFNQQUNFU19SRUxBVElWRV9UT19URVhUX01BU0spID09IFNQQUNFU19SRUxBVElWRV9UT19URVhUX0JFR0lOX0VORCApOworICAgICAgICBpZiAoIChvcHRpb25zJlNIQVBFX1RBSUxfVFlQRV9NQVNLKSA9PSBTSEFQRV9UQUlMX05FV19VTklDT0RFKXsKKyAgICAgICAgICAgIHRhaWxDaGFyID0gTkVXX1RBSUxfQ0hBUjsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHRhaWxDaGFyID0gT0xEX1RBSUxfQ0hBUjsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIFNlZW4gVGFpbCBvcHRpb25zICovCisgICAgLyoqCisgICAgICogTWVtb3J5I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EFJTCBjb2RlIHBvaW50IChpLmUuIDB4MjAwQikgYW5kIGRlLXNoYXBlIHRoZQorICAgICAqIFNlZW4tRmFtaWx5IGxldHRlciBhY2NvcmRpbmdseS4KKyAgICAgKgorICAgICAqIFNoYXBpbmcgTW9kZTogT25seSBzaGFwaW5nLgorICAgICAqIERlLXNoYXBpbmcgTW9kZTogTi9BLgorICAgICAqIEFmZmVjdHM6IEFsbCBTZWVuIG9wdGlvbnMKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBTSEFQRV9UQUlMX05FV19VTklDT0RFID0gMHg4MDAwMDAwOworCisgICAgLyoqIEJpdCBtYXNrIGZvciBuZXcgVW5pY29kZSBUYWlsIG9wdGlvbiAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IFNIQVBFX1RBSUxfVFlQRV9NQVNLID0gMHg4MDAwMDAwOworCisgICAgLyoqCisgICAgICogTWVtb3J5IG9wdGlvbjogYWxsb3cgdGhlIHJlc3VsdCB0byBoYXZlIGEgZGlmZmVyZW50IGxlbmd0aCB0aGFuIHRoZSBzb3VyY2UuCisgICAgICogQHN0YWJsZSBJQ1UgMi4wCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgTEVOR1RIX0dST1dfU0hSSU5LID0gMDsKKworICAgIC8qKgorICAgICAqIE1lbW9yeSBvcHRpb246IGFsbG93IHRoZSByZXN1bHQgdG8gaGF2ZSBhIGRpZmZlcmVudCBsZW5ndGggdGhhbiB0aGUgc291cmNlLgorICAgICAqIEFmZmVjdHM6IExhbUFsZWYgb3B0aW9ucworICAgICAqIFRoaXMgb3B0aW9uIGlzIGFuIGFsaWFzIHRvIExFTkdUSF9HUk9XX1NIUklOSworICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IExBTUFMRUZfUkVTSVpFICAgPSAwOworCisgICAgLyoqCisgICAgICogTWVtb3J5IG9wdGlvbjogdGhlIHJlc3VsdCBtd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taW5nIHNwYWNlcyBpZiByZXF1aXJlZC4KKyAgICAgKiBAc3RhYmxlIElDVSAyLjAKKyAgICAgKi8KKyAgICBwdWJsaWMgc3RhdGljIGZpbmFsIGludCBMRVRURVJTX1VOU0hBUEUgPSAweDEwOworCisgICAgLyoqCisgICAgICogTGV0dGVyIHNoYXBpbmcgb3B0aW9uOiByZXBsYWNlIG5vcm1hdGl2ZSBsZXR0ZXIgY2hhcmFjdGVycyBpbiB0aGUgVSswNjAwIChBcmFiaWMpIGJsb2NrLAorICAgICAqIGV4Y2VwdCBmb3IgdGhlIFRBU0hLRUVMIGNoYXJhY3RlcnMgYXQgVSswNjRCLi4uVSswNjUyLCBieSBzaGFwZWQgb25lcyBpbiB0aGUgVStGZTcwCisgICAgICogKFByZXNlbnRhdGlvbiBGb3JtcyBCKSBibG9jay4gIFRoZSBUQVNIS0VFTCBjaGFyYWN0ZXJzIHdpbGwgYWx3YXlzIGJlIGNvbnZlcnRlZCB0bworICAgICAqIHRoZSBpc29sYXRlZCBmb3JtcyByYXRoZXIgdGhhbiB0byB0aGVpciBjb3JyZWN0IHNoYXBlLgorICAgICAqIEBzdGFibGUgSUNVIDIuMAorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IExFVFRFUlNfU0hBUEVfVEFTSEtFRUxfSVNPTEFURUQgPSAweDE4OworCisgICAgLyoqCisgICAgICogQml0IG1hc2sgZm9yIGxldHRlciBzaGFwaW5nIG9wdGlvbnMuCisgICAgICogQHN0YWJsZSBJQ1UgMi4wCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgTEVUVEVSU19NQVNLID0gMHgxODsKKworCisgICAgLyoqCisgICAgICogRGlnaXQgc2hhcGluZyBvcHRpb246IGRvIG5vdCBwZXJmb3JtIGRpZ2l0IHNoYXBpbmcuCisgICAgICogQHN0YWJsZSBJQ1UgMi4wCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBpbnQgRElHSV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pOyBicmVhazsKKyAgICAgICAgfQorICAgICAgICBzd2l0Y2ggKG9wdGlvbnMgJiBESUdJVF9UWVBFX01BU0spIHsKKyAgICAgICAgY2FzZSBESUdJVF9UWVBFX0FOOiBidWYuYXBwZW5kKCIsIHN0YW5kYXJkIEFyYWJpYy1JbmRpYyBkaWdpdHMiKTsgYnJlYWs7CisgICAgICAgIGNhc2UgRElHSVRfVFlQRV9BTl9FWFRFTkRFRDogYnVmLmFwcGVuZCgiLCBleHRlbmRlZCBBcmFiaWMtSW5kaWMgZGlnaXRzIik7IGJyZWFrOworICAgICAgICB9CisgICAgICAgIGJ1Zi5hcHBlbmQoIl0iKTsKKworICAgICAgICByZXR1cm4gYnVmLnRvU3RyaW5nKCk7CisgICAgfQorICAgIC8vL0NMT1ZFUjpPTgorCisgICAgLy8KKyAgICAvLyBwb3J0ZWQgYXBpCisgICAgLy8KKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBJUlJFTEVWQU5UID0gNDsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgTEFNVFlQRSA9IDE2OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBBTEVGVFlQRSA9IDMyOworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IExJTktSID0gMTsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgTElOS0wgPSAyOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBMSU5LX01BU0sgPSAzOworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IGlycmVsZXZhbnRQb3NbXSA9IHsKKyAgICAgICAgMHgwLCAweDIsIDB4NCwgMHg2LCAweDgsIDB4QSwgMHhDLCAweEUKKyAgICB9OworCisvKgorICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGNoYXIgY29udmVydExhbUFsZWZbXSA9ICB7CisgICAgICAgICdcdTA2MjInLCAvLyBGRUY1CisgICAgICAgICdcdTA2MjInLCAvLyBGRUY2CisgICAgICAgICdcdTA2MjMnLCAvLyBGRUY3CisgICAgICAgICdcdTA2MjMnLCAvLyBGRUY4CisgICAgICAgICdcdTA2MjUnLCAvLyBGRUY5CisgICAgICAgICdcdTA2MjUnLCAvLyBGRUZBCisgICAgICAgICdcdTA2MjcnLCAvLyBGRUZCCisgICAgICAgICdcdTA2MjcnICAvLyBGRUZDCisgICAgfTsKKyovCisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgdGFpbEZhbWlseUlzb2xhdGVkRmluYWxbXSA9IHsKKyAgICAgICAgLyogRkVCMSAqLyAxLAorICAgICAgICAvKiBGRUIyICovIDEsCisgICAgICAgIC8qIEZFQjMgKi8gMCwKKyAgICAgICAgLyogRkVCNCAqLyAwLAorICAgICAgICAvKiBGRUI1ICovIDEsCisgICAgICAgIC8qIEZFQjYgKi8gMSwKKyAgICAgICAgLyogRkVCNyAqLyAwLAorICAgICAgICAvKiBGRUI4ICovIDAsCisgICAgICAgIC8qIEZFQjkgKi8gMSwKKyAgICAgICAgLyogRkVCQSAqLyAxLAorICAgICAgICAvKiBGRUJCICovIDAsCisgICAgICAgIC8qIEZFQkMgKi8gMCwKKyAgICAgICAgLyogRkVCRCAqLyAxLAorICAgICAgICAvKiBGRUJFICovIDEKKyAgICB9OworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IHRhc2hrZWVsTWVkaWFsW10gPSB7CisgICAgICAgIC8qIEZFNzAgKi8gMCwKKyAgICAgICAgLyogRkU3MSAqLyAxLAorICAgICAgICAvKiBGRTcyICovIDAsCisgICAgICAgIC8qIEZFNzMgKi8gMCwKKyAgICAgICAgLyogRkU3NCAqLyAwLAorICAgICAgICAvKiBGRTc1ICovIDAsCisgICAgICAgIC8qIEZFNzYgKi8gMCwKKyAgICAgICAgLyogRkU3NyAqLyAxLAorICAgICAgICAvKiBGRTc4ICovIDAsCisgICAgICAgIC8qIEZFNzkgKi8gMSwKKyAgICAgICAgLyogRkU3QSAqLyAwLAorICAgICAgICAvKiBGRTdCICovIDEsCisgICAgICAgIC8qIEZFN0MgKi8gMCwKKyAgICAgICAgLyogRkU3RCAqLyAxLAorICAgICAgICAvKiBGRTdFICovIDAsCisgICAgICAgIC8qIEZFN0YgKi8gMQorICAgIH07CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBjaGFyIHllaEhhbXphVG9ZZWhbXSA9CisgICAgeworICAgIC8qIGlzb2xhdGVkKi8gMHhGRUVGLAorICAgIC8qIGZpbmFsICAgKi8gMHhGRUYwCisgICAgfTsKKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGNoYXIgY29udmVydE5vcm1hbGl6ZWRMYW1BbGVmW10gPSB7CisgICAgICAgICdcdTA2MjInLCAvLyAwNjVDCisgICAgICAgICdcdTA2MjMnLCAvLyAwNjVECisgICAgICAgICdcdTA2MjUnLCAvLyAwNjVFCisgICAgICAgICdcdTA2MjcnLCAvLyAwNjVGCisgICAgfTsKKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludFtdIGFyYUxpbmsgPSB7CisgICAgICAgIDEgICAgICAgICAgICsgMzIgKyAyNTYgKiAweDExLCAgLyoweDA2MjIqLworICAgICAgICAxICAgICAgICAgICArIDMyICsgMjU2ICogMHgxMywgIC8qMHgwNjIzKi8KKyAgICAgICAgMSAgICAgICAgICAgICAgICArIDI1NiAqIDB4MTUsICAvKjB4MDYyNCovCisgICAgICAgIDEgICAgICAgICAgICsgMzIgKyAyNTYgKiAweDE3LCAgLyoweDA2MjUqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHgxOSwgIC8qMHgwNjI2Ki8KKyAgICAgICAgMSAgICAgICAgICAgKyAzMiArIDI1NiAqIDB4MUQsICAvKjB4MDYyNyovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDFGLCAgLyoweDA2MjgqLworICAgICAgICAxICAgICAgICAgICAgICAgICsgMjU2ICogMHgyMywgIC8qMHgwNjI5Ki8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4MjUsICAvKjB4MDYyQSovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDI5LCAgLyoweDA2MkIqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHgyRCwgIC8qMHgwNjJDKi8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4MzEsICAvKjB4MDYyRCovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDM1LCAgLyoweDA2MkUqLworICAgICAgICAxICAgICAgICAgICAgICAgICsgMjU2ICogMHgzOSwgIC8qMHgwNjJGKi8KKyAgICAgICAgMSAgICAgICAgICAgICAgICArIDI1NiAqIDB4M0IsICAvKjB4MDYzMCovCisgICAgICAgIDEgICAgICAgICAgICAgICAgKyAyNTYgKiAweDNELCAgLyoweDA2MzEqLworICAgICAgICAxICAgICAgICAgICAgICAgICsgMjU2ICogMHgzRiwgIC8qMHgwNjMyKi8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NDEsICAvKjB4MDYzMyovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDQ1LCAgLyoweDA2MzQqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg0OSwgIC8qMHgwNjM1Ki8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NEQsICAvKjB4MDYzNiovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDUxLCAgLyoweDA2MzcqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg1NSwgIC8qMHgwNjM4Ki8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NTksICAvKjB4MDYzOSovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDVELCAgLyoweDA2M0EqLworICAgICAgICAwLCAwLCAwLCAwLCAwLCAgICAgICAgICAgICAgICAgIC8qMHgwNjNCLTB4MDYzRiovCisgICAgICAgIDEgKyAyLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyoweDA2NDAqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg2MSwgIC8qMHgwNjQxKi8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NjUsICAvKjB4MDY0MiovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDY5LCAgLyoweDA2NDMqLworICAgICAgICAxICsgMiAgICAgICArIDE2ICsgMjU2ICogMHg2RCwgIC8qMHgwNjQ0Ki8KKyAgICAgICAgMSArIDIgICAgICAgICAgICArIDI1NiAqIDB4NzEsICAvKjB4MDY0NSovCisgICAgICAgIDEgKyAyICAgICAgICAgICAgKyAyNTYgKiAweDc1LCAgLyoweDA2NDYqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg3OSwgIC8qMHgwNjQ3Ki8KKyAgICAgICAgMSAgICAgICAgICAgICAgICArIDI1NiAqIDB4N0QsICAvKjB4MDY0OCovCisgICAgICAgIDEgICAgICAgICAgICAgICAgKyAyNTYgKiAweDdGLCAgLyoweDA2NDkqLworICAgICAgICAxICsgMiAgICAgICAgICAgICsgMjU2ICogMHg4MSwgIC8qMHgwNjRBKi8KKyAgICAgICAgNCwgNCwgNCwgNCwgICAgICAgICAgICAgICAgICAgICAvKjB4MDY0Qi0weDA2NEUqLworICAgICAgICA0LCA0LCA0LCA0LCAgICAgICAgICAgICAgICAgICAgIC8qMHgwNjRGLTB4MDY1MiovCisgICAgICAgIDQsIDQsIDQsIDAsIDAsICAgICAgICAgICAgICAgICAgLyoweDA2NTMtMHgwNjU3Ki8KKyAgICAgICAgMCwgMCwgMCwgMCwgICAgICAgICAgICAgICAgICAgICAvKjB4MDY1OC0weDA2NUIqLworICAgICAgICAxICAgICAgICAgICAgICAgICsgMjU2ICogMHg4NSwgIC8qMHgwNjVDKi8KKyAgICAgICAgMSAgICAgICAgICAgICAgICArIDI1NiAqIDB4ODcsICAvKjB4MDY1RCovCisgICAgICAgIDEgICAgICAgICAgICAgICAgKyAyNTYgKiAweDg5LCAgLyoweDA2NUUqLworICAgICAgICAxICAgICAgICAgICAgICAgICsgMjU2ICogMHg4QiwgIC8qMHgwNjVGKi8KKyAgICAgICAgMCwgMCwgMCwgMCwgMCwgICAgICAgICAgICAgICAgICAvKjB4MDY2MC0weDA2NjQqLworICAgICAgICAwLCAwLCAwLCAwLCAwLCAgICAgICAgICAgICAgICAgIC8qMHgwNjY1LTB4MDY2OSovCisgICAgICAgIDAsIDAsIDAsIDAsIDAsIDAsICAgICAgICAgICAgICAgLyoweDA2NkEtMHgwNjZGKi8KKyAgICAgICAgNCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKjB4MDY3MCovCisgICAgICAgIDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoweDA2NzEqLworICAgICAgICAxICAgICAgICAgICArIDMyLCAgICAgICAgICAgICAgIC8qMHgwNjcyKi8KKyAgICAgICAgMSAgICAgICAgICAgKyAzMiwgICAgICAgICAgICAgICAvKjB4MDY3MyovCisgICAgICAgIDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoweDA2NzQqLworICAgICAgICAxICAgICAgICAgICArIDMyLCAgICAgICAgICAgICAgIC8qMHgwNjc1Ki8KKyAgICAgICAgMSwgMSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKjB4MDY3Ni0weDA2NzcqLworICAgICAgICAxKzIsIDErMiwgMSsyLCAxKzIsIDErMiwgMSsyLCAgIC8qMHgwNjc4LTB4MDY3RCovCisgICAgICAgIDErMiwgMSsyLCAxKzIsIDErMiwgMSsyLCAxKzIsICAgLyoweDA2N0UtMHgwNjgzKi8KKyAgICAgICAgMSsyLCAxKzIsIDErMiwgMSsyLCAgICAgICAgICAgICAvKjB4MDY4NC0weDA2ODcqLworICAgICAgICAxLCAxLCAxLCAxLCAxLCAxLCAxLCAxLCAxLCAxLCAgIC8qMHgwNjg4LTB4MDY5MSovCisgICAgICAgIDEsIDEsIDEsIDEsIDEsIDEsIDEsIDEsICAgICAgICAgLyoweDA2OTItMHgwNjk5Ki8KKyAgICAgICAgMSsyLCAxKzIsIDErMiwgMSsyLCAxKzIsIDErMiwgICAvKjB4MDY5QS0weDA2QTMqLworICAgICAgICAxKzIsIDErMiwgMSsyLCAxKzIsICAgICAgICAgICAgIC8qMHgwNjlBLTB4MDZBMyovCisgICAgICAgIDErMiwgMSsyLCAxKzIsIDErMiwgMSsyLCAxKzIsICAgLyoweDA2QTQtMHgwNkFEKi8KKyAgICAgICAgMSsyLCAxKzIsIDErMiwgMSsyLCAgICAgICAgICAgICAvKjB4MDZBNC0weDA2QUQqLworICAgICAgICAxKzIsIDErMiwgMSsyLCAxKzIsIDErMiwgMSsyLCAgIC8qMHgwNkFFLTB4MDZCNyovCisgICAgICAgIDErMiwgMSsyLCAxKzIsIDErMiwgICAgICAgICAgICAgLyoweDA2QUUtMHgwNkI3Ki8KKyAgICAgICAgMSsyLCAxKzIsIDErMiwgMSsyLCAxKzIsIDErMiwgICAvKjB4MDZCOC0weDA2QkYqLworICAgICAgICAxKzIsIDErMiwgICAgICAgICAgICAgICAgICAgICAgIC8qMHgwNkI4LTB4MDZCRiovCisgICAgICAgIDEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoweDA2QzAqLworICAgICAgICAxKzIsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qMHgwNkMxKi8KKyAgICAgICAgMSwgMSwgMSwgMSwgMSwgMSwgMSwgMSwgMSwgMSwgICAvKjB4MDZDMi0weDA2Q0IqLworICAgICAgICAxKzIsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qMHgwNkNDKi8KKyAgICAgICAgMSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKjB4MDZDRCovCisgICAgICAgIDErMiwgMSsyLCAxKzIsIDErMiwgICAgICAgICAgICAgLyoweDA2Q0UtMHgwNkQxKi8KKyAgICAgICAgMSwgMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKjB4MDZEMi0weDA2RDMqLworICAgIH07CisKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnRbXSBwcmVzTGluayA9IHsKKyAgICAgICAgMSArIDIsICAgICAgICAgICAgICAgICAgICAgICAgLyoweEZFNzAqLworICAgICAgICAxICsgMiwgICAgICAgICAgICAgICAgICAgICAgICAvKjB4RkU3MSovCisgICAgICAgIDEgKyAyLCAwLCAxKyAyLCAwLCAxKyAyLCAgICAgIC8qMHhGRTcyLTB4RkU3NiovCisgICAgICAgIDEgKyAyLCAgICAgICAgICAgICAgICAgICAgICAgIC8qMHhGRTc3Ki8KKyAgICAgICAgMSsgMiwgMSArIDIsIDErMiwgMSArIDIsICAgICAgLyoweEZFNzgtMHhGRTgxKi8KKyAgICAgICAgMSsgMiwgMSArIDIsIDErMiwgMSArIDIsICAgICAgLyoweEZFODItMHhGRTg1Ki8KKyAgICAgICAgMCwgMCArIDMyLCAxICsgMzIsIDAgKyAzMiwgICAgLyoweEZFODYtMHhGRTg5Ki8KKyAgICAgICAgMSArIDMyLCAwLCAxLCAgMCArIDMyLCAgICAgICAgLyoweEZFOEEtMHhGRThEKi8KKyAgICAgICAgMSArIDMyLCAwLCAyLCAgMSArIDIsICAgICAgICAgLyoweEZFOEUtMHhGRTkxKi8KKyAgICAgICAgMSwgMCArIDMyLCAxICsgMzIsIDAsICAgICAgICAgLyoweEZFOTItMHhGRTk1Ki8KKyAgICAgICAgMiwgMSArIDIsIDEsIDAsICAgICAgICAgICAgICAgLyoweEZFOTYtMHhGRTk5Ki8KKyAgICAgICAgMSwgMCwgMiwgMSArIDIsICAgICAgICAgICAgICAgLyoweEZFOUEtMHhGRTlEKi8KKyAgICAgICAgMSwgMCwgMiwgMSArIDIsICAgICAgICAgICAgICAgLyoweEZFOUUtMHhGRUExKi8KKyAgICAgICAgMSwgMCwgMiwgMSArIDIsICAgICAgICAgICAgICAgLyoweEZFQTItMHhGRUE1Ki8KKyAgICAgICAgMSwgMCwgMiwgMSArIDIsICAgICAgICAgICAgICAgLyoweEZFQTYtMHhGRUE5Ki8KKyAgICAgICAgMSwgMCwgMiwgMSArIDIsICAgICAgICAgICAgICAgLyoweEZFQUEtMHhGRUFEKi8KKyAgICAgICAgMSwgMCwgMSwgMCwgICAgICAgICAgICAgICAgICAgLyoweEZFQUUtMHhGRUIxKi8KKyAgICAgICAgMSwgMCwgMSwgMCwgICAgICAgICAgICAgICAgICAgLyoweEZFQjItMHhGRUI1Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQjYtMHhGRUI5Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQkEtMHhGRUJEKi8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQkUtMHhGRUMxKi8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQzItMHhGRUM1Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQzYtMHhGRUM5Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQ0EtMHhGRUNEKi8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFQ0UtMHhGRUQxKi8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFRDItMHhGRUQ1Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFRDYtMHhGRUQ5Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFREEtMHhGRUREKi8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFREUtMHhGRUUxKi8KKyAgICAgICAgMSwgMCArIDE2LCAyICsgMTYsIDEgKyAyICsxNiwgLyoweEZFRTItMHhGRUU1Ki8KKyAgICAgICAgMSArIDE2LCAwLCAyLCAxKzIsICAgICAgICAgICAgLyoweEZFRTYtMHhGRUU5Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFRUEtMHhGRUVEKi8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFRUUtMHhGRUYxKi8KKyAgICAgICAgMSwgMCwgMSwgMCwgICAgICAgICAgICAgICAgICAgLyoweEZFRjItMHhGRUY1Ki8KKyAgICAgICAgMSwgMCwgMiwgMSsyLCAgICAgICAgICAgICAgICAgLyoweEZFRjYtMHhGRUY5Ki8KKyAgICAgICAgMSwgMCwgMSwgMCwgICAgICAgICAgICAgICAgICAgLyoweEZFRkEtMHhGRUZEKi8KKyAgICAgICAgMSwgMCwgMSwgMCwKKyAgICAgICAgMQorICAgIH07CisKKyAgICBwcml2YXRlIHN0YXRpYyBpbnRbXSBjb252ZXJ0RkV0bzA2ID0geworICAgICAgICAvKioqKioqKioqKiowKioqKioqMSoqKioqKjIqKioqKiozKioqKioqNCoqKioqKjUqKioqKio2KioqKioqNyoqKioqKjgqKioqKio5KioqKioqQSoqKioqKkIqKioqKipDKioqKioqRCoqKioqKkUqKioqKipGKioqLworICAgICAgICAvKkZFNyovICAgMHg2NEIsIDB4NjRCLCAweDY0QywgMHg2NEMsIDB4NjRELCAweDY0RCwgMHg2NEUsIDB4NjRFLCAweDY0RiwgMHg2NEYsIDB4NjUwLCAweDY1MCwgMHg2NTEsIDB4NjUxLCAweDY1MiwgMHg2NTIsCisgICAgICAgIC8qRkU4Ki8gICAweDYyMSwgMHg2MjIsIDB4NjIyLCAweDYyMywgMHg2MjMsIDB4NjI0L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g2NDcsIDB4NjQ3LCAweDY0NywgMHg2NDgsIDB4NjQ4LCAweDY0OSwKKyAgICAgICAgLypGRUYqLyAgIDB4NjQ5LCAweDY0QSwgMHg2NEEsIDB4NjRBLCAweDY0QSwgMHg2NUMsIDB4NjVDLCAweDY1RCwgMHg2NUQsIDB4NjVFLCAweDY1RSwgMHg2NUYsIDB4NjVGCisgICAgfTsKKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBzaGFwZVRhYmxlW11bXVtdID0geworICAgICAgICB7IHswLDAsMCwwfSwgezAsMCwwLDB9LCB7MCwxLDAsM30sIHswLDEsMCwxfSB9LAorICAgICAgICB7IHswLDAsMiwyfSwgezAsMCwxLDJ9LCB7MCwxLDEsMn0sIHswLDEsMSwzfSB9LAorICAgICAgICB7IHswLDAsMCwwfSwgezAsMCwwLDB9LCB7MCwxLDAsM30sIHswLDEsMCwzfSB9LAorICAgICAgICB7IHswLDAsMSwyfSwgezAsMCwxLDJ9LCB7MCwxLDEsMn0sIHswLDEsMSwzfSB9CisgICAgfTsKKworICAgIC8qCisgICAgICogVGhpcyBmdW5jdGlvbiBzaGFwZXMgRXVyb3BlYW4gZGlnaXRzIHRvIEFyYWJpYy1JbmRpYyBkaWdpdHMKKyAgICAgKiBpbi1wbGFjZSwgd3JpdGluZyBvdmVyIHRoZSBpbnB1dCBjaGFyYWN0ZXJzLiAgRGF0YSBpcyBpbiB2aXN1YWwKKyAgICAgKiBvcmRlci4KKyAgICAgKi8KKyAgICBwcml2YXRlIHZvaWQgc2hhcGVUb0FyYWJpY0RpZ2l0c1dpdGhDb250ZXh0KGNoYXJbXSBkZXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgZGlnaXRCYXNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBsYXN0U3Ryb25nV2FzQUwpIHsKKyAgICAgICAgZGlnaXRCYXNlIC09ICcwJzsgLy8gbW92ZSBjb21tb24gYWRqdXN0bWVudCBvdXQgb2YgbG9vcAorCisgICAgICAgIGZvcihpbnQgaSA9IHN0YXJ0ICsgbGVuZ3RoOyAtLWkgPj0gc3RhcnQ7KSB7CisgICAgICAgICAgICBjaGFyIGNoID0gZGVzdFtpXTsKKyAgICAgICAgICAgIHN3aXRjaCAoQ2hhcmFjdGVyLmdldERpcmVjdGlvbmFsaXR5KGNoKSkgeworICAgICAgICAgICAgY2FzZSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfTEVGVF9UT19SSUdIVDoKKyAgICAgICAgICAgIGNhc2UgQ2hhcmFjdGVyLkRJUkVDVElPTkFMSVRZX1JJR0hUX1RPX0xFRlQ6CisgICAgICAgICAgICAgICAgbGFzdFN0cm9uZ1dhc0FMID0gZmFsc2U7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIENoYXJhY3Rlci5ESVJFQ1RJT05BTElUWV9SSUdIVF9UT19MRUZUX0FSQUJJQzoKKyAgICAgICAgICAgICAgICBsYXN0U3Ryb25nV2FzQUwgPSB0cnVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBDaGFyYWN0ZXIuRElSRUNUSU9OQUxJVFlfRVVST1BFQU5fTlVNQkVSOgorICAgICAgICAgICAgICAgIGlmIChsYXN0U3Ryb25nV2FzQUwgJiYgY2ggPD0gJ1x1MDAzOScpIHsKKyAgICAgICAgICAgICAgICAgICAgZGVzdFtpXSA9IChjaGFyKShjaCArIGRpZ2l0QmFzZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICA6IGludmVydEJ1ZmZlcgorICAgICAqIEZ1bmN0aW9uOiBUaGlzIGZ1bmN0aW9uIGludmVydHMgdGhlIGJ1ZmZlciwgaXQncyB1c2VkCisgICAgICogICAgICAgICAgIGluIGNhc2UgdGhlIHVzZXIgc3BlY2lmaWVzIHRoZSBidWZmZXIgdG8gYmUKKyAgICAgKiAgICAgICAgICAgVEVYVF9ESVJFQ1RJT05fTE9HSUNBTAorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIHZvaWQgaW52ZXJ0QnVmZmVyKGNoYXJbXSBidWZmZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBsZW5ndGgpIHsKKworICAgICAgICBmb3IoaW50IGkgPSBzdGFydCwgaiA9IHN0YXJ0ICsgbGVuZ3RoIC0gMTsgaSA8IGo7IGkrKywgLS1qKSB7CisgICAgICAgICAgICBjaGFyIHRlbXAgPSBidWZmZXJbaV07CisgICAgICAgICAgICBidWZmZXJbaV0gPSBidWZmZXJbal07CisgICAgICAgICAgICBidWZmZXJbal0gPSB0ZW1wOworICAgICAgICB9CisgICAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogY2hhbmdlTGFtQWxlZgorICAgICAqIEZ1bmN0aW9uOiBDb252ZXJ0cyB0aGUgQWxlZiBjaGFyYWN0ZXJzIGludG8gYW4gZXF1aXZhbGVudAorICAgICAqICAgICAgICAgICBMYW1BbGVmIGxvY2F0aW9uIGluIHRoZSAweDA2eHggUmFuZ2UsIHRoaXMgaXMgYW4KKyAgICAgKiAgICAgICAgICAgaW50ZXJtZWRpYXRlIHN0YWdlIGluIHRoZSBvcGVyYXRpb24gb2YgdGhlIHByb2dyYW0KKyAgICAgKiAgICAgICA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AmJiBjaCA8ICdcdTA2NEEnKSB8fAorICAgICAgICAgICAgKGNoID09ICdcdTA2MjknKSkgeworICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgIH0gZWxzZSBpZiAoY2ggPj0gJ1x1MDY0QicgJiYgY2g8PSAnXHUwNjUyJykgeworICAgICAgICAgICAgcmV0dXJuIDI7CisgICAgICAgIH0gZWxzZSBpZiAoY2ggPj0gMHgwNjUzICYmIGNoIDw9IDB4MDY1NSB8fAorICAgICAgICAgICAgICAgICAgIGNoID09IDB4MDY3MCB8fAorICAgICAgICAgICAgICAgICAgIGNoID49IDB4RkU3MCAmJiBjaCA8PSAweEZFN0YpIHsKKyAgICAgICAgICAgIHJldHVybiAzOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWUgICAgOiBnZXRMaW5rCisgICAgICogRnVuY3Rpb246IFJlc29sdmVzIHRoZSBsaW5rIGJldHdlZW4gdGhlIGNoYXJhY3RlcnMgYXMKKyAgICAgKiAgICAgICAgICAgQXJhYmljIGNoYXJhY3RlcnMgaGF2ZSBmb3VyIGZvcm1zIDoKKyAgICAgKiAgICAgICAgICAgSXNvbGF0ZWQsIEluaXRpYWwsIE1pZGRsZSBhbmQgRmluYWwgRm9ybQorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGludCBnZXRMaW5rKGNoYXIgY2gpIHsKKyAgICAgICAgaWYgKGNoID49ICdcdTA2MjInICYmIGNoIDw9ICdcdTA2RDMnKSB7CisgICAgICAgICAgICByZXR1cm4gYXJhTGlua1tjaCAtICdcdTA2MjInXTsKKyAgICAgICAgfSBlbHNlIGlmIChjaCA9PSAnXHUyMDBEJykgeworICAgICAgICAgICAgcmV0dXJuIDM7CisgICAgICAgIH0gZWxzZSBpZiAoY2ggPj0gJ1x1MjA2RCcgJiYgY2ggPD0gJ1x1MjA2RicpIHsKKyAgICAgICAgICAgIHJldHVybiA0OworICAgICAgICB9IGVsc2UgaWYgKGNoID49ICdcdUZFNzAnICYmIGNoIDw9ICdcdUZFRkMnKSB7CisgICAgICAgICAgICByZXR1cm4gcHJlc0xpbmtbY2ggLSAnXHVGRTcwJ107CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICA6IGNvdW50U3BhY2VzCisgICAgICogRnVuY3Rpb246IENvdW50cyB0aGUgbnVtYmVyIG9mIHNwYWNlcworICAgICAqICAgICAgICAgICBhdCBlYWNoIGVuZCBvZiB0aGUgbG9naWNhbCBidWZmZXIKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgY291bnRTcGFjZXNMZWZ0KGNoYXJbXSBkZXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50KSB7CisgICAgICAgIGZvciAoaW50IGkgPSBzdGFydCwgZSA9IHN0YXJ0ICsgY291bnQ7IGkgPCBlOyArK2kpIHsKKyAgICAgICAgICAgIGlmIChkZXN0W2ldICE9IFNQQUNFX0NIQVIpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gaSAtIHN0YXJ0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBjb3VudDsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgY291bnRTcGFjZXNSaWdodChjaGFyW10gZGVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50KSB7CisKKyAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0ICsgY291bnQ7IC0taSA+PSBzdGFydDspIHsKKyAgICAgICAgICAgIGlmIChkZXN0W2ldICE9IFNQQUNFX0NIQVIpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gc3RhcnQgKyBjb3VudCAtIDEgLSBpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBjb3VudDsKKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWUgICAgOiBpc1Rhc2hrZWVsQ2hhcgorICAgICAqIEZ1bmN0aW9uOiBSZXR1cm5zIHRydWUgZm9yIFRhc2hrZWVsIGNoYXJhY3RlcnMgZWxzZSByZXR1cm4gZmFsc2UKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGlzVGFzaGtlZWxDaGFyKGNoYXIgY2gpIHsKKyAgICAgICAgcmV0dXJuICggY2ggPj0nXHUwNjRCJyAmJiBjaCA8PSAnXHUwNjUyJyApOworICAgIH0KKworICAgIC8qCisgICAgICpOYW1lICAgICA6IGlzU2VlblRhaWxGYW1pbHlDaGFyCisgICAgICpGdW5jdGlvbiA6IHJldHVybnMgMSBpZiB0aGUgY2hhcmFjdGVyIGlzIGEgc2VlbiBmYW1pbHkgaXNvbGF0ZWQgY2hhcmFjdGVyCisgICAgICogICAgICAgICAgIGluIHRoZSBGRSByYW5nZSBvdGhlcndpc2UgcmV0dXJucyAwCisgICAgICovCisKKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgaXNTZWVuVGFpbEZhbWlseUNoYXIoY2hhciBjaCkgeworICAgICAgICBpZiAoY2ggPj0gMHhmZWIxICYmIGNoIDwgMHhmZWJmKXsKKyAgICAgICAgICAgICByZXR1cm4gdGFpbEZhbWlseUlzb2xhdGVkRmluYWwgW2NoIC0gMHhGRUIxXTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgIH0KKworICAgICAvKiBOYW1lICAgICA6IGlzU2VlbkZhbWlseUNoYXIKKyAgICAgICogRnVuY3Rpb24gOiByZXR1cm5zIDEgaWYgdGhlIGNoYXJhY3RlciBpcyBhIHNlZW4gZmFtaWx5IGNoYXJhY3RlciBpbiB0aGUgVW5pY29kZQorICAgICAgKiAgICAgICAgICAgIDA2IHJhbmdlIG90aGVyd2lzZSByZXR1cm5zIDAKKyAgICAgKi8KKworICAgIHByaXZhdGUgc3RhdGljIGludCBpc1NlZW5GYW1pbHlDaGFyKGNoYXIgIGNoKXsKKyAgICAgICAgaWYgKGNoID49IDB4NjMzICYmIGNoIDw9IDB4NjM2KXsKKyAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICB9ZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qCisgICAgICpOYW1lICAgICA6IGlzVGFpbENoYXIKKyAgICAgKkZ1bmN0aW9uIDogcmV0dXJucyB0cnVlIGlmIHRoZSBjaGFyYWN0ZXIgbWF0Y2hlcyBvbmUgb2YgdGhlIHRhaWwgY2hhcmFjdGVycworICAgICAqICAgICAgICAgICAoMHhmZTczIG9yIDB4MjAwYikgb3RoZXJ3aXNlIHJldHVybnMgZmFsc2UKKyAgICAgKi8KKworICAgIHByaXZhdGUgc3RhdGljIGJvb2xlYW4gaXNUYWlsQ2hhcihjaGFyIGNoKSB7CisgICAgICAgIGlmKGNoID09IE9MRF9UQUlMX0NIQVIgfHwgY2ggPT0gTkVXX1RBSUxfQ0hBUil7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qCisgICAgICpOYW1lICAgICA6IGlzQWxlZk1ha3NvdXJhQ2hhcgorICAgICAqRnVuY3Rpb24gOiByZXR1cm5zIHRydWUgaWYgdGhlIGNoYXJhY3RlciBpcyBhIEFsZWYgTWFrc291cmEgRmluYWwgb3IgaXNvbGF0ZWQKKyAgICAgKiAgICAgICAgICAgb3RoZXJ3aXNlIHJldHVybnMgZmFsc2UKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGlzQWxlZk1ha3NvdXJhQ2hhcihjaGFyIGNoKSB7CisgICAgICAgIHJldHVybiAoIChjaCA9PSAweEZFRUYpIHx8ICggY2ggPT0gMHhGRUYwKSB8fCAoY2ggPT0gMHgwNjQ5KSk7CisgICAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgICA6IGlzWWVoSGFtemFDaGFyCisgICAgICogRnVuY3Rpb24gOiByZXR1cm5zIHRydWUgaWYgdGhlIGNoYXJhY3RlciBpcyBhIHllaEhhbXphIGlzb2xhdGVkIG9yIHllaGhhbXphCisgICAgICogICAgICAgICAgICBmaW5hbCBpcyBmb3VuZCBvdGhlcndpc2UgcmV0dXJucyBmYWxzZQorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGJvb2xlYW4gaXNZZWhIYW16YUNoYXIoY2hhciBjaCkgeworICAgICAgICBpZigoY2g9PTB4RkU4OSl8fChjaD09MHhGRThBKSl7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfWVsc2V7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKgorICAgICAqTmFtZSAgICAgOiBpc1Rhc2hrZWVsQ2hhckZFCisgICAgICpGdW5jdGlvbiA6IFJldHVybnMgdHJ1ZSBmb3IgVGFzaGtlZWwgY2hhcmFjdGVycyBpbiBGRSByYW5nZSBlbHNlIHJldHVybiBmYWxzZQorICAgICAqLworCisgICAgcHJpdmF0ZSBzdGF0aWMgYm9vbGVhbiBpc1Rhc2hrZWVsQ2hhckZFKGNoYXIgY2gpIHsKKyAgICAgICAgcmV0dXJuICggY2ghPTB4RkU3NSAmJihjaD49MHhGRTcwICYmIGNoPD0gMHhGRTdGKSApOworICAgIH0KKworICAgIC8qCisgICAgICogTmFtZTogaXNUYXNoa2VlbE9uVGF0d2VlbENoYXIKKyAgICAgKiB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QorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGJvb2xlYW4gaXNMYW1BbGVmQ2hhcihjaGFyIGNoKSB7CisgICAgICAgIHJldHVybiBjaCA+PSAnXHVGRUY1JyAmJiBjaCA8PSAnXHVGRUZDJzsKKyAgICB9CisKKyAgICBwcml2YXRlIHN0YXRpYyBib29sZWFuIGlzTm9ybWFsaXplZExhbUFsZWZDaGFyKGNoYXIgY2gpIHsKKyAgICAgICAgcmV0dXJuIGNoID49ICdcdTA2NUMnICYmIGNoIDw9ICdcdTA2NUYnOworICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICA6IGNhbGN1bGF0ZVNpemUKKyAgICAgKiBGdW5jdGlvbjogVGhpcyBmdW5jdGlvbiBjYWxjdWxhdGVzIHRoZSBkZXN0U2l6ZSB0byBiZSB1c2VkIGluIHByZWZsaWdodGluZworICAgICAqICAgICAgICAgICB3aGVuIHRoZSBkZXN0U2l6ZSBpcyBlcXVhbCB0byAwCisgICAgICovCisgICAgcHJpdmF0ZSBpbnQgY2FsY3VsYXRlU2l6ZShjaGFyW10gc291cmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNvdXJjZVN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNvdXJjZUxlbmd0aCkgeworCisgICAgICAgIGludCBkZXN0U2l6ZSA9IHNvdXJjZUxlbmd0aDsKKworICAgICAgICBzd2l0Y2ggKG9wdGlvbnMgJiBMRVRURVJTX01BU0spIHsKKyAgICAgICAgY2FzZSBMRVRURVJTX1NIQVBFOgorICAgICAgICBjYXNlIExFVFRFUlNfU0hBUEVfVEFTSEtFRUxfSVNPTEFURUQ6CisgICAgICAgICAgICBpZiAoaXNMb2dpY2FsKSB7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IHNvdXJjZVN0YXJ0LCBlID0gc291cmNlU3RhcnQgKyBzb3VyY2VMZW5ndGggLSAxOyBpIDwgZTsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgoc291cmNlW2ldID09IExBTV9DSEFSICYmIGlzQWxlZkNoYXIoc291cmNlW2krMV0pKSB8fCBpc1Rhc2hrZWVsQ2hhckZFKHNvdXJjZVtpXSkpeworICAgICAgICAgICAgICAgICAgICAgICAgLS1kZXN0U2l6ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7IC8vIHZpc3VhbAorICAgICAgICAgICAgICAgIGZvcihpbnQgaSA9IHNvdXJjZVN0YXJ0ICsgMSwgZSA9IHNvdXJjZVN0YXJ0ICsgc291cmNlTGVuZ3RoOyBpIDwgZTsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgoc291cmNlW2ldID09IExBTV9DSEFSICYmIGlzQWxlZkNoYXIoc291cmNlW2ktMV0pKSB8fCBpc1Rhc2hrZWVsQ2hhckZFKHNvdXJjZVtpXSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC0tZGVzdFNpemU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIExFVFRFUlNfVU5TSEFQRToKKyAgICAgICAgICAgIGZvcihpbnQgaSA9IHNvdXJjZVN0YXJ0LCBlID0gc291cmNlU3RhcnQgKyBzb3VyY2VMZW5ndGg7IGkgPCBlOyArK2kpIHsKKyAgICAgICAgICAgICAgICBpZiAoaXNMYW1BbGVmQ2hhcihzb3VyY2VbaV0pKSB7CisgICAgICAgICAgICAgICAgICAgIGRlc3RTaXplKys7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGRlc3RTaXplOworICAgIH0KKworCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogY291bnRTcGFjZVN1YgorICAgICAqIEZ1bmN0aW9uOiBDb3VudHMgbnVtYmVyIG9mIHRpbWVzIHRoZSBzdWJDaGFyIGFwcGVhcnMgaW4gdGhlIGFycmF5CisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBpbnQgY291bnRTcGFjZVN1YihjaGFyIFtdIGRlc3QsaW50IGxlbmd0aCwgY2hhciBzdWJDaGFyKXsKKyAgICAgICAgaW50IGkgPSAwOworICAgICAgICBpbnQgY291bnQgPSAwOworICAgICAgICB3aGlsZSAoaSA8IGxlbmd0aCkgeworICAgICAgICAgIGlmIChkZXN0W2ldID09IHN1YkNoYXIpIHsKKyAgICAgICAgICAgICAgY291bnQrKzsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIGkrKzsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gY291bnQ7CisgICAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogc2hpZnRBcnJheQorICAgICAqIEZ1bmN0aW9uOiBTaGlmdHMgY2hhcmFjdGVycyB0byByZXBsYWNlIHNwYWNlIHN1YiBjaGFyYWN0ZXJzCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyB2b2lkIHNoaWZ0QXJyYXkoY2hhciBbXSBkZXN0LGludCBzdGFydCwgaW50IGUsIGNoYXIgc3ViQ2hhcil7CisgICAgICAgIGludCB3ID0gZTsKKyAgICAgICAgaW50IHIgPSBlOworICAgICAgICB3aGlsZSAoLS1yID49IHN0YXJ0KSB7CisgICAgICAgICAgY2hhciBjaCA9IGRlc3Rbcl07CisgICAgICAgICAgaWYgKGNoICE9IHN1YkNoYXIpIHsKKyAgICAgICAgICAgIC0tdzsKKyAgICAgICAgICAgIGlmICh3ICE9IHIpIHsKKyAgICAgICAgICAgICAgZGVzdFt3XSA9IGNoOworICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgfQorICAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogZmxpcEFycmF5CisgICAgICogRnVuY3Rpb246IGludmVydHMgYXJyYXksIHNvIHRoYXQgc3RhcnQgYmVjb21lcyBlbmQgYW5kIHZpY2UgdmVyc2EKKyAgICAgKi8KKyAgICAgIHB1YmxpYyBzdGF0aWMgaW50IGZsaXBBcnJheShjaGFyIFtdIGRlc3QsIGludCBzdGFydCwgaW50IGUsIGludCB3KXsKKyAgICAgICAgaW50IHI7CisgICAgICAgIGlmICh3ID4gc3RhcnQpIHsKKyAgICAgICAgLy8gc2hpZnQsIGFzc3VtZSBzbWFsbCBidWZmZXIgc2l6ZSBzbyBkb24ndCB1c2UgYXJyYXljb3B5CisgICAgICAgICAgciA9IHc7CisgICAgICAgICAgdyA9IHN0YXJ0OworICAgICAgICAgIHdoaWxlIChyIDwgZSkgeworICAgICAgICAgICAgZGVzdFt3KytdID0gZGVzdFtyKytdOworICAgICAgICAgICB9CisgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgIHcgPSBlOworICAgICAgICAgfQorICAgICAgICByZXR1cm4gdzsKKyAgICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICAgOiBoYW5kbGVUYXNoa2VlbFdpdGhUYXR3ZWVsCisgICAgICogRnVuY3Rpb24gOiBSZXBsYWNlcyBUYXNoa2VlbCBhcyBmb2xsb3dpbmc6CisgICAgICogICAgICAgICAgICBDYXNlIDEgOmlmIHRoZSBUYXNoa2VlbCBvbiB0YXR3ZWVsLCByZXBsYWNlIGl0IHdpdGggVGF0d2VlbC4KKyAgICAgKiAgICAgICAgICAgIENhc2UgMiA6aWYgdGhlIFRhc2hrZWVsIGFnZ3JlZ2F0ZWQgd2l0aCBTaGFkZGEgb24gVGF0d2VlbCwgcmVwbGFjZQorICAgICAqICAgICAgICAgICAgICAgICAgIGl0IHdpdGggU2hhZGRhIG9uIFRhdHdlZWwuCisgICAgICogICAgICAgICAgICBDYXNlIDM6IGlmIHRoZSBUYXNoa2VlbCBpcyBpc29sYXRlZCByZXBsYWNlIGl0IHdpdGggU3BhY2UuCisgICAgICoKKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBpbnQgaGFuZGxlVGFzaGtlZWxXaXRoVGF0d2VlbChjaGFyW10gZGVzdCwgaW50IHNvdXJjZUxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICAgaW50IGk7CisgICAgICAgICAgICAgICAgICAgICBmb3IoaSA9IDA7IGkgPCBzb3VyY2VMZW5ndGg7IGkrKyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgaWYoKGlzVGFzaGtlZWxPblRhdHdlZWxDaGFyKGRlc3RbaV0pID09IDEpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFtpXSA9IFRBVFdFRUxfQ0hBUjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKChpc1Rhc2hrZWVsT25UYXR3ZWVsQ2hhcihkZXN0W2ldKSA9PSAyKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbaV0gPSBTSEFEREFfVEFUV0VFTF9DSEFSOworICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoKGlzSXNvbGF0ZWRUYXNoa2VlbENoYXIoZGVzdFtpXSk9PTEpICYmIGRlc3RbaV0gIT0gU0hBRERBX0NIQVIpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXN0W2ldID0gU1BBQ0VfQ0hBUjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzb3VyY2VMZW5ndGg7CisgICAgfQorCisgICAgLyoKKyAgICAgKk5hbWUgICAgIDogaGFuZGxlR2VuZXJhdGVkU3BhY2VzCisgICAgICpGdW5jdGlvbiA6IFRoZSBzaGFwZVVuaWNvZGUgZnVuY3Rpb24gY29udmVydHMgTGFtICsgQWxlZiBpbnRvIExhbUFsZWYgKyBzcGFjZSwKKyAgICAgKiAgICAgICAgICA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ChsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX05FQVIpIHsKKyAgICAgICAgICBmb3IgKGludCBpID0gc3RhcnQsIGUgPSBpICsgbGVuZ3RoOyBpIDwgZTsgKytpKSB7CisgICAgICAgICAgICAgIGlmIChkZXN0W2ldID09IExBTUFMRUZfU1BBQ0VfU1VCKSB7CisgICAgICAgICAgICAgICAgICBkZXN0W2ldID0gU1BBQ0VfQ0hBUl9GT1JfTEFNQUxFRjsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH0KKworICAgICAgfSBlbHNlIHsKKworICAgICAgICAgIGZpbmFsIGludCBlID0gc3RhcnQgKyBsZW5ndGg7CisgICAgICAgICAgaW50IHdMID0gY291bnRTcGFjZVN1YihkZXN0LCBsZW5ndGgsIExBTUFMRUZfU1BBQ0VfU1VCKTsKKyAgICAgICAgICBpbnQgd1QgPSBjb3VudFNwYWNlU3ViKGRlc3QsIGxlbmd0aCwgVEFTSEtFRUxfU1BBQ0VfU1VCKTsKKworICAgICAgICAgIGlmIChsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX0VORCl7CisgICAgICAgICAgICBsYW1BbGVmT24gPSB0cnVlOworICAgICAgICAgIH0KKyAgICAgICAgICBpZiAobGVuT3B0aW9uc1Rhc2hrZWVsID09IFRBU0hLRUVMX0VORCl7CisgICAgICAgICAgICB0YXNoa2VlbE9uID0gdHJ1ZTsKKyAgICAgICAgICB9CisKKworICAgICAgICAgIGlmIChsYW1BbGVmT24gJiYgKGxlbk9wdGlvbnNMYW1BbGVmID09IExBTUFMRUZfRU5EKSkgeworICAgICAgICAgICAgc2hpZnRBcnJheShkZXN0LCBzdGFydCwgZSwgTEFNQUxFRl9TUEFDRV9TVUIpOworICAgICAgICAgICAgd2hpbGUgKHdMID4gc3RhcnQpIHsKKyAgICAgICAgICAgICAgICBkZXN0Wy0td0xdID0gU1BBQ0VfQ0hBUjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisKKyAgICAgICAgICBpZiAodGFzaGtlZWxPbiAmJiAobGVuT3B0aW9uc1Rhc2hrZWVsID09IFRBU0hLRUVMX0VORCkpeworICAgICAgICAgICAgc2hpZnRBcnJheShkZXN0LCBzdGFydCwgZSwgVEFTSEtFRUxfU1BBQ0VfU1VCKTsKKyAgICAgICAgICAgIHdoaWxlICh3VCA+IHN0YXJ0KSB7CisgICAgICAgICAgICAgICAgIGRlc3RbLS13VF0gPSBTUEFDRV9DSEFSOworICAgICAgICAgICAgfQorICAgICAgICAgIH0KKworICAgICAgICAgIGxhbUFsZWZPbiA9IGZhbHNlOworICAgICAgICAgIHRhc2hrZWVsT24gPSBmYWxzZTsKKworICAgICAgICAgIGlmIChsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX1JFU0laRSl7CisgICAgICAgICAgICBsYW1BbGVmT24gPSB0cnVlOworICAgICAgICAgIH0KKyAgICAgICAgICBpZiAobGVuT3B0aW9uc1Rhc2hrZWVsID09IFRBU0hLRUVMX1JFU0laRSl7CisgICAgICAgICAgICB0YXNoa2VlbE9uID0gdHJ1ZTsKKyAgICAgICAgICB9CisKKyAgICAgICAgICBpZiAobGFtQWxlZk9uICYmIChsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX1JFU0laRSkpeworICAgICAgICAgICAgICBzaGlmdEFycmF5KGRlc3QsIHN0YXJ0LCBlLCBMQU1BTEVGX1NQQUNFX1NVQik7CisgICAgICAgICAgICAgIHdMID0gZmxpcEFycmF5KGRlc3Qsc3RhcnQsZSwgd0wpOworICAgICAgICAgICAgICBsZW5ndGggPSB3TCAtIHN0YXJ0OworICAgICAgICAgIH0KKyAgICAgICAgICBpZiAodGFzaGtlZWxPbiAmJiAobGVuT3B0aW9uc1Rhc2hrZWVsID09IFRBU0hLRUVMX1JFU0laRSkpIHsKKyAgICAgICAgICAgICAgc2hpZnRBcnJheShkZXN0LCBzdGFydCwgZSwgVEFTSEtFRUxfU1BBQ0VfU1VCKTsKKyAgICAgICAgICAgICAgd1QgPSBmbGlwQXJyYXkoZGVzdCxzdGFydCxlLCB3VCk7CisgICAgICAgICAgICAgIGxlbmd0aCA9IHdUIC0gc3RhcnQ7CisgICAgICAgICAgfQorCisgICAgICAgICAgbGFtQWxlZk9uID0gZmFsc2U7CisgICAgICAgICAgdGFzaGtlZWxPbiA9IGZhbHNlOworCisgICAgICAgICAgaWYgKChsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX0JFR0lOKSB8fAorICAgICAgICAgICAgICAobGVuT3B0aW9uc0xhbUFsZWYgPT0gTEFNQUxFRl9BVVRPKSl7CisgICAgICAgICAgICAgICAgbGFtQWxlZk9uID0gdHJ1ZTsKKyAgICAgICAgICB9CisgICAgICAgICAgaWYgKGxlbk9wdGlvbnNUYXNoa2VlbCA9PSBUQVNIS0VFTF9CRUdJTil7CisgICAgICAgICAgICAgICAgdGFzaGtlZWxPbiA9IHRydWU7CisgICAgICAgICAgfQorCisgICAgICAgICAgaWYgKGxhbUFsZWZPbiAmJiAoKGxlbk9wdGlvbnNMYW1BbGVmID09IExBTUFMRUZfQkVHSU4pfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGVuT3B0aW9uc0xhbUFsZWYgPT0gTEFNQUxFRl9BVVRPKSkpIHsgLy8gc3BhY2VzIGF0IGJlZ2lubmluZworICAgICAgICAgICAgICBzaGlmdEFycmF5KGRlc3QsIHN0YXJ0LCBlLCBMQU1BTEVGX1NQQUNFX1NVQik7CisgICAgICAgICAgICAgICB3TCA9IGZsaXBBcnJheShkZXN0LHN0YXJ0LGUsIHdMKTsKKyAgICAgICAgICAgICAgICAgIHdoaWxlICh3TCA8IGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICBkZXN0W3dMKytdID0gU1BBQ0VfQ0hBUjsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBpZih0YXNoa2VlbE9uICYmIChsZW5PcHRpb25zVGFzaGtlZ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AgICogICAgICAgICAgIHdhcyB1c2VkLCB0aGUgc3BhY2VzIHdpbGwgYmUgY29uc3VtZWQgZnJvbSBiZWdpbiBvZiBidWZmZXIuIElmCisgICAqICAgICAgICAgICB0aGVyZSBhcmUgbm8gc3BhY2VzIHRvIGV4cGFuZCB0aGUgTGFtQWxlZiwgYW4gZXhjZXB0aW9uIGlzIHRocm93bi4KKyAgICovCisKKyAgcHJpdmF0ZSBib29sZWFuICBleHBhbmRDb21wb3NpdENoYXJBdEVuZChjaGFyW10gZGVzdCxpbnQgc3RhcnQsIGludCBsZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBsYWNvdW50KXsKKyAgICAgIGJvb2xlYW4gc3BhY2VOb3RGb3VuZCA9IGZhbHNlOworCisgICAgICBpZiAobGFjb3VudCA+IGNvdW50U3BhY2VzTGVmdChkZXN0LCBzdGFydCwgbGVuZ3RoKSkgeworICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSB0cnVlOworICAgICAgICAgIHJldHVybiBzcGFjZU5vdEZvdW5kOworICAgICAgfQorICAgICAgZm9yIChpbnQgciA9IHN0YXJ0ICsgbGFjb3VudCwgdyA9IHN0YXJ0LCBlID0gc3RhcnQgKyBsZW5ndGg7IHIgPCBlOyArK3IpIHsKKyAgICAgICAgICBjaGFyIGNoID0gZGVzdFtyXTsKKyAgICAgICAgICBpZiAoaXNOb3JtYWxpemVkTGFtQWxlZkNoYXIoY2gpKSB7CisgICAgICAgICAgICAgIGRlc3RbdysrXSA9IGNvbnZlcnROb3JtYWxpemVkTGFtQWxlZltjaCAtICdcdTA2NUMnXTsKKyAgICAgICAgICAgICAgZGVzdFt3KytdID0gTEFNX0NIQVI7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgZGVzdFt3KytdID0gY2g7CisgICAgICAgICAgfQorICAgICAgfQorICAgICAgcmV0dXJuIHNwYWNlTm90Rm91bmQ7CisgIH0KKworICAvKgorICAgKk5hbWUgICAgIDogZXhwYW5kQ29tcG9zaXRDaGFyQXROZWFyCisgICAqRnVuY3Rpb24gOiBFeHBhbmRzIHRoZSBMYW1BbGVmIGNoYXJhY3RlciBpbnRvIExhbSArIEFsZWYsIFllaEhhbXphIGNoYXJhY3RlcgorICAgKiAgICAgICAgICAgaW50byBZZWggKyBIYW16YSwgU2VlbkZhbWlseSBjaGFyYWN0ZXIgaW50byBTZWVuRmFtaWx5IGNoYXJhY3RlcgorICAgKiAgICAgICAgICAgKyBUYWlsLCB3aGlsZSBjb25zdW1pbmcgdGhlIHNwYWNlIG5leHQgdG8gdGhlIGNoYXJhY3Rlci4KKyAgICovCisKKyAgcHJpdmF0ZSBib29sZWFuIGV4cGFuZENvbXBvc2l0Q2hhckF0TmVhcihjaGFyW10gZGVzdCxpbnQgc3RhcnQsIGludCBsZW5ndGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeWVoSGFtemFPcHRpb24sIGludCBzZWVuVGFpbE9wdGlvbiwgaW50IGxhbUFsZWZPcHRpb24peworCisgICAgICBib29sZWFuIHNwYWNlTm90Rm91bmQgPSBmYWxzZTsKKworCisKKyAgICAgIGlmIChpc05vcm1hbGl6ZWRMYW1BbGVmQ2hhcihkZXN0W3N0YXJ0XSkpIHsKKyAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICByZXR1cm4gc3BhY2VOb3RGb3VuZDsKKyAgICAgIH0KKyAgICAgIGZvciAoaW50IGkgPSBzdGFydCArIGxlbmd0aDsgLS1pID49c3RhcnQ7KSB7CisgICAgICAgICAgY2hhciBjaCA9IGRlc3RbaV07CisgICAgICAgICAgaWYgKGxhbUFsZWZPcHRpb24gPT0gMSAmJiBpc05vcm1hbGl6ZWRMYW1BbGVmQ2hhcihjaCkpIHsKKyAgICAgICAgICAgICAgaWYgKGk+c3RhcnQgJiZkZXN0W2ktMV0gPT0gU1BBQ0VfQ0hBUikgeworICAgICAgICAgICAgICAgICAgZGVzdFtpXSA9IExBTV9DSEFSOworICAgICAgICAgICAgICAgICAgZGVzdFstLWldID0gY29udmVydE5vcm1hbGl6ZWRMYW1BbGVmW2NoIC0gJ1x1MDY1QyddOworICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgc3BhY2VOb3RGb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICByZXR1cm4gc3BhY2VOb3RGb3VuZDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgIH1lbHNlIGlmKHNlZW5UYWlsT3B0aW9uID09IDEgJiYgaXNTZWVuVGFpbEZhbWlseUNoYXIoY2gpID09IDEpeworICAgICAgICAgICAgICBpZihpPnN0YXJ0ICYmZGVzdFtpLTFdID09IFNQQUNFX0NIQVIpeworICAgICAgICAgICAgICAgICAgZGVzdFtpLTFdID0gdGFpbENoYXI7CisgICAgICAgICAgICAgIH0gZWxzZXsKKyAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwYWNlTm90Rm91bmQ7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICB9ZWxzZSBpZih5ZWhIYW16YU9wdGlvbiA9PSAxICYmIGlzWWVoSGFtemFDaGFyKGNoKSl7CisKKyAgICAgICAgICAgICAgIGlmKGk+c3RhcnQgJiZkZXN0W2ktMV0gPT0gU1BBQ0VfQ0hBUil7CisgICAgICAgICAgICAgICAgICBkZXN0W2ldID0geWVoSGFtemFUb1llaFtjaCAtIFlFSF9IQU1aQUZFX0NIQVJdOworICAgICAgICAgICAgICAgICAgZGVzdFtpLTFdID0gSEFNWkFGRV9DSEFSOworICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwYWNlTm90Rm91bmQ7CisgICAgICAgICAgICAgICAgfQorCisKKyAgICAgICAgICB9CisgICAgICB9CisgICAgICByZXR1cm4gZmFsc2U7CisKKyAgfQorCisgICAgLyoKKyAgICAgKiBOYW1lICAgIDogZXhwYW5kQ29tcG9zaXRDaGFyCisgICAgICogRnVuY3Rpb246IExhbUFsZWYgbmVlZHMgc3BlY2lhbCBoYW5kbGluZyBhcyB0aGUgTGFtQWxlZiBpcworICAgICAqICAgICAgICAgICBvbmUgY2hhcmFjdGVyIHdoaWxlIGV4cGFuZGluZyBpdCB3aWxsIGdpdmUgdHdvCisgICAgICogICAgICAgICAgIGNoYXJhY3RlcnMgTGFtICsgQWxlZiwgc28gd2UgbmVlZCB0byBleHBhbmQgdGhlIExhbUFsZWYKKyAgICAgKiAgICAgICAgICAgaW4gbmVhciBvciBmYXIgc3BhY2VzIGFjY29yZGluZyB0byB0aGUgb3B0aW9ucyB0aGUgdXNlcgorICAgICAqICAgICAgICAgICBzcGVjaWZpZXMgb3IgaW5jcmVhc2UgdGhlIGJ1ZmZlciBzaXplLgorICAgICAqICAgICAgICAgICBEZXN0IGhhcyBlbm91Z2ggcm9vbSBmb3IgdGhlIGV4cGFuc2lvbiBpZiB3ZSBhcmUgZ3Jvd2luZy4KKyAgICAgKiAgICAgICAgICAgbGFtYWxlZiBhcmUgbm9ybWFsaXplZCB0byB0aGUgJ3NwZWNpYWwgY2hhcmFjdGVycycKKyAgICAgKi8KKyAgICBwcml2YXRlIGludCBleHBhbmRDb21wb3NpdENoYXIoY2hhcltdIGRlc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxhY291bnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2hhcGluZ01vZGUpIHRocm93cyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uIHsKKworICAgICAgICBpbnQgbGVuT3B0aW9uc0xhbUFsZWYgPSBvcHRpb25zICYgTEFNQUxFRl9NQVNLOworICAgICAgICBpbnQgbGVuT3B0aW9uc1NlZW4gPSBvcHRpb25zICYgU0VFTl9NQVNLOworICAgICAgICBpbnQgbGVuT3B0aW9uc1llaEhhbXphID0gb3B0aW9ucyAmIFlFSEhBTVpBX01BU0s7CisgICAgICAgIGJvb2xlYW4gc3BhY2VOb3RGb3VuZCA9IGZhbHNlOworCisgICAgICAgIGlmICghaXNMb2dpY2FsICYmICFzcGFjZXNSZWxhdGl2ZVRvVGV4dEJlZ2luRW5kKSB7CisgICAgICAgICAgICBzd2l0Y2ggKGxlbk9wdGlvbnNMYW1BbGVmKSB7CisgICAgICAgICAgICBjYXNlIExBTUFMRUZfQkVHSU46IGxlbk9wdGlvbnNMYW1BbGVmID0gTEFNQUxFRl9FTkQ7IGJyZWFrOworICAgICAgICAgICAgY2FzZSBMQU1BTEVGX0VORDogbGVuT3B0aW9uc0xhbUFsZWYgPSBMQU1BTEVGX0JFR0lOOyBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6IGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYoc2hhcGluZ01vZGUgPT0gMSl7CisgICAgICAgICAgICBpZihsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX0FVVE8peworICAgICAgICAgICAgICAgIGlmKGlzTG9naWNhbCl7CisgICAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdEVuZChkZXN0LCBzdGFydCwgbGVuZ3RoLCBsYWNvdW50KTsKKyAgICAgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gZXhwYW5kQ29tcG9zaXRDaGFyQXRCZWdpbihkZXN0LCBzdGFydCwgbGVuZ3RoLCBsYWNvdW50KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdE5lYXIoZGVzdCwgc3RhcnQsIGxlbmd0aCwwLDAsMSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXJhYmljU2hhcGluZ0V4Y2VwdGlvbigiTm8gc3BhY2Vmb3IgbGFtYWxlZiIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdEJlZ2luKGRlc3QsIHN0YXJ0LCBsZW5ndGgsIGxhY291bnQpOworICAgICAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdEVuZChkZXN0LCBzdGFydCwgbGVuZ3RoLCBsYWNvdW50KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdE5lYXIoZGVzdCwgc3RhcnQsIGxlbmd0aCwwLDAsMSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXJhYmljU2hhcGluZ0V4Y2VwdGlvbigiTm8gc3BhY2Vmb3IgbGFtYWxlZiIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfWVsc2UgaWYobGVuT3B0aW9uc0xhbUFsZWYgPT0gTEFNQUxFRl9FTkQpeworICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdEVuZChkZXN0LCBzdGFydCwgbGVuZ3RoLCBsYWNvdW50KTsKKyAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFyYWJpY1NoYXBpbmdFeGNlcHRpb24oIk5vIHNwYWNlZm9yIGxhbWFsZWYiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9ZWxzZSBpZihsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX0JFR0lOKXsKKyAgICAgICAgICAgICAgICBzcGFjZU5vdEZvdW5kID0gZXhwYW5kQ29tcG9zaXRDaGFyQXRCZWdpbihkZXN0LCBzdGFydCwgbGVuZ3RoLCBsYWNvdW50KTsKKyAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFyYWJpY1NoYXBpbmdFeGNlcHRpb24oIk5vIHNwYWNlZm9yIGxhbWFsZWYiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9ZWxzZSBpZihsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX05FQVIpeworICAgICAgICAgICAgICAgIHNwYWNlTm90Rm91bmQgPSBleHBhbmRDb21wb3NpdENoYXJBdE5lYXIoZGVzdCwgc3RhcnQsIGxlbmd0aCwwLDAsMSk7CisgICAgICAgICAgICAgICAgaWYoc3BhY2VOb3RGb3VuZCl7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uKCJObyBzcGFjZWZvciBsYW1hbGVmIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB9ZWxzZSBpZihsZW5PcHRpb25zTGFtQWxlZiA9PSBMQU1BTEVGX1JFU0laRSl7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgciA9IHN0YXJ0ICsgbGVuZ3RoLCB3ID0gciArIGxhY291bnQ7IC0tciA+PSBzdGFydDspIHsKKyAgICAgICAgICAgICAgICAgICAgY2hhciBjaCA9IGRlc3Rbcl07CisgICAgICAgICAgICAgICAgICAgIGlmIChpc05vcm1hbGl6ZWRMYW1BbGVmQ2hhcihjaCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbLS13XSA9ICdcdTA2NDQnOworICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFstLXddID0gY29udmVydE5vcm1hbGl6ZWRMYW1BbGVmW2NoIC0gJ1x1MDY1QyddOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFstLXddID0gY2g7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbGVuZ3RoICs9IGxhY291bnQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICBpZihsZW5PcHRpb25zU2VlbiA9PSBTRUVOX1RXT0NFTExfTkVBUil7CisgICAgICAgICAgICAgICAgc3BhY2VOb3RGb3VuZCA9IGV4cGFuZENvbXBvc2l0Q2hhckF0TmVhcihkZXN0LCBzdGFydCwgbGVuZ3RoLDAsMSwwKTsKKyAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFyYWJpY1NoYXBpbmdFeGNlcHRpb24oIk5vIHNwYWNlIGZvciBTZWVuIHRhaWwgZXhwYW5zaW9uIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYobGVuT3B0aW9uc1llaEhhbXphID09IFlFSEhBTVpBX1RXT0NFTExfTkVBUil7CisgICAgICAgICAgICAgICAgc3BhY2VOb3RGb3VuZCA9IGV4cGFuZENvbXBvc2l0Q2hhckF0TmVhcihkZXN0LCBzdGFydCwgbGVuZ3RoLDEsMCwwKTsKKyAgICAgICAgICAgICAgICBpZihzcGFjZU5vdEZvdW5kKXsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFyYWJpY1NoYXBpbmdFeGNlcHRpb24oIk5vIHNwYWNlIGZvciBZZWhIYW16YSBleHBhbnNpb24iKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIHJldHVybiBsZW5ndGg7CisgICAgfQorCisKKyAgICAvKiBDb252ZXJ0IHRoZSBpbnB1dCBidWZmZXIgZnJvbSBGRXh4IFJhbmdlIGludG8gMDZ4eCBSYW5nZQorICAgICAqIHRvIHB1dCBhbGwgY2hhcmFjdGVycyBpbnRvIHRoZSAwNnh4IHJhbmdlCisgICAgICogZXZlbiB0aGUgbGFtYWxlZiBpcyBjb252ZXJ0ZWQgdG8gdGhlIHNwZWNpYWwgcmVnaW9uIGluCisgICAgICogdGhlIDA2eHggcmFuZ2UuICBSZXR1cm4gdGhlIG51bWJlciBvZiBsYW1hbGVmIGNoYXJzIGZvdW5kLgorICAgICAqLworICAgIHByaXZhdGUgaW50IG5vcm1hbGl6ZShjaGFyW10gZGVzdCwgaW50IHN0YXJ0LCBpbnQgbGVuZ3RoKSB7CisgICAgICAgIGludCBsYWNvdW50ID0gMDsKKyAgICAgICAgZm9yIChpbnQgaSA9IHN0YXJ0LCBlID0gaSArIGxlbmd0aDsgaSA8IGU7ICsraSkgeworICAgICAgICAgICAgY2hhciBjaCA9IGRlc3RbaV07CisgICAgICAgICAgICBpZiAoY2ggPj0gJ1x1RkU3MCcgJiYgY2ggPD0gJ1x1RkVGQycpIHsKKyAgICAgICAgICAgICAgICBpZiAoaXNMYW1BbGVmQ2hhcihjaCkpIHsKKyAgICAgICAgICAgICAgICAgICAgKytsYWNvdW50OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkZXN0W2ldID0gKGNoYXIpY29udmVydEZFdG8wNltjaCAtICdcdUZFNzAnXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbGFjb3VudDsKKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWUgICAgOiBkZXNoYXBlTm9ybWFsaXplCisgICAgICogRnVuY3Rpb246IENvbnZlcnQgdGhlIGlucHV0IGJ1ZmZlciBmcm9tIEZFeHggUmFuZ2UgaW50byAwNnh4IFJhbmdlCisgICAgICogICAgICAgICAgIGV2ZW4gdGhlIGxhbWFsZWYgaXMgY29udmVydGVkIHRvIHRoZSBzcGVjaWFsIHJlZ2lvbiBpbiB0aGUgMDZ4eCByYW5nZS4KKyAgICAgKiAgICAgICAgICAgQWNjb3JkaW5nIHRvIHRoZSBvcHRpb25zIHRoZSB1c2VyIGVudGVycywgYWxsIHNlZW4gZmFtaWx5IGNoYXJhY3RlcnMKKyAgICAgKiAgICAgICAgICAgZm9sbG93ZWQgYnkgYSB0YWlsIGNoYXJhY3RlciBhcmUgbWVyZ2VkIHRvIHNlZW4gdGFpbCBmYW1pbHkgY2hhcmFjdGVyIGFuZAorICAgICAqICAgICAgICAgICBhbnkgeWVoIGZvbGxvd2VkIGJ5IGEgaGFtemEgY2hhcmFjdGVyIGFyZSBtZXJnZWQgdG8geWVoaGFtemEgY2hhcmFjdGVyLgorICAgICAqICAgICAgICAgICBNZXRob2QgcmV0dXJucyB0aGUgbnVtYmVyIG9mIGxhbWFsZWYgY2hhcnMgZm91bmQuCisgICAgICovCisgICAgcHJpdmF0ZSBpbnQgZGVzaGFwZU5vcm1hbGl6ZShjaGFyW10gZGVzdCwgaW50IHN0YXJ0LCBpbnQgbGVuZ3RoKSB7CisgICAgICAgIGludCBsYWNvdW50ID0gMDsKKyAgICAgICAgaW50IHllaEhhbXphQ29tcG9zZUVuYWJsZWQgPSAwOworICAgICAgICBpbnQgc2VlbkNvbXBvc2VFbmFibGVkID0gMDsKKworICAgICAgICB5ZWhIYW16YUNvbXBvc2VFbmFibGVkID0gKChvcHRpb25zJllFSEhBTVpBX01BU0spID09IFlFSEhBTVpBX1RXT0NFTExfTkVBUikgPyAxIDogMDsKKyAgICAgICAgc2VlbkNvbXBvc2VFbmFibGVkID0gKChvcHRpb25zJlNFRU5fTUFTSykgPT0gU0VFTl9UV09DRUxMX05FQVIpPyAxIDogMDsKKworICAgICAgICBmb3IgKGludCBpID0gc3RhcnQsIGUgPSBpICsgbGVuZ3RoOyBpIDwgZTsgKytpKSB7CisgICAgICAgICAgICBjaGFyIGNoID0gZGVzdFtpXTsKKworICAgICAgICBpZiggKHllaEhhbXphQ29tcG9zZUVuYWJsZWQgPT0gMSkgJiYgKChjaCA9PSBIQU1aQTA2X0NIQVIpIHx8IChjaCA9PSBIQU1aQUZFX0NIQVIpKQorICAgICAgICAgICAgICAgJiYgKGkgPCAobGVuZ3RoIC0gMSkpICYmIGlzQWxlZk1ha3NvdXJhQ2hhcihkZXN0W2krMV0gKSkgeworICAgICAgICAgICAgICAgIGRlc3RbaV0gPSBTUEFDRV9DSEFSOworICAgICAgICAgICAgICAgIGRlc3RbaSsxXSA9IFlFSF9IQU1aQV9DSEFSOworICAgICAgIH0gZWxzZSBpZiAoIChzZWVuQ29tcG9zZUVuYWJsZWQgPT0gMSkgJiYgKGlzVGFpbENoYXIoY2gpKSAmJiAoaTwgKGxlbmd0aCAtIDEpKQorICAgICAgICAgICAgICAgICAgICAgICAmJiAoaXNTZWVuVGFpbEZhbWlseUNoYXIoZGVzdFtpKzFdKT09MSkgKSB7CisgICAgICAgICAgICAgICBkZXN0W2ldID0gU1BBQ0VfQ0hBUjsKKyAgICAgICB9CisgICAgICAgZWxzZSBpZiAoY2ggPj0gJ1x1RkU3MCcgJiYgY2ggPD0gJ1x1RkVGQycpIHsKKyAgICAgICAgICAgICAgICBpZiAoaXNMYW1BbGVmQ2hhcihjaCkpIHsKKyAgICAgICAgICAgICAgICAgICAgKytsYWNvdW50OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkZXN0W2ldID0gKGNoYXIpY29udmVydEZFdG8wNltjaCAtICdcdUZFNzAnXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbGFjb3VudDsKKyAgICB9CisKKyAgICAvKgorICAgICAqIE5hbWUgICAgOiBzaGFwZVVuaWNvZGUKKyAgICAgKiBGdW5jdGlvbjogQ29udmVydHMgYW4gQXJhYmljIFVuaWNvZGUgYnVmZmVyIGluIDA2eHggUmFuZ2UgaW50byBhIHNoYXBlZAorICAgICAqICAgICAgICAgICBhcmFiaWMgVW5pY29kZSBidWZmZXIgaW4gRkV4eCBSYW5nZQorICAgICAqLworICAgIHByaXZhdGUgaW50IHNoYXBlVW5pY29kZShjaGFyW10gZGVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgbGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGVzdFNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB0YXNoa2VlbEZsYWcpdGhyb3dzIEFyYWJpY1NoYXBpbmdFeGNlcHRpb24geworCisgICAgICAgIGludCBsYW1hbGVmX2NvdW50ID0gbm9ybWFsaXplKGRlc3QsIHN0YXJ0LCBsZW5ndGgpOworCisgICAgICAgIC8vIHJlc29sdmUgdGhlIGxpbmsgYmV0d2VlbiB0aGUgY2hhcmFjdGVycy4KKyAgICAgICAgLy8gQXJhYmljIGNoYXJhY3RlcnMgaGF2ZSBmb3VyIGZvcm1zOiBJc29sYXRlZCwgSW5pdGlhbCwgTWVkaWFsIGFuZCBGaW5hbC4KKyAgICAgICAgLy8gVGFzaGtlZWwgY2hhcmFjdGVycyBoYXZlIHR3bywgaXNvbGF0ZWQgb3IgbWVkaWFsLCBhbmQgc29tZXRpbWVzIG9ubHkgaXNvbGF0ZWQuCisgICAgICAgIC8vIHRhc2hrZWVsRmxhZyA9PSAwOiBzaGFwZSBub3JtYWxseSwgMTogc2hhcGUgaXNvbGF0ZWQsIDI6IGRvbid0IHNoYXBlCisKKyAgICAgICAgYm9vbGVhbiBsYW1hbGVmX2ZvdW5kID0gZmFsc2UsIHNlZW5mYW1fZm91bmQgPSBmYWxzZTsKKyAgICAgICAgYm9vbGVhbiB5ZWhoYW16YV9mb3VuZCA9IGZhbHNlLCB0YXNoa2VlbF9mb3VuZCA9IGZhbHNlOworICAgICAgICBpbnQgaSA9IHN0YXJ0ICsgbGVuZ3RoIC0gMTsKKyAgICAgICAgaW50IGN1cnJMaW5rID0gZ2V0TGluayhkZXN0W2ldKTsKKyAgICAgICAgaW50IG5leHRMaW5rID0gMDsKKyAgICAgICAgaW50IHByZXZMaW5rID0gMDsKKyAgICAgICAgaW50IGxhc3RMaW5rID0gMDsKKyAgICAgICAgLy9pbnQgcHJldlBvcyA9IGk7CisgICAgICAgIGludCBsYXN0UG9zID0gaTsKKyAgICAgICAgaW50IG54ID0gLTI7CisgICAgICAgIGludCBudyA9IDA7CisKKyAgICAgICAgd2hpbGUgKGkgPj0gMCkgeworICAgICAgICAgICAgLy8gSWYgaGlnaCBieXRlIG9mIGN1cnJMaW5rID4gMCB0aGVuIHRoZXJlIG1pZ2h0IGJlIG1vcmUgdGhhbiBvbmUgc2hhcGUKKyAgICAgICAgICAgIGlmICgoY3VyckxpbmsgJiAnXHVGRjAwJykgPiAwIHx8IGlzVGFzaGtlZWxDaGFyKGRlc3RbaV0pKSB7CisgICAgICAgICAgICAgICAgbncgPSBpIC0gMTsKKyAgICAgICAgICAgICAgICBueCA9IC0yOworICAgICAgICAgICAgICAgIHdoaWxlIChueCA8IDApIHsgLy8gd2UgbmVlZCB0byBrbm93IGFib3V0IG5leHQgY2hhcgorICAgICAgICAgICAgICAgICAgICBpZiAobncgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5leHRMaW5rID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIG54ID0gSW50ZWdlci5NQVhfVkFMVUU7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBuZXh0TGluayA9IGdldExpbmsoZGVzdFtud10pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChuZXh0TGluayAmIElSUkVMRVZBTlQpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBueCA9IG53OworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLW53OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKCgoY3VyckxpbmsgJiBBTEVGVFlQRSkgPiAwKSAmJiAoKGxhc3RMaW5rICYgTEFNVFlQRSkgPiAwKSkgeworICAgICAgICAgICAgICAgICAgICBsYW1hbGVmX2ZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgY2hhciB3TGFtYWxlZiA9IGNoYW5nZUxhbUFsZWYoZGVzdFtpXSk7IC8vIGdldCBmcm9tIDB4MDY1Qy0weDA2NWYKKyAgICAgICAgICAgICAgICAgICAgaWYgKHdMYW1hbGVmICE9ICdcdTAwMDAnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyByZXBsYWNlIGFsZWYgYnkgbWFya2VyLCBpdCB3aWxsIGJlIHJlbW92ZWQgbGF0ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbaV0gPSAnXHVmZmZmJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc3RbbGFzdFBvc10gPSB3TGFtYWxlZjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBsYXN0UG9zOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgbGFzdExpbmsgPSBwcmV2TGluazsKKyAgICAgICAgICAgICAgICAgICAgY3VyckxpbmsgPSBnZXRMaW5rKHdMYW1hbGVmKTsgLy8gcmVxdWlyZXMgJ1x1MDAwMCcsIHVuZm9ydHVuYXRlbHkKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKChpID4gMCkgJiYgKGRlc3RbaS0xXSA9PSBTUEFDRV9DSEFSKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmICggaXNTZWVuRmFtaWx5Q2hhcihkZXN0W2ldKSA9PSAxKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlZW5mYW1fZm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGRlc3RbaV0gPT0gWUVIX0hBTVpBX0NIQVIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHllaGhhbXphX2ZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmKGk9PTApeworICAgICAgICAgICAgICAgICAgICBpZiAoIGlzU2VlbkZhbWlseUNoYXIoZGVzdFtpXSkgPT0gMSl7CisgICAgICAgICAgICAgICAgICAgICAgICBzZWVuZmFtX2ZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChkZXN0W2ldID09IFlFSF9IQU1aQV9DSEFSKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB5ZWhoYW16YV9mb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKworICAgICAgICAgICAgICAgIC8vIGdldCB0aGUgcHJvcGVyIHNoYXBlIGFjY29yZGluZyB0byBsaW5rIGFiaWxpdHkgb2YgbmVpZ2hib3JzCisgICAgICAgICAgICAgICAgLy8gYW5kIG9mIGNoYXJhY3RlcjsgZGVwZW5kcyBvbiB0aGUgb3JkZXIgb2YgdGhlIHNoYXBlcworICAgICAgICAgICAgICAgIC8vIChpc29sYXRlZCwgaW5pdGlhbCwgbWlkZGxlLCBmaW5hbCkgaW4gdGhlIGNvbXBhdGliaWxpdHkgYXJlYQorCisgICAgICAgICAgICAgICAgaW50IGZsYWcgPSBzcGVjaWFsQ2hhcihkZXN0W2ldKTsKKworICAgICAgICAgICAgICAgIGludCBzaGFwZSA9IHNoYXBlVGFibGVbbmV4dExpbmsgJiBMSU5LX01BU0tdCisgICAgICAgICAgICAgICAgICAgIFtsYXN0TGluayAmIExJTktfTUFTS10KKyAgICAgICAgICAgICAgICAgICAgW2N1cnJMaW5rICYgTElOS19NQVNLXTsKKworICAgICAgICAgICAgICAgIGlmIChmbGFnID09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgc2hhcGUgJj0gMHgxOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmxhZyA9PSAyKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh0YXNoa2VlbEZsYWcgPT0gMCAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKChsYXN0TGluayAmIExJTktMKSAhPSAwKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgKChuZXh0TGluayAmIExJTktSKSAhPSAwKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFtpXSAhPSAnXHUwNjRDJyAmJgorICAgICAgICAgICAgICAgICAgICAgICAgZGVzdFtpXSAhPSAnXHUwNjREJyAmJgorICAgICAgICAgICAgICAgICAgICAgICAgISgobmV4dExpbmsgJiBBTEVGVFlQRSkgPT0gQUxFRlRZUEUgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhc3RMaW5rICYgTEFNVFlQRSkgPT0gTEFNVFlQRSkpIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2hhcGUgPSAxOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgc2hhcGUgPSAwOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChmbGFnID09IDIpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRhc2hrZWVsRmxhZyA9PSAyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkZXN0W2ldID0gVEFTSEtFRUxfU1BBQ0VfU1VCOworICAgICAgICAgICAgICAgICAgICAgICAgdGFzaGtlZWxfZm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICBkZXN0W2ldID0gKGNoYXIpKCdcdUZFNzAnICsgaXJyZWxldmFudFBvc1tkZXN0W2ldIC0gJ1x1MDY0QiddICsgc2hhcGUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vIGVsc2UgbGVhdmUgdGFzaGtlZWwgYWxvbmUKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBkZXN0W2ldID0gKGNoYXIpKCdcdUZFNzAnICsgKGN1cnJMaW5rID4+IDgpICsgc2hhcGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gbW92ZSBvbmUgbm90Y2ggZm9yd2FyZAorICAgICAgICAgICAgaWYgKChjdXJyTGluayAmIElSUkVMRVZBTlQpID09IDApIHsKKyAgICAgICAgICAgICAgICBwcmV2TGluayA9IGxhc3RMaW5rOworICAgICAgICAgICAgICAgIGxhc3RMaW5rID0gY3Vyckxpbms7CisgICAgICAgICAgICAgICAgLy9wcmV2UG9zID0gbGFzdFBvczsKKyAgICAgICAgICAgICAgICBsYXN0UG9zID0gaTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLS1pOworICAgICAgICAgICAgaWYgKGkgPT0gbngpIHsKKyAgICAgICAgICAgICAgICBjdXJyTGluayA9IG5leHRMaW5rOworICAgICAgICAgICAgICAgIG54ID0gLTI7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGkgIT0gLTEpIHsKKyAgICAgICAgICAgICAgICBjdXJyTGluayA9IGdldExpbmsoZGVzdFtpXSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBJZiB3ZSBmb3VuZCBhIGxhbS9hbGVmIHBhaXIgaW4gdGhlIGJ1ZmZlcgorICAgICAgICAvLyBjYWxsIGhhbmRsZUdlbmVyYXRlZFNwYWNlcyB0byByZW1vdmUgdGhlIHNwYWNlcyB0aGF0IHdlcmUgYWRkZWQKKworICAgICAgICBkZXN0U2l6ZSA9IGxlbmd0aDsKKyAgICAgICAgaWYgKGxhbWFsZWZfZm91bmQgfHwgdGFzaGtlZWxfZm91bmQpIHsKKyAgICAgICAgICAgIGRlc3RTaXplID0gaGFuZGxlR2VuZXJhdGVkU3BhY2VzKGRlc3QsIHN0YXJ0LCBsZW5ndGgpOworICAgICAgICB9CisgICAgICAgIGlmIChzZWVuZmFtX2ZvdW5kIHx8IHllaGhhbXphX2ZvdW5kKXsKKyAgICAgICAgICAgIGRlc3RTaXplID0gZXhwYW5kQ29tcG9zaXRDaGFyKGRlc3QsIHN0YXJ0LCBkZXN0U2l6ZSwgbGFtYWxlZl9jb3VudCwgU0hBUEVfTU9ERSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGRlc3RTaXplOworICAgIH0KKworICAgIC8qCisgICAgICogTmFtZSAgICA6IGRlU2hhcGVVbmljb2RlCisgICAgICogRnVuY3Rpb246IENvbnZlcnRzIGFuIEFyYWJpYyBVbmljb2RlIGJ1ZmZlciBpbiBGRXh4IFJhbmdlIGludG8gdW5zaGFwZWQKKyAgICAgKiAgICAgICAgICAgYXJhYmljIFVuaWNvZGUgYnVmZmVyIGluIDA2eHggUmFuZ2UKKyAgICAgKi8KKyAgICBwcml2YXRlIGludCBkZVNoYXBlVW5pY29kZShjaGFyW10gZGVzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGVzdFNpemUpIHRocm93cyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uIHsKKworICAgICAgICBpbnQgbGFtYWxlZl9jb3VudCA9IGRlc2hhcGVOb3JtYWxpemUoZGVzdCwgc3RhcnQsIGxlbmd0aCk7CisKKyAgICAgICAgLy8gSWYgdGhlcmUgd2FzIGEgbGFtYWxlZiBpbiB0aGUgYnVmZmVyIGNhbGwgZXhwYW5kTGFtQWxlZgorICAgICAgICBpZiAobGFtYWxlZl9jb3VudCAhPSAwKSB7CisgICAgICAgICAgICAvLyBuZWVkIHRvIGFkanVzdCBkZXN0IHRvIGZpdCBleHBhbmRlZCBidWZmZXIuLi4gISEhCisgICAgICAgICAgICBkZXN0U2l6ZSA9IGV4cGFuZENvbXBvc2l0Q2hhcihkZXN0LCBzdGFydCwgbGVuZ3RoLCBsYW1hbGVmX2NvdW50LERFU0hBUEVfTU9ERSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBkZXN0U2l6ZSA9IGxlbmd0aDsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBkZXN0U2l6ZTsKKyAgICB9CisKKyAgICBwcml2YXRlIGludCBpbnRlcm5hbFNoYXBlKGNoYXJbXSBzb3VyY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc291cmNlU3RhcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc291cmNlTGVuZ3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhcltdIGRlc3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGVzdFN0YXJ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRlc3RTaXplKSB0aHJvd3MgQXJhYmljU2hhcGluZ0V4Y2VwdGlvbiB7CisKKyAgICAgICAgaWYgKHNvdXJjZUxlbmd0aCA9PSAwKSB7CisgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChkZXN0U2l6ZSA9PSAwKSB7CisgICAgICAgICAgICBpZiAoKChvcHRpb25zICYgTEVUVEVSU19NQVNLKSAhPSBMRVRURVJTX05PT1ApICYmCisgICAgICAgICAgICAgICAgKChvcHRpb25zICYgTEFNQUxFRl9NQVNLKSA9PSBMQU1BTEVGX1JFU0laRSkpIHsKKworICAgICAgICAgICAgICAgIHJldHVybiBjYWxjdWxhdGVTaXplKHNvdXJjZSwgc291cmNlU3RhcnQsIHNvdXJjZUxlbmd0aCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJldHVybiBzb3VyY2VMZW5ndGg7IC8vIGJ5IGRlZmluaXRpb24KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIGFsd2F5cyB1c2UgdGVtcCBidWZmZXIKKyAgICAgICAgY2hhcltdIHRlbXAgPSBuZXcgY2hhcltzb3VyY2VMZW5ndGggKiAyXTsgLy8gYWxsIGxhbWFsZWZzIHJlcXVpcmluZyBleHBhbnNpb24KKyAgICAgICAgU3lzdGVtLmFycmF5Y29weShzb3VyY2UsIHNvdXJjZVN0YXJ0LCB0ZW1wLCAwLCBzb3VyY2VMZW5ndGgpOworCisgICAgICAgIGlmIChpc0xvZ2ljYWwpIHsKKyAgICAgICAgICAgIGludmVydEJ1ZmZlcih0ZW1wLCAwLCBzb3VyY2VMZW5ndGgpOworICAgICAgICB9CisKKyAgICAgICAgaW50IG91dHB1dFNpemUgPSBzb3VyY2VMZW5ndGg7CisKKyAgICAgICAgc3dpdGNoIChvcHRpb25zICYgTEVUVEVSU19NQVNLKSB7CisgICAgICAgIGNhc2UgTEVUV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TCl7CisgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dFNpemUgPSBoYW5kbGVUYXNoa2VlbFdpdGhUYXR3ZWVsKHRlbXAsc291cmNlTGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIExFVFRFUlNfVU5TSEFQRToKKyAgICAgICAgICAgIG91dHB1dFNpemUgPSBkZVNoYXBlVW5pY29kZSh0ZW1wLCAwLCBzb3VyY2VMZW5ndGgsIGRlc3RTaXplKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChvdXRwdXRTaXplID4gZGVzdFNpemUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBBcmFiaWNTaGFwaW5nRXhjZXB0aW9uKCJub3QgZW5vdWdoIHJvb20gZm9yIHJlc3VsdCBkYXRhIik7CisgICAgICAgIH0KKworICAgICAgICBpZiAoKG9wdGlvbnMgJiBESUdJVFNfTUFTSykgIT0gRElHSVRTX05PT1ApIHsKKyAgICAgICAgICAgIGNoYXIgZGlnaXRCYXNlID0gJ1x1MDAzMCc7IC8vIEV1cm9wZWFuIGRpZ2l0cworICAgICAgICAgICAgc3dpdGNoIChvcHRpb25zICYgRElHSVRfVFlQRV9NQVNLKSB7CisgICAgICAgICAgICBjYXNlIERJR0lUX1RZUEVfQU46CisgICAgICAgICAgICAgICAgZGlnaXRCYXNlID0gJ1x1MDY2MCc7ICAvLyBBcmFiaWMtSW5kaWMgZGlnaXRzCisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgRElHSVRfVFlQRV9BTl9FWFRFTkRFRDoKKyAgICAgICAgICAgICAgICBkaWdpdEJhc2UgPSAnXHUwNmYwJzsgIC8vIEVhc3Rlcm4gQXJhYmljLUluZGljIGRpZ2l0cyAoUGVyc2lhbiBhbmQgVXJkdSkKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc3dpdGNoIChvcHRpb25zICYgRElHSVRTX01BU0spIHsKKyAgICAgICAgICAgIGNhc2UgRElHSVRTX0VOMkFOOgorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaW50IGRpZ2l0RGVsdGEgPSBkaWdpdEJhc2UgLSAnXHUwMDMwJzsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBvdXRwdXRTaXplOyArK2kpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgY2ggPSB0ZW1wW2ldOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoIDw9ICdcdTAwMzknICYmIGNoID49ICdcdTAwMzAnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcFtpXSArPSBkaWdpdERlbHRhOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIERJR0lUU19BTjJFTjoKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNoYXIgZGlnaXRUb3AgPSAoY2hhcikoZGlnaXRCYXNlICsgOSk7CisgICAgICAgICAgICAgICAgICAgIGludCBkaWdpdERlbHRhID0gJ1x1MDAzMCcgLSBkaWdpdEJhc2U7CisgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgb3V0cHV0U2l6ZTsgKytpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGFyIGNoID0gdGVtcFtpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaCA8PSBkaWdpdFRvcCAmJiBjaCA+PSBkaWdpdEJhc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wW2ldICs9IGRpZ2l0RGVsdGE7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgRElHSVRTX0VOMkFOX0lOSVRfTFI6CisgICAgICAgICAgICAgICAgc2hhcGVUb0FyYWJpY0RpZ2l0c1dpdGhDb250ZXh0KHRlbXAsIDAsIG91dHB1dFNpemUsIGRpZ2l0QmFzZSwgZmFsc2UpOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIERJR0lUU19FTjJBTl9JTklUX0FMOgorICAgICAgICAgICAgICAgIHNoYXBlVG9BcmFiaWNEaWdpdHNXaXRoQ29udGV4dCh0ZW1wLCAwLCBvdXRwdXRTaXplLCBkaWdpdEJhc2UsIHRydWUpOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKGlzTG9naWNhbCkgeworICAgICAgICAgICAgaW52ZXJ0QnVmZmVyKHRlbXAsIDAsIG91dHB1dFNpemUpOworICAgICAgICB9CisKKyAgICAgICAgU3lzdGVtLmFycmF5Y29weSh0ZW1wLCAwLCBkZXN0LCBkZXN0U3RhcnQsIG91dHB1dFNpemUpOworCisgICAgICAgIHJldHVybiBvdXRwdXRTaXplOworICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIEFyYWJpY1NoYXBpbmdFeGNlcHRpb24gZXh0ZW5kcyBSdW50aW1lRXhjZXB0aW9uIHsKKyAgICAgICAgQXJhYmljU2hhcGluZ0V4Y2VwdGlvbihTdHJpbmcgbXNnKSB7CisgICAgICAgICAgICBzdXBlcihtc2cpOworICA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gMS4wZjsKKworICAgIGFuZ2xlICo9IGZsb2F0KE1fUEkgLyAxODAuMGYpOworICAgIGZsb2F0IGMgPSBjb3NmKGFuZ2xlKTsKKyAgICBmbG9hdCBzID0gc2luZihhbmdsZSk7CisKKyAgICBjb25zdCBmbG9hdCBsZW5ndGggPSBzcXJ0Zih4ICogeCArIHkgKiB5ICsgeiAqIHopOworICAgIGNvbnN0IGZsb2F0IG5jID0gMS4wZiAtIGM7CisgICAgY29uc3QgZmxvYXQgeHkgPSB4ICogeTsKKyAgICBjb25zdCBmbG9hdCB5eiA9IHkgKiB6OworICAgIGNvbnN0IGZsb2F0IHp4ID0geiAqIHg7CisgICAgY29uc3QgZmxvYXQgeHMgPSB4ICogczsKKyAgICBjb25zdCBmbG9hdCB5cyA9IHkgKiBzOworICAgIGNvbnN0IGZsb2F0IHpzID0geiAqIHM7CisKKyAgICBkYXRhWzBdICA9IHggKiB4ICogbmMgKyAgYzsKKyAgICBkYXRhWzRdICA9ICAgIHh5ICogbmMgLSB6czsKKyAgICBkYXRhWzhdICA9ICAgIHp4ICogbmMgKyB5czsKKyAgICBkYXRhWzFdICA9ICAgIHh5ICogbmMgKyB6czsKKyAgICBkYXRhWzVdICA9IHkgKiB5ICogbmMgKyAgYzsKKyAgICBkYXRhWzldICA9ICAgIHl6ICogbmMgLSB4czsKKyAgICBkYXRhWzJdICA9ICAgIHp4ICogbmMgLSB5czsKKyAgICBkYXRhWzZdICA9ICAgIHl6ICogbmMgKyB4czsKKyAgICBkYXRhWzEwXSA9IHogKiB6ICogbmMgKyAgYzsKK30KKwordm9pZCBNYXRyaXg0Ojpsb2FkTXVsdGlwbHkoY29uc3QgTWF0cml4NCYgdSwgY29uc3QgTWF0cml4NCYgdikgeworICAgIGZvciAoaW50IGkgPSAwIDsgaSA8IDQgOyBpKyspIHsKKyAgICAgICAgZmxvYXQgeCA9IDA7CisgICAgICAgIGZsb2F0IHkgPSAwOworICAgICAgICBmbG9hdCB6ID0gMDsKKyAgICAgICAgZmxvYXQgdyA9IDA7CisKKyAgICAgICAgZm9yIChpbnQgaiA9IDAgOyBqIDwgNCA7IGorKykgeworICAgICAgICAgICAgY29uc3QgZmxvYXQgZSA9IHYuZ2V0KGksIGopOworICAgICAgICAgICAgeCArPSB1LmdldChqLCAwKSAqIGU7CisgICAgICAgICAgICB5ICs9IHUuZ2V0KGosIDEpICogZTsKKyAgICAgICAgICAgIHogKz0gdS5nZXQoaiwgMikgKiBlOworICAgICAgICAgICAgdyArPSB1LmdldChqLCAzKSAqIGU7CisgICAgICAgIH0KKworICAgICAgICBzZXQoaSwgMCwgeCk7CisgICAgICAgIHNldChpLCAxLCB5KTsKKyAgICAgICAgc2V0KGksIDIsIHopOworICAgICAgICBzZXQoaSwgMywgdyk7CisgICAgfQorfQorCit2b2lkIE1hdHJpeDQ6OmxvYWRPcnRobyhmbG9hdCBsZWZ0LCBmbG9hdCByaWdodCwgZmxvYXQgYm90dG9tLCBmbG9hdCB0b3AsIGZsb2F0IG5lYXIsIGZsb2F0IGZhcikgeworICAgIGxvYWRJZGVudGl0eSgpOworICAgIGRhdGFbMF0gID0gMi4wZiAvIChyaWdodCAtIGxlZnQpOworICAgIGRhdGFbNV0gID0gMi4wZiAvICh0b3AgLSBib3R0b20pOworICAgIGRhdGFbMTBdID0gLTIuMGYgLyAoZmFyIC0gbmVhcik7CisgICAgZGF0YVsxMl0gPSAtKHJpZ2h0ICsgbGVmdCkgLyAocmlnaHQgLSBsZWZ0KTsKKyAgICBkYXRhWzEzXSA9IC0odG9wICsgYm90dG9tKSAvICh0b3AgLSBib3R0b20pOworICAgIGRhdGFbMTRdID0gLShmYXIgKyBuZWFyKSAvIChmYXIgLSBuZWFyKTsKK30KKworI2RlZmluZSBNVUxfQUREX1NUT1JFKGEsIGIsIGMpIGEgPSAoYSkgKiAoYikgKyAoYykKKwordm9pZCBNYXRyaXg0OjptYXBSZWN0KFJlY3QmIHIpIGNvbnN0IHsKKyAgICBjb25zdCBmbG9hdCBzeCA9I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0b20sIGZsb2F0IHRvcCwgZmxvYXQgbmVhciwgZmxvYXQgZmFyKTsKKworICAgIHZvaWQgbXVsdGlwbHkoY29uc3QgTWF0cml4NCYgdikgeworICAgICAgICBNYXRyaXg0IHU7CisgICAgICAgIHUubG9hZE11bHRpcGx5KCp0aGlzLCB2KTsKKyAgICAgICAgbG9hZCh1KTsKKyAgICB9CisKKyAgICB2b2lkIHRyYW5zbGF0ZShmbG9hdCB4LCBmbG9hdCB5LCBmbG9hdCB6KSB7CisgICAgICAgIE1hdHJpeDQgdTsKKyAgICAgICAgdS5sb2FkVHJhbnNsYXRlKHgsIHksIHopOworICAgICAgICBtdWx0aXBseSh1KTsKKyAgICB9CisKKyAgICB2b2lkIHNjYWxlKGZsb2F0IHN4LCBmbG9hdCBzeSwgZmxvYXQgc3opIHsKKyAgICAgICAgTWF0cml4NCB1OworICAgICAgICB1LmxvYWRTY2FsZShzeCwgc3ksIHN6KTsKKyAgICAgICAgbXVsdGlwbHkodSk7CisgICAgfQorCisgICAgdm9pZCByb3RhdGUoZmxvYXQgYW5nbGUsIGZsb2F0IHgsIGZsb2F0IHksIGZsb2F0IHopIHsKKyAgICAgICAgTWF0cml4NCB1OworICAgICAgICB1LmxvYWRSb3RhdGUoYW5nbGUsIHgsIHksIHopOworICAgICAgICBtdWx0aXBseSh1KTsKKyAgICB9CisKKyAgICB2b2lkIGNvcHlUbyhmbG9hdCogdikgY29uc3Q7CisgICAgdm9pZCBjb3B5VG8oU2tNYXRyaXgmIHYpIGNvbnN0OworCisgICAgdm9pZCBtYXBSZWN0KFJlY3QmIHIpIGNvbnN0OworCisgICAgZmxvYXQgZ2V0VHJhbnNsYXRlWCgpOworICAgIGZsb2F0IGdldFRyYW5zbGF0ZVkoKTsKKworICAgIHZvaWQgZHVtcCgpIGNvbnN0OworCitwcml2YXRlOgorICAgIGlubGluZSBmbG9hdCBnZXQoaW50IGksIGludCBqKSBjb25zdCB7CisgICAgICAgIHJldHVybiBkYXRhW2kgKiA0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1EcmF3VGV4dHVyZVZlcnRpY2VzWzNdLnRleHR1cmVbMF0gPSB1MjsKKyAgICBtRHJhd1RleHR1cmVWZXJ0aWNlc1szXS50ZXh0dXJlWzFdID0gdjI7Cit9CisKK3ZvaWQgT3BlbkdMUmVuZGVyZXI6OmdldEFscGhhQW5kTW9kZShjb25zdCBTa1BhaW50KiBwYWludCwgaW50KiBhbHBoYSwgU2tYZmVybW9kZTo6TW9kZSogbW9kZSkgeworICAgIGlmIChwYWludCkgeworICAgICAgICBjb25zdCBib29sIGlzTW9kZSA9IFNrWGZlcm1vZGU6OklzTW9kZShwYWludC0+Z2V0WGZlcm1vZGUoKSwgbW9kZSk7CisgICAgICAgIGlmICghaXNNb2RlKSB7CisgICAgICAgICAgICAvLyBBc3N1bWUgU1JDX09WRVIKKyAgICAgICAgICAgICptb2RlID0gU2tYZmVybW9kZTo6a1NyY092ZXJfTW9kZTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFNraWEgZHJhd3MgdXNpbmcgdGhlIGNvbG9yJ3MgYWxwaGEgY2hhbm5lbCBpZiA8IDI1NQorICAgICAgICAvLyBPdGhlcndpc2UsIGl0IHVzZXMgdGhlIHBhaW50J3MgYWxwaGEKKyAgICAgICAgaW50IGNvbG9yID0gcGFpbnQtPmdldENvbG9yKCk7CisgICAgICAgICphbHBoYSA9IChjb2xvciA+PiAyNCkgJiAweEZGOworICAgICAgICBpZiAoKmFscGhhID09IDI1NSkgeworICAgICAgICAgICAgKmFscGhhID0gcGFpbnQtPmdldEFscGhhKCk7CisgICAgICAgIH0KKyAgICB9IGVsc2UgeworICAgICAgICAqbW9kZSA9IFNrWGZlcm1vZGU6OmtTcmNPdmVyX01vZGU7CisgICAgICAgICphbHBoYSA9IDI1NTsKKyAgICB9Cit9CisKK307IC8vIG5hbWVzcGFjZSB1aXJlbmRlcmVyCit9OyAvLyBuYW1lc3BhY2UgYW5kcm9pZApkaWZmIC0tZ2l0IGEvbGlicy9od3VpL09wZW5HTFJlbmR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KTsKKyAgICBnbEF0dGFjaFNoYWRlcihpZCwgdmVydGV4U2hhZGVyKTsKKyAgICBnbEF0dGFjaFNoYWRlcihpZCwgZnJhZ21lbnRTaGFkZXIpOworICAgIGdsTGlua1Byb2dyYW0oaWQpOworCisgICAgR0xpbnQgc3RhdHVzOworICAgIGdsR2V0UHJvZ3JhbWl2KGlkLCBHTF9MSU5LX1NUQVRVUywgJnN0YXR1cyk7CisgICAgaWYgKHN0YXR1cyAhPSBHTF9UUlVFKSB7CisgICAgICAgIEdMaW50IGluZm9MZW4gPSAwOworICAgICAgICBnbEdldFByb2dyYW1pdihpZCwgR0xfSU5GT19MT0dfTEVOR1RILCAmaW5mb0xlbik7CisgICAgICAgIGlmIChpbmZvTGVuID4gMSkgeworICAgICAgICAgICAgY2hhciogbG9nID0gKGNoYXIqKSBtYWxsb2Moc2l6ZW9mKGNoYXIpICogaW5mb0xlbik7CisgICAgICAgICAgICBnbEdldFByb2dyYW1JbmZvTG9nKGlkLCBpbmZvTGVuLCAwLCBsb2cpOworICAgICAgICAgICAgTE9HRSgiRXJyb3Igd2hpbGUgbGlua2luZyBzaGFkZXJzOiAlcyIsIGxvZyk7CisgICAgICAgICAgICBkZWxldGUgbG9nOworICAgICAgICB9CisgICAgICAgIGdsRGVsZXRlUHJvZ3JhbShpZCk7CisgICAgfQorfQorCitQcm9ncmFtOjp+UHJvZ3JhbSgpIHsKKyAgICBnbERlbGV0ZVNoYWRlcih2ZXJ0ZXhTaGFkZXIpOworICAgIGdsRGVsZXRlU2hhZGVyKGZyYWdtZW50U2hhZGVyKTsKKyAgICBnbERlbGV0ZVByb2dyYW0oaWQpOworfQorCit2b2lkIFByb2dyYW06OnVzZSgpIHsKKyAgICBnbFVzZVByb2dyYW0oaWQpOworfQorCitpbnQgUHJvZ3JhbTo6YWRkQXR0cmliKGNvbnN0IGNoYXIqIG5hbWUpIHsKKyAgICBpbnQgc2xvdCA9IGdsR2V0QXR0cmliTG9jYXRpb24oaWQsIG5hbWU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HZvaWQgdXNlKGNvbnN0IEdMZmxvYXQqIHByb2plY3Rpb25NYXRyaXgsIGNvbnN0IEdMZmxvYXQqIG1vZGVsVmlld01hdHJpeCwKKyAgICAgICAgICAgICBjb25zdCBHTGZsb2F0KiB0cmFuc2Zvcm1NYXRyaXgpOworCisgICAgLyoqCisgICAgICogTmFtZSBvZiB0aGUgcG9zaXRpb24gYXR0cmlidXRlLgorICAgICAqLworICAgIGludCBwb3NpdGlvbjsKKyAgICAvKioKKyAgICAgKiBOYW1lIG9mIHRoZSBjb2xvciBhdHRyaWJ1dGUuCisgICAgICovCisgICAgaW50IGNvbG9yOworCisgICAgLyoqCisgICAgICogTmFtZSBvZiB0aGUgcHJvamVjdGlvbiB1bmlmb3JtLgorICAgICAqLworICAgIGludCBwcm9qZWN0aW9uOworICAgIC8qKgorICAgICAqIE5hbWUgb2YgdGhlIG1vZGVsVmlldyB1bmlmb3JtLgorICAgICAqLworICAgIGludCBtb2RlbFZpZXc7CisgICAgLyoqCisgICAgICogTmFtZSBvZiB0aGUgdHJhbnNmb3JtIHVuaWZvcm0uCisgICAgICovCisgICAgaW50IHRyYW5zZm9ybTsKKworcHJvdGVjdGVkOgorICAgIHZvaWQgZ2V0QXR0cmlic0FuZFVuaWZvcm1zKCk7Cit9OworCisvKioKKyAqIFByb2dyYW0gdXNlZCB0byBkcmF3IHRleHR1cmVkIHZlcnRpY2VzLiBJbiBhZGRpdGlvbiB0byBldmVyeXRoaW5nIHRoYXQgdGhlCisgKiBEcmF3Q29sb3JQcm9ncmFtIHN1cHBvcnRzLCB0aGUgZm9sbG93aW5nIHR3byBhdHRyaWJ1dGVzIG11c3QgYmUgc3BlY2lmaWVkOgorICogICAgICBzYW1wbGVyMkQgc2FtcGxlciwgdGhlIHRleHR1cmUgc2FtcGxlcgorICogICAgICB2ZWMyIHRleENvb3JkcywgdGhlIHRleHR1cmUgY29vcmRpbmF0ZXMgb2YgdGhlIHZlcnRleAorICovCitjbGFzcyBEcmF3VGV4dH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AgYm90dG9tKGJvdHRvbSkgeworICAgIH0KKworICAgIFJlY3QoY29uc3QgUmVjdCYgcikgeworICAgICAgICBzZXQocik7CisgICAgfQorCisgICAgUmVjdChSZWN0JiByKSB7CisgICAgICAgIHNldChyKTsKKyAgICB9CisKKyAgICBSZWN0JiBvcGVyYXRvcj0oY29uc3QgUmVjdCYgcikgeworICAgICAgICBzZXQocik7CisgICAgICAgIHJldHVybiAqdGhpczsKKyAgICB9CisKKyAgICBSZWN0JiBvcGVyYXRvcj0oUmVjdCYgcikgeworICAgICAgICBzZXQocik7CisgICAgICAgIHJldHVybiAqdGhpczsKKyAgICB9CisKKyAgICBmcmllbmQgaW50IG9wZXJhdG9yPT0oY29uc3QgUmVjdCYgYSwgY29uc3QgUmVjdCYgYikgeworICAgICAgICByZXR1cm4gIW1lbWNtcCgmYSwgJmIsIHNpemVvZihhKSk7CisgICAgfQorCisgICAgZnJpZW5kIGludCBvcGVyYXRvciE9KGNvbnN0IFJlY3QmIGEsIGNvbnN0IFJlY3QmIGIpIHsKKyAgICAgICAgcmV0dXJuIG1lbWNtcCgmYSwgJmIsIHNpemVvZihhKSk7CisgICAgfQorCisgICAgYm9vbCBpc0VtcHR5KCkgY29uc3QgeworICAgICAgICByZXR1cm4gbGVmdCA+PSByaWdodCB8fCB0b3AgPj0gYm90dG9tOworICAgIH0KKworICAgIHZvaWQgc2V0RW1wdHkoKSB7CisgICAgICAgIG1lbXNldCh0aGlzLCAwLCBzaXplb2YoKnRoaXMpKTsKKyAgICB9CisKKyAgICB2b2lkIHNldChmbG9hdCBsZWZ0LCBmbG9hdCB0b3AsIGZsb2F0IHJpZ2h0LCBmbG9hdCBib3R0b20pIHsKKyAgICAgICAgdGhpcy0+bGVmdCA9IGxlZnQ7CisgICAgICAgIHRoaXMtPnJpZ2h0ID0gcmlnaHQ7CisgICAgICAgIHRoaXMtPnRvcCA9IHRvcDsKKyAgICAgICAgdGhpcy0+Ym90dG9tID0gYm90dG9tOworICAgIH0KKworICA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gYXMgdGhlIHByZXZpb3VzCisgICAgICogc25hcHNob3QuCisgICAgICovCisgICAgU25hcHNob3QoY29uc3Qgc3A8U25hcHNob3Q+IHMpOgorICAgICAgICAgICAgdHJhbnNmb3JtKHMtPnRyYW5zZm9ybSksCisgICAgICAgICAgICBjbGlwUmVjdChzLT5jbGlwUmVjdCksCisgICAgICAgICAgICBmbGFncyhrRmxhZ0RpcnR5VHJhbnNmb3JtKSwKKyAgICAgICAgICAgIHByZXZpb3VzKHMpLAorICAgICAgICAgICAgbGF5ZXIoMC4wZiwgMC4wZiwgMC4wZiwgMC4wZiksCisgICAgICAgICAgICB0ZXh0dXJlKDApLAorICAgICAgICAgICAgZmJvKDApLAorICAgICAgICAgICAgYWxwaGEoMjU1KSB7CisgICAgfQorCisgICAgLyoqCisgICAgICogVmFyaW91cyBmbGFncyBzZXQgb24gI2ZsYWdzLgorICAgICAqLworICAgIGVudW0gRmxhZ3MgeworICAgICAgICAvKioKKyAgICAgICAgICogSW5kaWNhdGVzIHRoYXQgdGhlIGNsaXAgcmVnaW9uIHdhcyBtb2RpZmllZC4gV2hlbiB0aGlzCisgICAgICAgICAqIHNuYXBzaG90IGlzIHJlc3RvcmVkIHNvIG11c3QgdGhlIGNsaXAuCisgICAgICAgICAqLworICAgICAgICBrRmxhZ0NsaXBTZXQgPSAweDEsCisgICAgICAgIC8qKgorICAgICAgICAgKiBJbmRpY2F0ZXMgdGhhdCB0aGUgc25hcHNob3QgaG9sZHMgbmV3IHRyYW5zZm9ybQorICAgICAgICAgKiBpbmZvcm1hdGlvbi4KKyAgICAgICAgICovCisgICAgICAgIGtGbGFnRGlydHlUcmFuc2Zvcm0gPSAweDIsCisgICAgICAgIC8qKgorICAgICAgICAgKiBJbmRpY2F0ZXMgdGhhdCB0aGlzIHNuYXBzaG90IHdhcyBjcmVhdGVkIHdoZW4gc2F2aW5nCisgICAgICAgICAqIGEgbmV3IGxheWVyLgorICAgICAgICAgKi8KKyAgICAgICAga0ZsYWdJc0xheWVyID0gMHg0LAorICAgIH07CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBjdXJyZW50IGNsaXAgcmVnaW9uIG1hcHBlZCBieSB0aGUgY3VycmVudCB0cmFuc2Zvcm0uCisgICAgICovCisgICAgY29uc3QgUmVjdCYgZ2V0TWFwcGVkQ2xpcCgpIHsKKyAgICAgICAgaWYgKGZsYWdzICYga0ZsYWdEaXJ0eVRyYW5zZm9ybSkgeworICAgICAgICAgICAgZmxhZ3MgJj0gfmtGbGFnRGlydHlUcmFuc2Zvcm07CisgICAgICAgICAgICBtYXBwZWRDbGlwLnNldChjbGlwUmVjdCk7CisgICAgICAgICAgICB0cmFuc2Zvcm0ubWFwUmVjdChtYXBwZWRDbGlwKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbWFwcGVkQ2xpcDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBMb2NhbCB0cmFuc2Zvcm1hdGlvbi4gSG9sZHMgdGhlIGN1cnJlbnQgdHJhbnNsYXRpb24sIHNjYWxlIGFuZAorICAgICAqIHJvdGF0aW9uIHZhbHVlcy4KKyAgICAgKi8KKyAgICBtYXQ0IHRyYW5zZm9ybTsKKworICAgIC8qKgorICAgICAqIEN1cnJlbnQgY2xpcCByZWdpb24uCisgICAgICovCisgICAgUmVjdCBjbGlwUmVjdDsKKworICAgIC8qKgorICAgICAqIERpcnR5IGZsYWdzLgorICAgICAqLworICAgIGludCBmbGFnczsKKworICAgIC8qKgorICAgICAqIFByZXZpb3VzIHNuYXBzaG90LgorICAgICAqLworICAgIHNwPFNuYXBzaG90PiBwcmV2aW91czsKKworICAgIC8qKgorICAgICAqIENvb3JkaW5hdGVzIG9mIHRoZSBsYXllciBjb3JyZXNwb25kaW5nIHRvIHRoaXMgc25hcHNob3QuCisgICAgICogT25seSBzZXQgd2hlbiB0aGUgZmxhZyBrRmxhZ0lzTGF5ZXIgaXMgc2V0LgorICAgICAqLworICAgIFJlY3QgbGF5ZXI7Cisg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CituYW1lc3BhY2UgdWlyZW5kZXJlciB7CisKKy8qKgorICogUmVwcmVzZW50cyBhbiBPcGVuR0wgdGV4dHVyZS4KKyAqLworc3RydWN0IFRleHR1cmUgeworICAgIC8qKgorICAgICAqIE5hbWUgb2YgdGhlIHRleHR1cmUuCisgICAgICovCisgICAgR0x1aW50IGlkOworICAgIC8qKgorICAgICAqIEdlbmVyYXRpb24gb2YgdGhlIGJhY2tpbmcgYml0bWFwLAorICAgICAqLworICAgIHVpbnQzMl90IGdlbmVyYXRpb247CisgICAgLyoqCisgICAgICogSW5kaWNhdGVzIHdoZXRoZXIgdGhlIHRleHR1cmUgcmVxdWlyZXMgYmxlbmRpbmcuCisgICAgICovCisgICAgYm9vbCBibGVuZDsKKyAgICAvKioKKyAgICAgKiBXaWR0aCBvZiB0aGUgYmFja2luZyBiaXRtYXAuCisgICAgICovCisgICAgdW5zaWduZWQgaW50IHdpZHRoOworICAgIC8qKgorICAgICAqIEhlaWdodCBvZiB0aGUgYmFja2luZyBiaXRtYXAuCisgICAgICovCisgICAgdW5zaWduZWQgaW50IGhlaWdodDsKK307IC8vIHN0cnVjdCBUZXh0dXJlCisKK307IC8vIG5hbWVzcGFjZSB1aXJlbmRlcmVyCit9OyAvLyBuYW1lc3BhY2UgYW5kcm9pZAorCisjZW5kaWYgLy8gQU5EUk9JRF9VSV9URVhUVVJFX0gKZGlmZiAtLWdpdCBhL2xpYnMvaHd1aS9UZXh0dXJlQ2FjaGUuY3BwIGIvbGlicy9od3VpL1RleHR1cmVDYWNoZS5jcHAKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uN2I4YjMxMwotLS0gL2Rldi9udWxsCisrKyBiL2xpYnMvaHd1aS9UZXh0dXJlQ2FjaGUuY3BwCkBAIC0wLDAgKzEsMTAzIEBACisvKgorICogQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY3QKKyAqCisgKiBMaWNlb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AgICAgICBtRXhwb3J0VmFyX2dQRlNCYWNrZ3JvdW5kID0gdjsKKyAgICAgICAgc2V0VmFyKG1FeHBvcnRWYXJJZHhfZ1BGU0JhY2tncm91bmQsICh2ID09IG51bGwpID8gMCA6IHYuZ2V0SUQoKSk7CisgICAgfQorCisgICAgcHVibGljIFByb2dyYW1TdG9yZSBnZXRfZ1BGU0JhY2tncm91bmQoKSB7CisgICAgICAgIHJldHVybiBtRXhwb3J0VmFyX2dQRlNCYWNrZ3JvdW5kOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBtRXhwb3J0VmFySWR4X2dSb3RhdGUgPSA1OworICAgIHByaXZhdGUgZmxvYXQgbUV4cG9ydFZhcl9nUm90YXRlOworICAgIHB1YmxpYyB2b2lkIHNldF9nUm90YXRlKGZsb2F0IHYpIHsKKyAgICAgICAgbUV4cG9ydFZhcl9nUm90YXRlID0gdjsKKyAgICAgICAgc2V0VmFyKG1FeHBvcnRWYXJJZHhfZ1JvdGF0ZSwgdik7CisgICAgfQorCisgICAgcHVibGljIGZsb2F0IGdldF9nUm90YXRlKCkgeworICAgICAgICByZXR1cm4gbUV4cG9ydFZhcl9nUm90YXRlOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBtRXhwb3J0VmFySWR4X2dJdGFsaWMgPSA2OworICAgIHByaXZhdGUgRm9udCBtRXhwb3J0VmFyX2dJdGFsaWM7CisgICAgcHVibGljIHZvaWQgc2V0X2dJdGFsaWMoRm9udCB2KSB7CisgICAgICAgIG1FeHBvcnRWYXJfZ0l0YWxpYyA9IHY7CisgICAgICAgIHNldFZhcihtRXhwb3J0VmFySWR4X2dJdGFsaWMsIHYpOworICAgIH0KKworICAgIHB1YmxpYyBGb250IGdldF9nSXRhbGljKCkgeworICAgICAgICByZXR1cm4gbUV4cG9ydFZhcl9nSXRhbGljOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBtRXhwb3J0VmFyS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ICAgICAgIG5ld1BhcnQgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHN0b3JlSTMyKGNvbiwgMiwgMCwgbmV3UGFydCk7Ci0gICAgfQotCi0gICAgZHJhd0NvdW50ID0gMDsKLSAgICBmb3IgKGN0PTA7IGN0IDwgY291bnQ7IGN0KyspIHsKLSAgICAgICAgc3JjSWR4ID0gY3QgKiA1ICsgMTsKLQotICAgICAgICBkeCA9IGxvYWRJMzIoY29uLCAyLCBzcmNJZHgpOwotICAgICAgICBkeSA9IGxvYWRJMzIoY29uLCAyLCBzcmNJZHggKyAxKTsKLSAgICAgICAgbGlmZSA9IGxvYWRJMzIoY29uLCAyLCBzcmNJZHggKyAyKTsKLSAgICAgICAgcG9zeCA9IGxvYWRJMzIoY29uLCAyLCBzcmNJZHggKyAzKTsKLSAgICAgICAgcG9zeSA9IGxvYWRJMzIoY29uLCAyLCBzcmNJZHggKyA0KTsKLQotICAgICAgICBpZiAobGlmZSkgewotICAgICAgICAgICAgaWYgKHBvc3kgPCAoNDgwIDw8IDE2KSkgewotICAgICAgICAgICAgICAgIGRzdElkeCA9IGRyYXdDb3VudCAqIDk7Ci0gICAgICAgICAgICAgICAgYyA9IDB4ZmZhZmNmIHwgKChsaWZlID4+IGxpZmVTaGlmdCkgPDwgMjQpOwotCi0gICAgICAgICAgICAgICAgc3RvcmVVMzIoY29uLCAxLCBkc3RJZHgsIGMpOwotICAgICAgICAgICAgICAgIHN0b3JlSTMyKGNvbiwgMSwgZHN0SWR4ICsgMSwgcG9zeCk7Ci0gICAgICAgICAgICAgICAgc3RvcmVJMzIoY29uLCAxLCBkc3RJZHggKyAyLCBwb3N5KTsKLQotICAgICAgICAgICAgICAgIHN0b3JlVTMyKGNvbiwgMSwgZHN0SWR4ICsgMywgYyk7Ci0gICAgICAgICAgICAgICAgc3RvcmVJMzIoY29uLCAxLCBkc3RJZHggKyA0LCBwb3N4ICsgMHgxMDAwMCk7Ci0gICAgICAgICAgICAgICAgc3RvcmVJMzIoY29uLCAxLCBkc3RJZHggKyA1LCBwb3N5ICsgZHkgKiA0KTsKLQotICAgICAgICAgICAgICAgIHN0b3JlVTMyKGNvbiwgMSwgZHN0SWR4ICsgNiwgYyk7Ci0gICAgICAgICAgICAgICAgc3RvcmVJMzIoY29uLCAxLCBkc3RJZHggKyA3LCBwb3N4IC0gMHgxMDAwMCk7Ci0gICAgICAgICAgICAgICAgc3RvcmVJMzIoY29uLCAxLCBkc3RJZHggKyA4LCBwb3N5ICsgZHkgKiA0KTsKLSAgICAgICAgICAgICAgICBkcmF3Q291bnQgKys7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmIChkeSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgZHkgPSAoLWR5KSA+PiAxOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcG9zeCA9IHBvc3ggKyBkeDsKLSAgICAgICAgICAgIHBvc3kgPSBwb3N5ICsgZHk7Ci0gICAgICAgICAgICBkeSA9IGR5ICsgMHg0MDA7Ci0gICAgICAgICAgICBsaWZlIC0tOwotCi0gICAgICAgICAgICAvL3N0b3JlSTMyKGNvbiwgMiwgc3JjSWR4LCBkeCk7Ci0gICAgICAgICAgICBzdG9yZUkzMihjb24sIDIsIHNyY0lkeCArIDEsIGR5KTsKLSAgICAgICAgICAgIHN0b3JlSTMyKGNvbiwgMiwgc3JjSWR4ICsgMiwgbGlmZSk7Ci0gICAgICAgICAgICBzdG9yZUkzMihjb24sIDIsIHNyY0lkeCArIDMsIHBvc3gpOwotICAgICAgICAgICAgc3RvcmVJMzIoY29uLCAyLCBzcmNJZHggKyA0LCBwb3N5KTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGRyYXdUcmlhbmdsZUFycmF5KGNvbiwgTkFNRURfUGFydEJ1ZmZlciwgZHJhd0NvdW50KTsKLSAgICByZXR1cm4gMTsKLX0KZGlmZiAtLWdpdCBhL2x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b24sIGVudi0+dGV4W2xhc3RGb2N1c0lEXSwgMSk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGZvY3VzSUQgPj0gMCkgewotICAgICAgICAgICAgdXBsb2FkVG9UZXh0dXJlKGNvbiwgZW52LT50ZXhbZm9jdXNJRF0sIDApOwotICAgICAgICB9Ci0gICAgfQotICAgICovCi0gICAgbGFzdEZvY3VzID0gZm9jdXNJRDsKLQotICAgIGludCB0cmlhbmdsZU9mZnNldHNDb3VudCA9IFBvcy0+dHJpYW5nbGVPZmZzZXRDb3VudDsKLQotICAgIGludCBpbWdJZCA9IDA7Ci0gICAgZm9yIChpbWdJZD0xOyBpbWdJZCA8PSBpbWdDb3VudDsgaW1nSWQrKykgewotICAgICAgICBmbG9hdCBwb3MgPSBmb2N1c1BvcyArIGltZ0lkICsgMC40ZjsKLSAgICAgICAgaW50IG9mZnNldCA9IChpbnQpZmxvb3JmKHBvcyAqIDIuZik7Ci0gICAgICAgIHBvcyA9IHBvcyAtIDAuNzVmOwotCi0gICAgICAgIG9mZnNldCA9IG9mZnNldCArIHRyaWFuZ2xlT2Zmc2V0c0NvdW50IC8gMjsKLSAgICAgICAgaWYgKCEoKG9mZnNldCA8IDApIHx8IChvZmZzZXQgPj0gdHJpYW5nbGVPZmZzZXRzQ291bnQpKSkgewotICAgICAgICAgICAgaW50IHN0YXJ0ID0gb2Zmc2V0IC0yOwotICAgICAgICAgICAgaW50IGVuZCA9IG9mZnNldCArIDI7Ci0KLSAgICAgICAgICAgIGlmIChzdGFydCA8IDApIHsKLSAgICAgICAgICAgICAgICBzdGFydCA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoZW5kID49IHRyaWFuZ2xlT2Zmc2V0c0NvdW50KSB7Ci0gICAgICAgICAgICAgICAgZW5kID0gdHJpYW5nbGVPZmZzZXRzQ291bnQtMTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgYmluZFRleHR1cmUoTkFNRURfUEZJbWFnZX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SAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLQotcGFja2FnZSBjb20uYW5kcm9pZC5maWxtOwotCi1pbXBvcnQgamF2YS5pby5Xcml0ZXI7Ci1pbXBvcnQgamF2YS5sYW5nLk1hdGg7Ci1pbXBvcnQgYW5kcm9pZC51dGlsLkxvZzsKLQotaW1wb3J0IGFuZHJvaWQucmVuZGVyc2NyaXB0LlJlbmRlclNjcmlwdDsKLWltcG9ydCBhbmRyb2lkLnJlbmRlcnNjcmlwdC5TaW1wbGVNZXNoOwotCi0KLWNsYXNzIEZpbG1TdHJpcE1lc2ggewotCi0gICAgY2xhc3MgVmVydGV4IHsKLSAgICAgICAgZmxvYXQgbng7Ci0gICAgICAgIGZsb2F0IG55OwotICAgICAgICBmbG9hdCBuejsKLSAgICAgICAgZmxvYXQgczsKLSAgICAgICAgZmxvYXQgdDsKLSAgICAgICAgZmxvYXQgeDsKLSAgICAgICAgZmxvYXQgeTsKLSAgICAgICAgZmxvYXQgejsKLQotICAgICAgICBWZXJ0ZXgoKSB7Ci0gICAgICAgICAgICBueCA9IDA7Ci0gICAgICAgICAgICBueSA9IDA7Ci0gICAgICAgICAgICBueiA9IDA7Ci0gICAgICAgICAgICBzID0gMDsKLSAgICAgICAgICAgIHQgPSAwOwotICAgICAgICAgICAgeCA9IDA7Ci0gICAgICAgICAgICB5ID0gMDsKLSAgICAgICAgICAgIHogPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgdm9pZCB4eXooZmxvYXQgX3gsIGZsb2F0IF95LCBmbG9hdCBfeikgewotICAgICAgICAgICAgeCA9IF94OwotICAgICAgICAgICAgeSA9IF95OwotICAgICAgICAgICAgeiA9IF96OwotICAgICAgICB9Ci0KLSAgICAgICAgdm9pZCBueHl6KGZsb2F0IF94LCBmbG9hdCBfeSwgZmxvYXQgX3opIHsKLSAgICAgICAgICAgIG54ID0gX3g7Ci0gICAgICAgICAgICBueSA9IF95OwotICAgICAgICAgICAgbnogPSBfejsKLSAgICAgICAgfQotCi0gICAgICAgIHZvaWQgc3QoZmxvYXQgX3MsIGZsb2F0IF90KSB7Ci0gICAgICAgICAgICBzID0gX3M7Ci0gICAgICAgICAgICB0ID0gX3Q7Ci0gICAgICAgIH0KLQotICAgICAgICB2b2lkIGNvbXB1dGVOb3JtKFZlcnRleCB2MSwgVmVydGV4IHYyKSB7Ci0gICAgICAgICAgICBmbG9hdCBkeCA9IHYxLnggLSB2Mi54OwotICAgICAgICAgICAgZmxvYXQgZHkgPSB2MS55IC0gdjIueTsKLSAgICAgICAgICAgIGZsb2F0IGR6ID0gdjEueiAtIHYyLno7Ci0gICAgICAgICAgICBmbG9hdCBsZW4gPSAoZmxvYXQpamF2YS5sYW5nLk1hdGguc3FydChkeCpkeCArIGR5KmR5ICsgZHoqZHopOwotICAgICAgICAgICAgZHggLz0gbGVuOwotICAgICAgICAgICAgZHkgLz0gbGVuOwotICAgICAgICAgICAgZHogLz0gbGVuOwotCi0gICAgICAgICAgICBueCA9IGR4ICogZHo7Ci0gICAgICAgICAgICBueSA9IGR5ICogZHo7Ci0gICAgICAgICAgICBueiA9IChmbG9hdClqYXZhLmxhbmcuTWF0aC5zcXJ0KGR4KmR4ICsgZHkqZHkpOwotCi0gICAgICAgICAgICBsZW4gPSAoZmxvYXQpamF2YS5sYW5nLk1hdGguc3FydChueCpueCArIG55Km55ICsgbnoqbnopOwotICAgICAgICAgICAgbnggLz0gbGVuOwotICAgICAgICAgICAgbnkgLz0gbGVuOwotICAgICAgICAgICAgbnogLz0gbGVuOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaW50W10gbVRyaWFuZ2xlT2Zmc2V0czsKLSAgICBmbG9hdFtdIG1UcmlhbmdsZU9mZnNldHNUZXg7Ci0gICAgaW50IG1UcmlhbmdsZU9mZnNldHNDb3VudDsKLQotICAgIFNpbXBsZU1lc2ggaW5pdChSZW5kZXJTY3JpcHQgcnMpCi0gICAgewotICAgICAgICBmbG9hdCB2dHhbX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BmLCAtMTguOTI0MDg0ZiwKLSAgICAgICAgICAgIDE1My41ODUxMzdmLCAtMzYuMTczMDQwZiwKLSAgICAgICAgICAgIDE0MS4xMzE2ODZmLCAtNTAuNDg2OTE0ZiwKLSAgICAgICAgICAgIDEyNS4xNDE3OTVmLCAtNjAuNjk5NTk0ZiwKLSAgICAgICAgICAgIDEwNi45MTgxMTdmLCAtNjUuOTc5MDgxZiwKLSAgICAgICAgICAgIDg3Ljk0NTI4M2YsIC02NS44OTUyNjlmLAotICAgICAgICAgICAgODBmLCAtNjUuODk1MjY5ZiwKLSAgICAgICAgICAgIDYwZiwgLTY1Ljg5NTI2OWYsCi0gICAgICAgICAgICA0MGYsIC02NS44OTUyNjlmLAotICAgICAgICAgICAgMjBmLCAtNjUuODk1MjY5ZiwKLSAgICAgICAgICAgIDBmLCAtNjUuODk1MjY5ZiwKLSAgICAgICAgICAgIC0yMGYsIC02NS44OTUyNjlmLAotICAgICAgICAgICAgLTQwZiwgLTY1Ljg5NTI2OWYsCi0gICAgICAgICAgICAtNjBmLCAtNjUuODk1MjY5ZiwKLSAgICAgICAgICAgIC04MGYsIC02NS44OTUyNjlmLAotICAgICAgICAgICAgLTg3Ljk0NTI4M2YsIC02NS44OTUyNjlmLAotICAgICAgICAgICAgLTEwNi45MTgxMTdmLCAtNjUuOTc5MDgxZiwKLSAgICAgICAgICAgIC0xMjUuMTQxNzk1ZiwgLTYwLjY5OTU5NGYsCi0gICAgICAgICAgICAtMTQxLjEzMTY4NmYsIC01MC40ODY5MTRmLAotICAgICAgICAgICAgLTE1My41ODUxMzdmLCAtMzYuMTczMDQwZiwKLSAgICAgICAgICAgIC0xNjEuNDg3NjAwZiwgLTE4LjkyNDA4NGYsCi0gICAgICAgICAgICAtMTY0LjE5NTI4M2YsIC0wLjE0NTI2OWYsCi0gICAgICAgICAgICAtMTYxLjQ4NzYwMGYsIDE4LjYzMzU0NWYsCi0gICAgICAgICAgICAgLTE1My41ODUxMzdmLCAzNS44ODI1MDJmLAotICAgICAgICAgICAgIC0xNDEuMTMxNjg2ZiwgNTAuMTk2Mzc2ZiwKLSAgICAgICAgICAgICAtMTI1LjE0MTc5NWYsIDYwLjQwOTA1NmYsCi0gICAgICAgICAgICAgLTEwNi45MTgxMTdmLCA2NS42ODg1NDJmLAotICAgICAgICAgICAgIC04Ny45NDUyODNmLCA2NS42MDQ3MzFmLAotICAgICAgICAgICAgIC03Mi41MDczMTNmLCA2NS41MzY1MzRmLAotICAgICAgICAgICAgIC01Ny42Nzg5MjBmLCA2OS44MzIzOTBmLAotICAgICAgICAgICAgIC00NC42NjgxMzVmLCA3OC4xNDIzMjdmLAotICAgICAgICAgICAgIC0zNC41MzQ5MDhmLCA4OS43ODkzNThmLAotICAgICAgICAgICAgIC0yOC4xMDQ3NjdmLCAxMDMuODI0NjMxZiwKLSAgICAgICAgICAgICAtMjUuOTAxNTU3ZiwgMTE5LjEwNDczMWYsCi0gICAgICAgICAgICAgLTI4LjEwNDc2N2YsIDEzNC4zODQ4MzFmLAotICAgICAgICAgICAgIC0zNC41MzQ5MDhmLCAxNDguNDIwMTA0ZiwKLSAgICAgICAgICAgICAtNDQuNjY4MTM1ZiwgMTYwLjA2NzEzNGYsCi0gICAgICAgICAgICAgLTU3LjY3ODkyMGYsIDE2OC4zNzcwNzFmLAotICAgICAgICAgICAgIC03Mi41MDczMTNmLCAxNzIuNjcyOTI3ZiwKLSAgICAgICAgICAgICAtODcuOTQ1MjgzZiwgMTcyLjYwNDczMWYsCi0gICAgICAgICAgICAgLTk4Ljk1ODk5NGYsIDE3Mi40NDIzNjRmLAotICAgICAgICAgICAgIC0xMDkuNDg5NTIzZiwgMTY5LjIxMTg2NmYsCi0gICAgICAgICAgICAgLTExOC42OTk1ODJmLCAxNjMuMTcwMDk2ZiwKLSAgICAgICAgICAgICAtMTI1Ljg1Njg3MmYsIDE1NC43OTc0MzlmLAotICAgICAgICAgICAgIC0xMzAuMzkyMzExZiwgMTQ0Ljc1OTYxM2YsCi0gICA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AgICAgICB0Lm55IC89IGxlbjsKLSAgICAgICAgICAgIHQueSA9IC0wLjVmOwotICAgICAgICAgICAgdC50ID0gMDsKLSAgICAgICAgICAgIHRtLnNldE5vcm1hbCh0Lm54LCB0Lm55LCB0Lm56KTsKLSAgICAgICAgICAgIHRtLnNldFRleHR1cmUodC5zLCB0LnQpOwotICAgICAgICAgICAgdG0uYWRkVmVydGV4KHQueCwgdC55LCB0LnopOwotICAgICAgICAgICAgLy9hbmRyb2lkLnV0aWwuTG9nLmUoInJzIiwgInZ0eCB4PSIrdC54KyIgeT0iK3QueSsiIHo9Iit0LnorIiBzPSIrdC5zKyIgdD0iK3QudCk7Ci0gICAgICAgICAgICB0LnkgPSAuNWY7Ci0gICAgICAgICAgICB0LnQgPSAxOwotICAgICAgICAgICAgdG0uc2V0VGV4dHVyZSh0LnMsIHQudCk7Ci0gICAgICAgICAgICB0bS5hZGRWZXJ0ZXgodC54LCB0LnksIHQueik7Ci0gICAgICAgICAgICAvL2FuZHJvaWQudXRpbC5Mb2cuZSgicnMiLCAidnR4IHg9Iit0LngrIiB5PSIrdC55KyIgej0iK3QueisiIHM9Iit0LnMrIiB0PSIrdC50KTsKLQotICAgICAgICAgICAgaWYoKHJ1bm5pbmdTKjIpID4gbVRyaWFuZ2xlT2Zmc2V0c0NvdW50KSB7Ci0gICAgICAgICAgICAgICAgbVRyaWFuZ2xlT2Zmc2V0c1ttVHJpYW5nbGVPZmZzZXRzQ291bnRdID0gY3QqMiAqIDM7Ci0gICAgICAgICAgICAgICAgbVRyaWFuZ2xlT2Zmc2V0c1RleFttVHJpYW5nbGVPZmZzZXRzQ291bnRdID0gdC5zOwotICAgICAgICAgICAgICAgIG1UcmlhbmdsZU9mZnNldHNDb3VudCArKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGNvdW50ID0gKGNvdW50ICogMiAtIDIpOwotICAgICAgICBmb3IgKGludCBjdD0wOyBjdCA8IChjb3VudC0yKTsgY3QrPSA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oQ29udHJvbC0+ZyAqIDI1NS5mKSkgPDwgOCB8Ci0gICAgICAgICAgICAgICAgICAgICgoaW50KShDb250cm9sLT5iICogMjU1LmYpKSA8PCAxNiB8Ci0gICAgICAgICAgICAgICAgICAgICgweGYwIDw8IDI0KTsKLSAgICAgICAgc3RydWN0IHBvaW50X3MgKiBucCA9ICZwW25ld1BhcnRdOwotCi0gICAgICAgIHdoaWxlIChyYXRlLS0pIHsKLSAgICAgICAgICAgIHZlYzJSYW5kKChmbG9hdCAqKSZucC0+ZGVsdGEueCwgck1heCk7Ci0gICAgICAgICAgICBucC0+cG9zaXRpb24ueCA9IHg7Ci0gICAgICAgICAgICBucC0+cG9zaXRpb24ueSA9IHk7Ci0gICAgICAgICAgICBucC0+Y29sb3IgPSBjb2xvcjsKLSAgICAgICAgICAgIG5ld1BhcnQrKzsKLSAgICAgICAgICAgIG5wKys7Ci0gICAgICAgICAgICBpZiAobmV3UGFydCA+PSBjb3VudCkgewotICAgICAgICAgICAgICAgIG5ld1BhcnQgPSAwOwotICAgICAgICAgICAgICAgIG5wID0gJnBbbmV3UGFydF07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBmb3IgKGN0PTA7IGN0IDwgY291bnQ7IGN0KyspIHsKLSAgICAgICAgZmxvYXQgZHkgPSBwLT5kZWx0YS55ICsgMC4xNWY7Ci0gICAgICAgIGZsb2F0IHBvc3kgPSBwLT5wb3NpdGlvbi55ICsgZHk7Ci0gICAgICAgIGlmICgocG9zeSA+IGhlaWdodCkgJiYgKGR5ID4gMCkpIHsKLSAgICAgICAgICAgIGR5ICo9IC0wLjNmOwotICAgICAgICB9Ci0gICAgICAgIHAtPmRlbHRhLnkgPSBkeTsKLSAgICAgICAgcC0+cG9zaXRpb24ueCArPSBwLT5kZWx0YS54OwotICAgICAgICBwLT5wb3NpdGlvbi55ID0gcG9zeTsKLSAgICAgICAgcCsrOwotICAgIH0KLQotICAgIHVwbG9hZFRvQnVmZm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3ByYWdtYSBycyBleHBvcnRfZnVuYyhhZGRQYXJ0aWNsZXMpCisKK2ludCByb290KCkgeworICAgIHJzZ0NsZWFyQ29sb3IoMC5mLCAwLmYsIDAuZiwgMS5mKTsKKyAgICBjb25zdCBmbG9hdCBoZWlnaHQgPSByc2dHZXRIZWlnaHQoKTsKKyAgICBjb25zdCBpbnQgc2l6ZSA9IHJzQWxsb2NhdGlvbkdldERpbVgocnNHZXRBbGxvY2F0aW9uKHBvaW50KSk7CisKKyAgICBQb2ludF90ICogcCA9IHBvaW50OworICAgIGZvciAoaW50IGN0PTA7IGN0IDwgc2l6ZTsgY3QrKykgeworICAgICAgICBwLT5kZWx0YS55ICs9IDAuMTVmOworICAgICAgICBwLT5wb3NpdGlvbiArPSBwLT5kZWx0YTsKKyAgICAgICAgaWYgKChwLT5wb3NpdGlvbi55ID4gaGVpZ2h0KSAmJiAocC0+ZGVsdGEueSA+IDApKSB7CisgICAgICAgICAgICBwLT5kZWx0YS55ICo9IC0wLjNmOworICAgICAgICB9CisgICAgICAgIHArKzsKKyAgICB9CisKKyAgICByc2dEcmF3U2ltcGxlTWVzaChwYXJ0TWVzaCk7CisgICAgcmV0dXJuIDE7Cit9CisKK3ZvaWQgYWRkUGFydGljbGVzKGludCByYXRlLCBmbG9hdCB4LCBmbG9hdCB5LCBib29sIG5ld0NvbG9yKQoreworICAgIGlmIChuZXdDb2xvcikgeworICAgICAgICBwYXJ0Q29sb3IueCA9IHJzUmFuZCgwLjVmLCAxLjBmKTsKKyAgICAgICAgcGFydENvbG9yLnkgPSByc1JhbmQoMS4wZik7CisgICAgICAgIHBhcnRDb2xvci56ID0gcnNSYW5kKDEuMGYpOworICAgIH0KKyAgICBmbG9hdCByTWF4ID0gKChmbG9hdClyYXRlKSAqIDAuMDA1ZjsKKyAgICBpbnQgc2l6ZSA9IHJzQWxsb2NhdGlvbkdldERpbVgocnNHZXRBbGxvY2F0aW9uKHBvaW50KSk7CisgICAgdWNoYXI0IGMgPSByc1BhY2tDb2xvclRvODg4OChwYXJ0Q29sb3IpOworCisgICAgUG9pbnRfdCAqIG5wID0gJnBvaW50W25ld1BhcnRdOworICAgIGZsb2F0MiBwID0ge3gsIHl9OworICAgIHdoaWxlIChyYXRlLS0pIHsKKyAgICAgICAgZmxvYXQgYW5nbGUgPSByc1JhbmQoMy4xNGYgKiAyLmYpOworICAgICAgICBmbG9hdCBsZW4gPSByc1JhbmQock1heCk7CisgICAgICAgIG5wLT5kZWx0YS54ID0gbGVuICogc2luKGFuZ2xlKTsKKyAgICAgICAgbnAtPmRlbHRhLnkgPSBsZW4gKiBjb3MoYW5nbGUpOworICAgICAgICBucC0+cG9zaXRpb24gPSBwOworICAgICAgICBucC0+Y29sb3IgPSBjOworICAgICAgICBuZXdQYXJ0Kys7CisgICAgICAgIG5wKys7CisgICAgICAgIGlmIChuZXdQYXJ0ID49IHNpemUpIHsKKyAgICAgICAgICAgIG5ld1BhcnQgPSAwOworICAgICAgICAgICAgbnAgPSAmcG9pbnRbbmV3UGFydF07CisgICAgICAgIH0KKyAgICB9Cit9CisKZGlmZiAtLWdpdCBhL2xpYnMvcnMvamF2YS9Gb3VudGFpbi9yZXMvcmF3L2ZvdW50YWluMi5ycyBiL2xpYnMvcnMvamF2YS9Gb3VudGFpbi9yZXMvcmF3L2ZvdW50YWluMi5ycwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMzMwMTE0MC4uMDAwMDAwMAotLS0gYS9saWJzL3JzL2phdmEvRm91bnRhaW4vcmVzL3Jhdy9mb3VudGFpbjIucnMKKysrIC9kZXYvbnVsbApAQCAtMSw3MyArMCwwIEBACi0vLyBGb3VudGFpbiB0ZXN0IHNjcmlwdAotI3ByYWdtYSB2ZXJzaW9uKDEpCi0KLSNpbmNsdWRlICJyc190eXBlcy5yc2giCi0jaW5jbHVkZSAicnNfbWF0aC5yc2giCi0jaW5jbHVkZSAicnNfZ3JhcGhpY3MucnNoIgotCi1zdGF0aWMgaW50IG5ld1BhcnQgPSAwOwotCi10eXBlZGVmIHN0cnVjdCBDb250cm9sX3MgewotICAgIGludCB4LCB5OwotICAgIGludCByYXRlOwotICAgIGludCBjb3VudDsKLSAgICBmbG9hdCByLCBnLCBiOwotICAgIHJzX2FsbG9jYXRpb24gcGFydEJ1ZmZlcjsKLSAgICByc19tZXNoIHBhcnRNZXNoOwotfSBDb250cm9sX3Q7Ci1Db250cm9sX3QgKkNvbnRyb2w7Ci0KLXR5cGVkZWYgc3RydWN0IFBvaW50X3N7Ci0gICAgZmxvYXQyIGRlbHRhOwotICAgIGZsb2F0MiBwb3NpdGlvbjsKLSAgICB1bnNpZ25lZCBpbnQgY29sb3I7Ci19IFBvaW50X3Q7Ci1Qb2ludF90ICpwb2ludDsKLQotaW50IG1haW4oaW50IGxhdW5jaElEKSB7Ci0gICAgaW50IGN0OwotICAgIGludCBjb3VudCA9IENvbnRyb2wtPmNvdW50OwotICAgIGludCByYXRlID0gQ29udHJvbC0+cmF0ZTsKLSAgICBmbG9hdCBoZWlnaHQgPSBnZXRIZWlnaHQoKTsKLSAgICBQb2ludF90ICogcCA9IHBvaW50OwotCi0gICAgaWYgKHJhdGUpIHsKLSAgICAgICAgZmxvYXQgck1heCA9ICgoZmxvYXQpcmF0ZSkgKiAwLjAwNWY7Ci0gICAgICAgIGludCB4ID0gQ29udHJvbC0+eDsKLSAgICAgICAgaW50IHkgPSBDb250cm9sLT55OwotICAgICAgICBpbnQgY29sb3IgPSAoKGludCkoQ29udHJvbC0+ciAqIDI1NS5mKSkgfAotICAgICAgICAgICAgICAgICAgICAoKGludCkoQ29udHJvbC0+ZyAqIDI1NS5mKSkgPDwgOCB8Ci0gICAgICAgICAgICAgICAgICAgICgoaW50KShDb250cm9sLT5iICogMjU1LmYpKSA8PCAxNiB8Ci0gICAgICAgICAgICAgICAgICAgICgweGYwIDw8IDI0KTsKLSAgICAgICAgUG9pbnRfdCAqIG5wID0gJnBbbmV3UGFydF07Ci0KLSAgICAgICAgd2hpbGUgKHJhdGUtLSkgewotICAgICAgICAgICAgbnAtPmRlbHRhID0gdmVjMlJhbmQock1heCk7Ci0gICAgICAgICAgICBucC0+cG9zaXRpb24ueCA9IHg7Ci0gICAgICAgICAgICBucC0+cG9zaXRpb24ueSA9IHk7Ci0gICAgICAgICAgICBucC0+Y29sb3IgPSBjb2xvcjsKLSAgICAgICAgICAgIG5ld1BhcnQrKzsKLSAgICAgICAgICAgIG5wKys7Ci0gICAgICAgICAgICBpZiAobmV3UGFydCA+PSBjb3VudCkgewotICAgICAgICAgICAgICAgIG5ld1BhcnQgPSAwOwotICAgICAgICAgICAgICAgIG5wID0gJnBbbmV3UGFydF07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBmb3IgKGN0PTA7IGN0IDwgY291bnQ7IGN0KyspIHsKLSAgICAgICAgZmxvYXQgZHkgPSBwLT5kZWx0YS55ICsgMC4xNWY7Ci0gICAgICAgIGZsb2F0IHBvc3kgPSBwLT5wb3NpdGlvbi55ICsgZHk7Ci0gICAgICAgIGlmICgocG9zeSA+IGhlaWdodCkgJiYgKGR5ID4gMCkpIHsKLSAgICAgICAgICAgIGR5ICo9IC0wLjNmOwotICAgICAgICB9Ci0gICAgICAgIHAtPmRlbHRhLnkgPSBkeTsKLSAgICAgICAgcC0+cG9zaXRpb24ueCArPSBwLT5kZWx0YS54OwotICAgICAgICBwLT5wb3NpdGlvbi55ID0gcG9zeTsKLSAgICAgICAgcCsrOwotICAgIH0KLQotICAgIHVwbG9hZFRvQnVmZmVyT2JqZWN0KENvbnRyb2wtPnBhcnRCdWZmZXIpOwotICAgIGRyYXdTaW1wbGVNZXNoKENvbnRyb2wtPnBhcnRNZXNoKTsKLSAgICByZXR1cm4gMTsKLX0KZGlmZiAtLWdpdCBhL2xpYnMvcnMvamF2YS9Gb3VudGFpbi9yZXMvcmF3L2ZvdW50YWluX2JjLmJjIGIvbGlicy9ycy9qYXZhL0ZvdW50YWluL3Jlcy9yYXcvZm91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AgICBwcml2YXRlIFJlbmRlclNjcmlwdEdMIG1SUzsKKyAgICBwcml2YXRlIFNjcmlwdENfRm91bnRhaW4gbVNjcmlwdDsKICAgICBwdWJsaWMgdm9pZCBpbml0KFJlbmRlclNjcmlwdEdMIHJzLCBSZXNvdXJjZXMgcmVzLCBpbnQgd2lkdGgsIGludCBoZWlnaHQpIHsKICAgICAgICAgbVJTID0gcnM7CiAgICAgICAgIG1SZXMgPSByZXM7Ci0gICAgICAgIGluaXRSUygpOwotICAgIH0KIAotICAgIHB1YmxpYyB2b2lkIG5ld1RvdWNoUG9zaXRpb24oaW50IHgsIGludCB5LCBpbnQgcmF0ZSkgewotICAgICAgICBpZiAobVNELnJhdGUgPT0gMCkgewotICAgICAgICAgICAgbVNELnIgPSAoKHggJiAweDEpICE9IDApID8gMC5mIDogMS5mOwotICAgICAgICAgICAgbVNELmcgPSAoKHggJiAweDIpICE9IDApID8gMC5mIDogMS5mOwotICAgICAgICAgICAgbVNELmIgPSAoKHggJiAweDQpICE9IDApID8gMC5mIDogMS5mOwotICAgICAgICAgICAgaWYgKChtU0QuciArIG1TRC5nICsgbVNELmIpIDwgMC45ZikgewotICAgICAgICAgICAgICAgIG1TRC5yID0gMC44ZjsKLSAgICAgICAgICAgICAgICBtU0QuZyA9IDAuNWY7Ci0gICAgICAgICAgICAgICAgbVNELmIgPSAxLmY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgbVNELnJhdGUgPSByYXRlOwotICAgICAgICBtU0QueCA9IHg7Ci0gICAgICAgIG1TRC55ID0geTsKLSAgICAgICAgbUludEFsbG9jLmRhdGEobVNEKTsKLSAgICB9Ci0KLQotICAgIC8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCi0KLSAgICBwcml2YXRlIFJlc291cmNlcyBtUmVzOwotCi0gICAgcHJpdmF0ZSBSZW5kZXJTY3JpcHRHTCBtUlM7Ci0gICAgcHJpdmF0ZSBB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Agc2Iuc2V0Um9vdCh0cnVlKTsKLSAgICAgICAgc2Iuc2V0VHlwZShtU0RUeXBlLCAiQ29udHJvbCIsIDApOwotICAgICAgICBzYi5zZXRUeXBlKG1TTS5nZXRWZXJ0ZXhUeXBlKDApLCAicG9pbnQiLCAxKTsKLSAgICAgICAgU2NyaXB0IHNjcmlwdCA9IHNiLmNyZWF0ZSgpOwotICAgICAgICBzY3JpcHQuc2V0Q2xlYXJDb2xvcigwLjBmLCAwLjBmLCAwLjBmLCAxLjBmKTsKLQotICAgICAgICBzY3JpcHQuYmluZEFsbG9jYXRpb24obUludEFsbG9jLCAwKTsKLSAgICAgICAgc2NyaXB0LmJpbmRBbGxvY2F0aW9uKHBhcnRBbGxvYywgMSk7Ci0gICAgICAgIG1SUy5jb250ZXh0QmluZFJvb3RTY3JpcHQoc2NyaXB0KTsKKyAgICAgICAgbVNjcmlwdCA9IG5ldyBTY3JpcHRDX0ZvdW50YWluKG1SUywgbVJlcywgUi5yYXcuZm91bnRhaW5fYmMsIHRydWUpOworICAgICAgICBtU2NyaXB0LnNldF9wYXJ0TWVzaChzbSk7CisgICAgICAgIG1TY3JpcHQuYmluZF9wb2ludChwb2ludHMpOworICAgICAgICBtUlMuY29udGV4dEJpbmRSb290U2NyaXB0KG1TY3JpcHQpOwogICAgIH0KIAorICAgIGJvb2xlYW4gaG9sZGluZ0NvbG9yID0gZmFsc2U7CisgICAgcHVibGljIHZvaWQgbmV3VG91Y2hQb3NpdGlvbihpbnQgeCwgaW50IHksIGludCByYXRlKSB7CisgICAgICAgIGlmIChyYXRlID4gMCkgeworICAgICAgICAgICAgbVNjcmlwdC5pbnZva2VfYWRkUGFydGljbGVzKHJhdGUsIHgsIHksICFob2xkaW5nQ29sb3IpOworICAgICAgICAgICAgaG9sZGluZ0NvbG9yID0gdHJ1ZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGhvbGRpbmdDb2xvciA9IGZhbHNlOworICAgICAgICB9CisKKyAgICB9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ICAgICAgIEVsZW1lbnQuQnVpbGRlciBlYiA9IG5ldyBFbGVtZW50LkJ1aWxkZXIocnMpOworICAgICAgICBlYi5hZGQoRWxlbWVudC5jcmVhdGVWZWN0b3IocnMsIEVsZW1lbnQuRGF0YVR5cGUuRkxPQVRfMzIsIDIpLCAiZGVsdGEiKTsKKyAgICAgICAgZWIuYWRkKEVsZW1lbnQuY3JlYXRlVmVjdG9yKHJzLCBFbGVtZW50LkRhdGFUeXBlLkZMT0FUXzMyLCAyKSwgInBvc2l0aW9uIik7CisgICAgICAgIGViLmFkZChFbGVtZW50LmNyZWF0ZVZlY3RvcihycywgRWxlbWVudC5EYXRhVHlwZS5VTlNJR05FRF84LCA0KSwgImNvbG9yIik7CisgICAgICAgIHJldHVybiBlYi5jcmVhdGUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgIFNjcmlwdEZpZWxkX1BvaW50KFJlbmRlclNjcmlwdCBycywgaW50IGNvdW50KSB7CisgICAgICAgIG1JdGVtQXJyYXkgPSBudWxsOworICAgICAgICBtSU9CdWZmZXIgPSBudWxsOworICAgICAgICBtRWxlbWVudCA9IGNyZWF0ZUVsZW1lbnQocnMpOworICAgICAgICBpbml0KHJzLCBjb3VudCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGNvcHlUb0FycmF5KEl0ZW0gaSwgaW50IGluZGV4KSB7CisgICAgICAgIGlmIChtSU9CdWZmZXIgPT0gbnVsbCkgbUlPQnVmZmVyID0gbmV3IEZpZWxkUGFja2VyKEl0ZW0uc2l6ZW9mICogbVR5cGUuZ2V0WCgpIC8qIGNvdW50ICovKTsKKyAgICAgICAgbUlPQnVmZmVyLnJlc2V0KGluZGV4ICogSXRlbS5zaXplb2YpOworICAgICAgICBtSU9CdWZmZXIuYWRkRjMyKGkuZGVsdGEpOworICAgICAgICBtSU9CdWZmZXIuYWRkRjMyKGkucG9zaXRpb24pOworICAgICAgICBtSU9CdWZmZXIuYWRkVTgoaS5jb2xvcik7CisgICAg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c19ncmFwaGljcy5yc2giCiAKLXZvaWQgbWFpbigpIHsKLSAgICBpbnQgdCA9IHVwdGltZU1pbGxpcygpOworI3ByYWdtYSBycyBqYXZhX3BhY2thZ2VfbmFtZShjb20uYW5kcm9pZC5ycy5pbWFnZSkKIAotICAgIHN0cnVjdCBjb2xvcl9zICppbiA9IChzdHJ1Y3QgY29sb3JfcyAqKSBJblBpeGVsOwotICAgIHN0cnVjdCBjb2xvcl9zICpvdXQgPSAoc3RydWN0IGNvbG9yX3MgKikgT3V0UGl4ZWw7CiAKLSAgICBpbnQgY291bnQgPSBQYXJhbXMtPmluV2lkdGggKiBQYXJhbXMtPmluSGVpZ2h0OwotICAgIGludCBpOwotICAgIGZsb2F0IHRocmVzaG9sZCA9IChQYXJhbXMtPnRocmVzaG9sZCAqIDI1NS5mKTsKKyNkZWZpbmUgTUFYX1JBRElVUyAyNQogCi0gICAgZm9yIChpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKLSAgICAgICAgZmxvYXQgbHVtaW5hbmNlID0gMC4yMTI1ZiAqIGluLT5yICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgMC43MTU0ZiAqIGluLT5nICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgMC4wNzIxZiAqIGluLT5iOwotICAgICAgICBpZiAobHVtaW5hbmNlID4gdGhyZXNob2xkKSB7Ci0gICAgICAgICAgICAqb3V0ID0gKmluOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgKigoaW50ICopb3V0KSA9ICooKGludCAqKWluKSAmIDB4ZmYwMDAwMDA7Ci0gICAgICAgIH0KK2ludCBoZWlnaHQ7CitpbnQgd2lkdGg7CitpbnQgcmFkaXVzOwogCi0gICAgICAgIGluKys7Ci0gICAgICAgIG91dCsrOwordWNoYXI0ICogSW5QaXhlbDsKK3VjaGFyNCAqIE91dFBpeGVsOwordWNoYXI0ICogU2NyYXRjaFBpeGVsOworCitmbG9hdCBpbkJsYWNrOworZmxvYXQgb3V0QmxhY2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bG9hdCBnV2VpZ2h0ID0gMC41ODdmOworICAgIGZsb2F0IGJXZWlnaHQgPSAwLjExNGY7CisKKyAgICBmbG9hdCBvbmVNaW51c1MgPSAxLjBmIC0gc2F0dXJhdGlvbjsKKworICAgIHJzTWF0cml4U2V0KCZjb2xvck1hdCwgMCwgMCwgb25lTWludXNTICogcldlaWdodCArIHNhdHVyYXRpb24pOworICAgIHJzTWF0cml4U2V0KCZjb2xvck1hdCwgMCwgMSwgb25lTWludXNTICogcldlaWdodCk7CisgICAgcnNNYXRyaXhTZXQoJmNvbG9yTWF0LCAwLCAyLCBvbmVNaW51c1MgKiByV2VpZ2h0KTsKKyAgICByc01hdHJpeFNldCgmY29sb3JNYXQsIDEsIDAsIG9uZU1pbnVzUyAqIGdXZWlnaHQpOworICAgIHJzTWF0cml4U2V0KCZjb2xvck1hdCwgMSwgMSwgb25lTWludXNTICogZ1dlaWdodCArIHNhdHVyYXRpb24pOworICAgIHJzTWF0cml4U2V0KCZjb2xvck1hdCwgMSwgMiwgb25lTWludXNTICogZ1dlaWdodCk7CisgICAgcnNNYXRyaXhTZXQoJmNvbG9yTWF0LCAyLCAwLCBvbmVNaW51c1MgKiBiV2VpZ2h0KTsKKyAgICByc01hdHJpeFNldCgmY29sb3JNYXQsIDIsIDEsIG9uZU1pbnVzUyAqIGJXZWlnaHQpOworICAgIHJzTWF0cml4U2V0KCZjb2xvck1hdCwgMiwgMiwgb25lTWludXNTICogYldlaWdodCArIHNhdHVyYXRpb24pOworCisgICAgaW5XTWluSW5CID0gaW5XaGl0ZSAtIGluQmxhY2s7CisgICAgb3V0V01pbk91dEIgPSBvdXRXaGl0ZSAtIG91dEJsYWNrOworICAgIG92ZXJJbldNaW5JbkIgPSAxLmYgLyBpbldNaW5JbkI7Cit9CisKK3N0YXRpYyB2b2lkIGNvbXB1dGVHYXVzc2lhbldlaWdodHMoKSB7CisgICAgLy8gQ29tcHV0ZSBnYXVzc2lhbiB3ZWlnaHRzIGZvciB0aGUgYmx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HVyYXRpb24oY3VycmVudFBpeGVsKTsKKworICAgICAgICAgICAgdWNoYXI0ICpvdXRwdXQgPSBPdXRQaXhlbCArIGgqd2lkdGggKyB3OworICAgICAgICAgICAgLy9vdXRwdXQueHl6ID0gY29udmVydF91Y2hhcjMoY3VycmVudFBpeGVsLnh5eik7CisgICAgICAgICAgICBvdXRwdXQtPnggPSAodWludDhfdCljdXJyZW50UGl4ZWwueDsKKyAgICAgICAgICAgIG91dHB1dC0+eSA9ICh1aW50OF90KWN1cnJlbnRQaXhlbC55OworICAgICAgICAgICAgb3V0cHV0LT56ID0gKHVpbnQ4X3QpY3VycmVudFBpeGVsLno7CisgICAgICAgICAgICBvdXRwdXQtPncgPSBpbnB1dC0+dzsKKyAgICAgICAgfQorICAgIH0KKyAgICByc1NlbmRUb0NsaWVudCgmY291bnQsIDEsIDQsIDApOworfQorCitzdGF0aWMgdm9pZCBob3Jpem9udGFsQmx1cigpIHsKKyAgICBmbG9hdDQgYmx1cnJlZFBpeGVsID0gMDsKKyAgICBmbG9hdDQgY3VycmVudFBpeGVsID0gMDsKKyAgICAvLyBIb3Jpem9udGFsIGJsdXIKKyAgICBpbnQgdywgaCwgcjsKKyAgICBmb3IoaCA9IDA7IGggPCBoZWlnaHQ7IGggKyspIHsKKyAgICAgICAgdWNoYXI0ICppbnB1dCA9IEluUGl4ZWwgKyBoKndpZHRoOworICAgICAgICB1Y2hhcjQgKm91dHB1dCA9IFNjcmF0Y2hQaXhlbCArIGgqd2lkdGg7CisKKyAgICAgICAgZm9yKHcgPSAwOyB3IDwgd2lkdGg7IHcgKyspIHsKKyAgICAgICAgICAgIGJsdXJyZWRQaXhlbCA9IDA7CisKKyAgICAgICAgICAgIGZvcihyID0gLXJhZGl1czsgciA8PSByYWRpdXM7IHIgKyspIHsKKyAgICAgICAgICAgICAgICAvLyBTdGVwcGluZyBsZWZ0IGFuZCByaWdodCBhd2F5IGZyb20gdGhlIHBpeGVsCisgICAgICAgICAgICAgICAgaW50IHZhbGlkVyA9IHcgKyByOworICAgICAgICAgICAgICAgIC8vIENsYW1wIHRvIHplcm8gYW5kIHdpZHRoIG1heCgpIGlzbid0IGV4cG9zZWQgZm9yIGludHMgeWV0CisgICAgICAgICAgICAgICAgaWYodmFsaWRXIDwgMCkgeworICAgICAgICAgICAgICAgICAgICB2YWxpZFcgPSAwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZih2YWxpZFcgPiB3aWR0aCAtIDEpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFsaWRXID0gd2lkdGggLSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvL2ludCB2YWxpZFcgPSByc0NsYW1wKHcgKyByLCAwLCB3aWR0aCAtIDEpOworCisgICAgICAgICAgICAgICAgZmxvYXQgd2VpZ2h0ID0gZ2F1c3NpYW5bciArIHJhZGl1c107CisgICAgICAgICAgICAgICAgY3VycmVudFBpeGVsLnggPSAoZmxvYXQpKGlucHV0W3ZhbGlkV10ueCk7CisgICAgICAgICAgICAgICAgY3VycmVudFBpeGVsLnkgPSAoZmxvYXQpKGlucHV0W3ZhbGlkV10ueSk7CisgICAgICAgICAgICAgICAgY3VycmVudFBpeGVsLnogPSAoZmxvYXQpKGlucHV0W3ZhbGlkV10ueik7CisgICAgICAgICAgICAgICAgLy9jdXJyZW50UGl4ZWwudyA9IChmbG9hdCkoaW5wdXQtPmEpOworCisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsICs9IGN1cnJlbnRQaXhlbCp3ZWlnaHQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG91dHB1dC0+eCA9ICh1aW50OF90KWJsdXJyZWRQaXhlbC54OworICAgICAgICAgICAgb3V0cHV0LT55ID0gKHVpbnQ4X3QpYmx1cnJlZFBpeGVsLnk7CisgICAgICAgICAgICBvdXRwdXQtPnogPSAodWludDhfdClibHVycmVkUGl4ZWwuejsKKyAgICAgICAgICAgIC8vb3V0cHV0LT5hID0gKHVpbnQ4X3QpYmx1cnJlZFBpeGVsLnc7CisgICAgICAgICAgICBvdXRwdXQrKzsKKyAgICAgICAgfQorICAgIH0KK30KKworc3RhdGljIHZvaWQgaG9yaXpvbnRhbEJsdXJMZXZlbHMoKSB7CisgICAgZmxvYXQ0IGJsdXJyZWRQaXhlbCA9IDA7CisgICAgZmxvYXQ0IGN1cnJlbnRQaXhlbCA9IDA7CisgICAgLy8gSG9yaXpvbnRhbCBibHVyCisgICAgaW50IHcsIGgsIHI7CisgICAgZm9yKGggPSAwOyBoIDwgaGVpZ2h0OyBoICsrKSB7CisgICAgICAgIHVjaGFyNCAqb3V0cHV0ID0gT3V0UGl4ZWwgKyBoKndpZHRoOworCisgICAgICAgIGZvcih3ID0gMDsgdyA8IHdpZHRoOyB3ICsrKSB7CisgICAgICAgICAgICBibHVycmVkUGl4ZWwgPSAwOworCisgICAgICAgICAgICBmb3IociA9IC1yYWRpdXM7IHIgPD0gcmFkaXVzOyByICsrKSB7CisgICAgICAgICAgICAgICAgLy8gU3RlcHBpbmcgbGVmdCBhbmQgcmlnaHQgYXdheSBmcm9tIHRoZSBwaXhlbAorICAgICAgICAgICAgICAgIGludCB2YWxpZFcgPSB3ICsgcjsKKyAgICAgICAgICAgICAgICAvLyBDbGFtcCB0byB6ZXJvIGFuZCB3aWR0aCBtYXgoKSBpc24ndCBleHBvc2VkIGZvciBpbnRzIHlldAorICAgICAgICAgICAgICAgIGlmKHZhbGlkVyA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgdmFsaWRXID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYodmFsaWRXID4gd2lkdGggLSAxKSB7CisgICAgICAgICAgICAgICAgICAgIHZhbGlkVyA9IHdpZHRoIC0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy9pbnQgdmFsaWRXID0gcnNDbGFtcCh3ICsgciwgMCwgd2lkdGggLSAxKTsKKworICAgICAgICAgICAgICAgIHVjaGFyNCAqaW5wdXQgPSBJblBpeGVsICsgaCp3aWR0aCArIHZhbGlkVzsKKworICAgICAgICAgICAgICAgIGZsb2F0IHdlaWdodCA9IGdhdXNzaWFuW3IgKyByYWRpdXNdOworICAgICAgICAgICAgICAgIGN1cnJlbnRQaXhlbC54ID0gKGZsb2F0KShpbnB1dC0+eCk7CisgICAgICAgICAgICAgICAgY3VycmVudFBpeGVsLnkgPSAoZmxvYXQpKGlucHV0LT55KTsKKyAgICAgICAgICAgICAgICBjdXJyZW50UGl4ZWwueiA9IChmbG9hdCkoaW5wdXQtPnopOworICAgICAgICAgICAgICAgIC8vY3VycmVudFBpeGVsLncgPSAoZmxvYXQpKGlucHV0LT5hKTsKKworICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbC54eXogKz0gY3VycmVudFBpeGVsLnh5eiAqIHdlaWdodDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgYmx1cnJlZFBpeGVsID0gbGV2ZWxzU2F0dXJhdGlvbihibHVycmVkUGl4ZWwpOworCisgICAgICAgICAgICBvdXRwdXQtPnggPSAodWludDhfdClibHVycmVkUGl4ZWwueDsKKyAgICAgICAgICAgIG91dHB1dC0+eSA9ICh1aW50OF90KWJsdXJyZWRQaXhlbC55OworICAgICAgICAgICAgb3V0cHV0LT56ID0gKHVpbnQ4X3QpYmx1cnJlZFBpeGVsLno7CisgICAgICAgICAgICAvL291dHB1dC0+YSA9ICh1aW50OF90KWJsdXJyZWRQaXhlbC53OworICAgICAgICAgICAgb3V0cHV0Kys7CisgICAgICAgIH0KKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkIHZlcnRpY2FsQmx1cigpIHsKKyAgICBmbG9hdDQgYmx1cnJlZFBpeGVsID0gMDsKKyAgICBmbG9hdDQgY3VycmVudFBpeGVsID0gMDsKKyAgICAvLyBWZXJ0aWNhbCBibHVyCisgICAgaW50IHcsIGgsIHI7CisgICAgZm9yKGggPSAwOyBoIDwgaGVpZ2h0OyBoICsrKSB7CisgICAgICAgIHVjaGFyNCAqb3V0cHV0ID0gT3V0UGl4ZWwgKyBoKndpZHRoOworCisgICAgICAgIGZvcih3ID0gMDsgdyA8IHdpZHRoOyB3ICsrKSB7CisKKyAgICAgICAgICAgIGJsdXJyZWRQaXhlbCA9IDA7CisgICAgICAgICAgICBmb3IociA9IC1yYWRpdXM7IHIgPD0gcmFkaXVzOyByICsrKSB7CisjaWYgMQorICAgICAgICAgICAgICAgIGludCB2YWxpZEggPSBoICsgcjsKKyAgICAgICAgICAgICAgICAvLyBDbGFtcCB0byB6ZXJvIGFuZCB3aWR0aAorICAgICAgICAgICAgICAgIGlmKHZhbGlkSCA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgdmFsaWRIID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYodmFsaWRIID4gaGVpZ2h0IC0gMSkgeworICAgICAgICAgICAgICAgICAgICB2YWxpZEggPSBoZWlnaHQgLSAxOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHVjaGFyNCAqaW5wdXQgPSBTY3JhdGNoUGl4ZWwgKyB2YWxpZEgqd2lkdGggKyB3OworCisgICAgICAgICAgICAgICAgZmxvYXQgd2VpZ2h0ID0gZ2F1c3NpYW5bciArIHJhZGl1c107CisKKyAgICAgICAgICAgICAgICBjdXJyZW50UGl4ZWwueCA9IChmbG9hdCkoaW5wdXQtPngpOworICAgICAgICAgICAgICAgIGN1cnJlbnRQaXhlbC55ID0gKGZsb2F0KShpbnB1dC0+eSk7CisgICAgICAgICAgICAgICAgY3VycmVudFBpeGVsLnogPSAoZmxvYXQpKGlucHV0LT56KTsKKworICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbC54eXogKz0gY3VycmVudFBpeGVsLnh5eiAqIHdlaWdodDsKKyNlbHNlCisgICAgICAgICAgICAgICAgaW50IHZhbGlkSCA9IHJzQ2xhbXAoaCArIHIsIDAsIGhlaWdodCAtIDEpOworICAgICAgICAgICAgICAgIHVjaGFyNCAqaW5wdXQgPSBTY3JhdGNoUGl4ZWwgKyB2YWxpZEgqd2lkdGggKyB3OworICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbC54eXogKz0gY29udmVydF9mbG9hdDMoaW5wdXQtPnh5eikgKiBnYXVzc2lhbltyICsgcmFkaXVzXTsKKyNlbmRpZgorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvL291dHB1dC0+eHl6ID0gY29udmVydF91Y2hhcjMoYmx1cnJlZFBpeGVsLnh5eik7CisgICAgICAgICAgICBvdXRwdXQtPnggPSAodWludDhfdClibHVycmVkUGl4ZWwueDsKKyAgICAgICAgICAgIG91dHB1dC0+eSA9ICh1aW50OF90KWJsdXJyZWRQaXhlbC55OworICAgICAgICAgICAgb3V0cHV0LT56ID0gKHVpbnQ4X3QpYmx1cnJlZFBpeGVsLno7CisgICAgICAgICAgICAvL291dHB1dC0+YSA9ICh1aW50OF90KWJsdXJyZWRQaXhlbC53OworICAgICAgICAgICAgb3V0cHV0Kys7CisgICAgICAgIH0KKyAgICB9Cit9CisKK3ZvaWQgZmlsdGVyKCkgeworICAgIFJTX0RFQlVHKGhlaWdodCk7CisgICAgUlNfREVCVUcod2lkdGgpOworICAgIFJTX0RFQlVHKHJhZGl1cyk7CisKKyAgICBjb21wdXRlQ29sb3JNYXRyaXgoKTsKKworICAgIGlmKHJhZGl1cyA9PSAwKSB7CisgICAgICAgIHByb2Nlc3NOb0JsdXIoKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIGNvbXB1dGVHYXVzc2lhbldlaWdodHMoKTsKKworICAgIGhvcml6b250YWxCbHVyTGV2ZWxzKCk7CisgICAgdmVydGljYWxCbHVyKCk7CisKKyAgICBpbnQgY291bnQgPSAwOworICAgIHJzU2VuZFRvQ2xpZW50KCZjb3VudCwgMSwgNCwgMCk7Cit9CisKK3ZvaWQgZmlsdGVyQmVuY2htYXJrKCkgeworCisgICAgY29tcHV0ZUdhdXNzaWFuV2VpZ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0gICAgICAgICAgICAgICAgICAgICAgICBtUGFyYW1zLm91dFdpZHRoLCBtUGFyYW1zLm91dEhlaWdodCk7CiAgICAgICAgICAgICAgICAgbURpc3BsYXlWaWV3LmludmFsaWRhdGUoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfTsKQEAgLTg5LDI5ICs4OSwyMTkgQEAKICAgICAgICAgfQogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCBqYXZhRmlsdGVyKCkgeworICAgIGludCBpbltdOworICAgIGludCBpbnRlcm1bXTsKKyAgICBpbnQgb3V0W107CisgICAgaW50IE1BWF9SQURJVVMgPSAyNTsKKyAgICAvLyBTdG9yZSBvdXIgY29lZmZpY2llbnRzIGhlcmUKKyAgICBmbG9hdCBnYXVzc2lhbltdOworCisgICAgcHJpdmF0ZSBsb25nIGphdmFGaWx0ZXIoKSB7CisgICAgICAgIGZpbmFsIGludCB3aWR0aCA9IG1CaXRtYXBJbi5nZXRXaWR0aCgpOworICAgICAgICBmaW5hbCBpbnQgaGVpZ2h0ID0gbUJpdG1hcEluLmdldEhlaWdodCgpOworICAgICAgICBmaW5hbCBpbnQgY291bnQgPSB3aWR0aCAqIGhlaWdodDsKKworICAgICAgICBpZiAoaW4gPT0gbnVsbCkgeworICAgICAgICAgICAgaW4gPSBuZXcgaW50W2NvdW50XTsKKyAgICAgICAgICAgIGludGVybSA9IG5ldyBpbnRbY291bnRdOworICAgICAgICAgICAgb3V0ID0gbmV3IGludFtjb3VudF07CisgICAgICAgICAgICBnYXVzc2lhbiA9IG5ldyBmbG9hdFtNQVhfUkFESVVTICogMiArIDFdOworICAgICAgICAgICAgbUJpdG1hcEluLmdldFBpeGVscyhpbiwgMCwgd2lkdGgsIDAsIDAsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICB9CisKICAgICAgICAgbG9uZyB0ID0gamF2YS5sYW5nLlN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwotICAgICAgICBpbnQgY291bnQgPSBtUGFyYW1zLmluV2lkdGggKiBtUGFyYW1zLmluSGVpZ2h0OwotICAgICAgICBmbG9hdCB0aHJlc2hvbGQgPSBtUGFyYW1zLnRocmVzaG9sZCAqIDI1NS5mOwogCi0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgewotICAgICAgICAgICAgZmluYWwgZmxvYXQgciA9IChmbG9hdCkoKG1JbkRhdGFbaV0gPj4gMCkgJiAweGZmKTsKLSAgICAgICAgICAgIGZpbmFsIGZsb2F0IGcgPSAoZmxvYXQpKChtSW5EYXRhW2ldID4+IDgpICYgMHhmZik7Ci0gICAgICAgICAgICBmaW5hbCBmbG9hdCBiID0gKGZsb2F0KSgobUluRGF0YVtpXSA+PiAxNikgJiAweGZmKTsKKyAgICAgICAgaW50IHcsIGgsIHI7CiAKLSAgICAgICAgICAgIGZpbmFsIGZsb2F0IGx1bWluYW5jZSA9IDAuMjEyNWYgKiByICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuNzE1NGYgKiBnICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuMDcyMWYgKiBiOwotICAgICAgICAgICAgaWYgKGx1bWluYW5jZSA+IHRocmVzaG9sZCkgewotICAgICAgICAgICAgICAgIG1PdXREYXRhW2ldID0gbUluRGF0YVtpXTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbU91dERhdGFbaV0gPSBtSW5EYXRhW2ldICYgMHhmZjAwMDAwMDsKKyAgICAgICAgZmxvYXQgZlJhZGl1cyA9IChmbG9hdCltUmFkaXVzOworICAgICAgICBpbnQgcmFkaXVzID0gKGludCltUmFkaXVzOworCisgICAgICAgIC8vIENvbXB1dGUgZ2F1c3NpYW4gd2VpZ2h0cyBmb3IgdGhlIGJsdXIKKyAgICAgICAgLy8gZSBpcyB0aGUgZXVsZXIncyBudW1iZXIKKyAgICAgICAgZmxvYXQgZSA9IDIuNzE4MjgxODI4NDU5MDQ1ZjsKKyAgICAg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uMGYgKiBwaSApICogc2lnbWEpOworICAgICAgICBmbG9hdCBjb2VmZjIgPSAtIDEuMGYgLyAoMi4wZiAqIHNpZ21hICogc2lnbWEpOworICAgICAgICBmbG9hdCBub3JtYWxpemVGYWN0b3IgPSAwLjBmOworICAgICAgICBmbG9hdCBmbG9hdFIgPSAwLjBmOworICAgICAgICBmb3IociA9IC1yYWRpdXM7IHIgPD0gcmFkaXVzOyByICsrKSB7CisgICAgICAgICAgICBmbG9hdFIgPSAoZmxvYXQpcjsKKyAgICAgICAgICAgIGdhdXNzaWFuW3IgKyByYWRpdXNdID0gY29lZmYxICogKGZsb2F0KU1hdGgucG93KGUsIGZsb2F0UiAqIGZsb2F0UiAqIGNvZWZmMik7CisgICAgICAgICAgICBub3JtYWxpemVGYWN0b3IgKz0gZ2F1c3NpYW5bciArIHJhZGl1c107CisgICAgICAgIH0KKworICAgICAgICAvL05vdyB3ZSBuZWVkIHRvIG5vcm1hbGl6ZSB0aGUgd2VpZ2h0cyBiZWNhdXNlIGFsbCBvdXIgY29lZmZpY2llbnRzIG5lZWQgdG8gYWRkIHVwIHRvIG9uZQorICAgICAgICBub3JtYWxpemVGYWN0b3IgPSAxLjBmIC8gbm9ybWFsaXplRmFjdG9yOworICAgICAgICBmb3IociA9IC1yYWRpdXM7IHIgPD0gcmFkaXVzOyByICsrKSB7CisgICAgICAgICAgICBmbG9hdFIgPSAoZmxvYXQpcjsKKyAgICAgICAgICAgIGdhdXNzaWFuW3IgKyByYWRpdXNdICo9IG5vcm1hbGl6ZUZhY3RvcjsKKyAgICAgICAgfQorCisgICAgICAgIGZsb2F0IGJsdXJyZWRQaXhlbFIgPSAwLjBmOworICAgICAgICBmbG9hdCBibHVycmVkUGl4ZWxHID0gMC4wZjsKKyAgICAgICAgZmxvYXQgYmx1cnJlZFBpeGVsQiA9IDAuMGY7CisgICAgICAgIGZsb2F0IGJsdXJyZWRQaXhlbEEgPSAwLjBmOworCisgICAgICAgIGZvcihoID0gMDsgaCA8IGhlaWdodDsgaCArKykgeworICAgICAgICAgICAgZm9yKHcgPSAwOyB3IDwgd2lkdGg7IHcgKyspIHsKKworICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbFIgPSAwLjBmOworICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbEcgPSAwLjBmOworICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbEIgPSAwLjBmOworICAgICAgICAgICAgICAgIGJsdXJyZWRQaXhlbEEgPSAwLjBmOworCisgICAgICAgICAgICAgICAgZm9yKHIgPSAtcmFkaXVzOyByIDw9IHJhZGl1czsgciArKykgeworICAgICAgICAgICAgICAgICAgICAvLyBTdGVwcGluZyBsZWZ0IGFuZCByaWdodCBhd2F5IGZyb20gdGhlIHBpeGVsCisgICAgICAgICAgICAgICAgICAgIGludCB2YWxpZFcgPSB3ICsgcjsKKyAgICAgICAgICAgICAgICAgICAgLy8gQ2xhbXAgdG8gemVybyBhbmQgd2lkdGggbWF4KCkgaXNuJ3QgZXhwb3NlZCBmb3IgaW50cyB5ZXQKKyAgICAgICAgICAgICAgICAgICAgaWYodmFsaWRXIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRXID0gMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZih2YWxpZFcgPiB3aWR0aCAtIDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkVyA9IHdpZHRoIC0gMTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGludCBpbnB1dCA9IGluW2gqd2lkdGggKyB2YWxpZFddOworCisgICAgICAgICAgICAgICAgICAgIGludCBSID0gKChpbnB1dCA+PiAyNCkgJiAweGZmKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IEcgPSAoKGlucHV0ID4+IDE2KSAmIDB4ZmYpOworICAgICAgICAgICAgICAgICAgICBpbnQgQiA9ICgoaW5wdXQgPj4gOCkgJiAweGZmKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IEEgPSAoaW5wdXQgJiAweGZmKTsKKworICAgICAgICAgICAgICAgICAgICBmbG9hdCB3ZWlnaHQgPSBnYXVzc2lhbltyICsgcmFkaXVzXTsKKworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxSICs9IChmbG9hdCkoUikqd2VpZ2h0OworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxHICs9IChmbG9hdCkoRykqd2VpZ2h0OworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxCICs9IChmbG9hdCkoQikqd2VpZ2h0OworICAgICAgICAgICAgICAgICAgICBibHVycmVkUGl4ZWxBICs9IChmbG9hdCkoQSkqd2VpZ2h0OworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGludCBSID0gKGludClibHVycmVkUGl4ZWxSOworICAgICAgICAgICAgICAgIGludCBHID0gKGludClibHVycmVkUGl4ZWxHOworICAgICAgICAgICAgICAgIGludCBCID0gKGludClibHVycmVkUGl4ZWxCOworICAgICAgICAgICAgICAgIGludCBBID0gKGludClibHVycmVkUGl4ZWxBOworCisgICAgICAgICAgICAgICAgaW50ZXJtW2gqd2lkdGggKyB3XSA9IChSIDw8IDI0KSB8IChHIDw8IDE2KSB8IChCIDw8IDgpIHwgKEEpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZm9yKGggPSAwOyBoIDwgaGVpZ2h0OyBoICsrKSB7CisgICAgICAgICAgICBmb3IodyA9IDA7IHcgPCB3aWR0aDsgdyArKykgeworCisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsUiA9IDAuMGY7CisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsRyA9IDAuMGY7CisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsQiA9IDAuMGY7CisgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsQSA9IDAuMGY7CisgICAgICAgICAgICAgICAgZm9yKHIgPSAtcmFkaXVzOyByIDw9IHJhZGl1czsgciArKykgeworICAgICAgICAgICAgICAgICAgICBpbnQgdmFsaWRIID0gaCArIHI7CisgICAgICAgICAgICAgICAgICAgIC8vIENsYW1wIHRvIHplcm8gYW5kIHdpZHRoCisgICAgICAgICAgICAgICAgICAgIGlmKHZhbGlkSCA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbGlkSCA9IDA7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYodmFsaWRIID4gaGVpZ2h0IC0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRIID0gaGVpZ2h0IC0gMTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGludCBpbnB1dCA9IGludGVybVt2YWxpZEgqd2lkdGggKyB3XTsKKworICAgICAgICAgICAgICAgICAgICBpbnQgUiA9ICgoaW5wdXQgPj4gMjQpICYgMHhmZik7CisgICAgICAgICAgICAgICAgICAgIGludCBHID0gKChpbnB1dCA+PiAxNikgJiAweGZmKTsKKyAgICAgICAgICAgICAgICAgICAgaW50IEIgPSAoKGlucHV0ID4+IDgpICYgMHhmZik7CisgICAgICAgICAgICAgICAgICAgIGludCBBID0gKGlucHV0ICYgMHhmZik7CisKKyAgICAgICAgICAgICAgICAgICAgZmxvYXQgd2VpZ2h0ID0gZ2F1c3NpYW5bciArIHJhZGl1c107CisKKyAgICAgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsUiArPSAoZmxvYXQpKFIpKndlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsRyArPSAoZmxvYXQpKEcpKndlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsQiArPSAoZmxvYXQpKEIpKndlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgYmx1cnJlZFBpeGVsQSArPSAoZmxvYXQpKEEpKndlaWdodDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpbnQgUiA9IChpbnQpYmx1cnJlZFBpeGVsUjsKKyAgICAgICAgICAgICAgICBpbnQgRyA9IChpbnQpYmx1cnJlZFBpeGVsRzsKKyAgICAgICAgICAgICAgICBpbnQgQiA9IChpbnQpYmx1cnJlZFBpeGVsQjsKKyAgICAgICAgICAgICAgICBpbnQgQSA9IChpbnQpYmx1cnJlZFBpeGVsQTsKKworICAgICAgICAgICAgICAgIG91dFtoKndpZHRoICsgd10gPSAoUiA8PCAyNCkgfCAoRyA8PCAxNikgfCAoQiA8PCA4KSB8IChBKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCiAgICAgICAgIHQgPSBqYXZhLmxhbmcuU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkgLSB0OworICAgICAgICBhbmRyb2lkLnV0aWwuTG9nLnYoIkltZyIsICJKYXZhIGZyYW1lIHRpbWUgbXMgIiArIHQpOworICAgICAgICBtQml0bWFwT3V0LnNldFBpeGVscyhvdXQsIDAsIHdpZHRoLCAwLCAwLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgcmV0dXJuIHQ7CisgICAgfQogCi0gICAgICAgIGFuZHJvaWQudXRpbC5Mb2cudigiSW1nIiwgImZyYW1lIHRpbWUgbXMgIiArIHQpOworICAgIHB1YmxpYyB2b2lkIG9uUHJvZ3Jlc3NDaGFuZ2VkKFNlZWtCYXIgc2Vla0JhciwgaW50IHByb2dyZXNzLCBib29sZWFuIGZyb21Vc2VyKSB7CisgICAgICAgIGlmIChmcm9tVXNlcikgeworCisgICAgICAgICAgICBpZihzZWVrQmFyID09IG1SYWRpdXNTZWVrQmFyKSB7CisgICAgICAgICAgICAgICAgZmxvYXQgZlJhZGl1cyA9IHByb2dyZXNzIC8gMTAwLjBmOworICAgICAgICAgICAgICAgIGZSYWRpdXMgKj0gKGZsb2F0KShNQVhfUkFESVVTKTsKKyAgICAgICAgICAgICAgICBtUmFkaXVzID0gKGludClmUmFkaXVzOworCisgICAgICAgICAgICAgICAgbVNjcmlwdC5zZXRfcmFkaXVzKG1SYWRpdXMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZihzZWVrQmFyID09IG1JbkJsYWNrU2Vla0JhcikgeworICAgICAgICAgICAgICAgIG1JbkJsYWNrID0gKGZsb2F0KXByb2dyZXNzOworICAgICAgICAgICAgICAgIG1TY3JpcHQuc2V0X2luQmxhY2sobUluQmxhY2spOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZihzZWVrQmFyID09IG1PdXRCbGFja1NlZWtCYXIpIHsKKyAgICAgICAgICAgICAgICBtT3V0QmxhY2sgPSAoZmxvYXQpcHJvZ3Jlc3M7CisgICAgICAgICAgICAgICAgbVNjcmlwdC5zZXRfb3V0QmxhY2sobU91dEJsYWNrKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoc2Vla0JhciA9PSBtSW5XaGl0ZVNlZWtCYXIpIHsKKyAgICAgICAgICAgICAgICBtSW5XaGl0ZSA9IChmbG9hdClwcm9ncmVzcyArIDEyNy4wZjsKKyAgICAgICAgICAgICAgICBtU2NyaXB0LnNldF9pbldoaXRlKG1JbldoaXRlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYoc2Vla0JhciA9PSBtT3V0V2hpdGVTZWVrQmFyKSB7CisgICAgICAgICAgICAgICAgbU91dFdoaXRlID0gKGZsb2F0KXByb2dyZXNzICsgMTI3LjBmOworICAgICAgICAgICAgICAgIG1TY3JpcHQuc2V0X291dFdoaXRlKG1PdXRXaGl0ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKHNlZWtCYXIgPT0gbUdhbW1hU2Vla0JhcikgeworICAgICAgICAgICAgICAgIG1HYW1tYSA9IChmbG9hdClwcm9ncmVzcy8xMDAuMGY7CisgICAgICAgICAgICAgICAgbUdhbW1hID0gTWF0aC5tYXgobUdhbW1hLCAwLjFmKTsKKyAgICAgICAgICAgICAgICBtR2FtbWEgPSAxLjBmIC8gbUdhbW1hOworICAgICAgICAgICAgICAgIG1TY3JpcHQuc2V0X2dhbW1hKG1HYW1tYSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKHNlZWtCYXIgPT0gbVNhdHVyYXRpb25TZWVrQmFyKSB7CisgICAgICAgICAgICAgICAgbVNhdHVyYXRpb24gPSAoZmxvYXQpcHJvZ3Jlc3MgLyA1MC4wZjsKKyAgICAgICAgICAgICAgICBtU2NyaXB0LnNldF9zYXR1cmF0aW9uKG1TYXR1cmF0aW9uKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbG9uZyB0ID0gamF2YS5sYW5nLlN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOworICAgICAgICAgICAgaWYgKHRydWUpIHsKKyAgICAgICAgICAgICAgICBtU2NyaXB0Lmludm9rZV9maWx0ZXIoKTsKKyAgICAgICAgICAgICAgICBtUlMuZmluaXNoKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGphdmFGaWx0ZXIoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdCA9IGphdmEubGFuZy5TeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSAtIHQ7CisgICAgICAgICAgICBhbmRyb2lkLnV0aWwuTG9nLnYoIkltZyIsICJSZW5kZXJzY3JpcHQgZnJhbWUgdGltZSBjb3JlIG1zICIgKyB0KTsKKworICAgICAgICAgICAgbURpc3BsYXlWaWV3LmludmFsaWRhdGUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG9uU3RhcnRUcmFja2luZ1RvdWNoKFNlZWtCYXIgc2Vla0JhcikgeworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG9uU3RvcFRyYWNraW5nVG91Y2goU2Vla0JhciBzZWVrQmFyKSB7CiAgICAgfQogCiAgICAgQE92ZXJyaWRlCkBAIC0xMTks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gaWYgKGZyb21Vc2VyKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1QYXJhbXMudGhyZXNob2xkID0gcHJvZ3Jlc3MgLyAxMDAuMGY7Ci0gICAgICAgICAgICAgICAgICAgIG1QYXJhbXNBbGxvY2F0aW9uLmRhdGEobVBhcmFtcyk7CisgICAgICAgIG1SYWRpdXNTZWVrQmFyID0gKFNlZWtCYXIpIGZpbmRWaWV3QnlJZChSLmlkLnJhZGl1cyk7CisgICAgICAgIG1SYWRpdXNTZWVrQmFyLnNldE9uU2Vla0JhckNoYW5nZUxpc3RlbmVyKHRoaXMpOwogCi0gICAgICAgICAgICAgICAgICAgIGlmICh0cnVlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtSW52b2thYmxlLmV4ZWN1dGUoKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGphdmFGaWx0ZXIoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1CaXRtYXAuc2V0UGl4ZWxzKG1PdXREYXRhLCAwLCBtUGFyYW1zLm91dFdpZHRoLCAwLCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUGFyYW1zLm91dFdpZHRoLCBtUGFyYW1zLm91dEhlaWdodCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRGlzcGxheVZpZXcuaW52YWxpZGF0ZSgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQorICAgICAgICBtSW5CbGFja1NlZWtCYXIgPSAoU2Vla0JhcilmaW5kVmlld0J5SWQoUi5pZC5pbkJsYWNrKTsKKyAgICAgICAgbUluQmxhY2tTZWVrQmFyLnNldE9uU2Vla0JhckNoYW5nZUxpc3RlbmVyKHRoaXMpOworICAgICAgICBtSW5CbGFja1NlZWtCYXIuc2V0TWF4KDEyOCk7CisgICAgICAgIG1JbkJsYWNrU2Vla0Jhci5zZXRQcm9ncmV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VGhyZXNob2xkKG1SUywgZ2V0UmVzb3VyY2VzKCksIFIucmF3LnRocmVzaG9sZF9iYywgZmFsc2UpOworICAgICAgICBtU2NyaXB0LnNldF93aWR0aChtQml0bWFwSW4uZ2V0V2lkdGgoKSk7CisgICAgICAgIG1TY3JpcHQuc2V0X2hlaWdodChtQml0bWFwSW4uZ2V0SGVpZ2h0KCkpOworICAgICAgICBtU2NyaXB0LnNldF9yYWRpdXMobVJhZGl1cyk7CiAKLSAgICAgICAgbVBpeGVsVHlwZSA9IFR5cGUuY3JlYXRlRnJvbUNsYXNzKG1SUywgUGl4ZWwuY2xhc3MsIDEsICJQaXhlbCIpOwotICAgICAgICBtSW5QaXhlbHNBbGxvY2F0aW9uID0gQWxsb2NhdGlvbi5jcmVhdGVTaXplZChtUlMsCi0gICAgICAgICAgICAgICAgRWxlbWVudC5jcmVhdGVVc2VyKG1SUywgRWxlbWVudC5EYXRhVHlwZS5TSUdORURfMzIpLAotICAgICAgICAgICAgICAgIHBpeGVsQ291bnQpOwotICAgICAgICBtT3V0UGl4ZWxzQWxsb2NhdGlvbiA9IEFsbG9jYXRpb24uY3JlYXRlU2l6ZWQobVJTLAotICAgICAgICAgICAgICAgIEVsZW1lbnQuY3JlYXRlVXNlcihtUlMsIEVsZW1lbnQuRGF0YVR5cGUuU0lHTkVEXzMyKSwKLSAgICAgICAgICAgICAgICBwaXhlbENvdW50KTsKKyAgICAgICAgbVNjcmlwdC5zZXRfaW5CbGFjayhtSW5CbGFjayk7CisgICAgICAgIG1TY3JpcHQuc2V0X291dEJsYWNrKG1PdXRCbGFjayk7CisgICAgICAgIG1TY3JpcHQuc2V0X2luV2hpdGUobUluV2hpdGUpOworICAgICAgICBtU2NyaXB0LnNldF9vdXRXaGl0ZShtT3V0V2hpdGUpOworICAgICAgICBtU2NyaXB0LnNldF9nYW1tYShtR2FtbWEpOworICAgICAgICBtU2NyaXB0LnNldF9zYXR1cmF0aW9uKG1TYXR1cmF0aW9uKTsKIAotICAgICA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WMgdm9pZCBzZXRfb3V0V2hpdGUoZmxvYXQgdikgeworICAgICAgICBtRXhwb3J0VmFyX291dFdoaXRlID0gdjsKKyAgICAgICAgc2V0VmFyKG1FeHBvcnRWYXJJZHhfb3V0V2hpdGUsIHYpOworICAgIH0KKworICAgIHB1YmxpYyBmbG9hdCBnZXRfb3V0V2hpdGUoKSB7CisgICAgICAgIHJldHVybiBtRXhwb3J0VmFyX291dFdoaXRlOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBtRXhwb3J0VmFySWR4X2dhbW1hID0gMTA7CisgICAgcHJpdmF0ZSBmbG9hdCBtRXhwb3J0VmFyX2dhbW1hOworICAgIHB1YmxpYyB2b2lkIHNldF9nYW1tYShmbG9hdCB2KSB7CisgICAgICAgIG1FeHBvcnRWYXJfZ2FtbWEgPSB2OworICAgICAgICBzZXRWYXIobUV4cG9ydFZhcklkeF9nYW1tYSwgdik7CisgICAgfQorCisgICAgcHVibGljIGZsb2F0IGdldF9nYW1tYSgpIHsKKyAgICAgICAgcmV0dXJuIG1FeHBvcnRWYXJfZ2FtbWE7CisgICAgfQorCisgICAgcHJpdmF0ZSBmaW5hbCBzdGF0aWMgaW50IG1FeHBvcnRWYXJJZHhfc2F0dXJhdGlvbiA9IDExOworICAgIHByaXZhdGUgZmxvYXQgbUV4cG9ydFZhcl9zYXR1cmF0aW9uOworICAgIHB1YmxpYyB2b2lkIHNldF9zYXR1cmF0aW9uKGZsb2F0IHYpIHsKKyAgICAgICAgbUV4cG9ydFZhcl9zYXR1cmF0aW9uID0gdjsKKyAgICAgICAgc2V0VmFyKG1FeHBvcnRWYXJJZHhfc2F0dXJhdGlvbiwgdik7CisgICAgfQorCisgICAgcHVibGljIGZsb2F0IGdldF9zYXR1cmF0aW9uKCkgeworICAgICAgICByZXR1cm4gbUV4cG9ydFZhcl9zYXR1cmF0aW9uOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgc3RhdGljIGludCBtRXhwb3J0RnVu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hdGlvbiArPSAzNjA7CisgICAgICAgIH0KKworICAgICAgICBtU2NyaXB0LnNldF9nUm90YXRlKC0oZmxvYXQpbVJvdGF0aW9uKTsKKworICAgICAgICBtTGFzdFggPSB4OworICAgICAgICBtTGFzdFkgPSB5OworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0UEZTKCkgeworICAgICAgICBQcm9ncmFtU3RvcmUuQnVpbGRlciBiID0gbmV3IFByb2dyYW1TdG9yZS5CdWlsZGVyKG1SUywgbnVsbCwgbnVsbCk7CisKKyAgICAgICAgYi5zZXREZXB0aEZ1bmMoUHJvZ3JhbVN0b3JlLkRlcHRoRnVuYy5MRVNTKTsKKyAgICAgICAgYi5zZXREaXRoZXJFbmFibGUoZmFsc2UpOworICAgICAgICBiLnNldERlcHRoTWFzayh0cnVlKTsKKyAgICAgICAgbVBTQmFja2dyb3VuZCA9IGIuY3JlYXRlKCk7CisKKyAgICAgICAgbVNjcmlwdC5zZXRfZ1BGU0JhY2tncm91bmQobVBTQmFja2dyb3VuZCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGluaXRQRigpIHsKKyAgICAgICAgU2FtcGxlci5CdWlsZGVyIGJzID0gbmV3IFNhbXBsZXIuQnVpbGRlcihtUlMpOworICAgICAgICBicy5zZXRNaW4oU2FtcGxlci5WYWx1ZS5MSU5FQVIpOworICAgICAgICBicy5zZXRNYWcoU2FtcGxlci5WYWx1ZS5MSU5FQVIpOworICAgICAgICBicy5zZXRXcmFwUyhTYW1wbGVyLlZhbHVlLkNMQU1QKTsKKyAgICAgICAgYnMuc2V0V3JhcFQoU2FtcGxlci5WYWx1ZS5XUkFQKTsKKyAgICAgICAgbVNhbXBsZXIgPSBicy5jcmVhdGUoKTsKKworICAgICAgICBQcm9ncmFtRnJhZ21lbnQuQnVpbGRlciBiID0gbmV3IFByb2dyYW1GcmFnbWVudC5CdWlsZGVyKG1SUyk7CisgICAgICAgIGIuc2V0VGV4dHVyZShQcm9ncmFtRnJh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fQU5JTUFUSU9OX0lOVEVSUE9MQVRJT05fU1RFUDsKKyAgICBtRWRnZVByZSA9IFJTX0FOSU1BVElPTl9FREdFX1VOREVGSU5FRDsKKyAgICBtRWRnZVBvc3QgPSBSU19BTklNQVRJT05fRURHRV9VTkRFRklORUQ7CisgICAgbUlucHV0TWluID0gMDsKKyAgICBtSW5wdXRNYXggPSAwOworfQorCitBbmltYXRpb24gKiBBbmltYXRpb246OmNyZWF0ZShDb250ZXh0ICpyc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBmbG9hdCAqaW5WYWx1ZXMsIGNvbnN0IGZsb2F0ICpvdXRWYWx1ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCB2YWx1ZUNvdW50LCBSc0FuaW1hdGlvbkludGVycG9sYXRpb24gaW50ZXJwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnNBbmltYXRpb25FZGdlIHByZSwgUnNBbmltYXRpb25FZGdlIHBvc3QpCit7CisgICAgaWYgKHZhbHVlQ291bnQgPCAyKSB7CisgICAgICAgIHJzYy0+c2V0RXJyb3IoUlNfRVJST1JfQkFEX1ZBTFVFLCAiQW5pbWF0aW9ucyByZXF1aXJlIG1vcmUgdGhhbiAyIHZhbHVlcy4iKTsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorICAgIEFuaW1hdGlvbiAqYSA9IG5ldyBBbmltYXRpb24ocnNjKTsKKyAgICBpZiAoIWEpIHsKKyAgICAgICAgcnNjLT5zZXRFcnJvcihSU19FUlJPUl9PVVRfT0ZfTUVNT1JZKTsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgZmxvYXQgKnZpbiA9IChmbG9hdCAqKW1hbGxvYyh2YWx1ZUNvdW50ICogc2l6ZW9mKGZsb2F0KSk7CisgICAgZmxvYXQgKnZvdXQgPSAoZmxvYXQgKiltYWxsb2ModmFsdWVDb3VudCAqIHNpemVvZihmbG9hdCkpOworICAgIGEtPm1WYWx1ZXNJbnB1dCA9IHZpbjsKKyAgICBhLT5tVmFsdWVzT3V0cHV0ID0gdm91dDsKKyAgICBpZiAoYS0+bVZhbHVlc0lucHV0ID09IE5VTEwgfHwgYS0+bVZhbHVlc091dHB1dCA9PSBOVUxMKSB7CisgICAgICAgIGRlbGV0ZSBhOworICAgICAgICByc2MtPnNldEVycm9yKFJTX0VSUk9SX09VVF9PRl9NRU1PUlkpOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICBhLT5tRWRnZVByZSA9IHByZTsKKyAgICBhLT5tRWRnZVBvc3QgPSBwb3N0OworICAgIGEtPm1JbnRlcnBvbGF0aW9uID0gaW50ZXJwOworICAgIGEtPm1WYWx1ZUNvdW50ID0gdmFsdWVDb3VudDsKKworICAgIG1lbWNweSh2aW4sIGluVmFsdWVzLCB2YWx1ZUNvdW50ICogc2l6ZW9mKGZsb2F0KSk7CisgICAgbWVtY3B5KHZvdXQsIG91dFZhbHVlcywgdmFsdWVDb3VudCAqIHNpemVvZihmbG9hdCkpOworICAgIGEtPm1JbnB1dE1pbiA9IGluVmFsdWVzWzBdOworICAgIGEtPm1JbnB1dE1heCA9IGluVmFsdWVzWzBdOworCisgICAgYm9vbCBuZWVkU29ydCA9IGZhbHNlOworICAgIGZvciAodWludDMyX3QgY3Q9MTsgY3QgPCB2YWx1ZUNvdW50OyBjdCsrKSB7CisgICAgICAgIGlmIChhLT5tSW5wdXRNaW4gPiB2aW5bY3RdKSB7CisgICAgICAgICAgICBuZWVkU29ydCA9IHRydWU7CisgICAgICAgICAgICBhLT5tSW5wdXRNaW4gPSB2aW5bY3RdOworICAgICAgICB9CisgICAgICAgIGlmIChhLT5tSW5wdXRNYXggPCB2aW5bY3RdKSB7CisgICAgICAgICAgICBhLT5tSW5wdXRNYXggPSB2aW5bY3RdOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbmVlZFNvcnQgPSB0cnVlOworICAgICAgICB9CisgICAgfQorCisgICAgd2hpbGUgKDEpIHsKKyAgICAgICAgYm9vbCBjaGFuZ2VkID0gZmFsc2U7CisgICAgICAgIGZvciAodWludDMyX3QgY3Q9MTsgY3QgPCB2YWx1ZUNvdW50OyBjdCsrKSB7CisgICAgICAgICAgICBpZiAodmluW2N0LTFdID4gdmluW2N0XSkgeworICAgICAgICAgICAgICAgIGZsb2F0IHQgPSB2aW5bY3QtMV07CisgICAgICAgICAgICAgICAgdmluW2N0LTFdID0gdmluW2N0XTsKKyAgICAgICAgICAgICAgICB2aW5bY3RdID0gdDsKKyAgICAgICAgICAgICAgICB0ID0gdm91dFtjdC0xXTsKKyAgICAgICAgICAgICAgICB2b3V0W2N0LTFdID0gdm91dFtjdF07CisgICAgICAgICAgICAgICAgdm91dFtjdF0gPSB0OworICAgICAgICAgICAgICAgIGNoYW5nZWQgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmICghY2hhbmdlZCkgYnJlYWs7CisgICAgfQorCisgICAgcmV0dXJuIGE7Cit9CisqLworCisKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisvLworCituYW1lc3BhY2UgYW5kcm9pZCB7CituYW1lc3BhY2UgcmVuZGVyc2NyaXB0IHsKKworUnNBbmltYXRpb24gcnNpX0FuaW1hdGlvbkNyZWF0ZShDb250ZXh0ICpyc2MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGZsb2F0ICppblZhbHVlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZmxvYXQgKm91dFZhbHVlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgdmFsdWVDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnNBbmltYXRpb25JbnRlcnBvbGF0aW9uIGludGVycCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnN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1FR0wubVdpZHRoLCByc2MtPm1FR0wubUhlaWdodCk7CisgICAgICAgICByc2MtPm1TdGF0ZVZlcnRleC5pbml0KHJzYyk7CiAgICAgICAgICByc2MtPnNldFZlcnRleChOVUxMKTsKLSAgICAgICAgIHJzYy0+bVN0YXRlRnJhZ21lbnQuaW5pdChyc2MsIHJzYy0+bUVHTC5tV2lkdGgsIHJzYy0+bUVHTC5tSGVpZ2h0KTsKKyAgICAgICAgIHJzYy0+bVN0YXRlRnJhZ21lbnQuaW5pdChyc2MpOwogICAgICAgICAgcnNjLT5zZXRGcmFnbWVudChOVUxMKTsKLSAgICAgICAgIHJzYy0+bVN0YXRlRnJhZ21lbnRTdG9yZS5pbml0KHJzYywgcnNjLT5tRUdMLm1XaWR0aCwgcnNjLT5tRUdMLm1IZWlnaHQpOworICAgICAgICAgcnNjLT5tU3RhdGVGcmFnbWVudFN0b3JlLmluaXQocnNjKTsKICAgICAgICAgIHJzYy0+c2V0RnJhZ21lbnRTdG9yZShOVUxMKTsKKyAgICAgICAgIHJzYy0+bVN0YXRlRm9udC5pbml0KHJzYyk7CisgICAgICAgICByc2MtPnNldEZvbnQoTlVMTCk7CiAgICAgICAgICByc2MtPm1TdGF0ZVZlcnRleEFycmF5LmluaXQocnNjKTsKICAgICAgfQogCkBAIC0zNDYsMTEgKzMzMiwxMyBAQAogICAgICAgICAgcnNjLT5tRnJhZ21lbnQuY2xlYXIoKTsKICAgICAgICAgIHJzYy0+bVZlcnRleC5jbGVhcigpOwogICAgICAgICAgcnNjLT5tRnJhZ21lbnRTdG9yZS5jbGVhcigpOworICAgICAgICAgcnNjLT5tRm9udC5jbGVhcigpOwogICAgICAgICAgcnNjLT5tUm9vdFNjcmlwdC5jbGVhcigpOwogICAgICAgICAgcnNjLT5tU3RhdGVSYXN0ZXIuZGVpbml0KHJzYyk7CiAgICAgICAgICByc2MtPm1TdGF0ZVZlcnRleC5kZWluaXQocnNjKTsKICAgICAgICAgIHJzYy0+bVN0YXRlRnJhZ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vbnN0IHsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorICAgIFByb2dyYW1TdG9yZSAqIGdldERlZmF1bHRQcm9ncmFtU3RvcmUoKSBjb25zdCB7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKyAgICBQcm9ncmFtUmFzdGVyICogZ2V0RGVmYXVsdFByb2dyYW1SYXN0ZXIoKSBjb25zdCB7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIHVpbnQzMl90IGdldFdpZHRoKCkgY29uc3Qge3JldHVybiAwO30KKyAgICB1aW50MzJfdCBnZXRIZWlnaHQoKSBjb25zdCB7cmV0dXJuIDA7fQorCisgICAgLy8gVGltZXJzCisgICAgZW51bSBUaW1lcnMgeworICAgICAgICBSU19USU1FUl9JRExFLAorICAgICAgICBSU19USU1FUl9JTlRFUk5BTCwKKyAgICAgICAgUlNfVElNRVJfU0NSSVBULAorICAgICAgICBSU19USU1FUl9DTEVBUl9TV0FQLAorICAgICAgICBfUlNfVElNRVJfVE9UQUwKKyAgICB9OworCisgICAgYm9vbCBjaGVja1ZlcnNpb24xXzEoKSBjb25zdCB7cmV0dXJuIGZhbHNlOyB9CisgICAgYm9vbCBjaGVja1ZlcnNpb24yXzAoKSBjb25zdCB7cmV0dXJuIGZhbHNlOyB9CisKKyAgICBzdHJ1Y3QgeworICAgICAgICBib29sIG1Mb2dUaW1lczsKKyAgICAgICAgYm9vbCBtTG9nU2NyaXB0czsKKyAgICAgICAgYm9vbCBtTG9nT2JqZWN0czsKKyAgICAgICAgYm9vbCBtTG9nU2hhZGVyczsKKyAgICB9IHByb3BzOworCisgICAgdm9pZCBkdW1wRGVidWcoKSBjb25zdCB7ICAgIH0KKyAgICB2b2lkIGNoZWNrRXJyb3IoY29uc3QgY2hhciAqKSBjb25zdCB7ICB9OworICAgIHZvaWQgc2V0RXJyb3IoUnNFcnJvciBlLCBjb25zdCBjaGFyICptc2cgPSBOVUxMKSB7ICB9CisKKyAgICBtdXRhYmxlIGNvbnN0IE9iamVjdEJhc2UgKiBtT2JqSGVhZDsKKworICAgIGJvb2wgZXh0X09FU190ZXh0dXJlX25wb3QoKSBjb25zdCB7cmV0dXJuIG1HTC5PRVNfdGV4dHVyZV9ucG90O30KKworcHJvdGVjdGVkOgorCisgICAgc3RydWN0IHsKKyAgICAgICAgY29uc3QgdWludDhfdCAqIG1WZW5kb3I7CisgICAgICAgIGNvbnN0IHVpbnQ4X3QgKiBtUmVuZGVyZXI7CisgICAgICAgIGNvbnN0IHVpbnQ4X3QgKiBtVmVyc2lvbjsKKyAgICAgICAgY29uc3QgdWludDhfdCAqIG1FeHRlbnNpb25zOworCisgICAgICAgIHVpbnQzMl90IG1NYWpvclZlcnNpb247CisgICAgICAgIHVpbnQzMl90IG1NaW5vclZlcnNpb247CisKKyAgICAgICAgaW50MzJfdCBtTWF4VmFyeWluZ1ZlY3RvcnM7CisgICAgICAgIGludDMyX3QgbU1heFRleHR1cmVJbWFnZVVuaXRzOworCisgICAgICAgIGludDMyX3QgbU1heEZyYWdtZW50VGV4dHVyZUltYWdlVW5pdHM7CisgICAgICAgIGludDMyX3QgbU1heEZyYWdtZW50VW5pZm9ybVZlY3RvcnM7CisKKyAgICAgICAgaW50MzJfdCBtTWF4VmVydGV4QXR0cmliczsKKyAgICAgICAgaW50MzJfdCBtTWF4VmVydGV4VW5pZm9ybVZlY3RvcnM7CisgICAgICAgIGludDMyX3QgbU1heFZlcnRleFRleHR1cmVVbml0czsKKworICAgICAgICBib29sIE9FU190ZXh0dXJlX25wb3Q7CisgICAgfSBtR0w7CisKK307CisKK30KK30KKyNlbmRpZgpkaWZmIC0tZ2l0IGEvbGlicy9ycy9yc0RldmljZS5jcHAgYi9saWJzL3JzL3JzRGV2aWNlLmNwcAppbmRleCBiNjcwYWQ0Li5hOTZiMTE0IDEwMDY0NAotLS0gYS9saWJzL3JzL3JzRGV2aWNlLmNwcAorKysgYi9saWJzL3JzL3JzRGV2aWNlLmNwcApAQCAtMTUsN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JuIE5VTEw7CisgICAgfQorCisgICAgU3RyaW5nOCBuYW1lOworICAgIHN0cmVhbS0+bG9hZFN0cmluZygmbmFtZSk7CisKKyAgICBFbGVtZW50ICplbGVtID0gbmV3IEVsZW1lbnQocnNjKTsKKyAgICBlbGVtLT5tQ29tcG9uZW50LmxvYWRGcm9tU3RyZWFtKHN0cmVhbSk7CisgICAgZWxlbS0+bUJpdHMgPSBlbGVtLT5tQ29tcG9uZW50LmdldEJpdHMoKTsKKworICAgIGVsZW0tPm1GaWVsZENvdW50ID0gc3RyZWFtLT5sb2FkVTMyKCk7CisgICAgaWYoZWxlbS0+bUZpZWxkQ291bnQpIHsKKyAgICAgICAgZWxlbS0+bUZpZWxkcyA9IG5ldyBFbGVtZW50RmllbGRfdCBbZWxlbS0+bUZpZWxkQ291bnRdOworICAgICAgICBmb3IodWludDMyX3QgY3QgPSAwOyBjdCA8IGVsZW0tPm1GaWVsZENvdW50OyBjdCArKykgeworICAgICAgICAgICAgc3RyZWFtLT5sb2FkU3RyaW5nKCZlbGVtLT5tRmllbGRzW2N0XS5uYW1lKTsKKyAgICAgICAgICAgIEVsZW1lbnQgKmZpZWxkRWxlbSA9IEVsZW1lbnQ6OmNyZWF0ZUZyb21TdHJlYW0ocnNjLCBzdHJlYW0pOworICAgICAgICAgICAgZWxlbS0+bUZpZWxkc1tjdF0uZS5zZXQoZmllbGRFbGVtKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8vIFdlIG5lZWQgdG8gY2hlY2sgaWYgdGhpcyBhbHJlYWR5IGV4aXN0cworICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCByc2MtPm1TdGF0ZUVsZW1lbnQubUVsZW1lbnRzLnNpemUoKTsgY3QrKykgeworICAgICAgICBFbGVtZW50ICplZSA9IHJzYy0+bVN0YXRlRWxlbWVudC5tRWxlbWVudHNbY3RdOworCisgICAgICAgIGlmICghZWUtPmdldEZpZWxkQ291bnQoKSApIHsKKworICAgICAgICAgICAgaWYoKGVlLT5nZXRDb21wb25lbnQoKS5nZXRUeXBlKCkgPT0gZWxlbS0+Z2V0Q29tcG9uZW50KCkuZ2V0VHlwZSgpKSAmJgorICAgICAgICAgICAgICAgKGVlLT5nZXRDb21wb25lbnQoKS5nZXRLaW5kKCkgPT0gZWxlbS0+Z2V0Q29tcG9uZW50KCkuZ2V0S2luZCgpKSAmJgorICAgICAgICAgICAgICAgKGVlLT5nZXRDb21wb25lbnQoKS5nZXRJc05vcm1hbGl6ZWQoKSA9PSBlbGVtLT5nZXRDb21wb25lbnQoKS5nZXRJc05vcm1hbGl6ZWQoKSkgJiYKKyAgICAgICAgICAgICAgIChlZS0+Z2V0Q29tcG9uZW50KCkuZ2V0VmVjdG9yU2l6ZSgpID09IGVsZW0tPmdldENvbXBvbmVudCgpLmdldFZlY3RvclNpemUoKSkpIHsKKyAgICAgICAgICAgICAgICAvLyBNYXRjaAorICAgICAgICAgICAgICAgIGRlbGV0ZSBlbGVtOworICAgICAgICAgICAgICAgIGVlLT5pbmNVc2VyUmVmKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGVlOworICAgICAgICAgICAgfQorCisgICAgICAgIH0gZWxzZSBpZiAoZWUtPmdldEZpZWxkQ291bnQoKSA9PSBlbGVtLT5tRmllbGRDb3VudCkgeworCisgICAgICAgICAgICBib29sIG1hdGNoID0gdHJ1ZTsKKyAgICAgICAgICAgIGZvciAodWludDMyX3QgaT0wOyBpIDwgZWxlbS0+bUZpZWxkQ291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgIGlmICgoZWUtPm1GaWVsZHNbaV0uZS5nZXQoKSAhPSBlbGVtLT5tRmllbGRzW2ldLmUuZ2V0KCkpIHx8CisgICAgICAgICAgICAgICAgICAgIChlZS0+bUZpZWxkc1tpXS5uYW1lLmxlbmd0aCgpICE9IGVsZW0tPm1GaWVsZHNbaV0ubmFtZS5sZW5ndGgoKSkgfHwKKyAgICAgICAgICAgICAgICAgICAgKGVlLT5tRmllbGRzW2ldLm5hbWUgIT0gZWxlbS0+bUZpZWxkc1tpXS5uYW1lKSkgeworICAgICAgICAgICAgICAgICAgICBtYXRjaCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobWF0Y2gpIHsKKyAgICAgICAgICAgICAgICBkZWxldGUgZWxlbTsKKyAgICAgICAgICAgICAgICBlZS0+aW5jVXNlclJlZigpOworICAgICAgICAgICAgICAgIHJldHVybiBlZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICB9CisgICAgfQorCisgICAgcnNjLT5tU3RhdGVFbGVtZW50Lm1FbGVtZW50cy5wdXNoKGVsZW0pOworICAgIHJldHVybiBlbGVtOworfQorCiAKIGNvbnN0IEVsZW1lbnQgKiBFbGVtZW50OjpjcmVhdGUoQ29udGV4dCAqcnNjLCBSc0RhdGFUeXBlIGR0LCBSc0RhdGFLaW5kIGRrLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgaXNOb3JtLCB1aW50MzJfdCB2ZWNTaXplKQpAQCAtMTQzLDQ1ICsyMzIsNiBAQAogICAgIHJldHVybiBlOwogfQogCi1TdHJpbmc4IEVsZW1lbnQ6OmdldENTdHJ1Y3RCb2R5KHVpbnQzMl90IGluZGVudCkgY29uc3QKLXsKLSAgICBTdHJpbmc4IHNpOwotICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCBpbmRlbnQ7IGN0KyspIHsKLSAgICAgICAgc2kuYXBwZW5kKCIgIik7Ci0gICAgfQotCi0gICAgU3RyaW5nOCBzKHNpKTsKLSAgICBzLmFwcGVuZCgie1xuIik7Ci0gICAgZm9yICh1aW50MzJfdCBjdCA9IDA7IGN0IDwgbUZpZWxkQ291bnQ7IGN0KyspIHsKLSAgICAgICAgcy5hcHBlbmQoc2kpOwotICAgICAgICBzLmFwcGVuZChtRmllbGRzW2N0XS5lLT5nZXRDVHlwZShpbmRlbnQrNCkpOwot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ICAgICAgTE9HRSgic3RyaW5nVHlwZSAlaSIsIHN0cmluZ1R5cGUpOwotICAgICAgICByc0Fzc2VydChzdHJpbmdUeXBlPT0wKTsKLSAgICAgICAgZm9yICh1aW50MzJfdCBjdCA9IDA7IGN0IDwgc3RyaW5nRW50cnlDb3VudDsgY3QrKykgewotICAgICAgICAgICAgdWludDY0X3Qgb2Zmc2V0ID0gc3RyaW5nVGFibGUubG9hZE9mZnNldCgpOwotICAgICAgICAgICAgTE9HRSgic3RyaW5nIG9mZnNldCAweCUwMTZsbHgiLCBvZmZzZXQpOwotICAgICAgICAgICAgSU8gdG1wKG1EYXRhICsgb2Zmc2V0LCBtVXNlNjRCaXRPZmZzZXRzKTsKLSAgICAgICAgICAgIFN0cmluZzggczsKLSAgICAgICAgICAgIHRtcC5sb2FkU3RyaW5nKCZzKTsKLSAgICAgICAgICAgIExPR0UoInN0cmluZyAlcyIsIHMuc3RyaW5nKCkpOwotICAgICAgICAgICAgbVN0cmluZ3MucHVzaChzKTsKLSAgICAgICAgfQorT2JqZWN0QmFzZSAqRmlsZUEzRDo6aW5pdGlhbGl6ZUZyb21FbnRyeShzaXplX3QgaW5kZXgpIHsKKyAgICBpZihpbmRleCA+PSBtSW5kZXguc2l6ZSgpKSB7CisgICAgICAgIHJldHVybiBOVUxMOwogICAgIH0KIAotICAgIExPR0UoInN0cmluZ3MgZG9uZSIpOwotICAgIHVpbnQzMl90IGluZGV4RW50cnlDb3VudCA9IGluZGV4LmxvYWRVMzIoKTsKLSAgICBMT0dFKCJpbmRleCBjb3VudCAlaSIsIGluZGV4RW50cnlDb3VudCk7Ci0gICAgbUluZGV4LnNldENhcGFjaXR5KGluZGV4RW50cnlDb3VudCk7Ci0gICAgZm9yICh1aW50MzJfdCBjdCA9IDA7IGN0IDwgaW5kZXhFbnRyeUNvdW50OyBjdCsrKSB7Ci0gICAgICAgIEEzREluZGV4RW50cnkgZTsKLSAgICAgICAgdWludDMyX3Qgc3RyaW5nSW5kZXggPSBpb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m1WZXJ0aWNpZXMgPSAoTWVzaDo6VmVydGljaWVzX3QgKiltSW5kZXhbdmVydElkeF0ubVJzT2JqOwotCi0gICAgcC0+bUluZGljaWVzID0gbmV3IHVpbnQxNl90W3AtPm1JbmRleENvdW50XTsKLSAgICBmb3IgKHVpbnQzMl90IGN0ID0gMDsgY3QgPCBwLT5tSW5kZXhDb3VudDsgY3QrKykgewotICAgICAgICBzd2l0Y2goYml0cykgewotICAgICAgICBjYXNlIDg6Ci0gICAgICAgICAgICBwLT5tSW5kaWNpZXNbY3RdID0gaW8tPmxvYWRVOCgpOworICAgIC8vIFNlZWsgdG8gdGhlIGJlZ2lubmluZyBvZiBvYmplY3QKKyAgICBtUmVhZFN0cmVhbS0+cmVzZXQoZW50cnktPm1PZmZzZXQpOworICAgIHN3aXRjaCAoZW50cnktPm1UeXBlKSB7CisgICAgICAgIGNhc2UgUlNfQTNEX0NMQVNTX0lEX1VOS05PV046CisgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgICAgY2FzZSBSU19BM0RfQ0xBU1NfSURfTUVTSDoKKyAgICAgICAgICAgIGVudHJ5LT5tUnNPYmogPSBNZXNoOjpjcmVhdGVGcm9tU3RyZWFtKG1SU0MsIG1SZWFkU3RyZWFtKTsKICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDE2OgotICAgICAgICAgICAgcC0+bUluZGljaWVzW2N0XSA9IGlvLT5sb2FkVTE2KCk7CisgICAgICAgIGNhc2UgUlNfQTNEX0NMQVNTX0lEX1NJTVBMRV9NRVNIOgorICAgICAgICAgICAgZW50cnktPm1Sc09iaiA9IFNpbXBsZU1lc2g6OmNyZWF0ZUZyb21TdHJlYW0obVJTQywgbVJlYWRTdHJlYW0pOwogICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgMzI6Ci0gICAgICAgICAgICBwLT5tSW5kaWNpZXNbY3RdID0gaW8tPmxvYWRVMzIoKTsKKyAgICAgICAgY2FzZSBSU19BM0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NDUklQVF9DOgorICAgICAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorICAgIGlmKGVudHJ5LT5tUnNPYmopIHsKKyAgICAgICAgZW50cnktPm1Sc09iai0+aW5jVXNlclJlZigpOworICAgIH0KKyAgICByZXR1cm4gZW50cnktPm1Sc09iajsKK30KKworYm9vbCBGaWxlQTNEOjp3cml0ZUZpbGUoY29uc3QgY2hhciAqZmlsZW5hbWUpCit7CisgICAgaWYoIW1Xcml0ZVN0cmVhbSkgeworICAgICAgICBMT0dFKCJObyBvYmplY3RzIHRvIHdyaXRlXG4iKTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICBpZihtV3JpdGVTdHJlYW0tPmdldFBvcygpID09IDApIHsKKyAgICAgICAgTE9HRSgiTm8gb2JqZWN0cyB0byB3cml0ZVxuIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBGSUxFICp3cml0ZUhhbmRsZSA9IGZvcGVuKGZpbGVuYW1lLCAid2IiKTsKKyAgICBpZighd3JpdGVIYW5kbGUpIHsKKyAgICAgICAgTE9HRSgiQ291bGRuJ3Qgb3BlbiB0aGUgZmlsZSBmb3Igd3JpdGluZ1xuIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvLyBPcGVuIGEgbmV3IHN0cmVhbSB0byBtYWtlIHdyaXRpbmcgdGhlIGhlYWRlciBlYXNpZXIKKyAgICBPU3RyZWFtIGhlYWRlclN0cmVhbSg1KjEwMjQsIGZhbHNlKTsKKyAgICBoZWFkZXJTdHJlYW0uYWRkVTMyKG1NYWpvclZlcnNpb24pOworICAgIGhlYWRlclN0cmVhbS5hZGRVMzIobU1pbm9yVmVyc2lvbik7CisgICAgdWludDMyX3QgaXM2NEJpdCA9IDA7CisgICAgaGVhZGVyU3RyZWFtLmFkZFUzMihpczY0Qml0KTsKKworICAgIHVpbnQzMl90IHdyaXRlSW5kZXhTaXplID0gbVdyaXRlSW5kZXguc2l6ZSgpOworICAgIGhlYWRlclN0cmVhbS5hZGRVMzIod3JpdGVJbmRleFNpemUpOworICAgIGZvcih1aW50MzJfdCBpID0gMDsgaSA8IHdyaXRlSW5kZXhTaXplOyBpICsrKSB7CisgICAgICAgIGhlYWRlclN0cmVhbS5hZGRTdHJpbmcoJm1Xcml0ZUluZGV4W2ldLT5tT2JqZWN0TmFtZSk7CisgICAgICAgIGhlYWRlclN0cmVhbS5hZGRVMzIoKHVpbnQzMl90KW1Xcml0ZUluZGV4W2ldLT5tVHlwZSk7CisgICAgICAgIGlmKG1Vc2U2NEJpdE9mZnNldHMpeworICAgICAgICAgICAgaGVhZGVyU3RyZWFtLmFkZE9mZnNldChtV3JpdGVJbmRleFtpXS0+bU9mZnNldCk7CisgICAgICAgICAgICBoZWFkZXJTdHJlYW0uYWRkT2Zmc2V0KG1Xcml0ZUluZGV4W2ldLT5tTGVuZ3RoKTsKICAgICAgICAgfQotICAgICAgICBMT0dFKCIgIGlkeCAlaSIsIHAtPm1JbmRpY2llc1tjdF0pOwotICAgIH0KLQotICAgIGlmIChwLT5tUmVzdGFydENvdW50cykgewotICAgICAgICBwLT5tUmVzdGFydHMgPSBuZXcgdWludDE2X3RbcC0+bVJlc3RhcnRDb3VudHNdOwotICAgICAgICBmb3IgKHVpbnQzMl90IGN0ID0gMDsgY3QgPCBwLT5tUmVzdGFydENvdW50czsgY3QrKykgewotICAgICAgICAgICAgc3dpdGNoKGJpdHMpIHsKLSAgICAgICAgICAgIGNhc2UgODoKLSAgICAgICAgICAgICAgICBwLT5tUmVzdGFydHNbY3RdID0gaW8tPmxvYWRVOCgpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSAxNjoKLSAgICAgICAgICAgICAgICBwLT5tUmVzdGFydHNbY3RdID0gaW8tPmxvYWRVMTYoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgMzI6Ci0gICAgICAgICAgICAgICAgc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MT0dFKCIgICVmIiwgKmRhdGEpOwotICAgICAgICBkYXRhKys7Ci0gICAgfQotICAgIGllLT5tUnNPYmogPSBhbGxvYzsKKyAgICBBM0RJbmRleEVudHJ5ICppbmRleEVudHJ5ID0gbmV3IEEzREluZGV4RW50cnkoKTsKKyAgICBpbmRleEVudHJ5LT5tT2JqZWN0TmFtZS5zZXRUbyhvYmotPmdldE5hbWUoKSk7CisgICAgaW5kZXhFbnRyeS0+bVR5cGUgPSBvYmotPmdldENsYXNzSWQoKTsKKyAgICBpbmRleEVudHJ5LT5tT2Zmc2V0ID0gbVdyaXRlU3RyZWFtLT5nZXRQb3MoKTsKKyAgICBpbmRleEVudHJ5LT5tUnNPYmogPSBvYmo7CisgICAgbVdyaXRlSW5kZXgucHVzaChpbmRleEVudHJ5KTsKKyAgICBvYmotPnNlcmlhbGl6ZShtV3JpdGVTdHJlYW0pOworICAgIGluZGV4RW50cnktPm1MZW5ndGggPSBtV3JpdGVTdHJlYW0tPmdldFBvcygpIC0gaW5kZXhFbnRyeS0+bU9mZnNldDsKKyAgICBtV3JpdGVTdHJlYW0tPmFsaWduKDQpOwogfQogCiBuYW1lc3BhY2UgYW5kcm9pZCB7CiBuYW1lc3BhY2UgcmVuZGVyc2NyaXB0IHsKIAordm9pZCByc2lfRmlsZUEzREdldE51bUluZGV4RW50cmllcyhDb250ZXh0ICpyc2MsIGludDMyX3QgKm51bUVudHJpZXMsIFJzRmlsZSBmaWxlKQoreworICAgIEZpbGVBM0QgKmZhM2QgPSBzdGF0aWNfY2FzdDxGaWxlQTNEICo+KGZpbGUpOworCisgICAgaWYoZmEzZCkgeworICAgICAgICAqbnVtRW50cmllcyA9IGZhM2QtPmdldE51bUluZGV4RW50cmllcygpOworICAgIH0KKyAgICBlbHNlIHsKKyAgICAgICAgKm51bUVudHJpZXMgPSAwOworICAgIH0KK30KKwordm9pZCByc2lfRmlsZUEzREdldEluZGV4RW50cmllcyhDb250ZXh0ICpyc2MsIFJzRmlsZUluZGV4RW50cnkgKmZpbGVFbnRyaWVzLCB1aW50MzJfdCBudW1FbnRyaWVzLCBSc0ZpbGUgZmlsZSkKK3sKKyAgICBGaWxlQTNEICpmYTNkID0gc3RhdGljX2Nhc3Q8RmlsZUEzRCAqPihmaWxlKTsKKworICAgIGlmKCFmYTNkKSB7CisgICAgICAgIExPR0UoIkNhbid0IGxvYWQgaW5kZXggZW50cmllcy4gTm8gdmFsaWQgZmlsZSIpOworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgdWludDMyX3QgbnVtRmlsZUVudHJpZXMgPSBmYTNkLT5nZXROdW1JbmRleEVudHJpZXMoKTsKKyAgICBpZihudW1GaWxlRW50cmllcyAhPSBudW1FbnRyaWVzIHx8IG51bUVudHJpZXMgPT0gMCB8fCBmaWxlRW50cmllcyA9PSBOVUxMKSB7CisgICAgICAgIExPR0UoIkNhbid0IGxvYWQgaW5kZXggZW50cmllcy4gSW52YWxpZCBudW1iZXIgcmVxdWVzdGVkIik7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBmb3IodWludDMyX3QgaSA9IDA7IGkgPCBudW1GaWxlRW50cmllczsgaSArKykgeworICAgICAgICBjb25zdCBGaWxlQTNEOjpBM0RJbmRleEVudHJ5ICplbnRyeSA9IGZhM2QtPmdldEluZGV4RW50cnkoaSk7CisgICAgICAgIGZpbGVFbnRyaWVzW2ldLmNsYXNzSUQgPSBlbnRyeS0+Z2V0VHlwZSgpOworICAgICAgICBmaWxlRW50cmllc1tpXS5vYmplY3ROYW1lID0gZW50cnktPmdldE9iamVjdE5hbWUoKS5zdHJpbmcoKTsKKyAgICB9CisKK30KKworUnNPYmplY3RCYXNlIHJzaV9GaWxlQTNER2V0RW50cnlCeUluZGV4KENvbnRleHQgKnJzYywgdWludDMyX3QgaW5kZXgsIFJzRmlsZSBmaWxlKQoreworICAgIEZpbGVBM0QgKmZhM2QgPSBzdGF0aWNfY2FzdDxGaWxlQTNEICo+KGZpbGUpOworICAgIGlmKCFmYTNk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2Zmc2V0czsKIAotICAgIHN0cnVjdCBBM0RJbmRleEVudHJ5IHsKLSAgICAgICAgU3RyaW5nOCBtSUQ7Ci0gICAgICAgIEEzRENodW5rVHlwZSBtVHlwZTsKKyAgICBjbGFzcyBBM0RJbmRleEVudHJ5IHsKKyAgICAgICAgU3RyaW5nOCBtT2JqZWN0TmFtZTsKKyAgICAgICAgUnNBM0RDbGFzc0lEIG1UeXBlOwogICAgICAgICB1aW50NjRfdCBtT2Zmc2V0OwotICAgICAgICB2b2lkICogbVJzT2JqOworICAgICAgICB1aW50NjRfdCBtTGVuZ3RoOworICAgICAgICBPYmplY3RCYXNlICptUnNPYmo7CisgICAgcHVibGljOgorICAgICAgICBmcmllbmQgY2xhc3MgRmlsZUEzRDsKKyAgICAgICAgY29uc3QgU3RyaW5nOCAmZ2V0T2JqZWN0TmFtZSgpIGNvbnN0IHsKKyAgICAgICAgICAgIHJldHVybiBtT2JqZWN0TmFtZTsKKyAgICAgICAgfQorICAgICAgICBSc0EzRENsYXNzSUQgZ2V0VHlwZSgpIGNvbnN0IHsKKyAgICAgICAgICAgIHJldHVybiBtVHlwZTsKKyAgICAgICAgfQogICAgIH07CiAKLSAgICBib29sIGxvYWQoQ29udGV4dCAqcnNjLCBGSUxFICpmKTsKKyAgICBib29sIGxvYWQoRklMRSAqZik7CisgICAgYm9vbCBsb2FkKGNvbnN0IHZvaWQgKmRhdGEsIHNpemVfdCBsZW5ndGgpOworCisgICAgc2l6ZV90IGdldE51bUluZGV4RW50cmllcygpIGNvbnN0OworICAgIGNvbnN0IEEzREluZGV4RW50cnkqIGdldEluZGV4RW50cnkoc2l6ZV90IGluZGV4KSBjb25zdDsKKyAgICBPYmplY3RCYXNlICppbml0aWFsaXplRnJvbUVudHJ5KHNpemVfdCBpbmRleCk7CisKKyAgICB2b2lkIGFwcGVuZFRvRmlsZShPYmplY3RCYXNlICpvYmopOworICAgIGJvb2wgd3JpdGVGaWxlKGNvbnN0IGNoYXIgKmZpbGVuYW1lKTsKKworICAgIC8vIEN1cnJlbnRseSBmaWxlcyBkbyBub3QgZ2V0IHNlcmlhbGl6ZWQsCisgICAgLy8gYnV0IHdlIG5lZWQgdG8gaW5oZXJpdCBmcm9tIE9iamVjdEJhc2UgZm9yIHJlZiB0cmFja2luZworICAgIHZpcnR1YWwgdm9pZCBzZXJpYWxpemUoT1N0cmVhbSAqc3RyZWFtKSBjb25zdCB7CisgICAgfQorICAgIHZpcnR1YWwgUnNBM0RDbGFzc0lEIGdldENsYXNzSWQoKSBjb25zdCB7CisgICAgICAgIHJldHVybiBSU19BM0RfQ0xBU1NfSURfVU5LTk9XTjsKKyAgICB9CiAKIHByb3RlY3RlZDoKLSAgICBjbGFzcyBJTwotICAgIHsKLSAgICBwdWJsaWM6Ci0gICAgICAgIElPKGNvbnN0IHVpbnQ4X3QgKiwgYm9vbCB1c2U2NCk7Ci0gICAgCi0gICAgICAgIGZsb2F0IGxvYWRGKCkgewotICAgICAgICAgICAgbVBvcyA9IChtUG9zICsgMykgJiAofjMpOwotICAgICAgICAgICAgZmxvYXQgdG1wID0gcmVpbnRlcnByZXRfY2FzdDxjb25zdCBmbG9hdCAqPigmbURhdGFbbVBvc10pWzBdOwotICAgICAgICAgICAgbVBvcyArPSBzaXplb2YoZmxvYXQpOwotICAgICAgICAgICAgcmV0dXJuIHRtcDsKLSAgICAgICAgfQotICAgICAgICBpbnQzMl90IGxvYWRJMzIoKSB7Ci0gICAgICAgICAgICBtUG9zID0gKG1Qb3MgKyAzKSAmICh+Myk7Ci0gICAgICAgICAgICBpbnQzMl90IHRtcCA9IHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgaW50MzJfdCAqPigmbURhdGFbbVBvc10pWzBdOwotICAgICAgICAgICAgbVBvcyArPSBzaXplb2YoaW50MzJfdCk7Ci0gICAgICAgICAgICByZXR1cm4gdG1wOwotICAgICAgICB9Ci0gICAgICAgIHVpbnQzMl90IGxvYWRVMzIoKSB7Ci0gICAgICAgICAgICBtUG9zID0gKG1Qb3MgKyAzKSAmICh+Myk7Ci0gICAgICAgICAgICB1aW50MzJfdCB0bXAgPSByZWludGVycHJldF9jYXN0PGNvbnN0IHVpbnQzMl90ICo+KCZtRGF0YVttUG9zXSlbMF07Ci0gICAgICAgICAgICBtUG9zICs9IHNpemVvZih1aW50MzJfdCk7Ci0gICAgICAgICAgICByZXR1cm4gdG1wOwotICAgICAgICB9Ci0gICAgICAgIHVpbnQxNl90IGxvYWRVMTYoKSB7Ci0gICAgICAgICAgICBtUG9zID0gKG1Qb3MgKyAxKSAmICh+MSk7Ci0gICAgICAgICAgICB1aW50MTZfdCB0bXAgPSByZWludGVycHJldF9jYXN0PGNvbnN0IHVpbnQxNl90ICo+KCZtRGF0YVttUG9zXSlbMF07Ci0gICAgICAgICAgICBtUG9zICs9IHNpemVvZih1aW50MTZfdCk7Ci0gICAgICAgICAgICByZXR1cm4gdG1wOwotICAgICAgICB9Ci0gICAgICAgIHVpbnQ4X3QgbG9hZFU4KCkgewotICAgICAgICAgICAgdWludDhfdCB0bXAgPSByZWludGVycHJldF9jYXN0PGNvbnN0IHVpbnQ4X3QgKj4oJm1EYXRhW21Qb3NdKVswXTsKLSAgICAgICAgICAgIG1Qb3MgKz0gc2l6ZW9mKHVpbnQ4X3QpOwotICAgICAgICAgICAgcmV0dXJuIHRtcDsKLSAgICAgICAgfQotICAgICAgICB1aW50NjRfdCBsb2FkT2Zmc2V0KCk7Ci0gICAgICAgIHZvaWQgbG9hZFN0cmluZyhTdHJpbmc4ICpzKTsKLSAgICAgICAgdWludDY0X3QgZ2V0UG9zKCkgY29uc3Qge3JldHVybiBtUG9zO30KLSAgICAgICAgY29uc3QgdWludDhfdCAqIGdldFB0cigpIGNvbnN0OwotICAgIHByb3RlY3RlZDoKLSAgICAgICAgY29uc3QgdWludDhfdCAqIG1EYXRhOwotICAgICAgICB1aW50NjRfdCBtUG9zOwotICAgICAgICBib29sIG1Vc2U2NDsKLSAgICB9OwogCi0KLSAgICBib29sIHByb2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pzdGF0ZSA9ICZtUlNDLT5tU3RhdGVGb250OworCisgICAgaW50IG5QZW5YID0geCArIGdseXBoLT5tQml0bWFwTGVmdDsKKyAgICBpbnQgblBlblkgPSB5IC0gZ2x5cGgtPm1CaXRtYXBUb3AgKyBnbHlwaC0+bUJpdG1hcEhlaWdodDsKKworICAgIHN0YXRlLT5hcHBlbmRNZXNoUXVhZChuUGVuWCwgblBlblksIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPm1CaXRtYXBNaW5VLCBnbHlwaC0+bUJpdG1hcE1heFYsCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuUGVuWCArIChpbnQpZ2x5cGgtPm1CaXRtYXBXaWR0aCwgblBlblksIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2x5cGgtPm1CaXRtYXBNYXhVLCBnbHlwaC0+bUJpdG1hcE1heFYsCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuUGVuWCArIChpbnQpZ2x5cGgtPm1CaXRtYXBXaWR0aCwgblBlblkgLSAoaW50KWdseXBoLT5tQml0bWFwSGVpZ2h0LCAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdseXBoLT5tQml0bWFwTWF4VSwgZ2x5cGgtPm1CaXRtYXBNaW5WLAorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgblBlblgsIG5QZW5ZIC0gKGludClnbHlwaC0+bUJpdG1hcEhlaWdodCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaC0+bUJpdG1hcE1pblUsIGdseXBoLT5tQml0bWFwTWluVik7Cit9CisKK3ZvaWQgRm9udDo6cmVuZGVyVVRGKGNvbnN0IGNoYXIgKnRleHQsIHVpbnQzMl90IGxlbiwgdWludDMyX3Qgc3RhcnQsIGludCBudW1HbHlwaHMsIGludCB4LCBpbnQgeSkKK3sKKyAgICBpZighbUluaXRpYWxpemVkIHx8IG51bUdseXBocyA9PSAwIHx8IHRleHQgPT0gTlVMTCB8fCBsZW4gPT0gMCkgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgaW50IHBlblggPSB4LCBwZW5ZID0geTsKKyAgICBpbnQgZ2x5cGhzTGVmdCA9IDE7CisgICAgaWYobnVtR2x5cGhzID4gMCkgeworICAgICAgICBnbHlwaHNMZWZ0ID0gbnVtR2x5cGhzOworICAgIH0KKworICAgIHNpemVfdCBpbmRleCA9IHN0YXJ0OworICAgIHNpemVfdCBuZXh0SW5kZXggPSAwOworCisgICAgd2hpbGUgKGdseXBoc0xlZnQgPiAwKSB7CisKKyAgICAgICAgaW50MzJfdCB1dGZDaGFyID0gdXRmMzJfYXQodGV4dCwgbGVuLCBpbmRleCwgJm5leHRJbmRleCk7CisKKyAgICAgICAgLy8gUmVhY2hlZCB0aGUgZW5kIG9mIHRoZSBzdHJpbmcgb3IgZW5jb3VudGVyZWQKKyAgICAgICAgaWYodXRmQ2hhciA8IDApIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgLy8gTW92ZSB0byB0aGUgbmV4dCBjaGFyYWN0ZXIgaW4gdGhlIGFycmF5CisgICAgICAgIGluZGV4ID0gbmV4dEluZGV4OworCisgICAgICAgIENhY2hlZEdseXBoSW5mbyAqY2FjaGVkR2x5cGggPSBtQ2FjaGVkR2x5cGhzLnZhbHVlRm9yKCh1aW50MzJfdCl1dGZDaGFyKTsKKworICAgICAgICBpZihjYWNoZWRHbHlwaCA9PSBOVUxMKSB7CisgICAgICAgICAgICBjYWNoZWRHbHlwaCA9IGNhY2hlR2x5cGgoKHVpbnQzMl90KXV0ZkNoYXIpOworICAgICAgICB9CisgICAgICAgIC8vIElzIHRoZSBnbHlwaCBzdGlsbCBpbiB0ZXh0dXJlIGNhY2hlPworICAgICAgICBpZighY2FjaGVkR2x5cGgtPm1Jc1ZhbGlkKSB7CisgICAgICAgICAgICB1cGRhdGVHbHlwaENhY2hlKGNhY2hlZEdseXBoKTsKKyAgICAgICA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yYXJ5ID0gTlVMTDsKK30KKworRm9udFN0YXRlOjp+Rm9udFN0YXRlKCkKK3sKKyAgICBmb3IodWludDMyX3QgaSA9IDA7IGkgPCBtQ2FjaGVMaW5lcy5zaXplKCk7IGkgKyspIHsKKyAgICAgICAgZGVsZXRlIG1DYWNoZUxpbmVzW2ldOworICAgIH0KKworICAgIHJzQXNzZXJ0KCFtQWN0aXZlRm9udHMuc2l6ZSgpKTsKK30KKworRlRfTGlicmFyeSBGb250U3RhdGU6OmdldExpYigpCit7CisgICAgaWYoIW1MaWJyYXJ5KSB7CisgICAgICAgIEZUX0Vycm9yIGVycm9yID0gRlRfSW5pdF9GcmVlVHlwZSgmbUxpYnJhcnkpOworICAgICAgICBpZihlcnJvcikgeworICAgICAgICAgICAgTE9HRSgiVW5hYmxlIHRvIGluaXRpYWxpemUgZnJlZXR5cGUiKTsKKyAgICAgICAgICAgIHJldHVybiBOVUxMOworICAgICAgICB9CisgICAgfQorCisgICAgcmV0dXJuIG1MaWJyYXJ5OworfQorCit2b2lkIEZvbnRTdGF0ZTo6aW5pdChDb250ZXh0ICpyc2MpCit7CisgICAgbVJTQyA9IHJzYzsKK30KKwordm9pZCBGb250U3RhdGU6OmZsdXNoQWxsQW5kSW52YWxpZGF0ZSgpCit7CisgICAgaWYobUN1cnJlbnRRdWFkSW5kZXggIT0gMCkgeworICAgICAgICBpc3N1ZURyYXdDb21tYW5kKCk7CisgICAgICAgIG1DdXJyZW50UXVhZEluZGV4ID0gMDsKKyAgICB9CisgICAgZm9yKHVpbnQzMl90IGkgPSAwOyBpIDwgbUFjdGl2ZUZvbnRzLnNpemUoKTsgaSArKykgeworICAgICAgICBtQWN0aXZlRm9udHNbaV0tPmludmFsaWRhdGVUZXh0dXJlQ2FjaGUoKTsKKyAgICB9CisgICAgZm9yKHVpbnQzMl90IGkgPSAwOyBpIDwgbUNhY2hlTGluZXMuc2l6ZSgpOyBpICsrKSB7CisgICAgICAgIG1DYWNoZUxpbmVzW2ldLT5tQ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KKyAgICAgICAgZmx1c2hBbGxBbmRJbnZhbGlkYXRlKCk7CisKKyAgICAgICAgLy8gVHJ5IHRvIGZpdCBpdCBhZ2FpbgorICAgICAgICBmb3IodWludDMyX3QgaSA9IDA7IGkgPCBtQ2FjaGVMaW5lcy5zaXplKCk7IGkgKyspIHsKKyAgICAgICAgICAgIGJpdG1hcEZpdCA9IG1DYWNoZUxpbmVzW2ldLT5maXRCaXRtYXAoYml0bWFwLCAmc3RhcnRYLCAmc3RhcnRZKTsKKyAgICAgICAgICAgIGlmKGJpdG1hcEZpdCkgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gaWYgd2Ugc3RpbGwgZG9uJ3QgZml0LCBzb21ldGhpbmcgaXMgd3JvbmcgYW5kIHdlIHNob3VsZG4ndCBkcmF3CisgICAgICAgIGlmKCFiaXRtYXBGaXQpIHsKKyAgICAgICAgICAgIExPR0UoIkJpdG1hcCBkb2Vzbid0IGZpdCBpbiBjYWNoZS4gd2lkdGgsIGhlaWdodCA9ICVpLCAlaSIsIChpbnQpYml0bWFwLT53aWR0aCwgKGludCliaXRtYXAtPnJvd3MpOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfQorCisgICAgKnJldE9yaWdpblggPSBzdGFydFg7CisgICAgKnJldE9yaWdpblkgPSBzdGFydFk7CisKKyAgICB1aW50MzJfdCBlbmRYID0gc3RhcnRYICsgYml0bWFwLT53aWR0aDsKKyAgICB1aW50MzJfdCBlbmRZID0gc3RhcnRZICsgYml0bWFwLT5yb3dzOworCisgICAgdWludDMyX3QgY2FjaGVXaWR0aCA9IGdldENhY2hlVGV4dHVyZVR5cGUoKS0+Z2V0RGltWCgpOworCisgICAgdW5zaWduZWQgY2hhciAqY2FjaGVCdWZmZXIgPSAodW5zaWduZWQgY2hhciopbVRleHRUZXh0dXJlLT5nZXRQdHIoKTsKKyAgICB1bnNpZ25lZCBjaG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gaW5kZXggZGF0YQorICAgIGNvbnN0IEVsZW1lbnQgKmluZGV4RWxlbSA9IEVsZW1lbnQ6OmNyZWF0ZShtUlNDLCBSU19UWVBFX1VOU0lHTkVEXzE2LCBSU19LSU5EX1VTRVIsIGZhbHNlLCAxKTsKKyAgICBUeXBlICppbmRleFR5cGUgPSBuZXcgVHlwZShtUlNDKTsKKyAgICB1aW50MzJfdCBudW1JbmRpY2llcyA9IG1NYXhOdW1iZXJPZlF1YWRzICogNjsKKyAgICBpbmRleFR5cGUtPnNldERpbVgobnVtSW5kaWNpZXMpOworICAgIGluZGV4VHlwZS0+c2V0RWxlbWVudChpbmRleEVsZW0pOworICAgIGluZGV4VHlwZS0+Y29tcHV0ZSgpOworCisgICAgQWxsb2NhdGlvbiAqaW5kZXhBbGxvYyA9IG5ldyBBbGxvY2F0aW9uKG1SU0MsIGluZGV4VHlwZSk7CisgICAgdWludDE2X3QgKmluZGV4UHRyID0gKHVpbnQxNl90KilpbmRleEFsbG9jLT5nZXRQdHIoKTsKKworICAgIC8vIEZvdXIgdmVydHMsIHR3byB0cmlhbmdsZXMgLCBzaXggaW5kaWNlcyBwZXIgcXVhZAorICAgIGZvcih1aW50MzJfdCBpID0gMDsgaSA8IG1NYXhOdW1iZXJPZlF1YWRzOyBpICsrKSB7CisgICAgICAgIGludCBpNiA9IGkgKiA2OworICAgICAgICBpbnQgaTQgPSBpICogNDsKKworICAgICAgICBpbmRleFB0cltpNiArIDBdID0gaTQgKyAwOworICAgICAgICBpbmRleFB0cltpNiArIDFdID0gaTQgKyAxOworICAgICAgICBpbmRleFB0cltpNiArIDJdID0gaTQgKyAyOworCisgICAgICAgIGluZGV4UHRyW2k2ICsgM10gPSBpNCArIDA7CisgICAgICAgIGluZGV4UHRyW2k2ICsgNF0gPSBpNCArIDI7CisgICAgICAgIGluZGV4UHRyW2k2ICsgNV0gPSBpNCArIDM7CisgICAgfQorCisgICAgaW5kZXhBbGxvYy0+ZGVmZXJlZFVwbG9hZFRvQ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IHN0YXRlCisgICAgbVJTQy0+c2V0VmVydGV4KChQcm9ncmFtVmVydGV4ICopdG1wVi5nZXQoKSk7CisgICAgbVJTQy0+c2V0RnJhZ21lbnQoKFByb2dyYW1GcmFnbWVudCAqKXRtcEYuZ2V0KCkpOworICAgIG1SU0MtPnNldEZyYWdtZW50U3RvcmUoKFByb2dyYW1TdG9yZSAqKXRtcFBTLmdldCgpKTsKK30KKwordm9pZCBGb250U3RhdGU6OmFwcGVuZE1lc2hRdWFkKGZsb2F0IHgxLCBmbG9hdCB5MSwgZmxvYXQgejEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTEsIGZsb2F0IHYxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgyLCBmbG9hdCB5MiwgZmxvYXQgejIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTIsIGZsb2F0IHYyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgzLCBmbG9hdCB5MywgZmxvYXQgejMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTMsIGZsb2F0IHYzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHg0LCBmbG9hdCB5NCwgZmxvYXQgejQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTQsIGZsb2F0IHY0KQoreworICAgIGNvbnN0IHVpbnQzMl90IHZlcnRzUGVyUXVhZCA9IDQ7CisgICAgY29uc3QgdWludDMyX3QgZmxvYXRzUGVyVmVydCA9IDU7CisgICAgZmxvYXQgKmN1cnJlbnRQb3MgPSBtVGV4dE1lc2hQdHIgKyBtQ3VycmVudFF1YWRJbmRleCAqIHZlcnRzUGVyUXVhZCAqIGZsb2F0c1BlclZlcnQ7CisKKyAgICAvLyBDdWxsIHRoaW5ncyB0aGF0IGFyZSBvZmYgdGhlIHNjcmVlbgorICAgIGZsb2F0IHdpZHRoID0gKGZsb2F0KW1SU0MtPmdldFdpZHRoKCk7CisgICAgZmxvYXQgaGVpZ2h0ID0gKGZsb2F0KW1SU0MtPmdldEhlaWdodCgpOworCisgICAgaWYoeDEgPiB3aWR0aCB8fCB5MSA8IDAuMGYgfHwgeDIgPCAwIHx8IHk0ID4gaGVpZ2h0KSB7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICAvKkxPR0UoIlYwIHg6ICVmIHk6ICVmIHo6ICVmIiwgeDEsIHkxLCB6MSk7CisgICAgTE9HRSgiVjEgeDogJWYgeTogJWYgejogJWYiLCB4MiwgeTIsIHoyKTsKKyAgICBMT0dFKCJWMiB4OiAlZiB5OiAlZiB6OiAlZiIsIHgzLCB5MywgejMpOworICAgIExPR0UoIlYzIHg6ICVmIHk6ICVmIHo6ICVmIiwgeDQsIHk0LCB6NCk7Ki8KKworICAgICgqY3VycmVudFBvcysrKSA9IHgxOworICAgICgqY3VycmVudFBvcysrKSA9IHkxOworICAgICgqY3VycmVudFBvcysrKSA9IHoxOworICAgICgqY3VycmVudFBvcysrKSA9IHUxOworICAgICgqY3VycmVudFBvcysrKSA9IHYxOworCisgICAgKCpjdXJyZW50UG9zKyspID0geDI7CisgICAgKCpjdXJyZW50UG9zKyspID0geTI7CisgICAgKCpjdXJyZW50UG9zKyspID0gejI7CisgICAgKCpjdXJyZW50UG9zKyspID0gdTI7CisgICAgKCpjdXJyZW50UG9zKyspID0gdjI7CisKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB4MzsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB5MzsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB6MzsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB1MzsKKyAgICAoKmN1cnJlbnRQb3MrKykgPSB2MzsKKworICAgICgqY3VycmVudFBvcysrKSA9IHg0OworICAgICgqY3VycmVudFBvcysrKSA9IHk0OworICAgICgqY3VycmVudFBvcysrKSA9IHo0OworICAgICgqY3VycmVudFBvcysrKSA9IHU0OworICAgICgqY3VycmVudFBvcysrKSA9IHY0OworCisgICAgbUN1cnJlbnRRdWFkSW5kZXggKys7CisKKyAgICBpZihtQ3VycmVudFF1YWRJbmRleCA9PSBtTWF4TnVtYmVyT2ZRdWFkcykgeworICAgICAgICBpc3N1ZURyYXdDb21tYW5kKCk7CisgICAgICAgIG1DdXJyZW50UXVhZEluZGV4ID0gMDsKKyAgICB9Cit9CisKK3ZvaWQgRm9udFN0YXRlOjpyZW5kZXJUZXh0KGNvbnN0IGNoYXIgKnRleHQsIHVpbnQzMl90IGxlbiwgdWludDMyX3Qgc3RhcnRJbmRleCwgaW50IG51bUdseXBocywgaW50IHgsIGludCB5KQoreworICAgIGNoZWNrSW5pdCgpOworCisgICAgLy9TdHJpbmc4IHRleHQ4KHRleHQpOworCisgICAgLy8gUmVuZGVyIGNvZGUgaGVyZQorICAgIEZvbnQgKmN1cnJlbnRGb250ID0gbVJTQy0+Z2V0Rm9udCgpOworICAgIGlmKCFjdXJyZW50Rm9udCkgeworICAgICAgICBpZighbURlZmF1bHQuZ2V0KCkpIHsKKyAgICAgICAgICAgIG1EZWZhdWx0LnNldChGb250OjpjcmVhdGUobVJTQywgIkRyb2lkU2Fucy50dGYiLCAxNiwgOTYpKTsKKyAgICAgICAgfQorICAgICAgICBjdXJyZW50Rm9udCA9IG1EZWZhdWx0LmdldCgpOworICAgIH0KKyAgICBpZighY3VycmVudEZvbnQpIHsKKyAgICAgICAgTE9HRSgiVW5hYmxlIHRvIGluaXRpYWxpemUgYW55IGZvbnRzIik7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBjdXJyZW50Rm9udC0+cmVuZGVyVVRGKHRleHQsIGxlbiwgc3RhcnRJbmRleCwgbnVtR2x5cGhzLCB4LCB5KTsKKworICAgIGlmKG1DdXJyZW50UXVhZEluZGV4ICE9IDApIHsKKyAgICAgICAgaXNzdWVEcmF3Q29tbWFuZCgpOworICAg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IGZvciB0aGUgcXVhZAorICAgICAgICBmbG9hdCBtQml0bWFwTWluVTsKKyAgICAgICAgZmxvYXQgbUJpdG1hcE1pblY7CisgICAgICAgIGZsb2F0IG1CaXRtYXBNYXhVOworICAgICAgICBmbG9hdCBtQml0bWFwTWF4VjsKKyAgICAgICAgLy8gTWluaW1pemUgaG93IG11Y2ggd2UgY2FsbCBmcmVldHlwZQorICAgICAgICBGVF9VSW50IG1HbHlwaEluZGV4OworICAgICAgICBGVF9WZWN0b3IgbUFkdmFuY2U7CisgICAgICAgIC8vIFZhbHVlcyBiZWxvdyBjb250YWluIGEgZ2x5cGgncyBvcmlnaW4gaW4gdGhlIGJpdG1hcAorICAgICAgICBGVF9JbnQgbUJpdG1hcExlZnQ7CisgICAgICAgIEZUX0ludCBtQml0bWFwVG9wOworICAgIH07CisKKyAgICBTdHJpbmc4IG1Gb250TmFtZTsKKyAgICB1aW50MzJfdCBtRm9udFNpemU7CisgICAgdWludDMyX3QgbURwaTsKKworICAgIEZvbnQoQ29udGV4dCAqcnNjKTsKKyAgICBib29sIGluaXQoY29uc3QgY2hhciAqbmFtZSwgdWludDMyX3QgZm9udFNpemUsIHVpbnQzMl90IGRwaSk7CisKKyAgICBGVF9GYWNlIG1GYWNlOworICAgIGJvb2wgbUluaXRpYWxpemVkOworICAgIGJvb2wgbUhhc0tlcm5pbmc7CisKKyAgICBEZWZhdWx0S2V5ZWRWZWN0b3I8dWludDMyX3QsIENhY2hlZEdseXBoSW5mbyogPiBtQ2FjaGVkR2x5cGhzOworCisgICAgQ2FjaGVkR2x5cGhJbmZvICpjYWNoZUdseXBoKHVpbnQzMl90IGdseXBoKTsKKyAgICB2b2lkIHVwZGF0ZUdseXBoQ2FjaGUoQ2FjaGVkR2x5cGhJbmZvICpnbHlwaCk7CisgICAgdm9pZCBkcmF3Q2FjaGVkR2x5cGgoQ2FjaGVkR2x5cGhJbmZvICpnbHlwaCwgaW50IHgsIGludCB5KTsKK307CisKK2NsYXNzIEZvbnRTdGF0ZQoreworcHVibGljOgorICAgIEZvbnRTdGF0ZSgpOworICAgIH5Gb250U3RhdGUoKTsKKworICAgIHZvaWQgaW5pdChDb250ZXh0ICpyc2MpOworICAgIHZvaWQgZGVpbml0KENvbnRleHQgKnJzYyk7CisKKyAgICBPYmplY3RCYXNlUmVmPEZvbnQ+IG1EZWZhdWx0OworICAgIE9iamVjdEJhc2VSZWY8Rm9udD4gbUxhc3Q7CisKKyAgICB2b2lkIHJlbmRlclRleHQoY29uc3QgY2hhciAqdGV4dCwgdWludDMyX3QgbGVuLCB1aW50MzJfdCBzdGFydEluZGV4LCBpbnQgbnVtR2x5cGhzLCBpbnQgeCwgaW50IHkpOworICAgIHZvaWQgcmVuZGVyVGV4dChjb25zdCBjaGFyICp0ZXh0LCBpbnQgeCwgaW50IHkpOworICAgIHZvaWQgcmVuZGVyVGV4dChBbGxvY2F0aW9uICphbGxvYywgaW50IHgsIGludCB5KTsKKyAgICB2b2lkIHJlbmRlclRleHQoQWxsb2NhdGlvbiAqYWxsb2MsIHVpbnQzMl90IHN0YXJ0LCBpbnQgbGVuLCBpbnQgeCwgaW50IHkpOworCitwcm90ZWN0ZWQ6CisKKyAgICBmcmllbmQgY2xhc3MgRm9udDsKKworICAgIHN0cnVjdCBDYWNoZVRleHR1cmVMaW5lCisgICAgeworICAgICAgICB1aW50MzJfdCBtTWF4SGVpZ2h0OworICAgICAgICB1aW50MzJfdCBtTWF4V2lkdGg7CisgICAgICAgIHVpbnQzMl90IG1DdXJyZW50Um93OworICAgICAgICB1aW50MzJfdCBtQ3VycmVudENvbDsKKworICAgICAgICBDYWNoZVRleHR1cmVMaW5lKHVpbnQzMl90IG1heEhlaWdodCwgdWludDMyX3QgbWF4V2lkdGgsIHVpbnQzMl90IGN1cnJlbnRSb3csIHVpbnQzMl90IGN1cnJlbnRDb2wpIDoKKyAgICAgICAgICAgIG1NYXhIZWlnaHQobWF4SGVpZ2h0KSwgbU1heFdpZHRoKG1heFdpZHRoKSwgbUN1cnJlbnRSb3coY3VycmVudFJvdyksIG1DdXJyZW50Q29sKGN1cnJlbnRDb2wpIHsKKyAgICAgICAgfQorCisgICAgICAgIGJvb2wgZml0Qml0bWFwKEZUX0JpdG1hcCAqYml0bWFwLCB1aW50MzJfdCAqcmV0T3JpZ2luWCwgdWludDMyX3QgKnJldE9yaWdpblkpIHsKKyAgICAgICAgICAgIGlmKCh1aW50MzJfdCliaXRtYXAtPnJvd3MgPiBtTWF4SGVpZ2h0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZihtQ3VycmVudENvbCArICh1aW50MzJfdCliaXRtYXAtPndpZHRoIDwgbU1heFdpZHRoKSB7CisgICAgICAgICAgICAgICAqcmV0T3JpZ2luWCA9IG1DdXJyZW50Q29sOworICAgICAgICAgICAgICAgKnJldE9yaWdpblkgPSBtQ3VycmVudFJvdzsKKyAgICAgICAgICAgICAgIG1DdXJyZW50Q29sICs9IGJpdG1hcC0+d2lkdGg7CisgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgfTsKKworICAgIFZlY3RvcjxDYWNoZVRleHR1cmVMaW5lKj4gbUNhY2hlTGluZXM7CisKKyAgICBDb250ZXh0ICptUlNDOworCisgICAgLy8gRnJlZSB0eXBlIGxpYnJhcnksIHdlIG9ubHkgbmVlZCBvbmUgY29weQorICAgIEZUX0xpYnJhcnkgbUxpYnJhcnk7CisgICAgRlRfTGlicmFyeSBnZXRMaWIoKTsKKyAgICBWZWN0b3I8Rm9udCo+IG1BY3RpdmVGb250czsKKworICAgIC8vIFJlbmRlciBzdGF0ZSBmb3IgdGhlIGZvbnQKKyAgICBPYmplY3RCYXNlUmVmPFByb2dyYW1GcmFnbWVudD4gbUZvbnRTaGFkZXJGOworICAgIE9iamVjdEJhc2VSZWY8U2FtcGxlcj4g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SwgZmxvYXQgeTEsIGZsb2F0IHoxLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1MSwgZmxvYXQgdjEsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgyLCBmbG9hdCB5MiwgZmxvYXQgejIsCisgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHUyLCBmbG9hdCB2MiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDMsIGZsb2F0IHkzLCBmbG9hdCB6MywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTMsIGZsb2F0IHYzLAorICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4NCwgZmxvYXQgeTQsIGZsb2F0IHo0LAorICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1NCwgZmxvYXQgdjQpOworCit9OworCisKK30KK30KKworI2VuZGlmCmRpZmYgLS1naXQgYS9saWJzL3JzL3JzSGFuZGNvZGUuaCBiL2xpYnMvcnMvcnNIYW5kY29kZS5oCmluZGV4IDgwMGVkZGQuLjM1M2I3M2EgMTAwNjQ0Ci0tLSBhL2xpYnMvcnMvcnNIYW5kY29kZS5oCisrKyBiL2xpYnMvcnMvcnNIYW5kY29kZS5oCkBAIC0xLDYgKzEsNTcgQEAKIAogI2RlZmluZSBEQVRBX1NZTkNfU0laRSAxMDI0CiAKK3N0YXRpYyBpbmxpbmUgdm9pZCByc0hDQVBJX0NvbnRleHRGaW5pc2ggKFJzQ29udGV4dCByc2MpCit7CisgICAgVGhyZWFkSU8gKmlvID0gJigoQ29udGV4dCAqKXJzYyktPm1JTzsKKyAgICB1aW50MzJfdCBzaXplID0gc2l6ZW9mKFJTX0NNRF9Db250ZXh0RmluaXNoKTsKKyAgICBSU19DTURfQ29udGV4dEZpbmlzaCAqY21kID0gc3RhdGljX2Nhc3Q8UlNfQ01EX0NvbnRleHRGaW5pc2ggKj4oaW8tPm1Ub0NvcmUucmVzZXJ2ZShzaXplKSk7CisgICAgaW8tPm1Ub0NvcmUuY29tbWl0U3luYyhSU19DTURfSURfQ29udGV4dEZpbmlzaCwgc2l6ZSk7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCByc0hDQVBJX1NjcmlwdEludm9rZVYgKFJzQ29udGV4dCByc2MsIFJzU2NyaXB0IHZhLCB1aW50MzJfdCBzbG90LCBjb25zdCB2b2lkICogZGF0YSwgdWludDMyX3Qgc2l6ZUJ5dGVzKQoreworICAgIFRocmVhZElPICppbyA9ICYoKENvbnRleHQgKilyc2MpLT5tSU87CisgICAgdWludDMyX3Qgc2l6ZSA9IHNpemVvZihSU19DTURfU2NyaXB0SW52b2tlVik7CisgICAgaWYgKHNpemVCeXRlcyA8IERBVEFfU1lOQ19TSVpFKSB7CisgICAgICAgIHNpemUgKz0gKHNpemVCeXRlcyArIDMpICYgfjM7CisgICAgfQorICAgIFJTX0NNRF9TY3JpcHRJbnZva2VWICpjbWQgPSBzdGF0aWNfY2FzdDxSU19DTURfU2NyaXB0SW52b2tlViAqPihpby0+bVRvQ29yZS5yZXNlcnZlKHNpemUpKTsKKyAgICBjbWQtPnMgPSB2YTsKKyAgICBjbWQtPnNsb3QgPSBzbG90OworICAgIGNtZC0+ZGF0YUxlbiA9IHNpemVCeXRlczsKKyAgICBjbWQtPmRhdGEgPSBkYXRhOworICAgIGlmIChzaXplQnl0ZXMgPCBEQVRBX1NZTkNfU0laRSkgeworICAgICAgICBjbWQtPmRhdGEgPSAodm9pZCAqKShjbWQrMSk7CisgICAgICAgIG1lbWNweShjbWQrMSwgZGF0YSwgc2l6ZUJ5dGVzKTsKKyAgICAgICAgaW8tPm1Ub0NvcmUuY29tbWl0KFJTX0NNRF9JRF9TY3JpcHRJbnZva2VWLCBzaXplKTsKKyAgICB9IGVsc2UgeworICAgICAgICBpby0+bVRvQ29yZS5jb21taXRTeW5jKFJTX0NNRF9JRF9TY3JpcHRJbnZva2VWLCBzaXplKTsKKyAgICB9Cit9CisKKworc3Rhd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ICAgICB2ZXJ0cy0+bVZlcnRleERhdGFTaXplID0gc3RyZWFtLT5sb2FkVTMyKCk7CisKKyAgICAgICAgdmVydHMtPm1PZmZzZXRDb29yZCA9IHN0cmVhbS0+bG9hZFUzMigpOworICAgICAgICB2ZXJ0cy0+bU9mZnNldFRleCA9IHN0cmVhbS0+bG9hZFUzMigpOworICAgICAgICB2ZXJ0cy0+bU9mZnNldE5vcm0gPSBzdHJlYW0tPmxvYWRVMzIoKTsKKworICAgICAgICB2ZXJ0cy0+bVNpemVDb29yZCA9IHN0cmVhbS0+bG9hZFUzMigpOworICAgICAgICB2ZXJ0cy0+bVNpemVUZXggPSBzdHJlYW0tPmxvYWRVMzIoKTsKKyAgICAgICAgdmVydHMtPm1TaXplTm9ybSA9IHN0cmVhbS0+bG9hZFUzMigpOworICAgIH0KKworICAgIG1lc2gtPm1QcmltaXRpdmVzQ291bnQgPSBzdHJlYW0tPmxvYWRVMzIoKTsKKyAgICBpZihtZXNoLT5tUHJpbWl0aXZlc0NvdW50KSB7CisgICAgICAgIG1lc2gtPm1QcmltaXRpdmVzID0gbmV3IFByaW1pdGl2ZV90ICpbbWVzaC0+bVByaW1pdGl2ZXNDb3VudF07CisgICAgfQorICAgIGVsc2UgeworICAgICAgICBtZXNoLT5tUHJpbWl0aXZlcyA9IE5VTEw7CisgICAgfQorCisgICAgLy8gbG9hZCBhbGwgcHJpbWl0aXZlcworICAgIGZvciAodWludDMyX3QgcENvdW50ID0gMDsgcENvdW50IDwgbWVzaC0+bVByaW1pdGl2ZXNDb3VudDsgcENvdW50ICsrKSB7CisgICAgICAgIFByaW1pdGl2ZV90ICogcHJpbSA9IG5ldyBQcmltaXRpdmVfdDsKKyAgICAgICAgbWVzaC0+bVByaW1pdGl2ZXNbcENvdW50XSA9IHByaW07CisKKyAgICAgICAgcHJpbS0+bVR5cGUgPSAoUnNQcmltaXRpdmUpc3RyZWFtLT5sb2FkVTgoKTsKKworICAgICAgICAvLyBXZSBzdG9yZSB0aGUgaW5kZXggdG8gdGhlIHZlcnRpY2VzCisgICAgICAgIHVpbnQzMl90IHZlcnRleEluZGV4ID0gc3RyZWFtLT5sb2FkVTMyKCk7CisgICAgICAgIGlmKHZlcnRleEluZGV4IDwgbWVzaC0+bVZlcnRpY2llc0NvdW50KSB7CisgICAgICAgICAgICBwcmltLT5tVmVydGljaWVzID0gbWVzaC0+bVZlcnRpY2llc1t2ZXJ0ZXhJbmRleF07CisgICAgICAgIH0KKyAgICAgICAgZWxzZSB7CisgICAgICAgICAgICBwcmltLT5tVmVydGljaWVzID0gTlVMTDsKKyAgICAgICAgfQorCisgICAgICAgIHByaW0tPm1JbmRleENvdW50ID0gc3RyZWFtLT5sb2FkVTMyKCk7CisgICAgICAgIGlmKHByaW0tPm1JbmRleENvdW50KXsKKyAgICAgICAgICAgIHByaW0tPm1JbmRpY2llcyA9IG5ldyB1aW50MTZfdFtwcmltLT5tSW5kZXhDb3VudF07CisgICAgICAgICAgICBmb3IgKHVpbnQzMl90IGN0ID0gMDsgY3QgPCBwcmltLT5tSW5kZXhDb3VudDsgY3QrKykgeworICAgICAgICAgICAgICAgIHByaW0tPm1JbmRpY2llc1tjdF0gPSBzdHJlYW0tPmxvYWRVMTYoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIHByaW0tPm1JbmRpY2llcyA9IE5VTEw7CisgICAgICAgIH0KKworICAgICAgICBwcmltLT5tUmVzdGFydENvdW50cyA9IHN0cmVhbS0+bG9hZFUzMigpOworICAgICAgICBpZiAocHJpbS0+bVJlc3RhcnRDb3VudHMpIHsKKyAgICAgICAgICAgIHByaW0tPm1SZXN0YXJ0cyA9IG5ldyB1aW50MTZfdFtwcmltLT5tUmVzdGFydENvdW50c107CisgICAgICAgICAgICBmb3IgKHVpbnQzMl90IGN0ID0gMDsgY3QgPCBwcmltLT5tUmVzdGFydENvdW50czsgY3QrKykgeworICAgICAgICAgICAgICAgIHByaW0tPm1SZ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BhbmRyb2lkOjpyZW5kZXJzY3JpcHQ7CisKKworTXV0ZXg6Ok11dGV4KCkKK3sKK30KKworTXV0ZXg6On5NdXRleCgpCit7CisgICAgcHRocmVhZF9tdXRleF9kZXN0cm95KCZtTXV0ZXgpOworfQorCitib29sIE11dGV4Ojppbml0KCkKK3sKKyAgICBpbnQgc3RhdHVzID0gcHRocmVhZF9tdXRleF9pbml0KCZtTXV0ZXgsIE5VTEwpOworICAgIGlmIChzdGF0dXMpIHsKKyAgICAgICAgTE9HRSgiTXV0ZXg6Ok11dGV4IGluaXQgZmFpbHVyZSIpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIHJldHVybiB0cnVlOworfQorCitib29sIE11dGV4Ojpsb2NrKCkKK3sKKyAgICBpbnQgc3RhdHVzOworICAgIHN0YXR1cyA9IHB0aHJlYWRfbXV0ZXhfbG9jaygmbU11dGV4KTsKKyAgICBpZiAoc3RhdHVzKSB7CisgICAgICAgIExPR0UoIk11dGV4OiBlcnJvciAlaSBsb2NraW5nLiIsIHN0YXR1cyk7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisgICAgcmV0dXJuIHRydWU7Cit9CisKK2Jvb2wgTXV0ZXg6OnVubG9jaygpCit7CisgICAgaW50IHN0YXR1czsKKyAgICBzdGF0dXMgPSBwdGhyZWFkX211dGV4X3VubG9jaygmbU11dGV4KTsKKyAgICBpZiAoc3RhdHVzKSB7CisgICAgICAgIExPR0UoIk11dGV4IGVycm9yICVpIHVubG9ja2luZy4iLCBzdGF0dXMpOworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorICAgIHJldHVybiB0cnVlOworfQorCisKZGlmZiAtLWdpdCBhL2dyYXBoaWNzL2phdmEvYW5kcm9pZC9yZW5kZXJzY3JpcHQvVmVjdG9yMmYuamF2YSBiL2xpYnMvcnMvcnNNdXRleC5oCnNpbWlsYXJpdHkgaW5kZXggNjklCmNvcHkgZnJvbSBncmFwaGljcy9qYXZhL2F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pbmUgdm9pZCBTQ19ub3JtYWxpemVmMyhmbG9hdCB2W10pCi17Ci0gICAgZmxvYXQgcyA9IChmbG9hdClzcXJ0Zih2WzBdICogdlswXSArIHZbMV0gKiB2WzFdICsgdlsyXSAqIHZbMl0pOwotICAgIHZbMF0gPSB2WzBdIC8gczsKLSAgICB2WzFdID0gdlsxXSAvIHM7Ci0gICAgdlsyXSA9IHZbMl0gLyBzOwotfQotCi1zdGF0aWMgdm9pZCBub2lzZV9pbml0KCkKLXsKLSAgICBpbnQgaSwgaiwgazsKLSAgICAKLSAgICBmb3IgKGkgPSAwOyBpIDwgQjsgaSsrKSB7Ci0gICAgICAgIHBbaV0gPSBpOwotICAgICAgICAKLSAgICAgICAgZzFbaV0gPSAoZmxvYXQpKChyYW5kKCkgJSAoQiArIEIpKSAtIEIpIC8gQjsKLSAgICAgICAgCi0gICAgICAgIGZvciAoaiA9IDA7IGogPCAyOyBqKyspCi0gICAgICAgICAgICBnMltpXVtqXSA9IChmbG9hdCkoKHJhbmQoKSAlIChCICsgQikpIC0gQikgLyBCOwotICAgICAgICBTQ19ub3JtYWxpemVmMihnMltpXSk7Ci0gICAgICAgIAotICAgICAgICBmb3IgKGogPSAwOyBqIDwgMzsgaisrKQotICAgICAgICAgICAgZzNbaV1bal0gPSAoZmxvYXQpKChyYW5kKCkgJSAoQiArIEIpKSAtIEIpIC8gQjsKLSAgICAgICAgU0Nfbm9ybWFsaXplZjMoZzNbaV0pOwotICAgIH0KLSAgICAKLSAgICBmb3IgKGkgPSBCLTE7IGkgPj0gMDsgaS0tKSB7Ci0gICAgICAgIGsgPSBwW2ldOwotICAgICAgICBwW2ldID0gcFtqID0gcmFuZCgpICUgQl07Ci0gICAgICAgIHBbal0gPSBrOwotICAgIH0KLSAgICAKLSAgICBmb3IgKGkgPSAwOyBpIDwgQiArIDI7IGkrKykgewotICAgICAgICBwW0IgKyBpXSA9IHBbaV07Ci0gICAgICAgIGcxW0IgKyBpXSA9IGcxW2ldOwotICAgIC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jdCk7CiAgICAgICAgIH0KKyNlbmRpZiAvL0FORFJPSURfUlNfQlVJTERfRk9SX0hPU1QKICAgICB9IGVsc2UgewogICAgICAgICBnbERpc2FibGUoR0xfTElHSFRJTkcpOwogICAgIH0KQEAgLTEyOCw2ICsxMzgsMTEgQEAKICAgICAgICAgICAgIGNvbnN0IEVsZW1lbnQgKmUgPSBtQ29uc3RhbnRUeXBlc1tjdF0tPmdldEVsZW1lbnQoKTsKICAgICAgICAgICAgIGZvciAodWludDMyX3QgZmllbGQ9MDsgZmllbGQgPCBlLT5nZXRGaWVsZENvdW50KCk7IGZpZWxkKyspIHsKICAgICAgICAgICAgICAgICBjb25zdCBFbGVtZW50ICpmID0gZS0+Z2V0RmllbGQoZmllbGQpOworICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKmZuID0gZS0+Z2V0RmllbGROYW1lKGZpZWxkKTsKKworICAgICAgICAgICAgICAgIGlmIChmblswXSA9PSAnIycpIHsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgLy8gQ2Fubm90IGJlIGNvbXBsZXgKICAgICAgICAgICAgICAgICByc0Fzc2VydCghZi0+Z2V0RmllbGRDb3VudCgpKTsKQEAgLTE0MCw3ICsxNTUsNyBAQAogICAgICAgICAgICAgICAgICAgICByc0Fzc2VydCgwKTsKICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICBtU2hhZGVyLmFwcGVuZChlLT5nZXRGaWVsZE5hbWUoZmllbGQpKTsKKyAgICAgICAgICAgICAgICBtU2hhZGVyLmFwcGVuZChmbik7CiAgICAgICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoIjtcbiIpOwogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC0xNTAsNiArMTY1LDExIEBACiAgICAgICAgICAgICBjb25zdCBFbGVtZW50ICplID0gbUlucHV0RWxlbWVudHNbY3RdLmdldCgpOwogICAgICAgICAgICAgZm9yICh1aW50MzJfdCBmaWVsZD0wOyBmaWVsZCA8IGUtPmdldEZpZWxkQ291bnQoKTsgZmllbGQrKykgewogICAgICAgICAgICAgICAgIGNvbnN0IEVsZW1lbnQgKmYgPSBlLT5nZXRGaWVsZChmaWVsZCk7CisgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqZm4gPSBlLT5nZXRGaWVsZE5hbWUoZmllbGQpOworCisgICAgICAgICAgICAgICAgaWYgKGZuWzBdID09ICcjJykgeworICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAvLyBDYW5ub3QgYmUgY29tcGxleAogICAgICAgICAgICAgICAgIHJzQXNzZXJ0KCFmLT5nZXRGaWVsZENvdW50KCkpOwpAQCAtMTYyLDE3ICsxODIsMTcgQEAKICAgICAgICAgICAgICAgICAgICAgcnNBc3NlcnQoMCk7CiAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoZS0+Z2V0RmllbGROYW1lKGZpZWxkKSk7CisgICAgICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoZm4pOwogICAgICAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKCI7XG4iKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICBtU2hhZGVyLmFwcGVuZChtVXNlclNoYWRlcik7CiAgICAgfSBlbHNlIHsKLSAgICAgICAgbVNoYWRlci5hcHBlbmQoImF0dHJpYnV0ZSB2ZWM0IEFUVFJJQl9MZWdhY3lQb3NpdGlvbjtcbiIpOwotICAgICAgICBtU2hhZGVyLmFwcGVuZCgiYXR0cmlidXRlIHZlYzQgQVRUUklCX0xlZ2FjeUNvbG9yO1xuIik7Ci0gICAgICAgIG1TaGFkZXIuYXBwZW5kKCJhdHRyaWJ1dGUgdmVjMyBBVFRSSUJfTGVnYWN5Tm9ybWFsO1xuIik7Ci0gICAgICAgIG1TaGFkZXIuYXBw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IDE2CisjZGVmaW5lIE1BWF9TQ1JJUFRfQkFOS1MgMzIKIAogY2xhc3MgU2NyaXB0IDogcHVibGljIE9iamVjdEJhc2UKIHsKQEAgLTM5LDM4ICszOSwzOCBAQAogICAgIFNjcmlwdChDb250ZXh0ICopOwogICAgIHZpcnR1YWwgflNjcmlwdCgpOwogCi0KICAgICBzdHJ1Y3QgRW52aXJvbWVudF90IHsKLSAgICAgICAgYm9vbCBtSXNSb290OwotICAgICAgICBmbG9hdCBtQ2xlYXJDb2xvcls0XTsKLSAgICAgICAgZmxvYXQgbUNsZWFyRGVwdGg7Ci0gICAgICAgIHVpbnQzMl90IG1DbGVhclN0ZW5jaWw7Ci0KICAgICAgICAgdWludDMyX3QgbVN0YXJ0VGltZU1pbGxpczsKICAgICAgICAgY29uc3QgY2hhciogbVRpbWVab25lOwogCiAgICAgICAgIE9iamVjdEJhc2VSZWY8UHJvZ3JhbVZlcnRleD4gbVZlcnRleDsKICAgICAgICAgT2JqZWN0QmFzZVJlZjxQcm9ncmFtRnJhZ21lbnQ+IG1GcmFnbWVudDsKICAgICAgICAgT2JqZWN0QmFzZVJlZjxQcm9ncmFtUmFzdGVyPiBtUmFzdGVyOwotICAgICAgICBPYmplY3RCYXNlUmVmPFByb2dyYW1GcmFnbWVudFN0b3JlPiBtRnJhZ21lbnRTdG9yZTsKLSAgICAgICAgSW52b2tlRnVuY190IG1JbnZva2FibGVzW01BWF9TQ1JJUFRfQkFOS1NdOworICAgICAgICBPYmplY3RCYXNlUmVmPFByb2dyYW1TdG9yZT4gbUZyYWdtZW50U3RvcmU7CisKKyAgICAgICAgdWludDMyX3QgbUludm9rZUZ1bmN0aW9uQ291bnQ7CisgICAgICAgIEludm9rZUZ1bmNfdCAqbUludm9rZUZ1bmN0aW9uczsKKyAgICAgICAgdWludDMyX3QgbUZpZWxkQ291bnQ7CisgICAgICAgIHZvaWQgKiogbUZpZWxkQWRkcmVzczsKKwogICAgICAgICBjaGFyICogbVNjcmlwdFRleHQ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CgpKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIGlmIChtU2xvdHNbY3RdLT5nZXRQdHIoKSA9PSBwdHIpIHsKKyAgICAgICAgICAgIHJldHVybiBtU2xvdHNbY3RdLmdldCgpOworICAgICAgICB9CisgICAgfQorICAgIExPR0UoIlNjcmlwdEM6OnB0clRvQWxsb2NhdGlvbiwgZmFpbGVkIHRvIGZpbmQgJXAiLCBwdHIpOworICAgIHJldHVybiBOVUxMOworfQogCi0gICAgQ29udGV4dDo6U2NyaXB0VExTU3RydWN0ICogdGxzID0KLSAgICAoQ29udGV4dDo6U2NyaXB0VExTU3RydWN0ICopcHRocmVhZF9nZXRzcGVjaWZpYyhDb250ZXh0OjpnVGhyZWFkVExTS2V5KTsKK1NjcmlwdCAqIFNjcmlwdEM6OnNldFRMUyhTY3JpcHQgKnNjKQoreworICAgIENvbnRleHQ6OlNjcmlwdFRMU1N0cnVjdCAqIHRscyA9IChDb250ZXh0OjpTY3JpcHRUTFNTdHJ1Y3QgKikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdGhyZWFkX2dldHNwZWNpZmljKENvbnRleHQ6OmdUaHJlYWRUTFNLZXkpOwogICAgIHJzQXNzZXJ0KHRscyk7CisgICAgU2NyaXB0ICpvbGQgPSB0bHMtPm1TY3JpcHQ7CisgICAgdGxzLT5tU2NyaXB0ID0gc2M7CisgICAgcmV0dXJuIG9sZDsKK30KIAorCit2b2lkIFNjcmlwdEM6OnNldHVwR0xTdGF0ZShDb250ZXh0ICpyc2MpCit7CiAgICAgaWYgKG1FbnZpcm9tZW50Lm1GcmFnbWVudFN0b3JlLmdldCgpKSB7CiAgICAgICAgIHJzYy0+c2V0RnJhZ21lbnRTdG9yZShtRW52aXJvbWVudC5tRnJhZ21lbnRTdG9yZS5nZXQoKSk7CiAgICAgfQpAQCAtODMsMjAgKzExNiw5MiBAQAogICAgIGlmIChtRW52aXJvbWVudC5tUmFzdGVyLmdldCgpKSB7CiAgICAgICA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YWdtYXMocy0+bUJjY1NjcmlwdCwgJnByYWdtYUNvdW50LCBwcmFnbWFNYXgsICZzdHJbMF0pOwogCiAgICAgICAgIGZvciAoaW50IGN0PTA7IGN0IDwgcHJhZ21hQ291bnQ7IGN0Kz0yKSB7CisgICAgICAgICAgICAvL0xPR0UoInByYWdtZSAlcyAlcyIsIHN0cltjdF0sIHN0cltjdCsxXSk7CiAgICAgICAgICAgICBpZiAoIXN0cmNtcChzdHJbY3RdLCAidmVyc2lvbiIpKSB7CiAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICB9CkBAIC0yMDgsMTEgKzMxMiw2IEBACiAgICAgICAgICAgICAgICAgICAgIHMtPm1FbnZpcm9tZW50Lm1WZXJ0ZXguY2xlYXIoKTsKICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIFByb2dyYW1WZXJ0ZXggKiBwdiA9IChQcm9ncmFtVmVydGV4ICopcnNjLT5sb29rdXBOYW1lKHN0cltjdCsxXSk7Ci0gICAgICAgICAgICAgICAgaWYgKHB2ICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgcy0+bUVudmlyb21lbnQubVZlcnRleC5zZXQocHYpOwotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgTE9HRSgiVW5yZWNvbml6ZWQgdmFsdWUgJXMgcGFzc2VkIHRvIHN0YXRlVmVydGV4Iiwgc3RyW2N0KzFdKTsKICAgICAgICAgICAgIH0KIApAQCAtMjI0LDExICszMjMsNiBAQAogICAgICAgICAgICAgICAgICAgICBzLT5tRW52aXJvbWVudC5tUmFzdGVyLmNsZWFyKCk7CiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBQcm9ncmFtUmFzdGVyICogcHIgPSAoUHJvZ3JhbVJhc3RlciAqKXJzYy0+bG9va3VwTmFtZShzdHJbY3QrMV0pOwotICAgICAgICAgICAgICAgIGlmIChwciAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIHMtPm1FbnZpcm9tZW50Lm1SYXN0ZXIuc2V0KHByKTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIExPR0UoIlVucmVjb25pemVkIHZhbHVlICVzIHBhc3NlZCB0byBzdGF0ZVJhc3RlciIsIHN0cltjdCsxXSk7CiAgICAgICAgICAgICB9CiAKQEAgLTI0MCwxMSArMzM0LDYgQEAKICAgICAgICAgICAgICAgICAgICAgcy0+bUVudmlyb21lbnQubUZyYWdtZW50LmNsZWFyKCk7CiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBQcm9ncmFtRnJhZ21lbnQgKiBwZiA9IChQcm9ncmFtRnJhZ21lbnQgKilyc2MtPmxvb2t1cE5hbWUoc3RyW2N0KzFdKTsKLSAgICAgICAgICAgICAgICBpZiAocGYgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICBzLT5tRW52aXJvbWVudC5tRnJhZ21lbnQuc2V0KHBmKTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIExPR0UoIlVucmVjb25pemVkIHZhbHVlICVzIHBhc3NlZCB0byBzdGF0ZUZyYWdtZW50Iiwgc3RyW2N0KzFdKTsKICAgICAgICAgICAgIH0KIApAQCAtMjU2LDEyICszNDUsNiBAQAogICAgICAgICAgICAgICAgICAgICBzLT5tRW52aXJvbWVudC5tRnJhZ21lbnRTdG9yZS5jbGVhcigpOwogICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgUHJvZ3JhbUZyYWdtZW50U3Rvcm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gICAgICAgIGlmIChlLT5nZXROYW1lKCkgJiYgKGUtPmdldEZpZWxkQ291bnQoKSA+IDEpKSB7Ci0gICAgICAgICAgICBTdHJpbmc4IHMoInN0cnVjdCBzdHJ1Y3RfIik7Ci0gICAgICAgICAgICBzLmFwcGVuZChlLT5nZXROYW1lKCkpOwotICAgICAgICAgICAgcy5hcHBlbmQoZS0+Z2V0Q1N0cnVjdEJvZHkoKSk7Ci0gICAgICAgICAgICBzLmFwcGVuZCgiO1xuIik7Ci0KLSAgICAgICAgICAgIHMuYXBwZW5kKCIjZGVmaW5lICIpOwotICAgICAgICAgICAgcy5hcHBlbmQoZS0+Z2V0TmFtZSgpKTsKLSAgICAgICAgICAgIHMuYXBwZW5kKCJfdCBzdHJ1Y3Qgc3RydWN0XyIpOwotICAgICAgICAgICAgcy5hcHBlbmQoZS0+Z2V0TmFtZSgpKTsKLSAgICAgICAgICAgIHMuYXBwZW5kKCJcblxuIik7Ci0gICAgICAgICAgICBpZiAocnNjLT5wcm9wcy5tTG9nU2NyaXB0cykgewotICAgICAgICAgICAgICAgIExPR1YoIiVzIiwgc3RhdGljX2Nhc3Q8Y29uc3QgY2hhcio+KHMpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHN0ci0+YXBwZW5kKHMpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1TbG90TmFtZXNbY3RdLmxlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgU3RyaW5nOCBzOwotICAgICAgICAgICAgaWYgKGUtPmdldE5hbWUoKSkgewotICAgICAgICAgICAgICAgIC8vIFVzZSB0aGUgbmFtZWQgc3RydWN0Ci0gICAgICAgICAgICAgICAgcy5zZXRUbyhlLT5nZXROYW1lKCkpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBjcmVhdGUgYW4gc3RydWN0IG5hbWVkIGZyb20gdGhlIHNsb3QuCi0gICAgICAgICAgICAgICAgcy5zZXRUbygic3RydWN0ICIpOwotICAgICAgICAgICAgICAgIHMuYXBwZW5kKG1TbG90TmFtZXNbY3RdKTsKLSAgICAgICAgICAgICAgICBzLmFwcGVuZCgiX3MiKTsKLSAgICAgICAgICAgICAgICBzLmFwcGVuZChlLT5nZXRDU3RydWN0Qm9keSgpKTsKLSAgICAgICAgICAgICAgICAvL2FwcGVuZEVsZW1lbnRCb2R5KCZzLCBlKTsKLSAgICAgICAgICAgICAgICBzLmFwcGVuZCgiO1xuIik7Ci0gICAgICAgICAgICAgICAgcy5hcHBlbmQoInN0cnVjdCAiKTsKLSAgICAgICAgICAgICAgICBzLmFwcGVuZChtU2xvdE5hbWVzW2N0XSk7Ci0gICAgICAgICAgICAgICAgcy5hcHBlbmQoIl9zIik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHMuYXBwZW5kKCIgKiAiKTsKLSAgICAgICAgICAgIHMuYXBwZW5kKG1TbG90TmFtZXNbY3RdKTsKLSAgICAgICAgICAgIHMuYXBwZW5kKCI7XG4iKTsKLSAgICAgICAgICAgIGlmIChyc2MtPnByb3BzLm1Mb2dTY3JpcHRzKSB7Ci0gICAgICAgICAgICAgICAgTE9HVigiJXMiLCBzdGF0aWNfY2FzdDxjb25zdCBjaGFyKj4ocykpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgc3RyLT5hcHBlbmQocyk7Ci0gICAgICAgIH0KLSAgICB9Ci19CiAKIAogbmFtZXNwYWNlIGFuZHJvaWQgewpAQCAtNDIwLDcgKzM5OCw2IEBACiAgICAgcy0+c2V0Q29udGV4dChyc2MpOwogICAgIGZvciAoaW50IGN0PTA7IGN0IDwgTUFYX1NDUklQVF9CQU5LUzsgY3QrKykgewogICAgICAgICBzLT5tVHlwZXNbY3RdLnNldChzcy0+bUNvbnN0YW50QnVmZmVyVHlwZXNbY3RdLmdldCgpKTsKLSAgICAgICAgcy0+bVNsb3ROYW1lc1tjdF0gPSBzcy0+bVNsb3ROYW1lc1tjdF07CiAgICAgICAgIHMtPm1T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EdFVF9UTFMoKTsKLSAgICBpZiAoIXJzYy0+c2V0dXBDaGVjaygpKSB7Ci0gICAgICAgIHJldHVybjsKLSAgICB9Ci0KLSAgICBmbG9hdCB2dHhbXSA9IHsgeCwgeSwgeiB9OwotCi0gICAgVmVydGV4QXJyYXkgdmE7Ci0gICAgdmEuYWRkTGVnYWN5KEdMX0ZMT0FULCAzLCAxMiwgUlNfS0lORF9QT1NJVElPTiwgZmFsc2UsICh1aW50MzJfdCl2dHgpOwotICAgIGlmIChyc2MtPmNoZWNrVmVyc2lvbjJfMCgpKSB7Ci0gICAgICAgIHZhLnNldHVwR0wyKHJzYywgJnJzYy0+bVN0YXRlVmVydGV4QXJyYXksICZyc2MtPm1TaGFkZXJDYWNoZSk7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgdmEuc2V0dXBHTChyc2MsICZyc2MtPm1TdGF0ZVZlcnRleEFycmF5KTsKLSAgICB9Ci0KLSAgICBnbERyYXdBcnJheXMoR0xfUE9JTlRTLCAwLCAxKTsKLX0KLQotc3RhdGljIHZvaWQgU0NfZHJhd1F1YWRUZXhDb29yZHMoZmxvYXQgeDEsIGZsb2F0IHkxLCBmbG9hdCB6MSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHUxLCBmbG9hdCB2MSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgyLCBmbG9hdCB5MiwgZmxvYXQgejIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1MiwgZmxvYXQgdjIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4MywgZmxvYXQgeTMsIGZsb2F0IHozLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTMsIGZsb2F0IHYzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDQsIGZsb2F0IHk0LCBmbG9hdCB6NCwKLSAgICAg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AgICAgIHJlZCA9IHo7Ci0gICAgICAgICAgICBncmVlbiA9IHR2OwotICAgICAgICAgICAgYmx1ZSA9IHB2OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgMTogICAgICAgICAvLyBHcmVlbiBpcyB0aGUgZG9taW5hbnQgY29sb3IKLSAgICAgICAgICAgIHJlZCA9IHF2OwotICAgICAgICAgICAgZ3JlZW4gPSB6OwotICAgICAgICAgICAgYmx1ZSA9IHB2OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgMjoKLSAgICAgICAgICAgIHJlZCA9IHB2OwotICAgICAgICAgICAgZ3JlZW4gPSB6OwotICAgICAgICAgICAgYmx1ZSA9IHR2OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgMzogICAgICAgICAvLyBCbHVlIGlzIHRoZSBkb21pbmFudCBjb2xvcgotICAgICAgICAgICAgcmVkID0gcHY7Ci0gICAgICAgICAgICBncmVlbiA9IHF2OwotICAgICAgICAgICAgYmx1ZSA9IHo7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA0OgotICAgICAgICAgICAgcmVkID0gdHY7Ci0gICAgICAgICAgICBncmVlbiA9IHB2OwotICAgICAgICAgICAgYmx1ZSA9IHo7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA1OiAgICAgICAgIC8vIFJlZCBpcyB0aGUgZG9taW5hbnQgY29sb3IKLSAgICAgICAgICAgIHJlZCA9IHo7Ci0gICAgICAgICAgICBncmVlbiA9IHB2OwotICAgICAgICAgICAgYmx1ZSA9IHF2OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotCi0gICAgcmdiWzBdID0gcmVkOwotICAgIHJnYlsxXSA9IGdyZWVuOwotICAgIHJnYlsyXSA9IGJsdWU7Ci19Ci0KLXN0YXRpYyBpbnQgU0NfaHNiVG9BYmdyKGZsb2F0IGgsIGZsb2F0IHMsIGZsb2F0IGIsIGZ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CBzaG9ydAorLy8gICAgICAgICAgICAgICAgIDo6PSBpICAjIGludAorLy8gICAgICAgICAgICAgICAgIDo6PSBqICAjIHVuc2lnbmVkIGludAorLy8gICAgICAgICAgICAgICAgIDo6PSBsICAjIGxvbmcKKy8vICAgICAgICAgICAgICAgICA6Oj0gbSAgIyB1bnNpZ25lZCBsb25nCisvLyAgICAgICAgICAgICAgICAgOjo9IHggICMgbG9uZyBsb25nLCBfX2ludDY0CisvLyAgICAgICAgICAgICAgICAgOjo9IHkgICMgdW5zaWduZWQgbG9uZyBsb25nLCBfX2ludDY0CisvLyAgICAgICAgICAgICAgICAgOjo9IGYgICMgZmxvYXQKKy8vICAgICAgICAgICAgICAgICA6Oj0gZCAgIyBkb3VibGUKIAotICAgIC8vIG1hdGgKLSAgICB7ICJtb2RmIiwgKHZvaWQgKikmZm1vZCwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCwgZmxvYXQpIiB9LAotICAgIHsgImFicyIsICh2b2lkICopJmFicywKLSAgICAgICAgImludCIsICIoaW50KSIgfSwKLSAgICB7ICJhYnNmIiwgKHZvaWQgKikmZmFic2YsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgInNpbmZfZmFzdCIsICh2b2lkICopJlNDX3NpbmZfZmFzdCwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCkiIH0sCi0gICAgeyAiY29zZl9mYXN0IiwgKHZvaWQgKikmU0NfY29zZl9mYXN0LAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJzaW5mIiwgKHZvaWQgKikmc2luZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCkiIH0sCi0gICAgeyAiY29zZiIsICh2b2lkICopJmNvc2YsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgImFzaW5mIiwgKHZvaWQgKikmYXNpbmYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgImFjb3NmIiwgKHZvaWQgKikmYWNvc2YsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgImF0YW5mIiwgKHZvaWQgKikmYXRhbmYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgImF0YW4yZiIsICh2b2lkICopJmF0YW4yZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCwgZmxvYXQpIiB9LAotICAgIHsgImZhYnNmIiwgKHZvaWQgKikmZmFic2YsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgInJhbmRmIiwgKHZvaWQgKikmU0NfcmFuZGYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgInJhbmRmMiIsICh2b2lkICopJlNDX3JhbmRmMiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCwgZmxvYXQpIiB9LAotICAgIHsgImZsb29yZiIsICh2b2lkICopJmZsb29yZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCkiIH0sCi0gICAgeyAiZnJhY2YiLCAodm9pZCAqKSZTQ19mcmFjZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCkiIH0sCi0gICAgeyAiY2VpbGYiLCAodm9pZCAqKSZjZWlsZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCkiIH0sCi0gICAgeyAicm91bmRmIiwgKHZvaWQgKikmU0Nfcm91bmRmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0KSIgfSwKLSAgICB7ICJleHBmIiwgKHZvaWQgKikmZXhwZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCkiIH0sCi0gICAgeyAibG9nZiIsICh2b2lkICopJmxvZ2YsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgInBvd2YiLCAodm9pZCAqKSZwb3dmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0LCBmbG9hdCkiIH0sCi0gICAgeyAibWF4ZiIsICh2b2lkICopJlNDX21heGYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQsIGZsb2F0KSIgfSwKLSAgICB7ICJtaW5mIiwgKHZvaWQgKikmU0NfbWluZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCwgZmxvYXQpIiB9LAotICAgIHsgInNxcnQiLCAodm9pZCAqKSZzcXJ0LAotICAgICAgICAiaW50IiwgIihpbnQpIiB9LAotICAgIHsgInNxcnRmIiwgKHZvaWQgKikmc3FydGYsCi0gICAgICAgICJmbG9hdCIsICIoZmxvYXQpIiB9LAotICAgIHsgInNxciIsICh2b2lkICopJlNDX3NxciwKLSAgICAgICAgImludCIsICIoaW50KSIgfSwKLSAgICB7ICJzcXJmIiwgKHZvaWQgKikmU0Nfc3FyZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCkiIH0sCi0gICAgeyAic2lnbiIsICh2b2lkICopJlNDX3NpZ24sCi0gICAgICAgICJpbnQiLCAiKGludCkiIH0sCi0gICAgeyAic2lnbmYiLCAodm9pZCAqKSZTQ19zaWduZiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCkiIH0sCi0gICAgeyAiY2xhbXAiLCAodm9pZCAqKSZTQ19jbGFtcCwKLSAgICAgICAgImludCIsICIoaW50LCBpbnQsIGludCkiIH0sCi0gICAgeyAiY2xhbXBmIiwgKHZvaWQgKikmU0NfY2xhbXBmLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0LCBmbG9hdCwgZmxvYXQpIiB9LAotICAgIHsgImRpc3RmMiIsICh2b2lkICopJlNDX2Rpc3RmMiwKLSAgICAgICAgImZsb2F0IiwgIihmbG9hdCwgZmxvYXQsIGZsb2F0LCBmbG9hdCkiIH0sCi0gICAgeyAiZGlzdGYzIiwgKHZvaWQgKikmU0NfZGlzdGYzLAotICAgICAgICAiZmxvYXQiLCAiKGZsb2F0LCBmbG9hdCwgZmxvYXQsIGZsb2F0LCBmbG9hdCw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5jVG9HTCwKLSAgICAgICAgInZvaWQiLCAiKGludCkiIH0sCi0KLSAgICB7ICJjb2xvckZsb2F0UkdCQXRvVU5vcm04IiwgKHZvaWQgKikmU0NfY29sb3JGbG9hdFJHQkF0b1VOb3JtOCwKLSAgICAgICAgImludCIsICIoZmxvYXQsIGZsb2F0LCBmbG9hdCwgZmxvYXQpIiB9LAotICAgIHsgImNvbG9yRmxvYXRSR0J0bzU2NSIsICh2b2lkICopJlNDX2NvbG9yRmxvYXRSR0JBdG81NjUsCi0gICAgICAgICJpbnQiLCAiKGZsb2F0LCBmbG9hdCwgZmxvYXQpIiB9LAotCi0KLSAgICB7ICJnZXRXaWR0aCIsICh2b2lkICopJlNDX2dldFdpZHRoLAotICAgICAgICAiaW50IiwgIigpIiB9LAotICAgIHsgImdldEhlaWdodCIsICh2b2lkICopJlNDX2dldEhlaWdodCwKLSAgICAgICAgImludCIsICIoKSIgfSwKLQotICAgIHsgInNlbmRUb0NsaWVudCIsICh2b2lkICopJlNDX3RvQ2xpZW50LAotICAgICAgICAiaW50IiwgIih2b2lkICpkYXRhLCBpbnQgY21kSUQsIGludCBsZW4sIGludCB3YWl0Rm9yU3BhY2UpIiB9LAotCi0KLSAgICB7ICJkZWJ1Z0YiLCAodm9pZCAqKSZTQ19kZWJ1Z0YsCi0gICAgICAgICJ2b2lkIiwgIih2b2lkICosIGZsb2F0KSIgfSwKLSAgICB7ICJkZWJ1Z0kzMiIsICh2b2lkICopJlNDX2RlYnVnSTMyLAotICAgICAgICAidm9pZCIsICIodm9pZCAqLCBpbnQpIiB9LAotICAgIHsgImRlYnVnSGV4RiIsICh2b2lkICopJlNDX2RlYnVnSGV4RiwKLSAgICAgICAgInZvaWQiLCAiKHZvaWQgKiwgZmxvYXQpIiB9LAotICAgIHsgImRlYnVnSGV4STMyIiwgKHZvaWQgKikmU0NfZGVidWdIZXhJMzIsCi0gICAgICAgICJ2b2lkIiwgIih2b2lkICosIGludCkiIH0sCi0KLSAgICB7ICJzY3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Q19hc2lucGkoZmxvYXQgdikgeworICAgIHJldHVybiBhc2luZih2KSAvIE1fUEk7Cit9CisKK3N0YXRpYyBmbG9hdCBTQ19hdGFucGkoZmxvYXQgdikgeworICAgIHJldHVybiBhdGFuZih2KSAvIE1fUEk7Cit9CisKK3N0YXRpYyBmbG9hdCBTQ19hdGFuMnBpKGZsb2F0IHksIGZsb2F0IHgpIHsKKyAgICByZXR1cm4gYXRhbjJmKHksIHgpIC8gTV9QSTsKK30KKworc3RhdGljIGZsb2F0IFNDX2Nvc3BpKGZsb2F0IHYpIHsKKyAgICByZXR1cm4gY29zZih2ICogTV9QSSk7Cit9CisKK3N0YXRpYyBmbG9hdCBTQ19leHAxMChmbG9hdCB2KSB7CisgICAgcmV0dXJuIHBvdygxMC5mLCB2KTsKKworfQorCitzdGF0aWMgZmxvYXQgU0NfZnJhY3QoZmxvYXQgdiwgaW50ICppcHRyKSB7CisgICAgaW50IGkgPSAoaW50KWZsb29yKHYpOworICAgIGlwdHJbMF0gPSBpOworICAgIHJldHVybiBmbWluKHYgLSBpLCAweDEuZmZmZmZlcC0xZik7Cit9CisKK3N0YXRpYyBmbG9hdCBTQ19sb2cyKGZsb2F0IHYpIHsKKyAgICByZXR1cm4gbG9nMTAodikgLyBsb2cxMCgyLmYpOworfQorCitzdGF0aWMgZmxvYXQgU0NfcG93bihmbG9hdCB2LCBpbnQgcCkgeworICAgIHJldHVybiBwb3dmKHYsIChmbG9hdClwKTsKK30KKworc3RhdGljIGZsb2F0IFNDX3Bvd3IoZmxvYXQgdiwgZmxvYXQgcCkgeworICAgIHJldHVybiBwb3dmKHYsIHApOworfQorCitmbG9hdCBTQ19yb290bihmbG9hdCB2LCBpbnQgcikgeworICAgIHJldHVybiBwb3codiwgMS5mIC8gcik7Cit9CisKK2Zsb2F0IFNDX3JzcXJ0KGZsb2F0IHYpIHsKKyAgICByZXR1cm4gMS5mIC8gc3FydGYodik7Cit9CisKK2Zsb2F0IFNDX3NpbmNvcyhmbG9hdC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dm9pZAorLy8gICAgICAgICAgICAgICAgIDo6PSBiICAjIGJvb2wKKy8vICAgICAgICAgICAgICAgICA6Oj0gYyAgIyBjaGFyCisvLyAgICAgICAgICAgICAgICAgOjo9IGEgICMgc2lnbmVkIGNoYXIKKy8vICAgICAgICAgICAgICAgICA6Oj0gaCAgIyB1bnNpZ25lZCBjaGFyCisvLyAgICAgICAgICAgICAgICAgOjo9IHMgICMgc2hvcnQKKy8vICAgICAgICAgICAgICAgICA6Oj0gdCAgIyB1bnNpZ25lZCBzaG9ydAorLy8gICAgICAgICAgICAgICAgIDo6PSBpICAjIGludAorLy8gICAgICAgICAgICAgICAgIDo6PSBqICAjIHVuc2lnbmVkIGludAorLy8gICAgICAgICAgICAgICAgIDo6PSBsICAjIGxvbmcKKy8vICAgICAgICAgICAgICAgICA6Oj0gbSAgIyB1bnNpZ25lZCBsb25nCisvLyAgICAgICAgICAgICAgICAgOjo9IHggICMgbG9uZyBsb25nLCBfX2ludDY0CisvLyAgICAgICAgICAgICAgICAgOjo9IHkgICMgdW5zaWduZWQgbG9uZyBsb25nLCBfX2ludDY0CisvLyAgICAgICAgICAgICAgICAgOjo9IGYgICMgZmxvYXQKKy8vICAgICAgICAgICAgICAgICA6Oj0gZCAgIyBkb3VibGUKKworc3RhdGljIFNjcmlwdENTdGF0ZTo6U3ltYm9sVGFibGVfdCBnU3ltc1tdID0geworICAgIC8vIE9wZW5DTCBtYXRoCisgICAgeyAiX1o0YWNvc2YiLCAodm9pZCAqKSZhY29zZiB9LAorICAgIHsgIl9aNWFjb3NoZiIsICh2b2lkICopJmFjb3NoZiB9LAorICAgIHsgIl9aNmFjb3NwaWYiLCAodm9pZCAqKSZTQ19hY29zcGkgfSwKKyAgICB7ICJfWjRhc2luZiIsICh2b2lkICopJmFzaW5mIH0sCisgICAgeyAiX1o1YXNpbmhmIiwgKHZvaWQgKikmYXNpbmhmIH0sCisgICAgeyAiX1o2YXNpbnBpZiIsICh2b2lkICopJlNDX2FzaW5waSB9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nBmLCB1aW50MzJfdCBzbG90LCBSc0FsbG9jYXRpb24gdmEpCit7CisgICAgR0VUX1RMUygpOworICAgIHJzaV9Qcm9ncmFtQmluZFRleHR1cmUocnNjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8UHJvZ3JhbUZyYWdtZW50ICo+KHZwZiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICBzbG90LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8QWxsb2NhdGlvbiAqPih2YSkpOworCit9CisKK3N0YXRpYyB2b2lkIFNDX2JpbmRTYW1wbGVyKFJzUHJvZ3JhbUZyYWdtZW50IHZwZiwgdWludDMyX3Qgc2xvdCwgUnNTYW1wbGVyIHZzKQoreworICAgIEdFVF9UTFMoKTsKKyAgICByc2lfUHJvZ3JhbUJpbmRTYW1wbGVyKHJzYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PFByb2dyYW1GcmFnbWVudCAqPih2cGYpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xvdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PFNhbXBsZXIgKj4odnMpKTsKKworfQorCitzdGF0aWMgdm9pZCBTQ19iaW5kUHJvZ3JhbVN0b3JlKFJzUHJvZ3JhbVN0b3JlIHBmcykKK3sKKyAgICBHRVRfVExTKCk7CisgICAgcnNpX0NvbnRleHRCaW5kUHJvZ3JhbVN0b3JlKHJzYywgcGZzKTsKK30KKworc3RhdGljIHZvaWQgU0NfYmluZFByb2dyYW1GcmFnbWVudChSc1Byb2dyYW1GcmFnbWVudCBwZikKK3sKKyAgICBHRVRfVExTKCk7CisgICAgcnNpX0NvbnRleHRCaW5kUHJvZ3JhbUZyYWdtZW50KHJzYywgcGYpOworfQorCitzdGF0aWMgdm9pZCBTQ19iaW5kUHJvZ3JhbVZlcnRleChSc1Byb2dyYW1WZXJ0ZXggcHYpCit7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HMoZmxvYXQgeDEsIGZsb2F0IHkxLCBmbG9hdCB6MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHUxLCBmbG9hdCB2MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHgyLCBmbG9hdCB5MiwgZmxvYXQgejIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1MiwgZmxvYXQgdjIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB4MywgZmxvYXQgeTMsIGZsb2F0IHozLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdTMsIGZsb2F0IHYzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDQsIGZsb2F0IHk0LCBmbG9hdCB6NCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IHU0LCBmbG9hdCB2NCkKK3sKKyAgICBHRVRfVExTKCk7CisgICAgaWYgKCFyc2MtPnNldHVwQ2hlY2soKSkgeworICAgICAgICByZXR1cm47CisgICAgfQorCisgICAgLy9MT0dFKCJRdWFkIik7CisgICAgLy9MT0dFKCIlNC4yZiwgJTQuMmYsICU0LjJmIiwgeDEsIHkxLCB6MSk7CisgICAgLy9MT0dFKCIlNC4yZiwgJTQuMmYsICU0LjJmIiwgeDIsIHkyLCB6Mik7CisgICAgLy9MT0dFKCIlNC4yZiwgJTQuMmYsICU0LjJmIiwgeDMsIHkzLCB6Myk7CisgICAgLy9MT0dFKCIlNC4yZiwgJTQuMmYsICU0LjJmIiwgeDQsIHk0LCB6NCk7CisKKyAgICBmbG9hdCB2dHhbXSA9IHt4MSx5MSx6MSwgeDIseTIsejIsIHgzLHkzLHozLCB4NCx5NCx6NH07CisgICAgY29uc3QgZmxvYXQgdGV4W10gPSB7dTEsdjEsIHUyLHYyLCB1Myx2MywgdTQsdjR9OworCisgICAgVmVydGV4QXJy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hLCBpbnQgeCwgaW50IHkpCit7CisgICAgR0VUX1RMUygpOworICAgIEFsbG9jYXRpb24gKmFsbG9jID0gc3RhdGljX2Nhc3Q8QWxsb2NhdGlvbiAqPih2YSk7CisgICAgcnNjLT5tU3RhdGVGb250LnJlbmRlclRleHQoYWxsb2MsIHgsIHkpOworfQorCitzdGF0aWMgdm9pZCBTQ19EcmF3VGV4dChjb25zdCBjaGFyICp0ZXh0LCBpbnQgeCwgaW50IHkpCit7CisgICAgR0VUX1RMUygpOworICAgIHJzYy0+bVN0YXRlRm9udC5yZW5kZXJUZXh0KHRleHQsIHgsIHkpOworfQorCitzdGF0aWMgdm9pZCBTQ19CaW5kRm9udChSc0ZvbnQgZm9udCkKK3sKKyAgICBHRVRfVExTKCk7CisgICAgcnNpX0NvbnRleHRCaW5kRm9udChyc2MsIGZvbnQpOworfQorCisvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKy8vIENsYXNzIGltcGxlbWVudGF0aW9uCisvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKworLy8gbGx2bSBuYW1lIG1hbmdsaW5nIHJlZgorLy8gIDxidWlsdGluLXR5cGU+IDo6PSB2ICAjIHZvaWQKKy8vICAgICAgICAgICAgICAgICA6Oj0gYiAgIyBib29sCisvLyAgICAgICAgICAgICAgICAgOjo9IGMgICMgY2hhcgorLy8gICAgICAgICAgICAgICAgIDo6PSBhICAjIHNpZ25lZCBjaGFyCisvLyAgICAgICAgICAgICAgICAgOjo9IGggICMgdW5zaWduZWQgY2hhcgorLy8gICAgICAgICAgICAgICAgIDo6PSBzICAjIHNob3J0CisvLyAgICAgICAgICAgICAgICAgOjo9IHQgICMgdW5zaWduZWQgc2hvcnQ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6flNpZ25hbCgpCit7CisgICAgcHRocmVhZF9tdXRleF9kZXN0cm95KCZtTXV0ZXgpOworICAgIHB0aHJlYWRfY29uZF9kZXN0cm95KCZtQ29uZGl0aW9uKTsKK30KKworYm9vbCBTaWduYWw6OmluaXQoKQoreworICAgIGludCBzdGF0dXMgPSBwdGhyZWFkX211dGV4X2luaXQoJm1NdXRleCwgTlVMTCk7CisgICAgaWYgKHN0YXR1cykgeworICAgICAgICBMT0dFKCJMb2NrbGVzc0ZpZm8gbXV0ZXggaW5pdCBmYWlsdXJlIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBzdGF0dXMgPSBwdGhyZWFkX2NvbmRfaW5pdCgmbUNvbmRpdGlvbiwgTlVMTCk7CisgICAgaWYgKHN0YXR1cykgeworICAgICAgICBMT0dFKCJMb2NrbGVzc0ZpZm8gY29uZGl0aW9uIGluaXQgZmFpbHVyZSIpOworICAgICAgICBwdGhyZWFkX211dGV4X2Rlc3Ryb3koJm1NdXRleCk7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICByZXR1cm4gdHJ1ZTsKK30KKwordm9pZCBTaWduYWw6OnNldCgpCit7CisgICAgaW50IHN0YXR1czsKKworICAgIHN0YXR1cyA9IHB0aHJlYWRfbXV0ZXhfbG9jaygmbU11dGV4KTsKKyAgICBpZiAoc3RhdHVzKSB7CisgICAgICAgIExPR0UoIkxvY2tsZXNzQ29tbWFuZEZpZm86IGVycm9yICVpIGxvY2tpbmcgZm9yIHNldCBjb25kaXRpb24uIiwgc3RhdHVzKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKworICAgIG1TZXQgPSB0cnVlOworCisgICAgc3RhdHVzID0gcHRocmVhZF9jb25kX3NpZ25hbCgmbUNvbmRpdGlvbik7CisgICAgaWYgKHN0YXR1cykgeworICAgICAgICBMT0dFKCJMb2NrbGVzc0NvbW1hbmRGaWZvOiBlcnJvciAlaSBvbiBzZXQgY29uZGl0aW9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CA9IGxlbjsKKyAgICBtUG9zID0gMDsKKyAgICBtVXNlNjQgPSB1c2U2NDsKK30KKworT1N0cmVhbTo6fk9TdHJlYW0oKQoreworICAgIGZyZWUobURhdGEpOworfQorCit2b2lkIE9TdHJlYW06OmFkZEJ5dGVBcnJheShjb25zdCB2b2lkICpzcmMsIHNpemVfdCBudW1CeXRlcykKK3sKKyAgICAvLyBXZSBuZWVkIHRvIHBvdGVudGlhbGx5IGdyb3cgbW9yZSB0aGFuIG9uY2UgaWYgdGhlIG51bWJlciBvZiBieWVzIHdlIHdyaXRlIGlzIHN1YnN0YW50aWFsCisgICAgd2hpbGUobVBvcyArIG51bUJ5dGVzID49IG1MZW5ndGgpIHsKKyAgICAgICAgZ3Jvd1NpemUoKTsKKyAgICB9CisgICAgbWVtY3B5KG1EYXRhICsgbVBvcywgc3JjLCBudW1CeXRlcyk7CisgICAgbVBvcyArPSBudW1CeXRlczsKK30KKwordm9pZCBPU3RyZWFtOjphZGRPZmZzZXQodWludDY0X3QgdikKK3sKKyAgICBpZiAobVVzZTY0KSB7CisgICAgICAgIG1Qb3MgPSAobVBvcyArIDcpICYgKH43KTsKKyAgICAgICAgaWYobVBvcyArIHNpemVvZih2KSA+PSBtTGVuZ3RoKSB7CisgICAgICAgICAgICBncm93U2l6ZSgpOworICAgICAgICB9CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkodiAmIDB4ZmYpOworICAgICAgICBtRGF0YVttUG9zKytdID0gKHVpbnQ4X3QpKCh2ID4+IDgpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMTYpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMjQpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMzIpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gNDApICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gNDgpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gNTYpICYgMHhmZik7CisgICAgfQorICAgIGVsc2UgeworICAgICAgICBhZGRVMzIodik7CisgICAgfQorfQorCit2b2lkIE9TdHJlYW06OmFkZFN0cmluZyhTdHJpbmc4ICpzKQoreworICAgIHVpbnQzMl90IGxlbiA9IHMtPnNpemUoKTsKKyAgICBhZGRVMzIobGVuKTsKKyAgICBpZihtUG9zICsgbGVuKnNpemVvZihjaGFyKSA+PSBtTGVuZ3RoKSB7CisgICAgICAgIGdyb3dTaXplKCk7CisgICAgfQorICAgIGNoYXIgKnN0cmluZ0RhdGEgPSByZWludGVycHJldF9jYXN0PGNoYXIgKj4oJm1EYXRhW21Qb3NdKTsKKyAgICBmb3IodWludDMyX3QgaSA9IDA7IGkgPCBsZW47IGkgKyspIHsKKyAgICAgICAgc3RyaW5nRGF0YVtpXSA9IHMtPnN0cmluZygpW2ldOworICAgIH0KKyAgICBtUG9zICs9IGxlbipzaXplb2YoY2hhcik7Cit9CisKK3ZvaWQgT1N0cmVhbTo6Z3Jvd1NpemUoKQoreworICAgIHVpbnQ4X3QgKm5ld0RhdGEgPSAodWludDhfdCopbWFsbG9jKG1MZW5ndGgqMik7CisgICAgbWVtY3B5KG5ld0RhdGEsIG1EYXRhLCBtTGVuZ3RoKnNpemVvZih1aW50OF90KSk7CisgICAgbUxlbmd0aCA9IG1MZW5ndGggKiAyOworICAgIGZyZWUobURhdGEpOworICAgIG1EYXRhID0gbmV3RGF0YTsKK30KKworCmRpZmYgLS1naXQgYS9saWJzL3JzL3JzU3RyZWFtLmggYi9saWJzL3JzL3JzU3RyZWFtLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZDQwMWNkMTIKLS0tIC9kZXYvbnVs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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorbmFtZXNwYWNlIGFuZHJvaWQgeworbmFtZXNwYWNlIHJlbmRlcnNjcmlwdCB7CisKK2NsYXNzIElTdHJlYW0KK3sKK3B1YmxpYzoKKyAgICBJU3RyZWFtKGNvbnN0IHVpbnQ4X3QgKiwgYm9vbCB1c2U2NCk7CisKKyAgICBmbG9hdCBsb2FkRigpIHsKKyAgICAgICAgbVBvcyA9IChtUG9zICsgMykgJiAofjMpOworICAgICAgICBmbG9hdCB0bXAgPSByZWludGVycHJldF9jYXN0PGNvbnN0IGZsb2F0ICo+KCZtRGF0YVttUG9zXSlbMF07CisgICAgICAgIG1Qb3MgKz0gc2l6ZW9mKGZsb2F0KTsKKyAgICAgICAgcmV0dXJuIHRtcDsKKyAgICB9CisgICAgaW50MzJfdCBsb2FkSTMyKCkgeworICAgICAgICBtUG9zID0gKG1Qb3MgKyAzKSAmICh+Myk7CisgICAgICAgIGludDMyX3QgdG1wID0gcmVpbnRlcnByZXRfY2FzdDxjb25zdCBpbnQzMl90ICo+KCZtRGF0YVttUG9zXSlbMF07CisgICAgICAgIG1Qb3MgKz0gc2l6ZW9mKGludDMyX3QpOworICAgICAgICByZXR1cm4gdG1wOworICAgIH0KKyAgICB1aW50MzJfdCBsb2FkVTMyKCkgeworICAgICAgICBtUG9zID0gKG1Qb3MgKyAzKSAmICh+Myk7CisgICAgICAgIHVpbnQzMl90IHRtcCA9IHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDMyX3QgKj4oJm1EYXRhW21Qb3NdKVswXTsKKyAgICAgICAgbVBvcyArPSBzaXplb2YodWludDMyX3QpOworICAgICAgICByZXR1cm4gdG1wOworICAgIH0KKyAgICB1aW50MTZfdCBsb2FkVTE2KCkgeworICAgICAgICBtUG9zID0gKG1Qb3MgKyAxKSAmICh+MSk7CisgICAgICAgIHVpbnQxNl90IHRtcCA9IHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDE2X3QgKj4oJm1EYXRhW21Qb3NdKVswXTsKKyAgICAgICAgbVBvcyArPSBzaXplb2YodWludDE2X3QpOworICAgICAgICByZXR1cm4gdG1wOworICAgIH0KKyAgICBpbmxpbmUgdWludDhfdCBsb2FkVTgoKSB7CisgICAgICAgIHVpbnQ4X3QgdG1wID0gcmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50OF90ICo+KCZtRGF0YVttUG9zXSlbMF07CisgICAgICAgIG1Qb3MgKz0gc2l6ZW9mKHVpbnQ4X3QpOworICAgICAgICByZXR1cm4gdG1wOworICAgIH0KKyAgICB2b2lkIGxvYWRCeXRlQXJyYXkodm9pZCAqZGVzdCwgc2l6ZV90IG51bUJ5dGVzKTsKKyAgICB1aW50NjRfdCBsb2FkT2Zmc2V0KCk7CisgICAgdm9pZCBsb2FkU3RyaW5nKFN0cmluZzggKnMpOworICAgIHVpbnQ2NF90IGdldFBvcygpIGNvbnN0IHsKKyAgICAgICAgcmV0dXJuIG1Qb3M7CisgICAgfQorICAgIHZvaWQgcmVzZXQodWludDY0X3QgcG9zKSB7CisgICAgICAgIG1Qb3MgPSBwb3M7CisgICAgfQorICAgIHZvaWQgcmVzZXQoKSB7CisgICAgICAgIG1Qb3MgPSAwOworICAgIH0KKyAgICAKKyAgICBjb25zdCB1aW50OF90ICogZ2V0UHRyKCkgY29uc3QgeworICAgICAgICByZXR1cm4gbURhdGE7CisgICAgfQorcHJvdGVjdGVkOgorICAgIGNvbnN0IHVpbnQ4X3QgKiBtRGF0YTsKKyAgICB1aW50NjRfdCBtUG9zOworICAgIGJvb2wgbVVzZTY0OworfTsKKworY2xhc3MgT1N0cmVhbQoreworcHVibGljOgorICAgIE9TdHJlYW0odWludDY0X3QgbGVuZ3RoLCBib29sIHVzZTY0KTsKKyAgICB+T1N0cmVhbSgpOworICAgIAorICAgIHZvaWQgYWxpZ24odWludDMyX3QgYnl0ZXMpIHsKKyAgICAgICAgbVBvcyA9IChtUG9zICsgKGJ5dGVzIC0gMSkpICYgKH4oYnl0ZXMgLSAxKSk7CisgICAgICAgIGlmKG1Qb3MgPj0gbUxlbmd0aCkgeworICAgICAgICAgICAgZ3Jvd1NpemUoKTsKKyAgICAgICAgfQorICAgIH0KKyAgICAKKyAgICB2b2lkIGFkZEYoZmxvYXQgdikgeworICAgICAgICB1aW50MzJfdCB1aW50ViA9ICpyZWludGVycHJldF9jYXN0PHVpbnQzMl90Kj4gKCZ2KTsKKyAgICAgICAgYWRkVTMyKHVpbnRWKTsKKyAgICB9CisgICAgdm9pZCBhZGRJMzIoaW50MzJfdCB2KSB7CisgICAgICAgIG1Qb3MgPSAobVBvcyArIDMpICYgKH4zKTsKKyAgICAgICAgaWYobVBvcyArIHNpemVvZih2KSA+PSBtTGVuZ3RoKSB7CisgICAgICAgICAgICBncm93U2l6ZSgpOworICAgICAgICB9CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkodiAmIDB4ZmYpOworICAgICAgICBtRGF0YVttUG9zKytdID0gKHVpbnQ4X3QpKCh2ID4+IDgpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMTYpICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMjQpICYgMHhmZik7CisgICAgfQorICAgIHZvaWQgYWRkVTMyKHVpbnQzMl90IHYpIHsKKyAgICAgICAgbVBvcyA9IChtUG9zICsgMykgJiAofjMpOworICAgICAgICBpZihtUG9zICsgc2l6ZW9mKHYpID49IG1MZW5ndGgpIHsKKyAgICAgICAgICAgIGdyb3dTaXplKCk7CisgICAgICAgIH0KKyAgICAgICAgbURhdGFbbVBvcysrXSA9ICh1aW50OF90KSh2ICYgMHhmZik7CisgICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gOCkgJiAweGZmKTsKKyAgICAgICAgbURhdGFbbVBvcysrXSA9ICh1aW50OF90KSgodiA+PiAxNikgJiAweGZmKTsKKyAgICAgICAgbURhdGFbbVBvcysrXSA9ICh1aW50OF90KSgodiA+PiAyNCkgJiAweGZmKTsKKyAgICB9CisgICAgdm9pZCBhZGRVMTYodWludDE2X3QgdikgeworICAgICAgICBtUG9zID0gKG1Qb3MgKyAxKSAmICh+MSk7CisgICAgICAgIGlmKG1Qb3MgKyBzaXplb2YodikgPj0gbUxlbmd0aCkgeworICAgICAgICAgICAgZ3Jvd1NpemUoKTsKKyAgICAgICAgfQorICAgICAgICBtRGF0YVttUG9zKytdID0gKHVpbnQ4X3QpKHYgJiAweGZmKTsKKyAgICAgICAgbURhdGFbbVBvcysrXSA9ICh1aW50OF90KSh2ID4+IDgpOworICAgIH0KKyAgICBpbmxpbmUgdm9pZCBhZGRVOCh1aW50OF90IHYpIHsKKyAgICAgICAgaWYobVBvcyArIDEgPj0gbUxlbmd0aCkgeworICAgICAgICAgICAgZ3Jvd1NpemUoKTsKKyAgICAgICAgfQorICAgICAgICByZWludGVycHJldF9jYXN0PHVpbnQ4X3QgKj4oJm1EYXRhW21Qb3NdKVswXSA9IHY7CisgICAgICAgIG1Qb3MgKys7CisgICAgfQorICAgIHZvaWQgYWRkQnl0ZUFycmF5KGNvbnN0IHZvaWQgKnNyYywgc2l6ZV90IG51bUJ5dGVzKTsKKyAgICB2b2lkIGFkZE9mZnNldCh1aW50NjRfdCB2KTsKKyAgICB2b2lkIGFkZFN0cmluZyhTdHJpbmc4ICpzKTsKKyAgICB1aW50NjRfdCBnZXRQb3MoKSBjb25zdCB7CisgICAgICAgIHJldHVybiBtUG9zOworICAgIH0KKyAgICB2b2lkIHJlc2V0KHVpbnQ2NF90IHBvcykgeworICAgICAgICBtUG9zID0gcG9zOworICAgIH0KKyAgICB2b2lkIHJlc2V0KCkgeworICAgICAgICBtUG9zID0gMDsKKyAgICB9CisgICAgY29uc3QgdWludDhfdCAqIGdldFB0cigpIGNvbnN0IHsK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AgbUdMLm1Ob3JtLm5hbWUuc2V0VG8oIk5vcm1hbCIpOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBSU19LSU5EX1RFWFRVUkU6Ci0gICAgICAgICAgICByc0Fzc2VydChtR0wubVRleC5zaXplID09IDApOwotICAgICAgICAgICAgbUdMLm1UZXguc2l6ZSA9IGMuZ2V0VmVjdG9yU2l6ZSgpOwotICAgICAgICAgICAgbUdMLm1UZXgub2Zmc2V0ID0gbUVsZW1lbnQtPmdldEZpZWxkT2Zmc2V0Qnl0ZXMoY3QpOwotICAgICAgICAgICAgbUdMLm1UZXgudHlwZSA9IGMuZ2V0R0xUeXBlKCk7Ci0gICAgICAgICAgICBtR0wubVRleC5ub3JtYWxpemVkID0gZmFsc2U7Ci0gICAgICAgICAgICBtR0wubVRleC5uYW1lLnNldFRvKCJUZXh0dXJlIik7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIFJTX0tJTkRfUE9JTlRfU0laRToKLSAgICAgICAgICAgIHJzQXNzZXJ0KCFtR0wubVBvaW50U2l6ZS5zaXplKTsKLSAgICAgICAgICAgIG1HTC5tUG9pbnRTaXplLnNpemUgPSBjLmdldFZlY3RvclNpemUoKTsKLSAgICAgICAgICAgIG1HTC5tUG9pbnRTaXplLm9mZnNldCA9IG1FbGVtZW50LT5nZXRGaWVsZE9mZnNldEJ5dGVzKGN0KTsKLSAgICAgICAgICAgIG1HTC5tUG9pbnRTaXplLnR5cGUgPSBjLmdldEdMVHlwZSgpOwotICAgICAgICAgICAgbUdMLm1Qb2ludFNpemUubm9ybWFsaXplZCA9IGZhbHNlOwotICAgICAgICAgICAgbUdMLm1Qb2ludFNpemUubmFtZS5zZXRUbygiUG9pbnRTaXplIik7Ci0gICAgICAgIGJyZWFrOwotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQorICAgICAgICBtQXR0cmlic1t1c2VyTnVtXS5zaXpl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ICAgICAgICAgc3RyaWRlLAotICAgICAgICAgICAgICAgICAgICAgIFJTX0tJTkRfUE9TSVRJT04sCi0gICAgICAgICAgICAgICAgICAgICAgZmFsc2UsCi0gICAgICAgICAgICAgICAgICAgICAgbUdMLm1WdHgub2Zmc2V0KTsKLSAgICB9Ci0KLSAgICBpZiAobUdMLm1Ob3JtLnNpemUpIHsKLSAgICAgICAgdmEtPmFkZExlZ2FjeShtR0wubU5vcm0udHlwZSwKLSAgICAgICAgICAgICAgICAgICAgIDMsCi0gICAgICAgICAgICAgICAgICAgICBzdHJpZGUsCi0gICAgICAgICAgICAgICAgICAgICBSU19LSU5EX05PUk1BTCwKLSAgICAgICAgICAgICAgICAgICAgIGZhbHNlLAotICAgICAgICAgICAgICAgICAgICAgbUdMLm1Ob3JtLm9mZnNldCk7Ci0gICAgfQotCi0gICAgaWYgKG1HTC5tQ29sb3Iuc2l6ZSkgewotICAgICAgICB2YS0+YWRkTGVnYWN5KG1HTC5tQ29sb3IudHlwZSwKLSAgICAgICAgICAgICAgICAgICAgIG1HTC5tQ29sb3Iuc2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgIHN0cmlkZSwKLSAgICAgICAgICAgICAgICAgICAgIFJTX0tJTkRfQ09MT1IsCi0gICAgICAgICAgICAgICAgICAgICB0cnVlLAotICAgICAgICAgICAgICAgICAgICAgbUdMLm1Db2xvci5vZmZzZXQpOwotICAgIH0KLQotICAgIGlmIChtR0wubVRleC5zaXplKSB7Ci0gICAgICAgIHZhLT5hZGRMZWdhY3kobUdMLm1UZXgudHlwZSwKLSAgICAgICAgICAgICAgICAgICAgIG1HTC5tVGV4LnNpemUsCi0gICAgICAgICAgICAgICAgICAgICBzdHJpZGUsCi0gICAgICAgICAgICAgICAgICAgICBSU19LSU5EX1RFWFRVUkUsCi0gICAgICAgICAgICAgICAgICAgICBmYWxzZSwKLSAgICAgICAgICAgICAgICAgICAgIG1HTC5tVGV4Lm9mZnNldCk7Ci0gICAgfQotCi0gICAgaWYgKG1HTC5tUG9pbnRTaXplLnNpemUpIHsKLSAgICAgICAgdmEtPmFkZExlZ2FjeShtR0wubVBvaW50U2l6ZS50eXBlLAotICAgICAgICAgICAgICAgICAgICAgMSwKLSAgICAgICAgICAgICAgICAgICAgIHN0cmlkZSwKLSAgICAgICAgICAgICAgICAgICAgIFJTX0tJTkRfUE9JTlRfU0laRSwKLSAgICAgICAgICAgICAgICAgICAgIGZhbHNlLAotICAgICAgICAgICAgICAgICAgICAgbUdMLm1Qb2ludFNpemUub2Zmc2V0KTsKLSAgICB9Ci0KLX0KLQotdm9pZCBUeXBlOjplbmFibGVHTFZlcnRleEJ1ZmZlcjIoVmVydGV4QXJyYXkgKnZhKSBjb25zdAotewotICAgIC8vIERvIGxlZ2FjeSBidWZmZXJzCi0gICAgZW5hYmxlR0xWZXJ0ZXhCdWZmZXIodmEpOwotCiAgICAgdWludDMyX3Qgc3RyaWRlID0gbUVsZW1lbnQtPmdldFNpemVCeXRlcygpOwogICAgIGZvciAodWludDMyX3QgY3Q9MDsgY3QgPCBSU19NQVhfQVRUUklCUzsgY3QrKykgewotICAgICAgICBpZiAobUdMLm1Vc2VyW2N0XS5zaXplKSB7Ci0gICAgICAgICAgICB2YS0+YWRkVXNlcihtR0wubVVzZXJbY3RdLCBzdHJpZGUpOworICAgICAgICBpZiAobUF0dHJpYnNbY3RdLnNpemUpIHsKKyAgICAgICAgICAgIHZhLT5hZGQobUF0dHJpYnNbY3RdLCBzdHJpZGUpOwogICAgICAgICB9CiAgICAgfQogfQpAQCAtMjgzLDYgKzE4MSw1NyBAQAogICAgIG1FbGVtZW50LT5kdW1wTE9HVihidWYpOwogfQogCit2b2lkIFR5cGU6OnNlcmlhbGl6ZShPU3RyZWFtICpzdHJlYW0pIGNvbnN0Cit7CisgICAgLy8gTmVlZCB0byBpZGVudGlmeSBvdXJzZWx2ZXMKKyAgICBzdHJlYW0tPmFkZFUzMigodWludDMyX3QpZ2V0Q2xhc3NJZCgpKTsKKworICAgIFN0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AgICAgICAgZ2xCaW5kQnVmZmVyKEdMX0FSUkFZX0JVRkZFUiwgbUF0dHJpYnNbY3RdLmJ1ZmZlcik7Ci0gICAgICAgICAgICBnbFZlcnRleFBvaW50ZXIobUF0dHJpYnNbY3RdLnNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnNbY3RdLnR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnNbY3RdLnN0cmlkZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKW1BdHRyaWJzW2N0XS5vZmZzZXQpOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBSU19LSU5EX05PUk1BTDoKLSAgICAgICAgICAgIC8vbG9nQXR0cmliKE5PUk1BTCk7Ci0gICAgICAgICAgICBnbEVuYWJsZUNsaWVudFN0YXRlKEdMX05PUk1BTF9BUlJBWSk7Ci0gICAgICAgICAgICByc0Fzc2VydChtQXR0cmlic1tjdF0uc2l6ZSA9PSAzKTsKLSAgICAgICAgICAgIGdsQmluZEJ1ZmZlcihHTF9BUlJBWV9CVUZGRVIsIG1BdHRyaWJzW2N0XS5idWZmZXIpOwotICAgICAgICAgICAgZ2xOb3JtYWxQb2ludGVyKG1BdHRyaWJzW2N0XS50eXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRyaWJzW2N0XS5zdHJpZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKiltQXR0cmlic1tjdF0ub2Zmc2V0KTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgUlNfS0lORF9DT0xPUjoKLSAgICAgICAgICAgIC8vbG9nQXR0cmliKENPTE9SKTsKLSAgICAgICAgICAgIGdsRW5hYmxlQ2xpZW50U3RhdGUoR0xfQ09MT1JfQVJSQVkpOwotICAgICAgICAgICAgZ2xCaW5kQnVmZmVyKEdMX0FSUkFZX0JVRkZFUiwgbUF0dHJpYnNbY3RdLmJ1ZmZlcik7Ci0gICAgICAgICAgICBnbENvbG9yUG9pbnRlcihtQXR0cmlic1tjdF0uc2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRyaWJzW2N0XS50eXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnNbY3RdLnN0cmlkZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopbUF0dHJpYnNbY3RdLm9mZnNldCk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIFJTX0tJTkRfVEVYVFVSRToKLSAgICAgICAgICAgIC8vbG9nQXR0cmliKFRFWFRVUkUpOwotICAgICAgICAgICAgZ2xFbmFibGVDbGllbnRTdGF0ZShHTF9URVhUVVJFX0NPT1JEX0FSUkFZKTsKLSAgICAgICAgICAgIGdsQmluZEJ1ZmZlcihHTF9BUlJBWV9CVUZGRVIsIG1BdHRyaWJzW2N0XS5idWZmZXIpOwotICAgICAgICAgICAgZ2xUZXhDb29yZFBvaW50ZXIobUF0dHJpYnNbY3RdLnNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cmlic1tjdF0udHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRyaWJzW2N0XS5zdHJpZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKW1BdHRyaWJzW2N0XS5vZmZzZXQpOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBSU19LSU5EX1BPSU5UX1NJWkU6Ci0gICAgICAgICAgICAvL2xvZ0F0dHJpYihQT0lOVF9TSVpFKTsKLSAgICAgICAgICAgIGdsRW5hYmxlQ2xpZW50U3RhdGUoR0xfUE9JTlRfU0laRV9BUlJBWV9PRVMpOwotICAgICAgICAgICAgZ2xCaW5kQnVmZmVyKEdMX0FSUkFZX0JVRkZFUiwgbUF0dHJpYnNbY3Rd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nKSB7CisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfQorCiAgICAgICAgIGlmIChzYy0+aXNVc2VyVmVydGV4UHJvZ3JhbSgpKSB7CiAgICAgICAgICAgICBzbG90ID0gc2MtPnZ0eEF0dHJpYlNsb3QoY3QpOwogICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKG1BdHRyaWJzW2N0XS5raW5kID09IFJTX0tJTkRfVVNFUikgeworICAgICAgICAgICAgaWYgKG1BdHRyaWJzW2N0XS5uYW1lID09ICJwb3NpdGlvbiIpIHsKKyAgICAgICAgICAgICAgICBzbG90ID0gMDsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobUF0dHJpYnNbY3RdLm5hbWUgPT0gImNvbG9yIikgeworICAgICAgICAgICAgICAgIHNsb3QgPSAxOworICAgICAgICAgICAgfSBlbHNlIGlmIChtQXR0cmlic1tjdF0ubmFtZSA9PSAibm9ybWFsIikgeworICAgICAgICAgICAgICAgIHNsb3QgPSAyOworICAgICAgICAgICAgfSBlbHNlIGlmIChtQXR0cmlic1tjdF0ubmFtZSA9PSAicG9pbnRTaXplIikgeworICAgICAgICAgICAgICAgIHNsb3QgPSAzOworICAgICAgICAgICAgfSBlbHNlIGlmIChtQXR0cmlic1tjdF0ubmFtZSA9PSAidGV4dHVyZTAiKSB7CisgICAgICAgICAgICAgICAgc2xvdCA9IDQ7CisgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgc2xvdCA9IHNjLT52dHhBdHRyaWJTbG90KG1BdHRyaWJzW2N0XS5raW5kKTsKICAgICAgICAgfQogCiAgICAgICAgIC8vbG9nQXR0cmliKGN0LCBzbG90KTsKICAgICAgICAgZ2xFbmFibGVWZXJ0ZXhBdHRyaWJBcnJheShzbG90KTsKICAgICAgICAgZ2xCaW5kQnVmZmVyKEdMX0FSUkFZX0JVRkZFUiwgbUF0dHJpYnNbY3RdLmJ1ZmZlcik7Ci0KICAgICAgICAgZ2xWZXJ0ZXhBdHRyaWJQb2ludGVyKHNsb3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cmlic1tjdF0uc2l6ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRyaWJzW2N0XS50eXBlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnNbY3RdLm5vcm1hbGl6ZWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cmlic1tjdF0uc3RyaWRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKiltQXR0cmlic1tjdF0ub2Zmc2V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRyaWJzW2N0XS5wdHIgKyBtQXR0cmlic1tjdF0ub2Zmc2V0KTsKICAgICB9CiAgICAgc3RhdGUtPm1MYXN0RW5hYmxlQ291bnQgPSBtQ291bnQ7CiAgICAgcnNjLT5jaGVja0Vycm9yKCJWZXJ0ZXhBcnJheTo6c2V0dXBHTDIgZG9uZSIpOwpkaWZmIC0tZ2l0IGEvbGlicy9ycy9yc1ZlcnRleEFycmF5LmggYi9saWJzL3JzL3JzVmVydGV4QXJyYXkuaAppbmRleCAzOTA0Y2I2Li43YzYwOWIyIDEwMDY0NAotLS0gYS9saWJzL3JzL3JzVmVydGV4QXJyYXkuaAorKysgYi9saWJzL3JzL3JzVmVydGV4QXJyYXkuaApAQCAtMzcsMTMgKzM3LDEzIEBACiAgICAgY2xhc3MgQXR0cmliIHsKICAgICBwdWJsaWM6CiAgICAgICAgIHVpbnQzMl90IGJ1ZmZlcjsKKyAgICAgICAgY29uc3QgdWludDhfdCAqIHB0cjsKICAgICAgICAgdWludDMyX3Qgb2Zmc2V0OwogICAgICAgICB1aW50MzJfdCB0eXBlOwogICAgICAgICB1aW50MzJfdCBzaXplOwogICAgICAgICB1aW50MzJfdCBzdHJpZGU7CiAg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ggPCBsb3cueCA/IGxvdy54IDogKGFtb3VudC54ID4gaGlnaC54ID8gaGlnaC54IDogYW1vdW50LngpOworICAgIHIueSA9IGFtb3VudC55IDwgbG93LnkgPyBsb3cueSA6IChhbW91bnQueSA+IGhpZ2gueSA/IGhpZ2gueSA6IGFtb3VudC55KTsKKyAgICByZXR1cm4gcjsKK30KK3N0YXRpYyBmbG9hdDMgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgY2xhbXAoZmxvYXQzIGFtb3VudCwgZmxvYXQzIGxvdywgZmxvYXQzIGhpZ2gpIHsKKyAgICBmbG9hdDMgcjsKKyAgICByLnggPSBhbW91bnQueCA8IGxvdy54ID8gbG93LnggOiAoYW1vdW50LnggPiBoaWdoLnggPyBoaWdoLnggOiBhbW91bnQueCk7CisgICAgci55ID0gYW1vdW50LnkgPCBsb3cueSA/IGxvdy55IDogKGFtb3VudC55ID4gaGlnaC55ID8gaGlnaC55IDogYW1vdW50LnkpOworICAgIHIueiA9IGFtb3VudC56IDwgbG93LnogPyBsb3cueiA6IChhbW91bnQueiA+IGhpZ2gueiA/IGhpZ2gueiA6IGFtb3VudC56KTsKKyAgICByZXR1cm4gcjsKK30KK3N0YXRpYyBmbG9hdDQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgY2xhbXAoZmxvYXQ0IGFtb3VudCwgZmxvYXQ0IGxvdywgZmxvYXQ0IGhpZ2gpIHsKKyAgICBmbG9hdDQgcjsKKyAgICByLnggPSBhbW91bnQueCA8IGxvdy54ID8gbG93LnggOiAoYW1vdW50LnggPiBoaWdoLnggPyBoaWdoLnggOiBhbW91bnQueCk7CisgICAgci55ID0gYW1vdW50LnkgPCBsb3cueSA/IGxvdy55IDogKGFtb3VudC55ID4gaGlnaC55ID8gaGlnaC55IDogYW1vdW50LnkpOworICAgIHIueiA9IGFtb3VudC56IDwgbG93LnogPyBsb3cueiA6IChhbW91bnQueiA+IGhpZ2gueiA/IGhpZ2gueiA6IGFtb3VudC56KTsKKyAgICByLncgPSBhbW91bnQudyA8IGxvdy53ID8gbG93LncgOiAoYW1vdW50LncgPiBoaWdoLncgPyBoaWdoLncgOiBhbW91bnQudyk7CisgICAgcmV0dXJuIHI7Cit9CitzdGF0aWMgZmxvYXQyIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGNsYW1wKGZsb2F0MiBhbW91bnQsIGZsb2F0IGxvdywgZmxvYXQgaGlnaCkgeworICAgIGZsb2F0MiByOworICAgIHIueCA9IGFtb3VudC54IDwgbG93ID8gbG93IDogKGFtb3VudC54ID4gaGlnaCA/IGhpZ2ggOiBhbW91bnQueCk7CisgICAgci55ID0gYW1vdW50LnkgPCBsb3cgPyBsb3cgOiAoYW1vdW50LnkgPiBoaWdoID8gaGlnaCA6IGFtb3VudC55KTsKKyAgICByZXR1cm4gcjsKK30KK3N0YXRpYyBmbG9hdDMgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgY2xhbXAoZmxvYXQzIGFtb3VudCwgZmxvYXQgbG93LCBmbG9hdCBoaWdoKSB7CisgICAgZmxvYXQzIHI7CisgICAgci54ID0gYW1vdW50LnggPCBsb3cgPyBsb3cgOiAoYW1vdW50LnggPiBoaWdoID8gaGlnaCA6IGFtb3VudC54KTsKKyAgICByLnkgPSBhbW91bnQueSA8IGxvdyA/IGxvdyA6IChhbW91bnQueSA+IGhpZ2ggPyBoaWdoIDogYW1vdW50LnkpOworICAgIHIueiA9IGFtb3VudC56IDwgbG93ID8gbG93IDogKGFtb3VudC56ID4gaGlnaCA/IGhpZ2ggOiBhbW91bnQueik7CisgICAgcmV0dXJuIHI7Cit9CitzdGF0aWMgZmxvYXQ0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGNsYW1wKGZsb2F0NCBhbW91bnQsIGZsb2F0IGxvdywgZmxvYXQgaGlnaCkgeworICAgIGZsb2F0NCByOworICAgIHIueCA9IGFtb3VudC54IDwgbG93ID8gbG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8gdjEueSA6IHYyLnk7CisgICAgci56ID0gdjEueiA+IHYyLnogPyB2MS56IDogdjIuejsKKyAgICByZXR1cm4gcjsKK30KK3N0YXRpYyBmbG9hdDQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgbWF4KGZsb2F0NCB2MSwgZmxvYXQ0IHYyKSB7CisgICAgZmxvYXQ0IHI7CisgICAgci54ID0gdjEueCA+IHYyLnggPyB2MS54IDogdjIueDsKKyAgICByLnkgPSB2MS55ID4gdjIueSA/IHYxLnkgOiB2Mi55OworICAgIHIueiA9IHYxLnogPiB2Mi56ID8gdjEueiA6IHYyLno7CisgICAgci53ID0gdjEudyA+IHYyLncgPyB2MS53IDogdjIudzsKKyAgICByZXR1cm4gcjsKK30KK3N0YXRpYyBmbG9hdDIgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgbWF4KGZsb2F0MiB2MSwgZmxvYXQgdjIpIHsKKyAgICBmbG9hdDIgcjsKKyAgICByLnggPSB2MS54ID4gdjIgPyB2MS54IDogdjI7CisgICAgci55ID0gdjEueSA+IHYyID8gdjEueSA6IHYyOworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0MyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBtYXgoZmxvYXQzIHYxLCBmbG9hdCB2MikgeworICAgIGZsb2F0MyByOworICAgIHIueCA9IHYxLnggPiB2MiA/IHYxLnggOiB2MjsKKyAgICByLnkgPSB2MS55ID4gdjIgPyB2MS55IDogdjI7CisgICAgci56ID0gdjEueiA+IHYyID8gdjEueiA6IHYyOworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0NCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBtYXgoZmxvYXQ0IHYxLCBmbG9hdCB2MikgeworICAgIGZsb2F0NCByOworICAgIHIueCA9IHYxLnggPiB2MiA/IHYxLnggOiB2MjsKKyAgICByLnkgPSB2MS55ID4gdjIgPyB2MS55IDogdjI7CisgICAgci56ID0gdjEueiA+IHYyID8gdjEueiA6IHYyOworICAgIHIudyA9IHYxLncgPiB2MiA/IHYxLncgOiB2MjsKKyAgICByZXR1cm4gcjsKK30KKworc3RhdGljIGZsb2F0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIG1pbihmbG9hdCB2MSwgZmxvYXQgdjIpIHsKKyAgICByZXR1cm4gdjEgPCB2MiA/IHYxIDogdjI7Cit9CitzdGF0aWMgZmxvYXQyIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIG1pbihmbG9hdDIgdjEsIGZsb2F0MiB2MikgeworICAgIGZsb2F0MiByOworICAgIHIueCA9IHYxLnggPCB2Mi54ID8gdjEueCA6IHYyLng7CisgICAgci55ID0gdjEueSA8IHYyLnkgPyB2MS55IDogdjIueTsKKyAgICByZXR1cm4gcjsKK30KK3N0YXRpYyBmbG9hdDMgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgbWluKGZsb2F0MyB2MSwgZmxvYXQzIHYyKSB7CisgICAgZmxvYXQzIHI7CisgICAgci54ID0gdjEueCA8IHYyLnggPyB2MS54IDogdjIueDsKKyAgICByLnkgPSB2MS55IDwgdjIueSA/IHYxLnkgOiB2Mi55OworICAgIHIueiA9IHYxLnogPCB2Mi56ID8gdjEueiA6IHYyLno7CisgICAgcmV0dXJuIHI7Cit9CitzdGF0aWMgZmxvYXQ0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIG1pbihmbG9hdDQgdjEsIGZsb2F0NCB2MikgeworICAgIGZsb2F0NCByOworICAgIHIueCA9IHYxLnggPCB2Mi54ID8gdjEueCA6IHYyLng7CisgICAgci55ID0gdjEueSA8IHYyLnkgPyB2MS55IDogdjIueTsKKyAgICByLnogPSB2MS56IDwgdjIueiA/IHYxLnogOiB2Mi56OworICAgIHIudyA9IHYxLncgPCB2Mi53ID8gdjEudyA6IHYyLnc7CisgICAgcmV0dXJuIHI7Cit9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yZWVzKSB7CisgICAgcmV0dXJuIGRlZ3JlZXMgKiAoTV9QSSAvIDE4MC5mKTsKK30KK0RFRl9GVU5DXzEocmFkaWFucykKKworc3RhdGljIGZsb2F0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIHN0ZXAoZmxvYXQgZWRnZSwgZmxvYXQgdikgeworICAgIHJldHVybiAodiA8IGVkZ2UpID8gMC5mIDogMS5mOworfQorc3RhdGljIGZsb2F0MiBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBzdGVwKGZsb2F0MiBlZGdlLCBmbG9hdDIgdikgeworICAgIGZsb2F0MiByOworICAgIHIueCA9ICh2LnggPCBlZGdlLngpID8gMC5mIDogMS5mOworICAgIHIueSA9ICh2LnkgPCBlZGdlLnkpID8gMC5mIDogMS5mOworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0MyBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBzdGVwKGZsb2F0MyBlZGdlLCBmbG9hdDMgdikgeworICAgIGZsb2F0MyByOworICAgIHIueCA9ICh2LnggPCBlZGdlLngpID8gMC5mIDogMS5mOworICAgIHIueSA9ICh2LnkgPCBlZGdlLnkpID8gMC5mIDogMS5mOworICAgIHIueiA9ICh2LnogPCBlZGdlLnopID8gMC5mIDogMS5mOworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0NCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBzdGVwKGZsb2F0NCBlZGdlLCBmbG9hdDQgdikgeworICAgIGZsb2F0NCByOworICAgIHIueCA9ICh2LnggPCBlZGdlLngpID8gMC5mIDogMS5mOworICAgIHIueSA9ICh2LnkgPCBlZGdlLnkpID8gMC5mIDogMS5mOworICAgIHIueiA9ICh2LnogPCBlZGdlLnopID8gMC5mIDogMS5mOworICAgIHIudyA9ICh2LncgPCBlZGdlLncpID8gMC5mIDogMS5mOworICAgIHJldHVybiByOworfQorc3RhdGljIGZsb2F0M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MpIHsKKyAgICBmbG9hdDQgcjsKKyAgICByLnggPSBsaHMueSAqIHJocy56ICAtIGxocy56ICogcmhzLnk7CisgICAgci55ID0gbGhzLnogKiByaHMueCAgLSBsaHMueCAqIHJocy56OworICAgIHIueiA9IGxocy54ICogcmhzLnkgIC0gbGhzLnkgKiByaHMueDsKKyAgICByLncgPSAwLmY7CisgICAgcmV0dXJuIHI7Cit9CisKK3N0YXRpYyBmbG9hdCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBkb3QoZmxvYXQgbGhzLCBmbG9hdCByaHMpIHsKKyAgICByZXR1cm4gbGhzICogcmhzOworfQorc3RhdGljIGZsb2F0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGRvdChmbG9hdDIgbGhzLCBmbG9hdDIgcmhzKSB7CisgICAgcmV0dXJuIGxocy54KnJocy54ICsgbGhzLnkqcmhzLnk7Cit9CitzdGF0aWMgZmxvYXQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgZG90KGZsb2F0MyBsaHMsIGZsb2F0MyByaHMpIHsKKyAgICByZXR1cm4gbGhzLngqcmhzLnggKyBsaHMueSpyaHMueSArIGxocy56KnJocy56OworfQorc3RhdGljIGZsb2F0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGRvdChmbG9hdDQgbGhzLCBmbG9hdDQgcmhzKSB7CisgICAgcmV0dXJuIGxocy54KnJocy54ICsgbGhzLnkqcmhzLnkgKyBsaHMueipyaHMueiArIGxocy53KnJocy53OworfQorCitzdGF0aWMgZmxvYXQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgbGVuZ3RoKGZsb2F0IHYpIHsKKyAgICByZXR1cm4gdjsKK30KK3N0YXRpYyBmbG9hdCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBsZW5ndGgoZmxvYXQyIHYpIHsKKyAgICByZXR1cm4gc3FydCh2Lngqdi54ICsgdi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U2V0KHJzX21hdHJpeDJ4MiAqbSwgdWludDMyX3Qgcm93LCB1aW50MzJfdCBjb2wsIGZsb2F0IHYpIHsKKyAgICBtLT5tW3JvdyAqIDIgKyBjb2xdID0gdjsKK30KKworc3RhdGljIGZsb2F0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeEdldChjb25zdCByc19tYXRyaXgyeDIgKm0sIHVpbnQzMl90IHJvdywgdWludDMyX3QgY29sKSB7CisgICAgcmV0dXJuIG0tPm1bcm93ICogMiArIGNvbF07Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeExvYWRJZGVudGl0eShyc19tYXRyaXg0eDQgKm0pIHsKKyAgICBtLT5tWzBdID0gMS5mOworICAgIG0tPm1bMV0gPSAwLmY7CisgICAgbS0+bVsyXSA9IDAuZjsKKyAgICBtLT5tWzNdID0gMC5mOworICAgIG0tPm1bNF0gPSAwLmY7CisgICAgbS0+bVs1XSA9IDEuZjsKKyAgICBtLT5tWzZdID0gMC5mOworICAgIG0tPm1bN10gPSAwLmY7CisgICAgbS0+bVs4XSA9IDAuZjsKKyAgICBtLT5tWzldID0gMC5mOworICAgIG0tPm1bMTBdID0gMS5mOworICAgIG0tPm1bMTFdID0gMC5mOworICAgIG0tPm1bMTJdID0gMC5mOworICAgIG0tPm1bMTNdID0gMC5mOworICAgIG0tPm1bMTRdID0gMC5mOworICAgIG0tPm1bMTVdID0gMS5mOworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhMb2FkSWRlbnRpdHkocnNfbWF0cml4M3gzICptKSB7CisgICAgbS0+bVswXSA9IDEuZjsKKyAgICBtLT5tWzFdID0gMC5mOworICAgIG0tPm1bMl0gPSAwLmY7CisgICAgbS0+bVszXSA9IDAuZjsKKyAgICBtLT5tWzRdID0gMS5mOworICAgIG0tPm1bNV0g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AgbS0+bVszXSA9IHZbM107CisgICAgbS0+bVs0XSA9IHZbNF07CisgICAgbS0+bVs1XSA9IHZbNV07CisgICAgbS0+bVs2XSA9IHZbNl07CisgICAgbS0+bVs3XSA9IHZbN107CisgICAgbS0+bVs4XSA9IHZbOF07Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeExvYWQocnNfbWF0cml4MngyICptLCBjb25zdCBmbG9hdCAqdikgeworICAgIG0tPm1bMF0gPSB2WzBdOworICAgIG0tPm1bMV0gPSB2WzFdOworICAgIG0tPm1bMl0gPSB2WzJdOworICAgIG0tPm1bM10gPSB2WzNdOworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhMb2FkKHJzX21hdHJpeDR4NCAqbSwgY29uc3QgcnNfbWF0cml4NHg0ICp2KSB7CisgICAgbS0+bVswXSA9IHYtPm1bMF07CisgICAgbS0+bVsxXSA9IHYtPm1bMV07CisgICAgbS0+bVsyXSA9IHYtPm1bMl07CisgICAgbS0+bVszXSA9IHYtPm1bM107CisgICAgbS0+bVs0XSA9IHYtPm1bNF07CisgICAgbS0+bVs1XSA9IHYtPm1bNV07CisgICAgbS0+bVs2XSA9IHYtPm1bNl07CisgICAgbS0+bVs3XSA9IHYtPm1bN107CisgICAgbS0+bVs4XSA9IHYtPm1bOF07CisgICAgbS0+bVs5XSA9IHYtPm1bOV07CisgICAgbS0+bVsxMF0gPSB2LT5tWzEwXTsKKyAgICBtLT5tWzExXSA9IHYtPm1bMTFdOworICAgIG0tPm1bMTJdID0gdi0+bVsxMl07CisgICAgbS0+bVsxM10gPSB2LT5tWzEzXTsKKyAgICBtLT5tWzE0XSA9IHYtPm1bMTRdOworICAgIG0tPm1bMTVdID0gdi0+bVsxNV07Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeExvYWQocnNfbWF0cml4NHg0ICptLCBjb25zdCByc19tYXRyaXgzeDMgKnYpIHsKKyAgICBtLT5tWzBdID0gdi0+bVswXTsKKyAgICBtLT5tWzFdID0gdi0+bVsxXTsKKyAgICBtLT5tWzJdID0gdi0+bVsyXTsKKyAgICBtLT5tWzNdID0gMC5mOworICAgIG0tPm1bNF0gPSB2LT5tWzNdOworICAgIG0tPm1bNV0gPSB2LT5tWzRdOworICAgIG0tPm1bNl0gPSB2LT5tWzVdOworICAgIG0tPm1bN10gPSAwLmY7CisgICAgbS0+bVs4XSA9IHYtPm1bNl07CisgICAgbS0+bVs5XSA9IHYtPm1bN107CisgICAgbS0+bVsxMF0gPSB2LT5tWzhdOworICAgIG0tPm1bMTFdID0gMC5mOworICAgIG0tPm1bMTJdID0gMC5mOworICAgIG0tPm1bMTNdID0gMC5mOworICAgIG0tPm1bMTRdID0gMC5mOworICAgIG0tPm1bMTVdID0gMS5mOworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhMb2FkKHJzX21hdHJpeDR4NCAqbSwgY29uc3QgcnNfbWF0cml4MngyICp2KSB7CisgICAgbS0+bVswXSA9IHYtPm1bMF07CisgICAgbS0+bVsxXSA9IHYtPm1bMV07CisgICAgbS0+bVsyXSA9IDAuZjsKKyAgICBtLT5tWzNdID0gMC5mOworICAgIG0tPm1bNF0gPSB2LT5tWzNdOworICAgIG0tPm1bNV0gPSB2LT5tWzRdOworICAgIG0tPm1bNl0gPSAwLmY7CisgICAgbS0+bVs3XSA9IDAuZjsKKyAgICBtLT5tWzhdID0gdi0+bVs2XTsKKyAgICBtLT5tWzldID0gdi0+bVs3XTsKKyAgICBtLT5tWzEwXSA9IDEuZjsKKyAgICBtLT5tWzExXSA9IDAuZjsKKyAgICBtLT5tWzEyXSA9IDAuZjsKKyAgICBtLT5tWzEzXSA9IDAuZjsKKyAgICBtLT5tWzE0XSA9IDAuZjsKKyAgICBtLT5tWzE1XSA9IDEuZjsKK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TG9hZChyc19tYXRyaXgzeDMgKm0sIGNvbnN0IHJzX21hdHJpeDN4MyAqdikgeworICAgIG0tPm1bMF0gPSB2LT5tWzBdOworICAgIG0tPm1bMV0gPSB2LT5tWzFdOworICAgIG0tPm1bMl0gPSB2LT5tWzJdOworICAgIG0tPm1bM10gPSB2LT5tWzNdOworICAgIG0tPm1bNF0gPSB2LT5tWzRdOworICAgIG0tPm1bNV0gPSB2LT5tWzVdOworICAgIG0tPm1bNl0gPSB2LT5tWzZdOworICAgIG0tPm1bN10gPSB2LT5tWzddOworICAgIG0tPm1bOF0gPSB2LT5tWzhdOworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhMb2FkKHJzX21hdHJpeDJ4MiAqbSwgY29uc3QgcnNfbWF0cml4MngyICp2KSB7CisgICAgbS0+bVswXSA9IHYtPm1bMF07CisgICAgbS0+bVsxXSA9IHYtPm1bMV07CisgICAgbS0+bVsyXSA9IHYtPm1bMl07CisgICAgbS0+bVszXSA9IHYtPm1bM107Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeExvYWRSb3RhdGUocnNfbWF0cml4NHg0ICptLCBmbG9hdCByb3QsIGZsb2F0IHgsIGZsb2F0IHksIGZsb2F0IHopIHsKKyAgICBmbG9hdCBjLCBzOworICAgIG0tPm1bM10gPSAwOworICAgIG0tPm1bN10gPSAwOworICAgIG0tPm1bMTFdPSAwOworICAgIG0tPm1bMTJdPSAwOworICAgIG0tPm1bMTNdPSAwOworICAgIG0tPm1bMTRdPSAwOworICAgIG0tPm1bMTVdPSAxOworICAgIHJvdCAqPSAoZmxvYXQpKE1fUEkgLyAxODAuMGYpOworICAgIGMgPSBjb3Mocm90KTsKKyAgICBzID0gc2luKHJvdCk7CisKKyAgICBjb25zdCBmbG9hdCBsZW4gPSB4KnggKyB5KnkgKyB6Kno7CisgICAgaWYgKCEobGVuICE9IDEpKSB7CisgICAgICAgIGNvbnN0IGZsb2F0IHJlY2lwTGVuID0gMS5mIC8gc3FydChsZW4pOworICAgICAgICB4ICo9IHJlY2lwTGVuOworICAgICAgICB5ICo9IHJlY2lwTGVuOworICAgICAgICB6ICo9IHJlY2lwTGVuOworICAgIH0KKyAgICBjb25zdCBmbG9hdCBuYyA9IDEuMGYgLSBjOworICAgIGNvbnN0IGZsb2F0IHh5ID0geCAqIHk7CisgICAgY29uc3QgZmxvYXQgeXogPSB5ICogejsKKyAgICBjb25zdCBmbG9hdCB6eCA9IHogKiB4OworICAgIGNvbnN0IGZsb2F0IHhzID0geCAqIHM7CisgICAgY29uc3QgZmxvYXQgeXMgPSB5ICogczsKKyAgICBjb25zdCBmbG9hdCB6cyA9IHogKiBzOworICAgIG0tPm1bIDBdID0geCp4Km5jICsgIGM7CisgICAgbS0+bVsgNF0gPSAgeHkqbmMgLSB6czsKKyAgICBtLT5tWyA4XSA9ICB6eCpuYyArIHlzOworICAgIG0tPm1bIDFdID0gIHh5Km5jICsgenM7CisgICAgbS0+bVsgNV0gPSB5KnkqbmMgKyAgYzsKKyAgICBtLT5tWyA5XSA9ICB5eipuYyAtIHhzOworICAgIG0tPm1bIDJdID0gIHp4Km5jIC0geXM7CisgICAgbS0+bVsgNl0gPSAgeXoqbmMgKyB4czsKKyAgICBtLT5tWzEwXSA9IHoqeipuYyArICBjOworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhMb2FkU2NhbGUocnNfbWF0cml4NHg0ICptLCBmbG9hdCB4LCBmbG9hdCB5LCBmbG9hdCB6KSB7CisgICAgcnNNYXRyaXhMb2FkSWRlbnRpdHkobSk7CisgICAgbS0+bVswXSA9IHg7CisgICAgbS0+bVs1XSA9IHk7CisgICAgbS0+bVsxMF0gPSB6OworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhMb2FkVHJhbnNsYXRlKHJzX21hdHJpeDR4NCAqbSwgZmxvYXQgeCwgZmxvYXQgeSwgZmxvYXQgeikgeworICAgIHJzTWF0cml4TG9hZElkZW50aXR5KG0pOworICAgIG0tPm1bMTJdID0geDsKKyAgICBtLT5tWzEzXSA9IHk7CisgICAgbS0+bVsxNF0gPSB6OworfQorCitzdGF0aWMgdm9pZCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhMb2FkTXVsdGlwbHkocnNfbWF0cml4NHg0ICptLCBjb25zdCByc19tYXRyaXg0eDQgKmxocywgY29uc3QgcnNfbWF0cml4NHg0ICpyaHMpIHsKKyAgICBmb3IgKGludCBpPTAgOyBpPDQgOyBpKyspIHsKKyAgICAgICAgZmxvYXQgcmkwID0gMDsKKyAgICAgICAgZmxvYXQgcmkxID0gMDsKKyAgICAgICAgZmxvYXQgcmkyID0gMDsKKyAgICAgICAgZmxvYXQgcmkzID0gMDsKKyAgICAgICAgZm9yIChpbnQgaj0wIDsgajw0IDsgaisrKSB7CisgICAgICAgICAgICBjb25zdCBmbG9hdCByaHNfaWogPSByc01hdHJpeEdldChyaHMsIGksaik7CisgICAgICAgICAgICByaTAgKz0gcnNNYXRyaXhHZXQobGhzLCBqLCAwKSAqIHJoc19pajsKKyAgICAgICAgICAgIHJpMSArPSByc01hdHJpeEdldChsaHMsIGosIDEpICogcmhzX2lqOworICAgICAgICAgICAgcmkyICs9IHJzTWF0cml4R2V0KGxocywgaiwgMikgKiByaHNfaWo7CisgICAgICAgICAgICByaTMgKz0gcnNNYXRyaXhHZXQobGhzLCBqLCAzKSAqIHJoc19pajsKKyAgICAgICAgfQorICAgICAgICByc01hdHJpeFNldChtLCBpLCAwLCByaTApOworICAgICAgICByc01hdHJpeFNldChtLCBpLCAxLCByaTEpOworICAgICAgICByc01hdHJpeFNldChtLCBpLCAyLCByaTIpOworICAgICAgICByc01hdHJpeFNldChtLCBpLCAzLCByaTMpOworICAgIH0KK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TXVsdGlwbHkocnNfbWF0cml4NHg0ICptLCBjb25zdCByc19tYXRyaXg0eDQgKnJocykgeworICAgIHJzX21hdHJpeDR4NCBtdDsKKyAgICByc01hdHJpeExvYWRNdWx0aXBseSgmbXQsIG0sIHJocyk7CisgICAgcnNNYXRyaXhMb2FkKG0sICZtdCk7Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeExvYWRNdWx0aXBseShyc19tYXRyaXgzeDMgKm0sIGNvbnN0IHJzX21hdHJpeDN4MyAqbGhzLCBjb25zdCByc19tYXRyaXgzeDMgKnJocykgeworICAgIGZvciAoaW50IGk9MCA7IGk8MyA7IGkrKykgeworICAgICAgICBmbG9hdCByaTAgPSAwOworICAgICAgICBmbG9hdCByaTEgPSAwOworICAgICAgICBmbG9hdCByaTIgPSAwOworICAgICAgICBmb3IgKGludCBqPTAgOyBqPDMgOyBqKyspIHsKKyAgICAgICAgICAgIGNvbnN0IGZsb2F0IHJoc19paiA9IHJzTWF0cml4R2V0KHJocywgaSxqKTsKKyAgICAgICAgICAgIHJpMCArPSByc01hdHJpeEdldChsaHMsIGosIDApICogcmhzX2lqOworICAgICAgICAgICAgcmkxICs9IHJzTWF0cml4R2V0KGxocywgaiwgMSkgKiByaHNfaWo7CisgICAgICAgICAgICByaTIgKz0gcnNNYXRyaXhHZXQobGhzLCBqLCAyKSAqIHJoc19pajsKKyAgICAgICAgfQorICAgICAgICByc01hdHJpeFNldChtLCBpLCAwLCByaTApOworICAgICAgICByc01hdHJpeFNldChtLCBpLCAxLCByaTEpOworICAgICAgICByc01hdHJpeFNldChtLCBpLCAyLCByaTIpOworICAgIH0KK30KKworc3RhdGljIHZvaWQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TXVsdGlwbHkocnNfbWF0cml4M3gzICptLCBjb25zdCByc19tYXRyaXgzeDMgKnJocykgeworICAgIHJzX21hdHJpeDN4MyBtdDsKKyAgICByc01hdHJpeExvYWRNdWx0aXBseSgmbXQsIG0sIHJocyk7CisgICAgcnNNYXRyaXhMb2FkKG0sICZtdCk7Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeExvYWRNdWx0aXBseShyc19tYXRyaXgyeDIgKm0sIGNvbnN0IHJzX21hdHJpeDJ4MiAqbGhzLCBjb25zdCByc19tYXRyaXgyeDIgKnJocykgeworICAgIGZvciAoaW50IGk9MCA7IGk8MiA7IGkrKykgeworICAgICAgICBmbG9hdCByaTAgPSAwOworICAgICAgICBmbG9hdCByaTEgPSAwOworICAgICAgICBmb3IgKGludCBqPTAgOyBqPDIgOyBqKyspIHsKKyAgICAgICAgICAgIGNvbnN0IGZsb2F0IHJoc19paiA9IHJzTWF0cml4R2V0KHJocywgaSxqKTsKKyAgICAgICAgICAgIHJpMCArPSByc01hdHJpeEdldChsaHMsIGosIDApICogcmhzX2lqOworICAgICAgICAgICAgcmkxICs9IHJzTWF0cml4R2V0KGxocywgaiwgMSkgKiByaHNfaWo7CisgICAgICAgIH0KKyAgICAgICAgcnNNYXRyaXhTZXQobSwgaSwgMCwgcmkwKTsKKyAgICAgICAgcnNNYXRyaXhTZXQobSwgaSwgMSwgcmkxKTsKKyAgICB9Cit9CisKK3N0YXRpYyB2b2lkIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeE11bHRpcGx5KHJzX21hdHJpeDJ4MiAqbSwgY29uc3QgcnNfbWF0cml4MngyICpyaHMpIHsKKyAgICByc19tYX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XQ0IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeE11bHRpcGx5KHJzX21hdHJpeDR4NCAqbSwgZmxvYXQ0IGluKSB7CisgICAgZmxvYXQ0IHJldDsKKyAgICByZXQueCA9IChtLT5tWzBdICogaW4ueCkgKyAobS0+bVs0XSAqIGluLnkpICsgKG0tPm1bOF0gKiBpbi56KSArIChtLT5tWzEyXSAqIGluLncpOworICAgIHJldC55ID0gKG0tPm1bMV0gKiBpbi54KSArIChtLT5tWzVdICogaW4ueSkgKyAobS0+bVs5XSAqIGluLnopICsgKG0tPm1bMTNdICogaW4udyk7CisgICAgcmV0LnogPSAobS0+bVsyXSAqIGluLngpICsgKG0tPm1bNl0gKiBpbi55KSArIChtLT5tWzEwXSAqIGluLnopICsgKG0tPm1bMTRdICogaW4udyk7CisgICAgcmV0LncgPSAobS0+bVszXSAqIGluLngpICsgKG0tPm1bN10gKiBpbi55KSArIChtLT5tWzExXSAqIGluLnopICsgKG0tPm1bMTVdICogaW4udyk7CisgICAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGZsb2F0NCBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKQorcnNNYXRyaXhNdWx0aXBseShyc19tYXRyaXg0eDQgKm0sIGZsb2F0MyBpbikgeworICAgIGZsb2F0NCByZXQ7CisgICAgcmV0LnggPSAobS0+bVswXSAqIGluLngpICsgKG0tPm1bNF0gKiBpbi55KSArIChtLT5tWzhdICogaW4ueikgKyBtLT5tWzEyXTsKKyAgICByZXQueSA9IChtLT5tWzFdICogaW4ueCkgKyAobS0+bVs1XSAqIGluLnkpICsgKG0tPm1bOV0gKiBpbi56KSArIG0tPm1bMTNdOworICAgIHJldC56ID0gKG0tPm1bMl0gKiBpbi54KSArIChtLT5tWzZdICogaW4ueSkgKyAobS0+bVsxMF0gKiBpbi56KSArIG0tPm1bMTRdOworICAgIHJldC53ID0gKG0tPm1bM10gKiBpbi54KSArIChtLT5tWzddICogaW4ueSkgKyAobS0+bVsxMV0gKiBpbi56KSArIG0tPm1bMTVdOworICAgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBmbG9hdDQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkKK3JzTWF0cml4TXVsdGlwbHkocnNfbWF0cml4NHg0ICptLCBmbG9hdDIgaW4pIHsKKyAgICBmbG9hdDQgcmV0OworICAgIHJldC54ID0gKG0tPm1bMF0gKiBpbi54KSArIChtLT5tWzRdICogaW4ueSkgKyBtLT5tWzEyXTsKKyAgICByZXQueSA9IChtLT5tWzFdICogaW4ueCkgKyAobS0+bVs1XSAqIGluLnkpICsgbS0+bVsxM107CisgICAgcmV0LnogPSAobS0+bVsyXSAqIGluLngpICsgKG0tPm1bNl0gKiBpbi55KSArIG0tPm1bMTRdOworICAgIHJldC53ID0gKG0tPm1bM10gKiBpbi54KSArIChtLT5tWzddICogaW4ueSkgKyBtLT5tWzE1XTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgZmxvYXQzIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeE11bHRpcGx5KHJzX21hdHJpeDN4MyAqbSwgZmxvYXQzIGluKSB7CisgICAgZmxvYXQzIHJldDsKKyAgICByZXQueCA9IChtLT5tWzBdICogaW4ueCkgKyAobS0+bVszXSAqIGluLnkpICsgKG0tPm1bNl0gKiBpbi56KTsKKyAgICByZXQueSA9IChtLT5tWzFdICogaW4ueCkgKyAobS0+bVs0XSAqIGluLnkpICsgKG0tPm1bN10gKiBpbi56KTsKKyAgICByZXQueiA9IChtLT5tWzJdICogaW4ueCkgKyAobS0+bVs1XSAqIGluLnkpICsgKG0tPm1bOF0gKiBpbi56KTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgZmxvYXQzIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeE11bHRpcGx5KHJzX21hdHJpeDN4MyAqbSwgZmxvYXQyIGluKSB7CisgICAgZmxvYXQzIHJldDsKKyAgICByZXQueCA9IChtLT5tWzBdICogaW4ueCkgKyAobS0+bVszXSAqIGluLnkpOworICAgIHJldC55ID0gKG0tPm1bMV0gKiBpbi54KSArIChtLT5tWzRdICogaW4ueSk7CisgICAgcmV0LnogPSAobS0+bVsyXSAqIGluLngpICsgKG0tPm1bNV0gKiBpbi55KTsKKyAgICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgZmxvYXQyIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpCityc01hdHJpeE11bHRpcGx5KHJzX21hdHJpeDJ4MiAqbSwgZmxvYXQyIGluKSB7CisgICAgZmxvYXQyIHJldDsKKyAgICByZXQueCA9IChtLT5tWzBdICogaW4ueCkgKyAobS0+bVsyXSAqIGluLnkpOworICAgIHJldC55ID0gKG0tPm1bMV0gKiBpbi54KSArIChtLT5tWzNdICogaW4ueSk7CisgICAgcmV0dXJuIHJldDsKK30KKworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKy8vIGludCBvcHMKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisKK19faW5saW5lX18gc3RhdGljIHVpbnQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlLCBhbHdheXNfaW5saW5lKSkgcnNDbGFtcCh1aW50IGFtb3VudCwgdWludCBsb3csIHVpbnQgaGlnaCkgeworICAgIHJldHVybiBhbW91bnQgPCBsb3cgPyBsb3cgOiAoYW1vdW50ID4gaGlnaCA/IGhpZ2ggOiBhbW91bnQpOworfQorX19pbmxpbmVfXyBzdGF0aWMgaW50IF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSwgYWx3YXlzX2lubGluZSkpIHJzQ2xhbXAoaW50IGFtb3VudCwgaW50IGxvdywgaW50IGhpZ2gpIHsKKyA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geworICAgICAgICBpZihvdXRFcnJvck1zZykgeworICAgICAgICAgICAgKm91dEVycm9yTXNnID0gIlJlc291cmNlIHR5cGUgY2Fubm90IGJlIGFuIGVtcHR5IHN0cmluZyI7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICBpZigqKm91dE5hbWUgPT0gMCkgeworICAgICAgICBpZihvdXRFcnJvck1zZykgeworICAgICAgICAgICAgKm91dEVycm9yTXNnID0gIlJlc291cmNlIGlkIGNhbm5vdCBiZSBhbiBlbXB0eSBzdHJpbmciOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CiAgICAgcmV0dXJuIHRydWU7CiB9CiAKQEAgLTQxMjcsMTMgKzQxNTcsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgKDB4MDBmZjAwMDAgJiAoKHR5cGVJbmRleCsxKTw8MTYpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAoMHgwMDAwZmZmZiAmIChlbnRyeUluZGV4KSk7CiAgICAgICAgICAgICAgICAgICAgICAgICByZXNvdXJjZV9uYW1lIHJlc05hbWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLT5nZXRSZXNvdXJjZU5hbWUocmVzSUQsICZyZXNOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiICAgICAgc3BlYyByZXNvdXJjZSAweCUwOHggJXM6JXMvJXM6IGZsYWdzPTB4JTA4eFxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNJRCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSEFSMTZfVE9fQ1NUUihyZXNOYW1lLnBhY2thZ2UsIHJlc05hbWUucGFja2FnZUxlbiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS50eXBlLCByZXNOYW1lLnR5cGVMZW4pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIENIQVIxNl9UT19DU1RSKHJlc05hbWUubmFtZSwgcmVzTmFtZS5uYW1lTGVuKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkdG9obCh0eXBlQ29uZmlncy0+dHlwZVNwZWNGbGFnc1tlbnRyeUluZGV4XSkpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMtPmdldFJlc291cmNlTmFtZShyZXNJRCwgJnJlc05hbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIgICAgICBzcGVjIHJlc291cmNlIDB4JTA4eCAlczolcy8lczogZmxhZ3M9MHglMDh4XG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS5wYWNrYWdlLCByZXNOYW1lLnBhY2thZ2VMZW4pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSEFSMTZfVE9fQ1NUUihyZXNOYW1lLnR5cGUsIHJlc05hbWUudHlwZUxlbiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENIQVIxNl9UT19DU1RSKHJlc05hbWUubmFtZSwgcmVzTmFtZS5uYW1lTGVuKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHRvaGwodHlwZUNvbmZpZ3MtPnR5cGVTcGVjRmxhZ3NbZW50cnlJbmRleF0pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIgICAgICBJTlZBTElEIFRZUEUgQ09ORklHIEZPUiBSRVNPVVJDRSAweCUwOHhcbiIsIHJlc0lEKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBjb25maWdJbmRleD0wOyBjb25maWdJbmRleDxOVEM7IGNvbmZpZ0luZGV4KyspIHsKQEAgLTQzNDAsMTEgKzQzNzMsMTQgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgKDB4MDBmZjAwMDAgJiAoKHR5cGVJbmRleCsxKTw8MTYpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAoMHgwMDAwZmZmZiAmIChlbnRyeUluZGV4KSk7CiAgICAgICAgICAgICAgICAgICAgICAgICByZXNvdXJjZV9uYW1lIHJlc05hbWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLT5nZXRSZXNvdXJjZU5hbWUocmVzSUQsICZyZXNOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiICAgICAgICByZXNvdXJjZSAweCUwOHggJXM6JXMvJXM6ICIsIHJlc0lELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDSEFSMTZfVE9fQ1NUUihyZXNOYW1lLnBhY2thZ2UsIHJlc05hbWUucGFja2FnZUxlbiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENIQVIxNl9UT19DU1RSKHJlc05hbWUudHlwZSwgcmVzTmFtZS50eXBlTGVuKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS5uYW1lLCByZXNOYW1lLm5hbWVMZW4pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLT5nZXRSZXNvdXJjZU5hbWUocmVzSUQsICZyZXNOYW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiICAgICAgICByZXNvdXJjZSAweCUwOHggJXM6JXMvJXM6ICIsIHJlc0lELAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS5wYWNrYWdlLCByZXNOYW1lLnBhY2thZ2VMZW4pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS50eXBlLCByZXNOYW1lLnR5cGVMZW4pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hBUjE2X1RPX0NTVFIocmVzTmFtZS5uYW1lLCByZXNOYW1lLm5hbWVMZW4pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIgICAgICAgIElOVkFMSUQgUkVTT1VSQ0UgMHglMDh4OiAiLCByZXNJRCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHRoaXNPZmZzZXQmMHgzKSAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJOT04tSU5URUdFUiBPRkZTRVQ6ICVwXG4iLCAodm9pZCopdGhpc09mZnNldCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CkBAIC00NDAyLDE4ICs0NDM4LDE5IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50X3ZhbHVlKHBrZywgdmFsdWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYmFnUHRyICE9IE5VTEwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgaW50IE4gPSBkdG9obChiYWdQdHItPmNvdW50KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUmVzVGFibGVfbWFwKiBtYXBQdHIgPSAoY29uc3QgUmVzVGFibGVfbWFwKikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChjb25zdCB1aW50OF90KillbnQpICsgZXNpemUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1aW50OF90KiBiYXNlTWFwUHRyID0gKGNvbnN0IHVpbnQ4X3QqKWVudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IG1hcE9mZnNldCA9IGVzaXplOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBSZXNUYWJsZV9tYXAqIG1hcFB0ciA9IChSZXNUYWJsZV9tYXAqKShiYXNlTWFwUHRyK21hcE9mZnNldCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiICAgICAgICAgIFBhcmVudD0weCUwOHgsIENvdW50PSVkXG4iLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHRvaGwoYmFnUHRyLT5wYXJlbnQuaWRlbnQpLCBOKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TiAmJiBtYXBPZmZzZXQgPCAodHlwZVNpemUtc2l6ZW9mKFJlc1RhYmxlX21hcCkpOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiICAgICAgICAgICMlaSAoS2V5PTB4JTA4eCk6ICIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSwgZHRvaGwobWFwUHRyLT5uYW1lLmlkZW50KSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZS5jb3B5RnJvbV9kdG9oKG1hcFB0ci0+dmFsdWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRfdmFsdWUocGtnLCB2YWx1ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzaXplX3Qgc2l6ZSA9IGR0b2hzKG1hcFB0ci0+dmFsdWUuc2l6ZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXBQdHIgPSAoUmVzVGFibGVfbWFwKikoKChjb25zdCB1aW50OF90KiltYXBQdHIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc2l6ZSArIHNpemVvZigqbWFwUHRyKS1zaXplb2YobWFwUHRyLT52YWx1ZSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwT2Zmc2V0ICs9IHNpemUgKyBzaXplb2YoKm1hcFB0ciktc2l6ZW9mKG1hcFB0ci0+dmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwUHRyID0gKFJlc1RhYmxlX21hcCopKGJhc2VNYXBQdHIrbWFwT2Zmc2V0KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0KZGlmZiAtLWdpdCBhL21lZGlhL2phdmEvYW5kcm9pZC9tZWRpYS9BdWRpb01hbmFnZXIuamF2YSBiL21lZGlhL2phdmEvYW5kcm9pZC9tZWRpYS9BdWRpb01hbmFnZXIuamF2YQppbmRleCBiYmJiYTc0Li5iMjNkY2RlIDEwMDY0NAotLS0gYS9tZWRpYS9qYXZhL2FuZHJvaWQvbWVkaWEvQXVkaW9NYW5hZ2VyLmphdmEKKysrIGIvbWVkaWEvamF2YS9hbmRyb2lkL21lZGlhL0F1ZGlvTWFuYWdlci5qYXZhCkBAIC0xNTI1LDQgKzE1MjUsMjIgQEAKICAgICAgICoge0BoaWRlfQogICAgICAgKi8KICAgICAgcHJpdmF0ZSBJQmluZGVyIG1JQ2FsbEJhY2sgPSBuZXcgQmluZGVyKCk7CisKKyAgICAvKioKKyAgICAgKiBDaGVja3Mgd2hldGhlciB0aGUgcGhvbmUgaXMgaW4gc2lsZW50IG1vZGUsIHdpdGggb3Igd2l0aG91dCB2aWJ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ICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oIk10cENsaWVudDogbGlzdGVuZXIgaXMgbnVsbCIpOworICAgICAgICB9CisgICAgICAgIG1MaXN0ZW5lciA9IGxpc3RlbmVyOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIGZpbmFsaXplKCkgeworICAgICAgICBuYXRpdmVfZmluYWxpemUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBzdGFydCgpIHsKKyAgICAgICAgcmV0dXJuIG5hdGl2ZV9zdGFydCgpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHN0b3AoKSB7CisgICAgICAgIG5hdGl2ZV9zdG9wKCk7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gZGVsZXRlT2JqZWN0KGludCBkZXZpY2VJRCwgaW50IG9iamVjdElEKSB7CisgICAgICAgIHJldHVybiBuYXRpdmVfZGVsZXRlX29iamVjdChkZXZpY2VJRCwgb2JqZWN0SUQpOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0UGFyZW50KGludCBkZXZpY2VJRCwgaW50IG9iamVjdElEKSB7CisgICAgICAgIHJldHVybiBuYXRpdmVfZ2V0X3BhcmVudChkZXZpY2VJRCwgb2JqZWN0SUQpOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0U3RvcmFnZUlEKGludCBkZXZpY2VJRCwgaW50IG9iamVjdElEKSB7CisgICAgICAgIHJldHVybiBuYXRpdmVfZ2V0X3N0b3JhZ2VfaWQoZGV2aWNlSUQsIG9iamVjdElEKTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50ZXJmYWNlIExpc3RlbmVyIHsKKyAgICAgICAgLy8gY2FsbGVkIHdoZW4gYSBuZXcgTVRQIGRldmljZSBoYXMgYmVlbiBkaXNjb3ZlcmVkCisgICAgICAgIHZvaWQgZGV2aWNlQWRkZWQoaW50IGlkKTsKKworICAgICAgICAv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KyAgICAgICAgc3dpdGNoIChxdWVyeVR5cGUpIHsKKyAgICAgICAgICAgIGNhc2UgREVWSUNFOgorICAgICAgICAgICAgY2FzZSBERVZJQ0VfSUQ6CisgICAgICAgICAgICAgICAgbWFwID0gc0RldmljZVByb2plY3Rpb25NYXA7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNUT1JBR0U6CisgICAgICAgICAgICBjYXNlIFNUT1JBR0VfSUQ6CisgICAgICAgICAgICAgICAgbWFwID0gc1N0b3JhZ2VQcm9qZWN0aW9uTWFwOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1Q6CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9JRDoKKyAgICAgICAgICAgIGNhc2UgU1RPUkFHRV9DSElMRFJFTjoKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX0NISUxEUkVOOgorICAgICAgICAgICAgICAgIG1hcCA9IHNPYmplY3RQcm9qZWN0aW9uTWFwOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJ1bmtub3duIHF1ZXJ5IHR5cGUgIiAgKyBxdWVyeVR5cGUpOworICAgICAgICB9CisKKyAgICAgICAgaW50W10gY29sdW1ucyA9IG5ldyBpbnRbcHJvamVjdGlvbi5sZW5ndGhdOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHByb2plY3Rpb24ubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgIEludGVnZXIgaWQgPSBtYXAuZ2V0KHByb2plY3Rpb25baV0pOworICAgICAgICAgICAgaWYgKGlkID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJ1bmtub3duIGNvbHVtbiAiICArIHByb2plY3Rpb25baV0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgY29sdW1uc1tpXSA9IGlkLmludFZhbHVlKCk7CisgICAgICAgIH0KKyAgICAgICAgbmF0aXZlX3NldHVwKGNsaWVudCwgcXVlcnlUeXBlLCBkZXZpY2VJRCwgc3RvcmFnZUlELCBvYmplY3RJRCwgY29sdW1ucyk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgZmluYWxpemUoKSB7CisgICAgICAgIG5hdGl2ZV9maW5hbGl6ZSgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBpbnQgZ2V0Q291bnQoKSB7CisgICAgICAgIGlmIChtQ291bnQgPT0gTk9fQ09VTlQpIHsKKyAgICAgICAgICAgIGZpbGxXaW5kb3coMCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG1Db3VudDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiByZXF1ZXJ5KCkgeworICAgICAgICBMb2cuZChUQUcsICJyZXF1ZXJ5Iik7CisgICAgICAgIG1Db3VudCA9IE5PX0NPVU5UOworICAgICAgICBpZiAobVdpbmRvdyAhPSBudWxsKSB7CisgICAgICAgICAgICBtV2luZG93LmNsZWFyKCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHN1cGVyLnJlcXVlcnkoKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgZmlsbFdpbmRvdyhpbnQgc3RhcnRQb3MpIHsKKyAgICAgICAgaWYgKG1XaW5kb3cgPT0gbnVsbCkgeworICAgICAgICAgICAgLy8gSWYgdGhlcmUgaXNuJ3QgYSB3aW5kb3cgc2V0IGFscmVhZHkgaXQgd2lsbCBvbmx5IGJlIGFjY2Vzc2VkIGxvY2FsbHkKKyAgICAgICAgICAgIG1XaW5kb3cgPSBuZXcgQ3Vyc29yV2luZG93KHRydWUgLyogdGhlIHdpbmRvdyBpcyBsb2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9ERVNDUklQVElPTiAgICA9IDEwMzsKKworICAgIC8qIE9iamVjdCBDb2x1bW4gSURzICovCisgICAgLyogVGhlc2UgbXVzdCBtYXRjaCB0aGUgdmFsdWVzIGluIE10cEN1cnNvci5jcHAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgT0JKRUNUX1JPV19JRCAgICAgICAgICAgICAgPSAyMDE7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IE9CSkVDVF9TVE9SQUdFX0lEICAgICAgICAgID0gMjAyOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBPQkpFQ1RfRk9STUFUICAgICAgICAgICAgICA9IDIwMzsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgT0JKRUNUX1BST1RFQ1RJT05fU1RBVFVTICAgPSAyMDQ7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IE9CSkVDVF9TSVpFICAgICAgICAgICAgICAgID0gMjA1OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBPQkpFQ1RfVEhVTUJfRk9STUFUICAgICAgICA9IDIwNjsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgT0JKRUNUX1RIVU1CX1NJWkUgICAgICAgICAgPSAyMDc7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IE9CSkVDVF9USFVNQl9XSURUSCAgICAgICAgID0gMjA4OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBPQkpFQ1RfVEhVTUJfSEVJR0hUICAgICAgICA9IDIwOTsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBpbnQgT0JKRUNUX0lNQUdFX1dJRFRIICAgICAgICAgPSAyMTA7CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgaW50IE9CSkVDVF9JTUFHRV9IRUlHSFQgICAgICAgID0gMjExOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGludCBPQkp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2xpZW50IHsKK3ByaXZhdGU6CisgICAgdmlydHVhbCB2b2lkICAgIGRldmljZUFkZGVkKE10cERldmljZSAqZGV2aWNlKTsKKyAgICB2aXJ0dWFsIHZvaWQgICAgZGV2aWNlUmVtb3ZlZChNdHBEZXZpY2UgKmRldmljZSk7CisKKyAgICBqb2JqZWN0ICAgICAgICAgbUNsaWVudDsKKyAgICBNdHBEZXZpY2UqICAgICAgbUV2ZW50RGV2aWNlOworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgIE15Q2xpZW50KEpOSUVudiAqZW52LCBqb2JqZWN0IGNsaWVudCk7CisgICAgdm9pZCAgICAgICAgICAgIGNsZWFudXAoSk5JRW52ICplbnYpOworfTsKKworTXRwQ2xpZW50KiBnZXRfY2xpZW50X2Zyb21fb2JqZWN0KEpOSUVudiogZW52LCBqb2JqZWN0IGphdmFDbGllbnQpCit7CisgICAgcmV0dXJuIChNdHBDbGllbnQqKWVudi0+R2V0SW50RmllbGQoamF2YUNsaWVudCwgZmllbGRfY29udGV4dCk7Cit9CisKKworTXlDbGllbnQ6Ok15Q2xpZW50KEpOSUVudiAqZW52LCBqb2JqZWN0IGNsaWVudCkKKyAgICA6ICAgbUNsaWVudChlbnYtPk5ld0dsb2JhbFJlZihjbGllbnQpKQoreworfQorCit2b2lkIE15Q2xpZW50OjpjbGVhbnVwKEpOSUVudiAqZW52KSB7CisgICAgZW52LT5EZWxldGVHbG9iYWxSZWYobUNsaWVudCk7Cit9CisKK3ZvaWQgTXlDbGllbnQ6OmRldmljZUFkZGVkKE10cERldmljZSAqZGV2aWNlKSB7CisgICAgSk5JRW52KiBlbnYgPSBBbmRyb2lkUnVudGltZTo6Z2V0Sk5JRW52KCk7CisgICAgY29uc3QgY2hhciogbmFtZSA9IGRldmljZS0+Z2V0RGV2aWNlTmFtZSgpOworICAgIExPR0QoIk15Q2xpZW50OjpkZXZpY2VBZGRlZCAlc1xuIiwgbmFtZSk7CisKKyAgICBlbnYtPkNhbGxWb2l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W52LCBqb2JqZWN0IHRoaXopCit7CisgICAgTE9HRCgiZmluYWxpemVcbiIpOworICAgIE15Q2xpZW50ICpjbGllbnQgPSAoTXlDbGllbnQgKillbnYtPkdldEludEZpZWxkKHRoaXosIGZpZWxkX2NvbnRleHQpOworICAgIGNsaWVudC0+Y2xlYW51cChlbnYpOworICAgIGRlbGV0ZSBjbGllbnQ7CisgICAgZW52LT5TZXRJbnRGaWVsZCh0aGl6LCBmaWVsZF9jb250ZXh0LCAwKTsKK30KKworc3RhdGljIGpib29sZWFuCithbmRyb2lkX21lZGlhX010cENsaWVudF9zdGFydChKTklFbnYgKmVudiwgam9iamVjdCB0aGl6KQoreworICAgIExPR0QoInN0YXJ0XG4iKTsKKyAgICBNeUNsaWVudCAqY2xpZW50ID0gKE15Q2xpZW50ICopZW52LT5HZXRJbnRGaWVsZCh0aGl6LCBmaWVsZF9jb250ZXh0KTsKKyAgICByZXR1cm4gY2xpZW50LT5zdGFydCgpOworfQorCitzdGF0aWMgdm9pZAorYW5kcm9pZF9tZWRpYV9NdHBDbGllbnRfc3RvcChKTklFbnYgKmVudiwgam9iamVjdCB0aGl6KQoreworICAgIExPR0QoInN0b3BcbiIpOworICAgIE15Q2xpZW50ICpjbGllbnQgPSAoTXlDbGllbnQgKillbnYtPkdldEludEZpZWxkKHRoaXosIGZpZWxkX2NvbnRleHQpOworICAgIGNsaWVudC0+c3RvcCgpOworfQorCitzdGF0aWMgamJvb2xlYW4KK2FuZHJvaWRfbWVkaWFfTXRwQ2xpZW50X2RlbGV0ZV9vYmplY3QoSk5JRW52ICplbnYsIGpvYmplY3QgdGhpeiwKKyAgICAgICAgamludCBkZXZpY2VfaWQsIGppbnQgb2JqZWN0X2lkKQoreworICAgIE15Q2xpZW50ICpjbGllbnQgPSAoTXlDbGllbnQgKillbnYtPkdldEludEZpZWxkKHRoaXosIGZpZWxkX2NvbnRleHQpOworICAgIE10cERldmljZSogZGV2aWNlID0gY2xpZW50LT5nZXREZXZpY2UoZGV2aWNlX2lkKTsKKyAgICBpZiAoZGV2aWNlKQorICAgICAgICByZXR1cm4gZGV2aWNlLT5kZWxldGVPYmplY3Qob2JqZWN0X2lkKTsKKyAgICBlbHNlCisgICAgICAgIHJldHVybiBOVUxMOworfQorCitzdGF0aWMgamludAorYW5kcm9pZF9tZWRpYV9NdHBDbGllbnRfZ2V0X3BhcmVudChKTklFbnYgKmVudiwgam9iamVjdCB0aGl6LAorICAgICAgICBqaW50IGRldmljZV9pZCwgamludCBvYmplY3RfaWQpCit7CisgICAgTXlDbGllbnQgKmNsaWVudCA9IChNeUNsaWVudCAqKWVudi0+R2V0SW50RmllbGQodGhpeiwgZmllbGRfY29udGV4dCk7CisgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBjbGllbnQtPmdldERldmljZShkZXZpY2VfaWQpOworICAgIGlmIChkZXZpY2UpCisgICAgICAgIHJldHVybiBkZXZpY2UtPmdldFBhcmVudChvYmplY3RfaWQpOworICAgIGVsc2UKKyAgICAgICAgcmV0dXJuIC0xOworfQorCitzdGF0aWMgamludAorYW5kcm9pZF9tZWRpYV9NdHBDbGllbnRfZ2V0X3N0b3JhZ2VfaWQoSk5JRW52ICplbnYsIGpvYmplY3QgdGhpeiwKKyAgICAgICAgamludCBkZXZpY2VfaWQsIGppbnQgb2JqZWN0X2lkKQoreworICAgIE15Q2xpZW50ICpjbGllbnQgPSAoTXlDbGllbnQgKillbnYtPkdldEludEZpZWxkKHRoaXosIGZpZWxkX2NvbnRleHQpOworICAgIE10cERldmljZSogZGV2aWNlID0gY2xpZW50LT5nZXREZXZpY2UoZGV2aWNlX2lkKTsKKyAgICBpZiAoZGV2aWNlKQorICAgICAgICByZXR1cm4gZGV2aWNlLT5nZXRTdG9yYWdlSUQob2JqZWN0X2lkKTsKKyAgICBlbHNlCisgICAgICAgIHJldHVybiAtMTsKK30KKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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RpYV9NdHBDbGllbnRcbiIpOworCisgICAgY2xhenogPSBlbnYtPkZpbmRDbGFzcygiYW5kcm9pZC9tZWRpYS9NdHBDbGllbnQiKTsKKyAgICBpZiAoY2xhenogPT0gTlVMTCkgeworICAgICAgICBMT0dFKCJDYW4ndCBmaW5kIGFuZHJvaWQvbWVkaWEvTXRwQ2xpZW50Iik7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisgICAgbWV0aG9kX2RldmljZUFkZGVkID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgImRldmljZUFkZGVkIiwgIihJKVYiKTsKKyAgICBpZiAobWV0aG9kX2RldmljZUFkZGVkID09IE5VTEwpIHsKKyAgICAgICAgTE9HRSgiQ2FuJ3QgZmluZCBkZXZpY2VBZGRlZCIpOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorICAgIG1ldGhvZF9kZXZpY2VSZW1vdmVkID0gZW52LT5HZXRNZXRob2RJRChjbGF6eiwgImRldmljZVJlbW92ZWQiLCAiKEkpViIpOworICAgIGlmIChtZXRob2RfZGV2aWNlUmVtb3ZlZCA9PSBOVUxMKSB7CisgICAgICAgIExPR0UoIkNhbid0IGZpbmQgZGV2aWNlUmVtb3ZlZCIpOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorICAgIGZpZWxkX2NvbnRleHQgPSBlbnYtPkdldEZpZWxkSUQoY2xhenosICJtTmF0aXZlQ29udGV4dCIsICJJIik7CisgICAgaWYgKGZpZWxkX2NvbnRleHQgPT0gTlVMTCkgeworICAgICAgICBMT0dFKCJDYW4ndCBmaW5kIE10cENsaWVudC5tTmF0aXZlQ29udGV4dCIpOworICAgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgcmV0dXJuIEFuZHJvaWRSdW50aW1lOjpyZWdpc3Rlck5hdGl2ZU1ldGhvZHMoZW52LAorICAgICAgICAgICAgICAgICJhbmRyb2lkL21lZGlhL010cENsaWVudCIsIGdNZXRob2RzLCBORUxFTShnTWV0aG9kcykp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vaWQKK2FuZHJvaWRfbWVkaWFfTXRwQ3Vyc29yX3NldHVwKEpOSUVudiAqZW52LCBqb2JqZWN0IHRoaXosIGpvYmplY3QgamF2YUNsaWVudCwKKyAgICAgICAgamludCBxdWVyeVR5cGUsIGppbnQgZGV2aWNlSUQsIGppbnQgc3RvcmFnZUlELCBqaW50IG9iamVjdElELCBqaW50QXJyYXkgamF2YUNvbHVtbnMpCit7CisgICAgTE9HRCgiYW5kcm9pZF9tZWRpYV9NdHBDdXJzb3Jfc2V0dXAgcXVlcnlUeXBlOiAlZCBkZXZpY2VJRDogJWQgc3RvcmFnZUlEOiAlZCBvYmplY3RJRDogJWRcbiIsCisgICAgICAgICAgICAgICAgcXVlcnlUeXBlLCBkZXZpY2VJRCwgc3RvcmFnZUlELCBvYmplY3RJRCk7CisKKyAgICBpbnQqIGNvbHVtbnMgPSBOVUxMOworICAgIGludCBjb2x1bW5Db3VudCA9IDA7CisgICAgaWYgKGphdmFDb2x1bW5zKSB7CisgICAgICAgIGNvbHVtbnMgPSBlbnYtPkdldEludEFycmF5RWxlbWVudHMoamF2YUNvbHVtbnMsIDApOworICAgICAgICBjb2x1bW5Db3VudCA9IGVudi0+R2V0QXJyYXlMZW5ndGgoamF2YUNvbHVtbnMpOworICAgIH0KKworICAgIE10cENsaWVudCogY2xpZW50ID0gZ2V0X2NsaWVudF9mcm9tX29iamVjdChlbnYsIGphdmFDbGllbnQpOworICAgIE10cEN1cnNvciogY3Vyc29yID0gbmV3IE10cEN1cnNvcihjbGllbnQsIHF1ZXJ5VHlwZSwKKyAgICAgICAgICAgIGRldmljZUlELCBzdG9yYWdlSUQsIG9iamVjdElELCBjb2x1bW5Db3VudCwgY29sdW1ucyk7CisKKyAgICBpZiAoY29sdW1ucykKKyAgICAgICAgZW52LT5SZWxlYXNlSW50QXJyYXlFbGVtZW50cyhqYXZhQ29sdW1ucywgY29sdW1ucywgMCk7CisgICAgZW52LT5TZXRJbnRGaWVsZCh0aGl6LCBmaWVsZF9jb250ZXh0LCAoaW50KWN1cnNvcik7Cit9CisKK3N0YXRpYyB2b2lkCithbmRyb2lkX21lZGlhX010cEN1cnNvcl9maW5hbGl6ZShKTklFbnYgKmVudiwgam9iamVjdCB0aGl6KQoreworICAgIExPR0QoImZpbmFsaXplXG4iKTsKKyAgICBNdHBDdXJzb3IgKmN1cnNvciA9IChNdHBDdXJzb3IgKillbnYtPkdldEludEZpZWxkKHRoaXosIGZpZWxkX2NvbnRleHQpOworICAgIGRlbGV0ZSBjdXJzb3I7Cit9CisKK3N0YXRpYyBqaW50CithbmRyb2lkX21lZGlhX010cEN1cnNvcl9maWxsX3dpbmRvdyhKTklFbnYgKmVudiwgam9iamVjdCB0aGl6LCBqb2JqZWN0IGphdmFXaW5kb3csIGppbnQgc3RhcnRQb3MpCit7CisgICAgQ3Vyc29yV2luZG93KiB3aW5kb3cgPSBnZXRfd2luZG93X2Zyb21fb2JqZWN0KGVudiwgamF2YVdpbmRvdyk7CisgICAgaWYgKCF3aW5kb3cpIHsKKyAgICAgICAgTE9HRSgiSW52YWxpZCBDdXJzb3JXaW5kb3ciKTsKKyAgICAgICAgam5pVGhyb3dFeGNlcHRpb24oZW52LCAiamF2YS9sYW5nL0lsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICJCYWQgQ3Vyc29yV2luZG93Iik7CisgICAgICAgIHJldHVybiAwOworICAgIH0KKyAgICBNdHBDdXJzb3IgKmN1cnNvciA9IChNdHBDdXJzb3IgKillbnYtPkdldEludEZpZWxkKHRoaXosIGZpZWxkX2NvbnRleHQpOworCisgICAgcmV0dXJuIGN1cnNvci0+ZmlsbFdpbmRvdyh3aW5kb3csIHN0YXJ0UG9zKTsKK30KKworLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCitzdGF0aWMgSk5J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S0tLS0tLS0tLQorCitzdGF0aWMgYm9vbCBFeGNlcHRpb25DaGVjayh2b2lkKiBlbnYpCit7CisgICAgcmV0dXJuICgoSk5JRW52ICopZW52KS0+RXhjZXB0aW9uQ2hlY2soKTsKK30KKworY2xhc3MgTXRwVGhyZWFkIDogcHVibGljIFRocmVhZCB7Citwcml2YXRlOgorICAgIFN0cmluZzggbVN0b3JhZ2VQYXRoOworICAgIFN0cmluZzggbURhdGFiYXNlUGF0aDsKKyAgICBib29sIG1Eb25lOworICAgIGJvb2wgbVNjYW5uZWRPbmNlOworCitwdWJsaWM6CisgICAgTXRwVGhyZWFkKGNvbnN0IGNoYXIqIHN0b3JhZ2VQYXRoLCBjb25zdCBjaGFyKiBkYXRhYmFzZVBhdGgpCisgICAgICAgIDogbVN0b3JhZ2VQYXRoKHN0b3JhZ2VQYXRoKSwgbURhdGFiYXNlUGF0aChkYXRhYmFzZVBhdGgpLCBtRG9uZShmYWxzZSksIG1TY2FubmVkT25jZShmYWxzZSkKKyAgICB7CisgICAgfQorCisgICAgdmlydHVhbCBib29sIHRocmVhZExvb3AoKSB7CisgICAgICAgIGludCBmZCA9IG9wZW4oIi9kZXYvbXRwX3VzYiIsIE9fUkRXUik7CisgICAgICAgIHByaW50Zigib3BlbiByZXR1cm5lZCAlZFxuIiwgZmQpOworICAgICAgICBpZiAoZmQgPCAwKSB7CisgICAgICAgICAgICBMT0dFKCJjb3VsZCBub3Qgb3BlbiBNVFAgZHJpdmVyXG4iKTsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIE10cFNlcnZlciogc2VydmVyID0gbmV3IE10cFNlcnZlcihmZCwgbURhdGFiYXNlUGF0aCk7CisgICAgICAgIHNlcnZlci0+YWRkU3RvcmFnZShtU3RvcmFnZVBhdGgpOworCisgICAgICAgIC8vIHRlbXBvcmFyeQorICAgICAgICBMT0dEKCJNdHBUaHJlYWQgc2VydmVyLT5zY2FuU3RvcmFnZSIpOwor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WFTY2FubmVyLmNwcCBiL21lZGlhL2xpYm1lZGlhL01lZGlhU2Nhbm5lci5jcHAKaW5kZXggNmY1ODFkMy4uMjQ0MjZmZiAxMDA2NDQKLS0tIGEvbWVkaWEvbGlibWVkaWEvTWVkaWFTY2FubmVyLmNwcAorKysgYi9tZWRpYS9saWJtZWRpYS9NZWRpYVNjYW5uZXIuY3BwCkBAIC0xMzMsNiArMTMzLDEzIEBACiAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgfQogCisgICAgICAgIGludCBuYW1lTGVuZ3RoID0gc3RybGVuKG5hbWUpOworICAgICAgICBpZiAobmFtZUxlbmd0aCArIDEgPiBwYXRoUmVtYWluaW5nKSB7CisgICAgICAgICAgICAvLyBwYXRoIHRvbyBsb25nIQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKyAgICAgICAgc3RyY3B5KGZpbGVTcG90LCBuYW1lKTsKKwogICAgICAgICBpbnQgdHlwZSA9IGVudHJ5LT5kX3R5cGU7CiAgICAgICAgIGlmICh0eXBlID09IERUX1VOS05PV04pIHsKICAgICAgICAgICAgIC8vIElmIHRoZSB0eXBlIGlzIHVua25vd24sIHN0YXQoKSB0aGUgZmlsZSBpbnN0ZWFkLgpAQCAtMTUwLDE2ICsxNTcsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIGlmICh0eXBlID09IERUX1JFRyB8fCB0eXBlID09IERUX0RJUikgewotICAgICAgICAgICAgaW50IG5hbWVMZW5ndGggPSBzdHJsZW4obmFtZSk7Ci0gICAgICAgICAgICBib29sIGlzRGlyZWN0b3J5ID0gKHR5cGUgPT0gRFRfRElSKTsKLQotICAgICAgICAgICAgaWYgKG5hbWVMZW5ndGggPiBwYXRoUmVtYWluaW5nIHx8IChpc0RpcmVjdG9yeSAmJiBuYW1lTGVuZ3RoICsgMSA+IHBhdGhSZW1haW5pbmcpKSB7Ci0gICAgICAgICAgICAgICAgLy8gcGF0aCB0b28gbG9uZyEKLSA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0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorIyBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorIyBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyMgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorIyBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyMKK0xPQ0FMX1BBVEg6PSAkKGNhbGwgbXktZGlyKQorCitpbmNsdWRlICQoQ0xFQVJfVkFSUykKKworTE9DQUxfU1JDX0ZJTEVTOj0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBDbGllbnQuY3BwICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cEN1cnNvci5jcHAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwRGF0YWJhc2UuY3BwICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0LmNwcCAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cERlYnVnLmNwcCAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwRGV2aWNlLmNwcCAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBEZXZpY2VJbmZvLmNwcCAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cE1lZGlhU2Nhbm5lci5jcHAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SW5mby5jcHAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBQYWNrZXQuY3BwICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFByb3BlcnR5LmNwcCAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwUmVxdWVzdFBhY2tldC5jcHAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBSZXNwb25zZVBhY2tldC5jcHAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFNlcnZlci5jcHAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwU3RvcmFnZUluZm8uY3BwICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBTdHJpbmdCdWZmZXIuY3BwICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFN0b3JhZ2UuY3BwICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwVXRpbHMuY3BwICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBTcWxpdGVEYXRhYmFzZS5jcHAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIFNxbGl0ZVN0YXRlbWVudC5jcHAgICAgICAgICAgICAgICAgICAgXAorCitMT0NBTF9NT0RVTEU6PSBsaWJtdHAKKworTE9DQUxfQ19JTkNMVURFUyA6PSBleHRlcm5hbC9zcWxpdGUvZGlzdAorCitMT0NBTF9DRkxBR1MgOj0gLURNVFBfREVWSUNFIC1ETVRQX0hPU1QKKworaW5jbHVkZSAkKEJVSUxEX1NUQVRJQ19MSUJSQVJZKQorCitpZm5lcSAoJChUQVJHRVRfU0lNVUxBVE9SKSx0cnVlKQorCitpbmNsdWRlICQoQ0xFQVJfVkFSUykKKworTE9DQUxfU1JDX0ZJTEVTOj0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBtdHB0ZXN0LmNwcCAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKworTE9DQUxfTU9EVUxFOj0gbXRwdGVzdAorCitMT0NBTF9DRkxBR1MgOj0gLURNVFBfREVWSUNFCisKK0xPQ0FMX1NIQVJFRF9MSUJSQVJJRVMgOj0gbGlidXRpbHMgbGlic3FsaXRlIGxpYnN0YWdlZnJpZ2h0IGxpYmN1dGlscyBcCisJbGlibWVkaWEKKworTE9DQUxfU1RBVElDX0xJQlJBUklFUyA6PSBsaWJtdHAKKworaW5jbHVkZSAkKEJVSUxEX0VYRUNVVEFCTEUpCisKK2luY2x1ZGUgJChDTEVBUl9WQVJTKQorCitMT0NBTF9NT0RVTEUgOj0gc2NhbnRlc3QKK0xPQ0FMX1NSQ19GSUxFUzo9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgc2NhbnRlc3QuY3BwICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBNZWRpYVNjYW5uZXIuY3BwICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cERhdGFiYXNlLmNwcCAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwRGF0YVBhY2tldC5jcHAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBNdHBQYWNrZXQuY3BwICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgIE10cFN0cmluZ0J1ZmZlci5jcHAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgTXRwVXRpbHMuY3BwICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICBTcWxpdGVEYXRhYmFzZS5jcHAgICAgIC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KK25hbWVzcGFjZSBhbmRyb2lkIHsKKworY2xhc3MgTXRwQ2xpZW50VGhyZWFkIDogcHVibGljIFRocmVhZCB7Citwcml2YXRlOgorICAgIE10cENsaWVudCogICBtQ2xpZW50OworCitwdWJsaWM6CisgICAgTXRwQ2xpZW50VGhyZWFkKE10cENsaWVudCogY2xpZW50KQorICAgICAgICA6IG1DbGllbnQoY2xpZW50KQorICAgIHsKKyAgICB9CisKKyAgICB2aXJ0dWFsIGJvb2wgdGhyZWFkTG9vcCgpIHsKKyAgICAgICAgcmV0dXJuIG1DbGllbnQtPnRocmVhZExvb3AoKTsKKyAgICB9Cit9OworCisKK010cENsaWVudDo6TXRwQ2xpZW50KCkKKyAgICA6ICAgbVRocmVhZChOVUxMKSwKKyAgICAgICAgbVVzYkhvc3RDb250ZXh0KE5VTEwpLAorICAgICAgICBtRG9uZShmYWxzZSkKK3sKK30KKworTXRwQ2xpZW50Ojp+TXRwQ2xpZW50KCkgeworICAgIHVzYl9ob3N0X2NsZWFudXAobVVzYkhvc3RDb250ZXh0KTsKK30KKworYm9vbCBNdHBDbGllbnQ6OnN0YXJ0KCkgeworICAgIGlmIChtVGhyZWFkKQorICAgICAgICByZXR1cm4gdHJ1ZTsKKworICAgIG1Vc2JIb3N0Q29udGV4dCA9IHVzYl9ob3N0X2luaXQoKTsKKyAgICBpZiAoIW1Vc2JIb3N0Q29udGV4dCkKKyAgICAgICAgcmV0dXJuIGZhbHNlOworCisgICAgbVRocmVhZCA9IG5ldyBNdHBDbGllbnRUaHJlYWQodGhpcyk7CisgICAgbVRocmVhZC0+cnVuKCJNdHBDbGllbnRUaHJlYWQiKTsKKworICAgIHJldHVybiB0cnVlOworfQorCit2b2lkIE10cENsaWVudDo6c3RvcCgpIHsKKyAgICBtRG9uZSA9IHRydWU7Cit9CisKK2Jvb2wgTXRwQ2xpZW50Ojp1c2JEZXZpY2VBZGRlZChjb25zdCBjaGFyICpkZXZuYW1lKSB7CisgICAgc3RydWN0IHVzYl9kZ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0X21hbnVmYWN0dXJlcl9uYW1lKGRldmljZSksCisgICAgICAgICAgICAgICAgICAgICAgICB1c2JfZGV2aWNlX2dldF9wcm9kdWN0X25hbWUoZGV2aWNlKSk7CisKKyAgICAgICAgICAgICAgICAvLyBpbnRlcmZhY2Ugc2hvdWxkIGJlIGZvbGxvd2VkIGJ5IHRocmVlIGVuZHBvaW50cworICAgICAgICAgICAgICAgIHN0cnVjdCB1c2JfZW5kcG9pbnRfZGVzY3JpcHRvciAqZXA7CisgICAgICAgICAgICAgICAgc3RydWN0IHVzYl9lbmRwb2ludF9kZXNjcmlwdG9yICplcF9pbl9kZXNjID0gTlVMTDsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50X2Rlc2NyaXB0b3IgKmVwX291dF9kZXNjID0gTlVMTDsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50X2Rlc2NyaXB0b3IgKmVwX2ludHJfZGVzYyA9IE5VTEw7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCAzOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgZXAgPSAoc3RydWN0IHVzYl9lbmRwb2ludF9kZXNjcmlwdG9yICopdXNiX2Rlc2NyaXB0b3JfaXRlcl9uZXh0KCZpdGVyKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFlcCB8fCBlcC0+YkRlc2NyaXB0b3JUeXBlICE9IFVTQl9EVF9FTkRQT0lOVCkgeworICAgICAgICAgICAgICAgICAgICAgICAgTE9HRSgiZW5kcG9pbnRzIG5vdCBmb3VuZFxuIik7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbURvbmU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGVwLT5ibUF0dHJpYnV0ZXMgPT0gVVNCX0VORFBPSU5UX1hGRVJfQlVMSykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVwLT5iRW5kcG9pbnRBZGRyZXNzICYgVVNCX0VORFBPSU5UX0RJUl9NQVNLKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVwX2luX2Rlc2MgPSBlcDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcF9vdXRfZGVzYyA9IGVwOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVwLT5ibUF0dHJpYnV0ZXMgPT0gVVNCX0VORFBPSU5UX1hGRVJfSU5UICYmCisgICAgICAgICAgICAgICAgICAgICAgICBlcC0+YkVuZHBvaW50QWRkcmVzcyAmIFVTQl9FTkRQT0lOVF9ESVJfTUFTSykgeworICAgICAgICAgICAgICAgICAgICAgICAgZXBfaW50cl9kZXNjID0gZXA7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKCFlcF9pbl9kZXNjIHx8ICFlcF9vdXRfZGVzYyB8fCAhZXBfaW50cl9kZXNjKSB7CisgICAgICAgICAgICAgICAgICAgIExPR0UoImVuZHBvaW50cyBub3QgZm91bmRcbiIpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbURvbmU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgc3RydWN0IHVzYl9lbmRwb2ludCAqZXBfaW4gPSB1c2JfZW5kcG9pbnRfb3BlbihkZXZpY2UsIGVwX2luX2Rlc2MpOworICAgICAgICAgICAgICAgIHN0cnVjdCB1c2JfZW5kcG9pbnQgKmVwX291dCA9IHVzYl9lbmRwb2ludF9vcGVuKGRldmljZSwgZXBfb3V0X2Rlc2MpOworICAgICAgICAgICAgICAgIHN0cnVjdCB1c2JfZW5kcG9pbnQgKmVwX2ludHIgPSB1c2JfZW5kcG9pbnRfb3BlbihkZXZpY2UsIGVwX2ludHJfZGVzYyk7CisKKyAgICAgICAgICAgICAgICBpZiAodXNiX2RldmljZV9jbGFpbV9pbnRlcmZhY2UoZGV2aWNlLCBpbnRlcmZhY2UtPmJJbnRlcmZhY2VOdW1iZXIpKSB7CisgICAgICAgICAgICAgICAgICAgIExPR0UoInVzYl9kZXZpY2VfY2xhaW1faW50ZXJmYWNlIGZhaWxlZFxuIik7CisgICAgICAgICAgICAgICAgICAgIHVzYl9lbmRwb2ludF9jbG9zZShlcF9pbik7CisgICAgICAgICAgICAgICAgICAgIHVzYl9lbmRwb2ludF9jbG9zZShlcF9vdXQpOworICAgICAgICAgICAgICAgICAgICB1c2JfZW5kcG9pbnRfY2xvc2UoZXBfaW50cik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBtRG9uZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBNdHBEZXZpY2UqIG10cERldmljZSA9IG5ldyBNdHBEZXZpY2UoZGV2aWNlLCBpbnRlcmZhY2UtPmJJbnRlcmZhY2VOdW1iZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXBfaW4sIGVwX291dCwgZXBfaW50cik7CisgICAgICAgICAgICAgICAgbURldmljZUxpc3QuYWRkKG10cERldmljZSk7CisgICAgICAgICAgICAgICAgbXRwRGV2aWNlLT5pbml0aWFsaXplKCk7CisgICAgICAgICAgICAgICAgZGV2aWNlQWRkZWQobXRwRGV2aWNlKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gbURvbmU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICB1c2JfZGV2aWNlX2Nsb3NlKGRldmljZSk7CisgICAgcmV0dXJuIG1Eb25lOworfQorCitNdHBEZXZpY2UqIE10cENsaWVudDo6Z2V0RGV2aWNlKGludCBpZCkgeworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbURldmljZUxpc3Quc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBtRGV2aWNlTGlzdFtpXTsKKyAgICAgICAgaWYgKGRldmljZS0+Z2V0SUQoKSA9PSBpZCkKKyAgICAgICAgICAgIHJldHVybiBkZXZpY2U7CisgICAgfQorICAgIHJldHVybiBOVUxMOworfQorCitib29sIE10cENsaWVudDo6dXNiRGV2aWNlUmVtb3ZlZChjb25zdCBjaGFyICpkZXZuYW1lKSB7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtRGV2aWNlTGlzdC5zaXplKCk7IGkrKykgeworICAgICAgICBNdHBEZXZpY2UqIGRldmljZSA9IG1EZXZpY2VMaXN0W2ldOworICAgICAgICBpZiAoIXN0cmNtcChkZXZuYW1lLCBkZXZpY2UtPmdldERldmljZU5hbWUoKSkpIHsKKyAgICAgICAgICAgIGRldmljZVJlbW92ZWQoZGV2aWNlKTsKKyAgICAgICAgICAgIG1EZXZpY2VMaXN0LnJlbW92ZUF0KGkpOworICAgICAgICAgICAgZGVsZXRlIGRldmljZTsKKyAgICAgICAgICAgIExPR0QoIkNhbWVyYSByZW1vdmVkIVxuIik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gbURvbmU7Cit9CisKK2Jvb2wgTXRwQ2xpZW50Ojp0aHJlYWRMb29wKCkgeworICAgIHVzYl9ob3N0X3J1bihtVXNiSG9zdENvbnRleHQsIHVzYl9kZXZpY2VfYWRkZWQsIHVzYl9kZXZpY2VfcmVtb3ZlZCwgdGhpcyk7CisgICAgcmV0dXJuIGZhbHNlOworfQorCitpbnQgTXRwQ2xpZW50Ojp1c2JfZGV2aWNlX2FkZGVkKGNvbnN0IGNoYXIgKmRldm5hbWUsIHZvaWQqIGNsaWVudF9kYXRhKSB7CisgICAgTE9HRCgidXNiX2RldmljZV9hZGRlZCAlc1xuIiwgZGV2bmFtZSk7CisgICAgcmV0dXJuICgoTXRwQ2xpZW50ICopY2xpZW50X2RhdGEpLT51c2JEZXZpY2VBZGRlZChkZXZuYW1lKTsKK30KKworaW50IE10cENsaWVudDo6dXNiX2RldmljZV9yZW1vdmVkKGNvbnN0IGNoYX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T05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKi8KKworI2lmbmRlZiBfTVRQX0NMSUVOVF9ICisjZGVmaW5lIF9NVFBfQ0xJRU5UX0gKKworI2luY2x1ZGUgIk10cFR5cGVzLmgiCisKK3N0cnVjdCB1c2JfaG9zdF9jb250ZXh0OworCituYW1lc3BhY2UgYW5kcm9pZCB7CisKK2NsYXNzIE10cENsaWVudFRocmVhZDsKKworY2xhc3MgTXRwQ2xpZW50IHsKK3ByaXZhdGU6CisgICAgTXRwRGV2aWNlTGlzdCAgICAgICAgICAgICAgIG1EZXZpY2VMaXN0OworICAgIE10cENsaWVudFRocmVhZCogICAgICAgICAgICBtVGhyZWFkOworICAgIHN0cnVjdCB1c2JfaG9zdF9jb250ZXh0KiAgICBtVXNiSG9zdENvbnRleHQ7CisgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgIG1Eb25lOworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwQ2xpZW50KCk7CisgICAgdmlydHVhbCAgICAgICAgICAgICAgICAgfk10cENsaWVudCgpOworCisgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgc3RhcnQoKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgICAgICBzdG9wKCk7CisKKyAgICBpbmxpbmUgTXRwRGV2aWNlTGlzdCYgICBnZXREZXZpY2VMaXN0KCkgeyByZXR1cm4gbURldmljZUxpc3Q7IH0KKyAgICBNdHBEZXZpY2UqICAgICAgICAgICAgICBnZXREZXZpY2UoaW50IGlkKTsKKworCisgICAgdmlydHVhbCB2b2lkICAgICAgICAgICAgZGV2aWNlQWRkZWQoTXRwRGV2aWNlICpk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SEVJR0hUICAgICAgICAgMjA5CisjZGVmaW5lIE9CSkVDVF9JTUFHRV9XSURUSCAgICAgICAgICAyMTAKKyNkZWZpbmUgT0JKRUNUX0lNQUdFX0hFSUdIVCAgICAgICAgIDIxMQorI2RlZmluZSBPQkpFQ1RfSU1BR0VfREVQVEggICAgICAgICAgMjEyCisjZGVmaW5lIE9CSkVDVF9QQVJFTlQgICAgICAgICAgICAgICAyMTMKKyNkZWZpbmUgT0JKRUNUX0FTU09DSUFUSU9OX1RZUEUgICAgIDIxNAorI2RlZmluZSBPQkpFQ1RfQVNTT0NJQVRJT05fREVTQyAgICAgMjE1CisjZGVmaW5lIE9CSkVDVF9TRVFVRU5DRV9OVU1CRVIgICAgICAyMTYKKyNkZWZpbmUgT0JKRUNUX05BTUUgICAgICAgICAgICAgICAgIDIxNworI2RlZmluZSBPQkpFQ1RfREFURV9DUkVBVEVEICAgICAgICAgMjE4CisjZGVmaW5lIE9CSkVDVF9EQVRFX01PRElGSUVEICAgICAgICAyMTkKKyNkZWZpbmUgT0JKRUNUX0tFWVdPUkRTICAgICAgICAgICAgIDIyMAorI2RlZmluZSBPQkpFQ1RfVEhVTUIgICAgICAgICAgICAgICAgMjIxCisKK010cEN1cnNvcjo6TXRwQ3Vyc29yKE10cENsaWVudCogY2xpZW50LCBpbnQgcXVlcnlUeXBlLCBpbnQgZGV2aWNlSUQsCisgICAgICAgICAgICAgICAgaW50IHN0b3JhZ2VJRCwgaW50IG9iamVjdElELCBpbnQgY29sdW1uQ291bnQsIGludCogY29sdW1ucykKKyAgICAgICAgOiAgIG1DbGllbnQoY2xpZW50KSwKKyAgICAgICAgICAgIG1RdWVyeVR5cGUocXVlcnlUeXBlKSwKKyAgICAgICAgICAgIG1EZXZpY2VJRChkZXZpY2VJRCksCisgICAgICAgICAgICBtU3RvcmFnZUlEKHN0b3JhZ2VJRCksCisgICAgICAgICAgICBtUWJqZWN0SUQob2JqZWN0SUQpLAorICAgICAgICAgICAgbUNvbHVtbkNvd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b3csIHN0YXJ0UG9zKTsKKyAgICAgICAgY2FzZSBTVE9SQUdFX0NISUxEUkVOOgorICAgICAgICAgICAgcmV0dXJuIGZpbGxPYmplY3RzKHdpbmRvdywgLTEsIHN0YXJ0UG9zKTsKKyAgICAgICAgY2FzZSBPQkpFQ1RfQ0hJTERSRU46CisgICAgICAgICAgICByZXR1cm4gZmlsbE9iamVjdHMod2luZG93LCBtUWJqZWN0SUQsIHN0YXJ0UG9zKTsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgIExPR0UoIk10cEN1cnNvcjo6ZmlsbFdpbmRvdzogdW5rbm93biBxdWVyeSB0eXBlICVkXG4iLCBtUXVlcnlUeXBlKTsKKyAgICAgICAgICAgIHJldHVybiAwOworICAgIH0KK30KKworaW50IE10cEN1cnNvcjo6ZmlsbERldmljZXMoQ3Vyc29yV2luZG93KiB3aW5kb3csIGludCBzdGFydFBvcykgeworICAgIGludCBjb3VudCA9IDA7CisgICAgTXRwRGV2aWNlTGlzdCYgZGV2aWNlTGlzdCA9IG1DbGllbnQtPmdldERldmljZUxpc3QoKTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGRldmljZUxpc3Quc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBkZXZpY2VMaXN0W2ldOworICAgICAgICBpZiAoZmlsbERldmljZSh3aW5kb3csIGRldmljZSwgc3RhcnRQb3MpKSB7CisgICAgICAgICAgICBjb3VudCsrOworICAgICAgICAgICAgc3RhcnRQb3MrKzsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorICAgIHJldHVybiBjb3VudDsKK30KKworaW50IE10cEN1cnNvcjo6ZmlsbERldmljZShDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKSB7CisgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBtQ2xpZW50LT5nZXREZXZpY2UobURldmljZUlEKTsKKyAgICBpZiAoZGV2aWNlICYmIGZpbGxEZXZpY2Uod2luZG93LCBkZXZpY2UsIHN0YXJ0UG9zKSkKKyAgICAgICAgcmV0dXJuIDE7CisgICAgZWxzZQorICAgICAgICByZXR1cm4gMDsKK30KKworaW50IE10cEN1cnNvcjo6ZmlsbFN0b3JhZ2VzKEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgc3RhcnRQb3MpIHsKKyAgICBpbnQgY291bnQgPSAwOworICAgIE10cERldmljZSogZGV2aWNlID0gbUNsaWVudC0+Z2V0RGV2aWNlKG1EZXZpY2VJRCk7CisgICAgaWYgKCFkZXZpY2UpCisgICAgICAgIHJldHVybiAwOworICAgIE10cFN0b3JhZ2VJRExpc3QqIHN0b3JhZ2VJRHMgPSBkZXZpY2UtPmdldFN0b3JhZ2VJRHMoKTsKKyAgICBpZiAoIXN0b3JhZ2VJRHMpCisgICAgICAgIHJldHVybiAwOworCisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBzdG9yYWdlSURzLT5zaXplKCk7IGkrKykgeworICAgICAgICBNdHBTdG9yYWdlSUQgc3RvcmFnZUlEID0gKCpzdG9yYWdlSURzKVtpXTsKKyAgICAgICAgaWYgKGZpbGxTdG9yYWdlKHdpbmRvdywgZGV2aWNlLCBzdG9yYWdlSUQsIHN0YXJ0UG9zKSkgeworICAgICAgICAgICAgY291bnQrKzsKKyAgICAgICAgICAgIHN0YXJ0UG9zKys7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgICBkZWxldGUgc3RvcmFnZUlEczsKKyAgICByZXR1cm4gY291bnQ7Cit9CisKK2ludCBNdHBDdXJzb3I6OmZpbGxTdG9yYWdlKEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgc3RhcnRQb3MpIHsKKyAgICBNdHBEZXZpY2UqIGRldmljZSA9IG1DbGllbnQtPmdldERldmljZShtRGV2aWNlSUQpOworICAgIGlmIChkZXZpY2UgJiYgZmlsbFN0b3JhZ2Uod2luZG93LCBkZXZpY2UsIG1TdG9yYWdlSUQsIHN0YXJ0UG9zKSkKKyAgICAgICAgcmV0dXJuIDE7CisgICAgZWxzZQorICAgICAgICByZXR1cm4gMDsKK30KKworaW50IE10cEN1cnNvcjo6ZmlsbE9iamVjdHMoQ3Vyc29yV2luZG93KiB3aW5kb3csIGludCBwYXJlbnQsIGludCBzdGFydFBvcykgeworICAgIGludCBjb3VudCA9IDA7CisgICAgTXRwRGV2aWNlKiBkZXZpY2UgPSBtQ2xpZW50LT5nZXREZXZpY2UobURldmljZUlEKTsKKyAgICBpZiAoIWRldmljZSkKKyAgICAgICAgcmV0dXJuIDA7CisgICAgTXRwT2JqZWN0SGFuZGxlTGlzdCogaGFuZGxlcyA9IGRldmljZS0+Z2V0T2JqZWN0SGFuZGxlcyhtU3RvcmFnZUlELCAwLCBwYXJlbnQpOworICAgIGlmICghaGFuZGxlcykKKyAgICAgICAgcmV0dXJuIDA7CisKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGhhbmRsZXMtPnNpemUoKTsgaSsrKSB7CisgICAgICAgIE10cE9iamVjdEhhbmRsZSBoYW5kbGUgPSAoKmhhbmRsZXMpW2ldOworICAgICAgICBpZiAoZmlsbE9iamVjdCh3aW5kb3csIGRldmljZSwgaGFuZGxlLCBzdGFydFBvcykpIHsKKyAgICAgICAgICAgIGNvdW50Kys7CisgICAgICAgICAgICBzdGFydFBvcysrOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisgICAgZGVsZXRlIGhhbmRsZXM7CisgICAgcmV0dXJuIGNvdW50OworfQorCitpbnQgTXRwQ3Vyc29yOjpmaWxsT2JqZWN0KEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgc3RhcnRQb3MpIHsKKyAgICBNdHBEZXZpY2UqIGRldmljZSA9IG1DbGllbnQtPmdldERldmljZShtRGV2aWNlSUQpOworICAgIGlmIChkZXZpY2UgJiYgZmlsbE9iamVjdCh3aW5kb3csIGRldmljZSwgbVFiamVjdElELCBzdGFydFBvcykpCisgICAgICAgIHJldHVybiAxOworICAgIGVsc2UKKyAgICAgICAgcmV0dXJuIDA7Cit9CisKK2Jvb2wgTXRwQ3Vyc29yOjpmaWxsRGV2aWNlKEN1cnNvcldpbmRvdyogd2luZG93LCBNdHBEZXZpY2UqIGRldmljZSwgaW50IHJvdykgeworICAgIE10cERldmljZUluZm8qIGRldmljZUluZm8gPSBkZXZpY2UtPmdldERldmljZUluZm8oKTsKKyAgICBpZiAoIWRldmljZUluZm8pCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICBpZiAoIXByZXBhcmVSb3cod2luZG93KSkKKyAgICAgICAgcmV0dXJuIGZhbHNlOworCisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtQ29sdW1uQ291bnQ7IGkrKykgeworICAgICAgICBzd2l0Y2ggKG1Db2x1bW5zW2ldKSB7CisgICAgICAgICAgICBjYXNlIERFVklDRV9ST1dfSUQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgZGV2aWNlLT5nZXRJRCgpLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBERVZJQ0VfTUFOVUZBQ1RVUkVSOgorICAgICAgICAgICAgICAgIGlmICghcHV0U3RyaW5nKHdpbmRvdywgZGV2aWNlSW5mby0+bU1hbnVmYWN0dXJlciwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgREVWSUNFX01PREVMOgorICAgICAgICAgICAgICAgIGlmICghcHV0U3RyaW5nKHdpbmRvdywgZGV2aWNlSW5mby0+bU1vZGVsLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBMT0dFKCJmaWxsRGV2aWNlOiB1bmtub3duIGNvbHVtbiAlZFxuIiwgbUNvbHVtbnNbaV0pOworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiB0cnVlOworfQorCitib29sIE10cEN1cnNvcjo6ZmlsbFN0b3JhZ2UoQ3Vyc29yV2luZG93KiB3aW5kb3csIE10cERldmljZSogZGV2aWNlLAorICAgICAgICBNdHBTdG9yYWdlSUQgc3RvcmFnZUlELCBpbnQgcm93KSB7CisKK0xPR0QoImZpbGxTdG9yYWdlICVkXG4iLCBzdG9yYWdlSUQpOworCisgICAgTXRwU3RvcmFnZUluZm8qIHN0b3JhZ2VJbmZvID0gZGV2aWNlLT5nZXRTdG9yYWdlSW5mbyhzdG9yYWdlSUQpOworICAgIGlmICghc3RvcmFnZUluZm8pCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICBpZiAoIXByZXBhcmVSb3cod2luZG93KSkgeworICAgICAgICBkZWxldGUgc3RvcmFnZUluZm87CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBjb25zdCBjaGFyKiB0ZXh0OworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbUNvbHVtbkNvdW50OyBpKyspIHsKKyAgICAgICAgc3dpdGNoIChtQ29sdW1uc1tpXSkgeworICAgICAgICAgICAgY2FzZSBTVE9SQUdFX1JPV19JRDoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBzdG9yYWdlSUQsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIFNUT1JBR0VfSURFTlRJRklFUjoKKyAgICAgICAgICAgICAgICB0ZXh0ID0gc3RvcmFnZUluZm8tPm1Wb2x1bWVJZGVudGlmaWVyOworICAgICAgICAgICAgICAgIGlmICghdGV4dCB8fCAhdGV4dFswXSkKKyAgICAgICAgICAgICAgICAgICAgdGV4dCA9ICJDYW1lcmEgU3RvcmFnZSI7CisgICAgICAgICAgICAgICAgaWYgKCFwdXRTdHJpbmcod2luZG93LCB0ZXh0LCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBTVE9SQUdFX0RFU0NSSVBUSU9OOgorICAgICAgICAgICAgICAgIHRleHQgPSBzdG9yYWdlSW5mby0+bVN0b3JhZ2VEZXNjcmlwdGlvbjsKKyAgICAgICAgICAgICAgICBpZiAoIXRleHQgfHwgIXRleHRbMF0pCisgICAgICAgICAgICAgICAgICAgIHRleHQgPSAiU3RvcmFnZSBEZXNjcmlwdGlvbiI7CisgICAgICAgICAgICAgICAgaWYgKCFwdXRTdHJpbmcod2luZG93LCB0ZXh0LCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBMT0dFKCJmaWxsU3RvcmFnZTogdW5rbm93biBjb2x1bW4gJWRcbiIsIG1Db2x1bW5zW2ldKTsKKyAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBkZWxldGUgc3RvcmFnZUluZm87CisgICAgcmV0dXJuIHRydWU7CisKK2ZhaWw6CisgICAgZGVsZXRlIHN0b3JhZ2VJbmZvOworICAgIHJldHVybiBmYWxzZTsKK30KKworYm9vbCBNdHBDdXJzb3I6OmZpbGxPYmplY3QoQ3Vyc29yV2luZG93KiB3aW5kb3csIE10cERldmljZSogZGV2aWNlLAorICAgICAgICBNdHBPYmplY3RIYW5kbGUgb2JqZWN0SUQsIGludCByb3cpIHsKKworICAgIE10cE9iamVjdEluZm8qIG9iamVjdEluZm8gPSBkZXZpY2UtPmdldE9iamVjdEluZm8ob2JqZWN0SUQpOworICAgIGlmICghb2JqZWN0SW5mbykKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIC8vIG9iamVjdEluZm8tPnByaW50KCk7CisgICAgaWYgKCFwcmVwYXJlUm93KHdpbmRvdykpIHsKKyAgICAgICAgZGVsZXRlIG9iamVjdEluZm87CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IG1Db2x1bW5Db3VudDsgaSsrKSB7CisgICAgICAgIHN3aXRjaCAobUNvbHVtbnNbaV0pIHsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX1JPV19JRDoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBvYmplY3RJRCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX1NUT1JBR0VfSUQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bVN0b3JhZ2VJRCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX0ZPUk1BVDoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBvYmplY3RJbmZvLT5tRm9ybWF0LCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfUFJPVEVDVElPTl9TVEFUVVM6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bVByb3RlY3Rpb25TdGF0dXMsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9TSVpFOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1Db21wcmVzc2VkU2l6ZSwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX1RIVU1CX0ZPUk1BVDoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBvYmplY3RJbmZvLT5tVGh1bWJGb3JtYXQsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9USFVNQl9TSVpFOgorICAgICAgICAgICAgICAgIGlmICghcHV0TG9uZyh3aW5kb3csIG9iamVjdEluZm8tPm1UaHVtYkNvbXByZXNzZWRTaXplLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfVEhVTUJfV0lEVEg6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bVRodW1iUGl4V2lkdGgsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9USFVNQl9IRUlHSFQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bVRodW1iUGl4SGVpZ2h0LCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfSU1BR0VfV0lEVEg6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bUltYWdlUGl4V2lkdGgsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9JTUFHRV9IRUlHSFQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bUltYWdlUGl4SGVpZ2h0LCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfSU1BR0VfREVQVEg6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bUltYWdlUGl4RGVwdGgsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9QQVJFTlQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bVBhcmVudCwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX0FTU09DSUFUSU9OX1RZUEU6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bUFzc29jaWF0aW9uVHlwZSwgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX0FTU09DSUFUSU9OX0RFU0M6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bUFzc29jaWF0aW9uRGVzYywgcm93LCBpKSkKKyAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOworICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgT0JKRUNUX1NFUVVFTkNFX05VTUJFUjoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBvYmplY3RJbmZvLT5tU2VxdWVuY2VOdW1iZXIsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9OQU1FOgorICAgICAgICAgICAgICAgIGlmICghcHV0U3RyaW5nKHdpbmRvdywgb2JqZWN0SW5mby0+bU5hbWUsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9EQVRFX0NSRUFURUQ6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRMb25nKHdpbmRvdywgb2JqZWN0SW5mby0+bURhdGVDcmVhdGVkLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfREFURV9NT0RJRklFRDoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dExvbmcod2luZG93LCBvYmplY3RJbmZvLT5tRGF0ZU1vZGlmaWVkLCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBPQkpFQ1RfS0VZV09SRFM6CisgICAgICAgICAgICAgICAgaWYgKCFwdXRTdHJpbmcod2luZG93LCBvYmplY3RJbmZvLT5tS2V5d29yZHMsIHJvdywgaSkpCisgICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIE9CSkVDVF9USFVNQjoKKyAgICAgICAgICAgICAgICBpZiAoIXB1dFRodW1ibmFpbCh3aW5kb3csIG9iamVjdElELCByb3csIGkpKQorICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIExPR0UoImZpbGxTdG9yYWdlOiB1bmtub3duIGNvbHVtbiAlZFxuIiwgbUNvbHVtbnNbaV0pOworICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIGRlbGV0ZSBvYmplY3RJbmZvOworICAgIHJldHVybiB0cnVlOworCitmYWlsOgorICAgIGRlbGV0ZSBvYmplY3RJbmZvOworICAgIHJldHVybiBmYWxzZTsKK30KKworYm9vbCBNdHBDdXJzb3I6OnByZXBhcmVSb3coQ3Vyc29yV2luZG93KiB3aW5kb3cpIHsKKyAgICBpZiAoIXdpbmRvdy0+c2V0TnVtQ29sdW1ucyhtQ29sdW1uQ291bnQpKSB7CisgICAgICAgIExPR0UoIkZhaWxlZCB0byBjaGFuZ2UgY29sdW1uIGNvdW50IGZyb20gJWQgdG8gJWQiLCB3aW5kb3ctPmdldE51bUNvbHVtbnMoKSwgbUNvbHVtbkNvdW50KTsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICBmaWVsZF9zbG90X3QgKiBmaWVsZERpciA9IHdpbmRvdy0+YWxsb2NSb3coKTsKKyAgICBpZiAoIWZpZWxkRGlyKSB7CisgICAgICAgIExPR0UoIkZhaWxlZCBhbGxvY2F0aW5nIGZpZWx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B3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKi8KKworI2lmbmRlZiBfTVRQX0NVUlNPUl9ICisjZGVmaW5lIF9NVFBfQ1VSU09SX0gKKworI2luY2x1ZGUgIk10cFR5cGVzLmgiCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworY2xhc3MgQ3Vyc29yV2luZG93OworCitjbGFzcyBNdHBDdXJzb3IgeworcHJpdmF0ZToKKyAgICBlbnVtIHsKKyAgICAgICAgREVWSUNFICAgICAgICAgICAgICA9IDEsCisgICAgICAgIERFVklDRV9JRCAgICAgICAgICAgPSAyLAorICAgICAgICBTVE9SQUdFICAgICAgICAgICAgID0gMywKKyAgICAgICAgU1RPUkFHRV9JRCAgICAgICAgICA9IDQsCisgICAgICAgIE9CSkVDVCAgICAgICAgICAgICAgPSA1LAorICAgICAgICBPQkpFQ1RfSUQgICAgICAgICAgID0gNiwKKyAgICAgICAgU1RPUkFHRV9DSElMRFJFTiAgICA9IDcsCisgICAgICAgIE9CSkVDVF9DSElMRFJFTiAgICAgPSA4LAorICAgIH07CisKKyAgICBNdHBDbGllbnQqICBtQ2xpZW50OworICAgIGludCAgICAgICAgIG1RdWVyeVR5cGU7CisgICAgaW50ICAgICAgICAgbURldmljZUlEOworICAgIGludCAgICAgICAgIG1TdG9yYWdlSUQ7CisgICAgaW50ICAgICAgICAgbVFiamVjdElEOworICAgIGludCAgICAgICAgIG1Db2x1bW5Db3VudDsKKyAgICBpbnQqICAgICAgICBtQ29sdW1uczsKKworcHVibGljOgorICAgICAgICAgICAgICAgIE10cEN1cnNvcihNdHBDbGllbnQqIGNsaWVudCwgaW50IHF1ZXJ5VHlwZSwgaW50IGRldmljZUlELAorICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0b3JhZ2VJRCwgaW50IG9iamVjdElELCBpbnQgY29sdW1uQ291bnQsIGludCogY29sdW1ucyk7CisgICAgdmlydHVhbCAgICAgfk10cEN1cnNvcigpOworCisgICAgaW50ICAgICAgICAgZmlsbFdpbmRvdyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKTsKKworcHJpdmF0ZToKKyAgICBpbnQgICAgICAgICBmaWxsRGV2aWNlcyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKTsKKyAgICBpbnQgICAgICAgICBmaWxsRGV2aWNlKEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgc3RhcnRQb3MpOworICAgIGludCAgICAgICAgIGZpbGxTdG9yYWdlcyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKTsKKyAgICBpbnQgICAgICAgICBmaWxsU3RvcmFnZShDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHN0YXJ0UG9zKTsKKyAgICBpbnQgICAgICAgICBmaWxsT2JqZWN0cyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHBhcmVudCwgaW50IHN0YXJ0UG9zKTsKKyAgICBpbnQgICAgICAgICBmaWxsT2JqZWN0KEN1cnNvcldpbmRvdyogd2luZG93LCBpbnQgc3RhcnRQb3MpOworCisgICAgYm9vbCAgICAgICAgZmlsbERldmljZShDdXJzb3JXaW5kb3cqIHdpbmRvdywgTXRwRGV2aWNlKiBkZXZpY2UsIGludCBzdGFydFBvcyk7CisgICAgYm9vbCAgICAgICAgZmlsbFN0b3JhZ2UoQ3Vyc29yV2luZG93KiB3aW5kb3csIE10cERldmljZSogZGV2aWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCwgaW50IHJvdyk7CisgICAgYm9vbCAgICAgICAgZmlsbE9iamVjdChDdXJzb3JXaW5kb3cqIHdpbmRvdywgTXRwRGV2aWNlKiBkZXZpY2UsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RIYW5kbGUgb2JqZWN0SUQsIGludCByb3cpOworCisgICAgYm9vbCAgICAgICAgcHJlcGFyZVJvdyhDdXJzb3JXaW5kb3cqIHdpbmRvdyk7CisgICAgYm9vbCAgICAgICAgcHV0TG9uZyhDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IHZhbHVlLCBpbnQgcm93LCBpbnQgY29sdW1uKTsKKyAgICBib29sICAgICAgICBwdXRTdHJpbmcoQ3Vyc29yV2luZG93KiB3aW5kb3csIGNvbnN0IGNoYXIqIHRleHQsIGludCByb3csIGludCBjb2x1bW4pOworICAgIGJvb2wgICAgICAgIHB1dFRodW1ibmFpbChDdXJzb3JXaW5kb3cqIHdpbmRvdywgaW50IG9iamVjdElELCBpbnQgcm93LCBpbnQgY29sdW1uKTsKK307CisKK307IC8vIG5hbWVzcGFjZSBhbmRyb2lkCisKKyNlbmRpZiAvLyBfTVRQX0NVUlNPUl9ICmRpZmYgLS1naXQgYS9tZWRpYS9tdHAvTXRwRGF0YVBhY2tldC5jcHAgYi9tZWRpYS9tdHAvTXRwRGF0YVBhY2tldC5jcHAKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYTdlOTc1YwotLS0gL2Rldi9udWxsCisrKyBiL21lZGlhL210cC9NdHBEYXRhUGFja2V0LmNwcApAQCAtMCwwICsxLDQxMSBAQAorLyoKKyAqIENvcHlyaWdodCAoQykgMjAxMCBUaGUgQW5kcm9pZCBPcGVuIFNvdXJjZSBQcm9qZWN0CisgKgor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KSk7CisgICAgcmV0dXJuIHJlc3VsdDsKK30KKworSW50MzJMaXN0KiBNdHBEYXRhUGFja2V0OjpnZXRBSW50MzIoKSB7CisgICAgSW50MzJMaXN0KiByZXN1bHQgPSBuZXcgSW50MzJMaXN0OworICAgIGludCBjb3VudCA9IGdldFVJbnQzMigpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcmVzdWx0LT5wdXNoKGdldEludDMyKCkpOworICAgIHJldHVybiByZXN1bHQ7Cit9CisKK1VJbnQzMkxpc3QqIE10cERhdGFQYWNrZXQ6OmdldEFVSW50MzIoKSB7CisgICAgVUludDMyTGlzdCogcmVzdWx0ID0gbmV3IFVJbnQzMkxpc3Q7CisgICAgaW50IGNvdW50ID0gZ2V0VUludDMyKCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICByZXN1bHQtPnB1c2goZ2V0VUludDMyKCkpOworICAgIHJldHVybiByZXN1bHQ7Cit9CisKK0ludDY0TGlzdCogTXRwRGF0YVBhY2tldDo6Z2V0QUludDY0KCkgeworICAgIEludDY0TGlzdCogcmVzdWx0ID0gbmV3IEludDY0TGlzdDsKKyAgICBpbnQgY291bnQgPSBnZXRVSW50MzIoKTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAgICAgIHJlc3VsdC0+cHVzaChnZXRJbnQ2NCgpKTsKKyAgICByZXR1cm4gcmVzdWx0OworfQorCitVSW50NjRMaXN0KiBNdHBEYXRhUGFja2V0OjpnZXRBVUludDY0KCkgeworICAgIFVJbnQ2NExpc3QqIHJlc3VsdCA9IG5ldyBVSW50NjRMaXN0OworICAgIGludCBjb3VudCA9IGdldFVJbnQzMigpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcmVzdWx0LT5wdXNoKGdldFVJbnQ2NCgpKTsKKyAgICByZXR1cm4gcmVzdWx0OworfQorCit2b2lkIE10cERhdGFQYWNrZXQ6OnB1dEludDgoaW50OF90IHZhbHVlKSB7CisgICAgYWxsb2NhdGUobU9mZnNldCArIDEpOworICAgIG1CdWZmZXJbbU9mZnNldCsrXSA9ICh1aW50OF90KXZhbHVlOworICAgIGlmIChtUGFja2V0U2l6ZSA8IG1PZmZzZXQpCisgICAgICAgIG1QYWNrZXRTaXplID0gbU9mZnNldDsKK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRVSW50OCh1aW50OF90IHZhbHVlKSB7CisgICAgYWxsb2NhdGUobU9mZnNldCArIDEpOworICAgIG1CdWZmZXJbbU9mZnNldCsrXSA9ICh1aW50OF90KXZhbHVlOworICAgIGlmIChtUGFja2V0U2l6ZSA8IG1PZmZzZXQpCisgICAgICAgIG1QYWNrZXRTaXplID0gbU9mZnNldDsKK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRJbnQxNihpbnQxNl90IHZhbHVlKSB7CisgICAgYWxsb2NhdGUobU9mZnNldCArIDIpOworICAgIG1CdWZmZXJbbU9mZnNldCsrXSA9ICh1aW50OF90KSh2YWx1ZSAmIDB4RkYpOworICAgIG1CdWZmZXJbbU9mZnNldCsrXSA9ICh1aW50OF90KSgodmFsdWUgPj4gOCkgJiAweEZGKTsKKyAgICBpZiAobVBhY2tldFNpemUgPCBtT2Zmc2V0KQorICAgICAgICBtUGFja2V0U2l6ZSA9IG1PZmZzZXQ7Cit9CisKK3ZvaWQgTXRwRGF0YVBhY2tldDo6cHV0VUludDE2KHVpbnQxNl90IHZhbHVlKSB7CisgICAgYWxsb2NhdGUobU9mZnNldCArIDIpOworICAgIG1CdWZmZXJbbU9mZnNldCsrXSA9ICh1aW50OF90KSh2YWx1ZSAmIDB4RkYpOworICAgIG1CdWZmZXJbbU9mZnNldCsrXSA9ICh1aW50OF90KSgodmFsdWUgPj4gOCkgJiAweEZGKTsKKyAgICBpZiAobVBhY2tldFNpemUgPCBtT2Zmc2V0KQorICAgIC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KHZhbHVlID4+IDI0KSAmIDB4RkYpOworICAgIG1CdWZmZXJbbU9mZnNldCsrXSA9ICh1aW50OF90KSgodmFsdWUgPj4gMzIpICYgMHhGRik7CisgICAgbUJ1ZmZlclttT2Zmc2V0KytdID0gKHVpbnQ4X3QpKCh2YWx1ZSA+PiA0MCkgJiAweEZGKTsKKyAgICBtQnVmZmVyW21PZmZzZXQrK10gPSAodWludDhfdCkoKHZhbHVlID4+IDQ4KSAmIDB4RkYpOworICAgIG1CdWZmZXJbbU9mZnNldCsrXSA9ICh1aW50OF90KSgodmFsdWUgPj4gNTYpICYgMHhGRik7CisgICAgaWYgKG1QYWNrZXRTaXplIDwgbU9mZnNldCkKKyAgICAgICAgbVBhY2tldFNpemUgPSBtT2Zmc2V0OworfQorCit2b2lkIE10cERhdGFQYWNrZXQ6OnB1dEludDEyOChjb25zdCBpbnQxMjhfdCYgdmFsdWUpIHsKKyAgICBwdXRJbnQzMih2YWx1ZVswXSk7CisgICAgcHV0SW50MzIodmFsdWVbMV0pOworICAgIHB1dEludDMyKHZhbHVlWzJdKTsKKyAgICBwdXRJbnQzMih2YWx1ZVszXSk7Cit9CisKK3ZvaWQgTXRwRGF0YVBhY2tldDo6cHV0VUludDEyOChjb25zdCB1aW50MTI4X3QmIHZhbHVlKSB7CisgICAgcHV0VUludDMyKHZhbHVlWzBdKTsKKyAgICBwdXRVSW50MzIodmFsdWVbMV0pOworICAgIHB1dFVJbnQzMih2YWx1ZVsyXSk7CisgICAgcHV0VUludDMyKHZhbHVlWzNdKTsKK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRBSW50OChjb25zdCBpbnQ4X3QqIHZhbHVlcywgaW50IGNvdW50KSB7CisgICAgcHV0VUludDMyKGNvdW50KTsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAgICAgIHB1dEludDgoKnZhbHVlcysrKTsKK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRBVUludDgoY29uc3QgdWludDhfdCogdmFsdWVzLCBpbnQgY291bnQpIHsKKyAgICBwdXRVSW50MzIoY291bnQpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcHV0VUludDgoKnZhbHVlcysrKTsKK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRBSW50MTYoY29uc3QgaW50MTZfdCogdmFsdWVzLCBpbnQgY291bnQpIHsKKyAgICBwdXRVSW50MzIoY291bnQpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcHV0SW50MTYoKnZhbHVlcysrKTsKK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRBVUludDE2KGNvbnN0IHVpbnQxNl90KiB2YWx1ZXMsIGludCBjb3VudCkgeworICAgIHB1dFVJbnQzMihjb3VudCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICBwdXRVSW50MTYoKnZhbHVlcysrKTsKK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRBSW50MzIoY29uc3QgaW50MzJfdCogdmFsdWVzLCBpbnQgY291bnQpIHsKKyAgICBwdXRVSW50MzIoY291bnQpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcHV0SW50MzIoKnZhbHVlcysrKTsKK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRBVUludDMyKGNvbnN0IHVpbnQzMl90KiB2YWx1ZXMsIGludCBjb3VudCkgeworICAgIHB1dFVJbnQzMihjb3VudCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICBwdXRVSW50MzIoKnZhbHVlcysrKTsKK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRBVUludDMyKGNvbnN0IFVJbnQzMkxpc3QqIGxpc3QpIHsKKyAgICBpZiAoIWxpc3QpIHsKKyAgICAgICAgcHV0RW1wdHlBcnJheSgpOworICAgIH0gZWxzZSB7CisgICAgICAgIHNpemVfdCBzaXplID0gbGlzdC0+c2l6ZSgpOworICAgICAgICBwdXRVSW50MzIoc2l6ZSk7CisgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgc2l6ZTsgaSsrKQorICAgICAgICAgICAgcHV0VUludDMyKCgqbGlzdClbaV0pOworICAgIH0KK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRBSW50NjQoY29uc3QgaW50NjRfdCogdmFsdWVzLCBpbnQgY291bnQpIHsKKyAgICBwdXRVSW50MzIoY291bnQpOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKKyAgICAgICAgcHV0SW50NjQoKnZhbHVlcysrKTsKK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRBVUludDY0KGNvbnN0IHVpbnQ2NF90KiB2YWx1ZXMsIGludCBjb3VudCkgeworICAgIHB1dFVJbnQzMihjb3VudCk7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQorICAgICAgICBwdXRVSW50NjQoKnZhbHVlcysrKTsKK30KKwordm9pZCBNdHBEYXRhUGFja2V0OjpwdXRTdHJpbmcoY29uc3QgTXRwU3RyaW5nQnVmZmVyJiBzdHJpbmcpCit7CisgICAgc3RyaW5nLndyaXRlVG9QYWNrZXQodGhpcyk7Cit9CisKK3ZvaWQgTXRwRGF0YVBhY2tldDo6cHV0U3RyaW5nKGNvbnN0IGNoYXIqIHMpCit7CisgICAgTXRwU3RyaW5nQnVmZmVyIHN0cmluZyhzKTsKKyAgICBzdHJpbmcud3JpdGVUb1BhY2tldCh0aGlzKTsKK30KKworI2lmZGVmIE1UUF9ERVZJQ0UgCitpbnQgTXRwRGF0YVBhY2tldDo6cmVhZChpbnQgZmQpIHsKKyAgICAvLyBmaXJzdCByZWFkIHRoZSBoZWFkZXIKKyAgICBpbnQgcmV0ID0gOjpyZWFkKGZ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NsdWRlICJtdHAuaCIKKworbmFtZXNwYWNlIGFuZHJvaWQgeworCitjbGFzcyBNdHBEYXRhUGFja2V0IDogcHVibGljIE10cFBhY2tldCB7Citwcml2YXRlOgorICAgIC8vIGN1cnJlbnQgb2Zmc2V0IGZvciBnZXQvcHV0IG1ldGhvZHMKKyAgICBpbnQgICAgICAgICAgICAgICAgIG1PZmZzZXQ7CisKK3B1YmxpYzoKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cERhdGFQYWNrZXQoKTsKKyAgICB2aXJ0dWFsICAgICAgICAgICAgIH5NdHBEYXRhUGFja2V0KCk7CisKKyAgICB2aXJ0dWFsIHZvaWQgICAgICAgIHJlc2V0KCk7CisKKyAgICB2b2lkICAgICAgICAgICAgICAgIHNldE9wZXJhdGlvbkNvZGUoTXRwT3BlcmF0aW9uQ29kZSBjb2RlKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHNldFRyYW5zYWN0aW9uSUQoTXRwVHJhbnNhY3Rpb25JRCBpZCk7CisKKyAgICBpbmxpbmUgdWludDhfdCAgICAgIGdldFVJbnQ4KCkgeyByZXR1cm4gKHVpbnQ4X3QpbUJ1ZmZlclttT2Zmc2V0KytdOyB9CisgICAgaW5saW5lIGludDhfdCAgICAgICBnZXRJbnQ4KCkgeyByZXR1cm4gKGludDhfdCltQnVmZmVyW21PZmZzZXQrK107IH0KKyAgICB1aW50MTZfdCAgICAgICAgICAgIGdldFVJbnQxNigpOworICAgIGlubGluZSBpbnQxNl90ICAgICAgZ2V0SW50MTYoKSB7IHJldHVybiAoaW50MTZfdClnZXRVSW50MTYoKTsgfQorICAgIHVpbnQzMl90ICAgICAgICAgICAgZ2V0VUludDMyKCk7CisgICAgaW5saW5lIGludDMyX3QgICAgICBnZXRJbnQzMigpIHsgcmV0dXJuIChpbnQzMl90KWdldFVJbnQzMigpOyB9CisgICAgdWludDY0X3QgICAgICAgICAgICBnZXRVSW50NjQoKTsKKyAgICBpbmxpbmUgaW50NjRfdCAgICAgIGdldEludDY0KCkgeyByZXR1cm4gKGludDY0X3QpZ2V0VUludDY0KCk7IH0KKyAgICB2b2lkICAgICAgICAgICAgICAgIGdldFVJbnQxMjgodWludDEyOF90JiB2YWx1ZSk7CisgICAgaW5saW5lIHZvaWQgICAgICAgICBnZXRJbnQxMjgoaW50MTI4X3QmIHZhbHVlKSB7IGdldFVJbnQxMjgoKHVpbnQxMjhfdCYpdmFsdWUpOyB9CisgICAgdm9pZCAgICAgICAgICAgICAgICBnZXRTdHJpbmcoTXRwU3RyaW5nQnVmZmVyJiBzdHJpbmcpOworCisgICAgSW50OExpc3QqICAgICAgICAgICBnZXRBSW50OCgpOworICAgIFVJbnQ4TGlzdCogICAgICAgICAgZ2V0QVVJbnQ4KCk7CisgICAgSW50MTZMaXN0KiAgICAgICAgICBnZXRBSW50MTYoKTsKKyAgICBVSW50MTZMaXN0KiAgICAgICAgIGdldEFVSW50MTYoKTsKKyAgICBJbnQzMkxpc3QqICAgICAgICAgIGdldEFJbnQzMigpOworICAgIFVJbnQzMkxpc3QqICAgICAgICAgZ2V0QVVJbnQzMigpOworICAgIEludDY0TGlzdCogICAgICAgICAgZ2V0QUludDY0KCk7CisgICAgVUludDY0TGlzdCogICAgICAgICBnZXRBVUludDY0KCk7CisKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEludDgoaW50OF90IHZhbHVlKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dFVJbnQ4KHVpbnQ4X3QgdmFsdWUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0SW50MTYoaW50MTZfdCB2YWx1ZSk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRVSW50MTYodWludDE2X3QgdmFsdWUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0SW50MzIoaW50MzJfdCB2YWx1ZSk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRVSW50MzIodWludDMyX3QgdmFsdWUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0SW50NjQoaW50NjRfdCB2YWx1ZSk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRVSW50NjQodWludDY0X3QgdmFsdWUpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0SW50MTI4KGNvbnN0IGludDEyOF90JiB2YWx1ZSk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRVSW50MTI4KGNvbnN0IHVpbnQxMjhfdCYgdmFsdWUpOworCisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRBSW50OChjb25zdCBpbnQ4X3QqIHZhbHVlcywgaW50IGNvdW50KTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEFVSW50OChjb25zdCB1aW50OF90KiB2YWx1ZXMsIGludCBjb3VudCk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRBSW50MTYoY29uc3QgaW50MTZfdCogdmFsdWVzLCBpbnQgY291bnQpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0QVVJbnQxNihjb25zdCB1aW50MTZfdCogdmFsdWVzLCBpbnQgY291bnQpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0QUludDMyKGNvbnN0IGludDMyX3QqIHZhbHVlcywgaW50IGNvdW50KTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEFVSW50MzIoY29uc3QgdWludDMyX3QqIHZhbHVlcywgaW50IGNvdW50KTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEFVSW50MzIoY29uc3QgVUludDMyTGlzdCogbGlzdCk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBwdXRBSW50NjQoY29uc3QgaW50NjRfdCogdmFsdWVzLCBpbnQgY291bnQpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0QVVJbnQ2NChjb25zdCB1aW50NjRfdCogdmFsdWVzLCBpbnQgY291bnQpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0U3RyaW5nKGNvbnN0IE10cFN0cmluZ0J1ZmZlciYgc3RyaW5nKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIHB1dFN0cmluZyhjb25zdCBjaGFyKiBzdHJpbmcpOworICAgIGlubGluZSB2b2lkICAgICAgICAgcHV0RW1wdHlTdHJpbmcoKSB7IHB1dFVJbnQxNigwKTsgfQorICAgIGlubGluZSB2b2lkICAgICAgICAgcHV0RW1wdHlBcnJheSgpIHsgcHV0VUludDMyKDApOyB9CisKKworI2lmZGVmIE1UUF9ERVZJQ0UKKyAgICAvLyBmaWxsIG91ciBidWZmZXIgd2l0aCBkYXRhIGZyb20gdGhlIGdpdmVuIGZpbGUgZGVzY3JpcHRvcgorICAgIGludCAgICAgICAgICAgICAgICAgcmVhZChpbnQgZmQpOworICAgIGludCAgICAgICAgICAgICAgICAgcmVhZERhdGFIZWFkZXIoaW50IGZkKTsKKworICAgIC8vIHdyaXRlIG91ciBkYXRhIHRvIHRoZSBnaXZlbiBmaWxlIGRlc2NyaXB0b3IKKyAgICBpbnQgICAgICAgICAgICAgICAgIHdyaXRlKGludCBmZCk7CisgICAgaW50ICAgICAgICAgICAgICAgICB3cml0ZURhdGFIZWFkZXIoaW50IGZkLCB1aW50MzJfdCBsZW5ndGgpOworI2VuZGlmCisKKyNpZmRlZiBNVFBfSE9TVAorICAgIGludCAgICAgICAgICAgICAgICAgcmVhZChzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcCk7CisgICAgaW50ICAgICAgICAgICAgICAgICB3cml0ZShzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcCk7CisjZW5kaWYKKworICAgIGlubGluZSBib29sICAgICAgICAgaGFzRGF0YSgpIGNvbnN0IHsgcmV0dXJuIG1QYWNrZXRTaXplID4gTVRQX0NPTlRBSU5FUl9IRUFERVJfU0laRTsgfQorICAgIHZvaWQqICAgICAgICAgICAgICAgZ2V0RGF0YShpbnQmIG91dExlbmd0aCkgY29uc3Q7Cit9OworCit9OyAvLyBuYW1lc3BhY2UgYW5kcm9pZAorCisjZW5kaWYgLy8gX01UUF9EQ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VTU4gICAgICAgICAgICAgIDYKKyNkZWZpbmUgQVVESU9fQ09NUE9TRVJfQ09MVU1OICAgICAgICAgICA3CisjZGVmaW5lIEFVRElPX1RSQUNLX05VTUJFUl9DT0xVTU4gICAgICAgOAorI2RlZmluZSBBVURJT19ZRUFSX0NPTFVNTiAgICAgICAgICAgICAgIDkKKyNkZWZpbmUgQVVESU9fRFVSQVRJT05fQ09MVU1OICAgICAgICAgICAxMAorI2RlZmluZSBBVURJT19VU0VfQ09VTlRfQ09MVU1OICAgICAgICAgIDExCisjZGVmaW5lIEFVRElPX1NBTVBMRV9SQVRFX0NPTFVNTiAgICAgICAgMTIKKyNkZWZpbmUgQVVESU9fTlVNX0NIQU5ORUxTX0NPTFVNTiAgICAgICAxMworI2RlZmluZSBBVURJT19BVURJT19XQVZFX0NPREVDX0NPTFVNTiAgIDE0CisjZGVmaW5lIEFVRElPX0FVRElPX0JJVF9SQVRFX0NPTFVNTiAgICAgMTUKKworI2RlZmluZSBGSUxFX1RBQkxFX0NSRUFURSAgICAiQ1JFQVRFIFRBQkxFIElGIE5PVCBFWElTVFMgZmlsZXMgKCIgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgIl9pZCBJTlRFR0VSIFBSSU1BUlkgS0VZLCIgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICJwYXRoIFRFWFQsIiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAiZm9ybWF0IElOVEVHRVIsIiAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgInBhcmVudCBJTlRFR0VSLCIgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICJzdG9yYWdlIElOVEVHRVIsIiAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAic2l6ZSBJTlRFR0VSLCIgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgImRhdGVfbW9kaWZpZWQgSU5URUdFUiIgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgIik7IgorCisjZGVmaW5lIEFVRElPX1RBQkxFX0NSRUFURSAgICAiQ1JFQVRFIFRBQkxFIElGIE5PVCBFWElTVFMgYXVkaW8gKCIgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgImlkIElOVEVHRVIgUFJJTUFSWSBLRVksIiAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICJ0aXRsZSBURVhULCIgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAiYXJ0aXN0IFRFWFQsIiAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgImFsYnVtIFRFWFQsIiAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICJhbGJ1bV9hcnRpc3QgVEVYVCwiICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAiZ2VucmUgVEVYVCwiICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgImNvbXBvc2VyIFRFWFQsIiAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICJ0cmFja19udW1iZXIgSU5URUdFUiwiICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAieWVhciBJTlRFR0VSLCIgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgImR1cmF0aW9uIElOVEVHRVIsIiAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICJ1c2VfY291bnQgSU5URUdFUiwiICAgICAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAic2FtcGxlX3JhdGUgSU5URUdFUiwiICAgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgIm51bV9jaGFubmVscyBJTlRFR0VSLCIgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICJhdWRpb193YXZlX2NvZGVjIFRFWFQsIiAgICAgICAgICAgICAgICBcCisgICAgICAgICAgICAgICAgICAgICAgICAiYXVkaW9fYml0X3JhdGUgSU5URUdFUiIgICAgICAgICAgICAgICAgXAorICAgICAgICAgICAgICAgICAgICAgICAgIik7IgorCisjZGVmaW5lIFBBVEhfSU5ERVhfQ1JFQVRFICJDUkVBVEUgSU5ERVggSUYgTk9UIEVYSVNUUyBwYXRoX2luZGV4IG9uIGZpbGVzKHBhdGgpOyIKKworI2RlZmluZSBGSUxFX0lEX1FVRVJZICAgIlNFTEVDVCBfaWQsZm9ybWF0IEZST00gZmlsZXMgV0hFUkUgcGF0aCA9ID87IgorI2RlZmluZSBGSUxFX1BBVEhfUVVFUlkgIlNFTEVDVCBwYXRoLHNpemUgRlJPTSBmaWxlcyBXSEVSRSBfaWQgPSA/IgorCisjZGVmaW5lIEdFVF9PQkpFQ1RfSU5GT19RVUVSWSAgICJTRUxFQ1Qgc3RvcmFnZSxmb3JtYXQscGFyZW50LHBhdGgsc2l6ZSxkYXRlX21vZGlmaWVkIEZST00gZmlsZXMgV0hFUkUgX2lkID0gPzsiCisjZGVmaW5lIEZJTEVfSU5TRVJUICAgICAiSU5TRVJUIElOVE8gZmlsZXMgVkFMVUVTKD8sPyw/LD8sPyw/LD8pOyIKKyNkZWZpbmUgRklMRV9ERUxFVEUgICAgICJERUxFVEUgRlJPTSBmaWxlcyBXSEVSRSBfaWQgPSA/OyIKKworI2RlZmluZSBBVURJT19JTlNFUlQgICAgIklOU0VSVCBJTlRPIGF1ZGlvIFZBTFVFUyg/LD8sPyw/LD8sPyw/LD8sPyw/LD8sPyw/LD8sPyk7IgorI2RlZmluZSBBVURJT19ERUxFVEU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m9wZXJ0eVRhYmxlKSAvIHNpemVvZihrUHJvcGVydHlUYWJsZVswXSk7CisgICAgY29uc3QgUHJvcGVydHlUYWJsZUVudHJ5KiBlbnRyeSA9IGtQcm9wZXJ0eVRhYmxlOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKywgZW50cnkrKykgeworICAgICAgICBpZiAoZW50cnktPnByb3BlcnR5ID09IHByb3BlcnR5KSB7CisgICAgICAgICAgICB0eXBlID0gZW50cnktPnR5cGU7CisgICAgICAgICAgICBjb2x1bW5OYW1lID0gZW50cnktPmNvbHVtbk5hbWU7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gZmFsc2U7Cit9CisKKworCitNdHBEYXRhYmFzZTo6TXRwRGF0YWJhc2UoKQorICAgIDogICBtRmlsZUlkUXVlcnkoTlVMTCksCisgICAgICAgIG1GaWxlUGF0aFF1ZXJ5KE5VTEwpLAorICAgICAgICBtT2JqZWN0SW5mb1F1ZXJ5KE5VTEwpLAorICAgICAgICBtRmlsZUluc2VydGVyKE5VTEwpLAorICAgICAgICBtRmlsZURlbGV0ZXIoTlVMTCksCisgICAgICAgIG1BdWRpb0luc2VydGVyKE5VTEwpLAorICAgICAgICBtQXVkaW9EZWxldGVyKE5VTEwpCit7Cit9CisKK010cERhdGFiYXNlOjp+TXRwRGF0YWJhc2UoKSB7Cit9CisKK2Jvb2wgTXRwRGF0YWJhc2U6Om9wZW4oY29uc3QgY2hhciogcGF0aCwgYm9vbCBjcmVhdGUpIHsKKyAgICBpZiAoIVNxbGl0ZURhdGFiYXNlOjpvcGVuKHBhdGgsIGNyZWF0ZSkpCisgICAgICAgIHJldHVybiBmYWxzZTsKKworICAgIC8vIGNyZWF0ZSB0YWJsZXMgYW5kIGluZGljZXMgaWYgbmVjZXNzYXJ5CisgICAgaWYgKCFleGVjKEZJTEVfVEFCTEVfQ1JFQVRFKSkgeworICAgICAgICBMT0dF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lbWVudCh0aGlzKTsKKyAgICAgICAgaWYgKCFtT2JqZWN0SW5mb1F1ZXJ5LT5wcmVwYXJlKEdFVF9PQkpFQ1RfSU5GT19RVUVSWSkpIHsKKyAgICAgICAgICAgIExPR0UoImNvdWxkIG5vdCBjb21waWxlIEdFVF9PQkpFQ1RfSU5GT19RVUVSWSIpOworICAgICAgICAgICAgZXhpdCgtMSk7CisgICAgICAgIH0KKyAgICB9CisgICAgaWYgKCFtRmlsZUluc2VydGVyKSB7CisgICAgICAgIG1GaWxlSW5zZXJ0ZXIgPSBuZXcgU3FsaXRlU3RhdGVtZW50KHRoaXMpOworICAgICAgICBpZiAoIW1GaWxlSW5zZXJ0ZXItPnByZXBhcmUoRklMRV9JTlNFUlQpKSB7CisgICAgICAgICAgICBMT0dFKCJjb3VsZCBub3QgY29tcGlsZSBGSUxFX0lOU0VSVFxuIik7CisgICAgICAgICAgICBleGl0KC0xKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZiAoIW1GaWxlRGVsZXRlcikgeworICAgICAgICBtRmlsZURlbGV0ZXIgPSBuZXcgU3FsaXRlU3RhdGVtZW50KHRoaXMpOworICAgICAgICBpZiAoIW1GaWxlRGVsZXRlci0+cHJlcGFyZShGSUxFX0RFTEVURSkpIHsKKyAgICAgICAgICAgIExPR0UoImNvdWxkIG5vdCBjb21waWxlIEZJTEVfREVMRVRFXG4iKTsKKyAgICAgICAgICAgIGV4aXQoLTEpOworICAgICAgICB9CisgICAgfQorICAgIGlmICghbUF1ZGlvSW5zZXJ0ZXIpIHsKKyAgICAgICAgbUF1ZGlvSW5zZXJ0ZXIgPSBuZXcgU3FsaXRlU3RhdGVtZW50KHRoaXMpOworICAgICAgICBpZiAoIW1BdWRpb0luc2VydGVyLT5wcmVwYXJlKEFVRElPX0lOU0VSVCkpIHsKKyAgICAgICAgICAgIExPR0UoImNvdWxkIG5vdCBjb21waWxlIEFVRElPX0lOU0VSVFxuIik7CisgICAgICAgICAgICBleGl0KC0xKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZiAoIW1BdWRpb0RlbGV0ZXIpIHsKKyAgICAgICAgbUF1ZGlvRGVsZXRlciA9IG5ldyBTcWxpdGVTdGF0ZW1lbnQodGhpcyk7CisgICAgICAgIGlmICghbUF1ZGlvRGVsZXRlci0+cHJlcGFyZShBVURJT19ERUxFVEUpKSB7CisgICAgICAgICAgICBMT0dFKCJjb3VsZCBub3QgY29tcGlsZSBBVURJT19ERUxFVEVcbiIpOworICAgICAgICAgICAgZXhpdCgtMSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gdHJ1ZTsKK30KKwordWludDMyX3QgTXRwRGF0YWJhc2U6OmdldFRhYmxlRm9yRmlsZShNdHBPYmplY3RGb3JtYXQgZm9ybWF0KSB7CisgICAgc3dpdGNoIChmb3JtYXQpIHsKKyAgICAgICAgY2FzZSBNVFBfRk9STUFUX0FJRkY6CisgICAgICAgIGNhc2UgTVRQX0ZPUk1BVF9XQVY6CisgICAgICAgIGNhc2UgTVRQX0ZPUk1BVF9NUDM6CisgICAgICAgIGNhc2UgTVRQX0ZPUk1BVF9GTEFDOgorICAgICAgICBjYXNlIE1UUF9GT1JNQVRfVU5ERUZJTkVEX0FVRElPOgorICAgICAgICBjYXNlIE1UUF9GT1JNQVRfV01BOgorICAgICAgICBjYXNlIE1UUF9GT1JNQVRfT0dHOgorICAgICAgICBjYXNlIE1UUF9GT1JNQVRfQUFDOgorICAgICAgICBjYXNlIE1UUF9GT1JNQVRfQVVESUJMRToKKyAgICAgICAgICAgIHJldHVybiBrT2JqZWN0SGFuZGxlVGFibGVBdWRpbzsKKyAgICAgICAgY2FzZSBNVFBfRk9STUFUX0FWSToKKyAgICAgICAgY2FzZSBNVFBfRk9STUFUX01QRUc6CisgICAgICAgIGNhc2UgTVRQX0ZPUk1BVF9BU0Y6CisgICAgICAgIGNhc2UgTVRQX0ZPUk1BVF9VTkRFRklORURfVklERU86CisgICAgICAgIGNhc2UgTVRQX0ZP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orICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0Rm9ybWF0IGZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSBwYXJlbnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBTdG9yYWdlSUQgc3RvcmFnZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQ2NF90IHNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lX3QgbW9kaWZpZWQpIHsKKyAgICBtRmlsZUluc2VydGVyLT5iaW5kKEZJTEVfUEFUSF9DT0xVTU4sIHBhdGgpOworICAgIG1GaWxlSW5zZXJ0ZXItPmJpbmQoRklMRV9GT1JNQVRfQ09MVU1OLCBmb3JtYXQpOworICAgIG1GaWxlSW5zZXJ0ZXItPmJpbmQoRklMRV9QQVJFTlRfQ09MVU1OLCBwYXJlbnQpOworICAgIG1GaWxlSW5zZXJ0ZXItPmJpbmQoRklMRV9TVE9SQUdFX0NPTFVNTiwgc3RvcmFnZSk7CisgICAgbUZpbGVJbnNlcnRlci0+YmluZChGSUxFX1NJWkVfQ09MVU1OLCBzaXplKTsKKyAgICBtRmlsZUluc2VydGVyLT5iaW5kKEZJTEVfTU9ESUZJRURfQ09MVU1OLCBtb2RpZmllZCk7CisgICAgbUZpbGVJbnNlcnRlci0+c3RlcCgpOworICAgIG1GaWxlSW5zZXJ0ZXItPnJlc2V0KCk7CisgICAgaW50IHJlc3VsdCA9IGxhc3RJbnNlcnRlZFJvdygpOworICAgIHJldHVybiAocmVzdWx0IDw9IDAgPyBrSW52YWxpZE9iamVjdEhhbmRsZSA6IHJlc3VsdCk7Cit9CisKK010cE9iamVjdEhhbmRsZSBNdHBEYXRhYmFzZTo6YWRkQXVkaW9GaWxlKE10cE9iamVjdEhhbmRsZSBoYW5kbGUpIHsKKyAgICBtQXVkaW9JbnNlcnRlci0+YmluZChBVURJT19JRF9DT0xVTU4sIGhhbmRsZSk7CisgICAgbUF1ZGlvSW5zZXJ0ZXItPnN0ZXAoKTsKKyAgICBtQXVkaW9JbnNlcnRlci0+cmVzZXQoKTsKKyAgICBpbnQgcmVzdWx0ID0gbGFzdEluc2VydGVkUm93KCk7CisgICAgaGFuZGxlIHw9IGtPYmplY3RIYW5kbGVUYWJsZUF1ZGlvOworICAgIHJldHVybiAocmVzdWx0ID4gMCA/IGhhbmRsZSA6IGtJbnZhbGlkT2JqZWN0SGFuZGxlKTsKK30KKworTXRwT2JqZWN0SGFuZGxlIE10cERhdGFiYXNlOjphZGRBdWRpb0ZpbGUoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqIHRpdGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciogYXJ0aXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciogYWxidW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyKiBhbGJ1bUFydGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqIGdlbnJlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciogY29tcG9zZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyKiBtaW1lVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB0cmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB5ZWFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGR1cmF0aW9uKSB7CisgICAgbUF1ZGlvSW5zZXJ0ZXItPmJpbmQoQVVESU9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mVzdWx0IHw9IGtPYmplY3RIYW5kbGVUYWJsZUF1ZGlvOworICAgIHJldHVybiByZXN1bHQ7Cit9CisKK010cE9iamVjdEhhbmRsZUxpc3QqIE10cERhdGFiYXNlOjpnZXRPYmplY3RMaXN0KE10cFN0b3JhZ2VJRCBzdG9yYWdlSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RGb3JtYXQgZm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCkgeworICAgIGJvb2wgICAgICAgICAgICAgICAgd2hlcmVTdG9yYWdlID0gKHN0b3JhZ2VJRCAhPSAweEZGRkZGRkZGKTsKKyAgICBib29sICAgICAgICAgICAgICAgIHdoZXJlRm9ybWF0ID0gKGZvcm1hdCAhPSAwKTsKKyAgICBib29sICAgICAgICAgICAgICAgIHdoZXJlUGFyZW50ID0gKHBhcmVudCAhPSAwKTsKKyAgICBjaGFyICAgICAgICAgICAgICAgIGludEJ1ZmZlclsyMF07CisKKyAgICBNdHBTdHJpbmcgIHF1ZXJ5KCJTRUxFQ1QgX2lkLGZvcm1hdCBGUk9NIGZpbGVzIik7CisgICAgaWYgKHdoZXJlU3RvcmFnZSB8fCB3aGVyZUZvcm1hdCB8fCB3aGVyZVBhcmVudCkKKyAgICAgICAgcXVlcnkgKz0gIiBXSEVSRSI7CisgICAgaWYgKHdoZXJlU3RvcmFnZSkgeworICAgICAgICBzbnByaW50ZihpbnRCdWZmZXIsIHNpemVvZihpbnRCdWZmZXIpLCAiJWQiLCBzdG9yYWdlSUQpOworICAgICAgICBxdWVyeSArPSAiIHN0b3JhZ2UgPSAiOworICAgICAgICBxdWVyeSArPSBpbnRCdWZmZXI7CisgICAgfQorICAgIGlmICh3aGVyZUZvcm1hdCkgeworICAgICAgICBzbnByaW50ZihpbnRCdWZmZXIsIHNpemVvZihpbnRCdWZmZXIpLCAiJWQiLCBmb3JtYXQpOworICAgICAgICBpZiAod2hlcmVTdG9yYWdlKQorICAgICAgICAgICAgcXVlcnkgKz0gIiBBTkQiOworICAgICAgICBxdWVyeSArPSAiIGZvcm1hdCA9ICI7CisgICAgICAgIHF1ZXJ5ICs9IGludEJ1ZmZlcjsKKyAgICB9CisgICAgaWYgKHdoZXJlUGFyZW50KSB7CisgICAgICAgIGlmIChwYXJlbnQgIT0gTVRQX1BBUkVOVF9ST09UKQorICAgICAgICAgICAgcGFyZW50ICY9IGtPYmplY3RIYW5kbGVJbmRleE1hc2s7CisgICAgICAgIHNucHJpbnRmKGludEJ1ZmZlciwgc2l6ZW9mKGludEJ1ZmZlciksICIlZCIsIHBhcmVudCk7CisgICAgICAgIGlmICh3aGVyZVN0b3JhZ2UgfHwgd2hlcmVGb3JtYXQpCisgICAgICAgICAgICBxdWVyeSArPSAiIEFORCI7CisgICAgICAgIHF1ZXJ5ICs9ICIgcGFyZW50ID0gIjsKKyAgICAgICAgcXVlcnkgKz0gaW50QnVmZmVyOworICAgIH0KKyAgICBxdWVyeSArPSAiOyI7CisKKyAgICBTcWxpdGVTdGF0ZW1lbnQgc3RtdCh0aGlzKTsKKyAgICBMT0dWKCIlcyIsIChjb25zdCBjaGFyICopcXVlcnkpOworICAgIHN0bXQucHJlcGFyZShxdWVyeSk7CisKKyAgICBNdHBPYmplY3RIYW5kbGVMaXN0KiBsaXN0ID0gbmV3IE10cE9iamVjdEhhbmRsZUxpc3QoKTsKKyAgICB3aGlsZSAoIXN0bXQuaXNEb25lKCkpIHsKKyAgICAgICAgaWYgKHN0bXQuc3RlcCgpKSB7CisgICAgICAgICAgICBpbnQgaW5kZXggPSBzdG10LmdldENvbHVtbkludCgwKTsKKyAgICAgICAgICAgIExPR1YoInN0bXQuZ2V0Q29sdW1uSW50IHJldHVybmVkICVkIiwgaW5kZXgpOworICAgICAgICAgICAgaWYgKGluZGV4ID4gMCkgeworICAgICAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQgPSBzdG10LmdldENvbHVtbkludCgxKTsKKyAgICAgICAgICAgICAgICBpbmRleCB8PSBnZXRUYWJsZUZvckZpbGUoZm9ybWF0KTsKKyAgICAgICAgICAgICAgICBsaXN0LT5wdXNoKGluZGV4KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBMT0dWKCJsaXN0IHNpemU6ICVkIiwgbGlzdC0+c2l6ZSgpKTsKKyAgICByZXR1cm4gbGlzdDsKK30KKworCitNdHBSZXNwb25zZUNvZGUgTXRwRGF0YWJhc2U6OmdldE9iamVjdFByb3BlcnR5KE10cE9iamVjdEhhbmRsZSBoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RQcm9wZXJ0eSBwcm9wZXJ0eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cERhdGFQYWNrZXQmIHBhY2tldCkgeworICAgIGludCAgICAgICAgIHR5cGU7CisgICAgY29uc3QgY2hhciogY29sdW1uTmFtZTsKKyAgICBjaGFyICAgICAgICBpbnRCdWZmZXJbMjBdOworCisgICAgaWYgKGhhbmRsZSAhPSBNVFBfUEFSRU5UX1JPT1QpCisgICAgICAgIGhhbmRsZSAmPSBrT2JqZWN0SGFuZGxlSW5kZXhNYXNrOworCisgICAgaWYgKCFnZXRQcm9wZXJ0eUluZm8ocHJvcGVydHksIHR5cGUsIGNvbHVtbk5hbWUpKQorICAgICAgICByZXR1cm4gTVRQX1JFU1BPTlNFX0lOVkFMSURfT0JKRUNUX1BST1BfQ09ERTsKKyAgICBzbnByaW50ZihpbnRCdWZmZXIsIHNpemVvZihpbnRCdWZmZXIpLCAiJWQiLCBoYW5kbGUpOworCisgICAgTXRwU3RyaW5nICBxdWVyeSgiU0VMRUNUICIpOworICAgIHF1ZXJ5ICs9IGNvbHVtbk5hbWU7CisgICAgcXVlcnkgKz0gIiBGUk9NIGZpbGVzIFdIRVJFIF9pZCA9ICI7CisgICAgcXVlcnkgKz0gaW50QnVmZmVyOworICAgIHF1ZXJ5ICs9ICI7IjsKKworICAgIFNxbGl0ZVN0YXRlbWVudCBzdG10KHRoaXMpOworICAgIExPR1YoIiVzIiwgKGNvbnN0IGNoYXIgKilxdWVyeSk7CisgICAgc3RtdC5wcmVwYXJlKHF1ZXJ5KTsKKworICAgIGlmICghc3RtdC5zdGVwKCkpCisgICAgICAgIHJldHVybiBNVFBfUkVTUE9OU0VfSU5WQUxJRF9PQkpFQ1RfSEFORExFOworCisgICAgc3dpdGNoICh0eXBlKSB7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UODoKKyAgICAgICAgICAgIHBhY2tldC5wdXRJbnQ4KHN0bXQuZ2V0Q29sdW1uSW50KDApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQ4OgorICAgICAgICAgICAgcGFja2V0LnB1dFVJbnQ4KHN0bXQuZ2V0Q29sdW1uSW50KDApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDE2OgorICAgICAgICAgICAgcGFja2V0LnB1dEludDE2KHN0bXQuZ2V0Q29sdW1uSW50KDApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQxNjoKKyAgICAgICAgICAgIHBhY2tldC5wdXRVSW50MTYoc3RtdC5nZXRDb2x1bW5JbnQoMCkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMzI6CisgICAgICAgICAgICBwYWNrZXQucHV0SW50MzIoc3RtdC5nZXRDb2x1bW5JbnQoMCkpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDMyOgorICAgICAgICAgICAgcGFja2V0LnB1dFVJbnQzMihzdG10LmdldENvbHVtbkludCgwKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQ2NDoKKyAgICAgICAgICAgIHBhY2tldC5wdXRJbnQ2NChzdG10LmdldENvbHVtbkludDY0KDApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQ2NDoKKyAgICAgICAgICAgIHBhY2tldC5wdXRVSW50NjQoc3RtdC5nZXRDb2x1bW5JbnQ2NCgwKSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9TVFI6CisgICAgICAgICAgICBwYWNrZXQucHV0U3RyaW5nKHN0bXQuZ2V0Q29sdW1uU3RyaW5nKDApKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgTE9HRSgidW5zdXBwb3J0ZWQgb2JqZWN0IHR5cGVcbiIpOworICAgICAgICAgICAgcmV0dXJuIE1UUF9SRVNQT05TRV9JTlZBTElEX09CSkVDVF9IQU5ETEU7CisgICAgfQorICAgIHJldHVybiBNVFBfUkVTUE9OU0VfT0s7Cit9CisKK010cFJlc3BvbnNlQ29kZSBNdHBEYXRhYmFzZTo6Z2V0T2JqZWN0SW5mbyhNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cERhdGFQYWNrZXQmIHBhY2tldCkgeworICAgIGNoYXIgICAgZGF0ZVsyMF07CisKKyAgICBpZiAoaGFuZGxlICE9IE1UUF9QQVJFTlRfUk9PVCkKKyAgICAgICAgaGFuZGxlICY9IGtPYmplY3RIYW5kbGVJbmRleE1hc2s7CisKKyAgICBtT2JqZWN0SW5mb1F1ZXJ5LT5yZXNldCgpOworICAgIG1PYmplY3RJbmZvUXVlcnktPmJpbmQoMSwgaGFuZGxlKTsKKyAgICBpZiAoIW1PYmplY3RJbmZvUXVlcnktPnN0ZXAoKSkKKyAgICAgICAgcmV0dXJuI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KKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgICAgICBpZiAoIXN0bXQyLnN0ZXAoKSkgeworICAgICAgICAgICAgICAgIExPR1coImdldEZpbGVMaXN0IGVuZGVkIGVhcmx5Iik7CisgICAgICAgICAgICAgICAgY291bnQgPSBpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSA9IHN0bXQyLmdldENvbHVtbkludCgwKTsKKyAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQgPSBzdG10Mi5nZXRDb2x1bW5JbnQoMSk7CisgICAgICAgICAgICBoYW5kbGUgfD0gZ2V0VGFibGVGb3JGaWxlKGZvcm1hdCk7CisgICAgICAgICAgICByZXN1bHRbaV0gPSBoYW5kbGU7CisgICAgICAgIH0KKyAgICB9CisgICAgb3V0Q291bnQgPSBjb3VudDsKKyAgICByZXR1cm4gcmVzdWx0OworfQorCisvKgorICAgIGZvciBnZXRPYmplY3RQcm9wRGVzYworCisgICAgcGFja2V0LnB1dFVJbnQxNihwcm9wZXJ0eSk7CisgICAgcGFja2V0LnB1dFVJbnQxNihkYXRhVHlwZSk7CisgICAgcGFja2V0LnB1dFVJbnQ4KGdldFNldCk7CisgICAgLy8gZGVmYXVsdCB2YWx1ZSBEVFMKKyAgICBwYWNrZXQucHV0VUludDMyKGdyb3VwQ29kZSk7CisgICAgcGFja2V0LnB1dFVJbnQ4KGZvcm1GbGFnKTsKKyAgICAvLyBmb3JtLCB2YXJpYWJsZQorKi8KKworfSAgLy8gbmFtZXNwYWNlIGFuZHJvaWQKZGlmZiAtLWdpdCBhL21lZGlhL210cC9NdHBEYXRhYmFzZS5oIGIvbWVkaWEvbXRwL010cERhdGFiYXNlLmgKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNTFkNWZiMQotLS0gL2Rldi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GFzcyBNdHBEYXRhUGFja2V0OworY2xhc3MgU3FsaXRlU3RhdGVtZW50OworCitjbGFzcyBNdHBEYXRhYmFzZSA6IHB1YmxpYyBTcWxpdGVEYXRhYmFzZSB7Citwcml2YXRlOgorICAgIFNxbGl0ZVN0YXRlbWVudCogICAgICAgIG1GaWxlSWRRdWVyeTsKKyAgICBTcWxpdGVTdGF0ZW1lbnQqICAgICAgICBtRmlsZVBhdGhRdWVyeTsKKyAgICBTcWxpdGVTdGF0ZW1lbnQqICAgICAgICBtT2JqZWN0SW5mb1F1ZXJ5OworICAgIFNxbGl0ZVN0YXRlbWVudCogICAgICAgIG1GaWxlSW5zZXJ0ZXI7CisgICAgU3FsaXRlU3RhdGVtZW50KiAgICAgICAgbUZpbGVEZWxldGVyOworICAgIFNxbGl0ZVN0YXRlbWVudCogICAgICAgIG1BdWRpb0luc2VydGVyOworICAgIFNxbGl0ZVN0YXRlbWVudCogICAgICAgIG1BdWRpb0RlbGV0ZXI7CisKK3B1YmxpYzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhYmFzZSgpOworICAgIHZpcnR1YWwgICAgICAgICAgICAgICAgIH5NdHBEYXRhYmFzZSgpOworCisgICAgc3RhdGljIHVpbnQzMl90ICAgICAgICAgZ2V0VGFibGVGb3JGaWxlKE10cE9iamVjdEZvcm1hdCBmb3JtYXQpOworCisgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgb3Blbihjb25zdCBjaGFyKiBwYXRoLCBib29sIGNyZWF0ZSk7CisgICAgTXRwT2JqZWN0SGFuZGxlICAgICAgICAgZ2V0T2JqZWN0SGFuZGxlKGNvbnN0IGNoYXIqIHBhdGgpOworICAgIE10cE9iamVjdEhhbmRsZSAgICAgICAgIGFkZEZpbGUoY29uc3QgY2hhciogcGF0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RIYW5kbGUgcGFyZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwU3RvcmFnZUlEIHN0b3JhZ2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50NjRfdCBzaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZV90IG1vZGlmaWVkKTsKKworICAgIE10cE9iamVjdEhhbmRsZSAgICAgICAgIGFkZEF1ZGlvRmlsZShNdHBPYmplY3RIYW5kbGUgaWQpOworCisgICAgTXRwT2JqZWN0SGFuZGxlICAgICAgICAgYWRkQXVkaW9GaWxlKE10cE9iamVjdEhhbmRsZSBpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqIHRpdGxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciogYXJ0aXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciogYWxidW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyKiBhbGJ1bUFydGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqIGdlbnJlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciogY29tcG9zZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyKiBtaW1lVHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB0cmFjaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB5ZWFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGR1cmF0aW9uKTsKKworICAgIE10cE9iamVjdEhhbmRsZUxpc3QqICAgIGdldE9iamVjdExpc3QoTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RIYW5kbGUgcGFyZW50KTsKKworICAgIE10cFJlc3BvbnNlQ29kZSAgICAgICAgIGdldE9iamVjdFByb3BlcnR5KE10cE9iamVjdEhhbmRsZSBoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RQcm9wZXJ0eSBwcm9wZXJ0eSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cERhdGFQYWNrZXQmIHBhY2tldCk7CisKKyAgICBNdHBSZXNwb25zZUNvZGUgICAgICAgICBnZXRPYmplY3RJbmZvKE10cE9iamVjdEhhbmRsZSBoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0JiBwYWNrZXQpOworCisgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgZ2V0T2JqZWN0RmlsZVBhdGgoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cFN0cmluZyYgZmlsZVBhdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQ2NF90JiBmaWxlTGVuZ3RoKTsKKyAgICBib29sICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKE10cE9iamVjdEhhbmRsZSBoYW5kbGUpOworCisgICAgLy8gaGVscGVyIGZvciBtZWRpYSBzY2FubmVyCisgICAgTXRwT2JqZWN0SGFuZGxlKiAgICAgICAgZ2V0RmlsZUxpc3QoaW50JiBvdXRDb3VudCk7Cit9OworCit9OyAvLyBuYW1lc3BhY2UgYW5kcm9pZAorCisjZW5kaWYgLy8gX01UUF9EQVRBQkFTRV9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cERlYnVnLmgiCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworc3RydWN0IE9wZXJhdGlvbkNvZGVFbnRyeSB7CisgICAgY29uc3QgY2hhciogbmFtZTsKKyAgICBNdHBPcGVyYXRpb25Db2RlIGNvZGU7Cit9OworCitzdGF0aWMgY29uc3QgT3BlcmF0aW9uQ29kZUVudHJ5IHNPcGVyYXRpb25Db2Rlc1tdID0geworICAgIHsgIk1UUF9PUEVSQVRJT05fR0VUX0RFVklDRV9JTkZPIiwgICAgICAgICAgICAgIDB4MTAwMSB9LAorICAgIHsgIk1UUF9PUEVSQVRJT05fT1BFTl9TRVNTSU9OIiwgICAgICAgICAgICAgICAgIDB4MTAwMiB9LAorICAgIHsgIk1UUF9PUEVSQVRJT05fQ0xPU0VfU0VTU0lPTiIsICAgICAgICAgICAgICAgIDB4MTAwMyB9LAorICAgIHsgIk1UUF9PUEVSQVRJT05fR0VUX1NUT1JBR0VfSURTIiwgICAgICAgICAgICAgIDB4MTAwNCB9LAorICAgIHsgIk1UUF9PUEVSQVRJT05fR0VUX1NUT1JBR0VfSU5GTyIsICAgICAgICAgICAgIDB4MTAwNSB9LAorICAgIHsgIk1UUF9PUEVSQVRJT05fR0VUX05VTV9PQkpFQ1RTIiwgICAgICAgICAgICAgIDB4MTAwNiB9LAorICAgIHsgIk1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9IQU5ETEVTIiwgICAgICAgICAgIDB4MTAwNyB9LAorICAgIHsgIk1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9JTkZPIiwgICAgICAgICAgICAgIDB4MTAwOCB9LAorICAgIHsgIk1UUF9PUEVSQVRJT05fR0VUX09CSkVDVCIsICAgICAgICAgICAgICAgICAgIDB4MTAwOSB9LAorICAgIHsgIk1UUF9PUEVSQVRJT05fR0VUX1RIVU1CIiwgICAgICAgICAgICAgICAgICAgIDB4MTAwQSB9LAorICAgIHsgIk1UUF9PUEVSQVRJT05fREVMRVRFX09CSkVDVCIsICAgIC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emUoKSB7CisgICAgb3BlblNlc3Npb24oKTsKKyAgICBtRGV2aWNlSW5mbyA9IGdldERldmljZUluZm8oKTsKKyAgICBpZiAobURldmljZUluZm8pIHsKKyAgICAgICAgbURldmljZUluZm8tPnByaW50KCk7CisKKyAgICAgICAgaWYgKG1EZXZpY2VJbmZvLT5tRGV2aWNlUHJvcGVydGllcykgeworICAgICAgICAgICAgaW50IGNvdW50ID0gbURldmljZUluZm8tPm1EZXZpY2VQcm9wZXJ0aWVzLT5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKKyAgICAgICAgICAgICAgICBNdHBEZXZpY2VQcm9wZXJ0eSBwcm9wQ29kZSA9ICgqbURldmljZUluZm8tPm1EZXZpY2VQcm9wZXJ0aWVzKVtpXTsKKyAgICAgICAgICAgICAgICBNdHBQcm9wZXJ0eSogcHJvcGVydHkgPSBnZXREZXZpY2VQcm9wRGVzYyhwcm9wQ29kZSk7CisgICAgICAgICAgICAgICAgaWYgKHByb3BlcnR5KSB7CisgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5LT5wcmludCgpOworICAgICAgICAgICAgICAgICAgICBtRGV2aWNlUHJvcGVydGllcy5wdXNoKHByb3BlcnR5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9CisKK3ZvaWQgTXRwRGV2aWNlOjpjbG9zZSgpIHsKKyAgICBpZiAobURldmljZSkgeworICAgICAgICB1c2JfZGV2aWNlX3JlbGVhc2VfaW50ZXJmYWNlKG1EZXZpY2UsIG1JbnRlcmZhY2UpOworICAgICAgICB1c2JfZGV2aWNlX2Nsb3NlKG1EZXZpY2UpOworICAgICAgICBtRGV2aWNlID0gTlVMTDsKKyAgICB9Cit9CisKK2NvbnN0IGNoYXIqIE10cERldmljZTo6Z2V0RGV2aWNlTmFtZSgpIHsKKyAgICBpZiAobURldmljZSkKKyAgICAgICAgcmV0dXJuIH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ERhdGEoKSkKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgTXRwUmVzcG9uc2VDb2RlIHJldCA9IHJlYWRSZXNwb25zZSgpOworICAgIGlmIChyZXQgPT0gTVRQX1JFU1BPTlNFX09LKSB7CisgICAgICAgIE10cERldmljZUluZm8qIGluZm8gPSBuZXcgTXRwRGV2aWNlSW5mbzsKKyAgICAgICAgaW5mby0+cmVhZChtRGF0YSk7CisgICAgICAgIHJldHVybiBpbmZvOworICAgIH0KKyAgICByZXR1cm4gTlVMTDsKK30KKworTXRwU3RvcmFnZUlETGlzdCogTXRwRGV2aWNlOjpnZXRTdG9yYWdlSURzKCkgeworICAgIG1SZXF1ZXN0LnJlc2V0KCk7CisgICAgaWYgKCFzZW5kUmVxdWVzdChNVFBfT1BFUkFUSU9OX0dFVF9TVE9SQUdFX0lEUykpCisgICAgICAgIHJldHVybiBOVUxMOworICAgIGlmICghcmVhZERhdGEoKSkKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgTXRwUmVzcG9uc2VDb2RlIHJldCA9IHJlYWRSZXNwb25zZSgpOworICAgIGlmIChyZXQgPT0gTVRQX1JFU1BPTlNFX09LKSB7CisgICAgICAgIHJldHVybiBtRGF0YS5nZXRBVUludDMyKCk7CisgICAgfQorICAgIHJldHVybiBOVUxMOworfQorCitNdHBTdG9yYWdlSW5mbyogTXRwRGV2aWNlOjpnZXRTdG9yYWdlSW5mbyhNdHBTdG9yYWdlSUQgc3RvcmFnZUlEKSB7CisgICAgbVJlcXVlc3QucmVzZXQoKTsKKyAgICBtUmVxdWVzdC5zZXRQYXJhbWV0ZXIoMSwgc3RvcmFnZUlEKTsKKyAgICBpZiAoIXNlbmRSZXF1ZXN0KE1UUF9PUEVSQVRJT05fR0VUX1NUT1JBR0VfSU5GTykpCisgICAgICAgIHJldHVybiBOVUxMOworICAgIGlmICghcmVhZERhdGEoKSkKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgTXRwUmVzcG9uc2VDb2Rl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ZU9iamVjdChNdHBPYmplY3RIYW5kbGUgaGFuZGxlKSB7CisgICAgbVJlcXVlc3QucmVzZXQoKTsKKyAgICBtUmVxdWVzdC5zZXRQYXJhbWV0ZXIoMSwgaGFuZGxlKTsKKyAgICBpZiAoc2VuZFJlcXVlc3QoTVRQX09QRVJBVElPTl9ERUxFVEVfT0JKRUNUKSkgeworICAgICAgICBNdHBSZXNwb25zZUNvZGUgcmV0ID0gcmVhZFJlc3BvbnNlKCk7CisgICAgICAgIGlmIChyZXQgPT0gTVRQX1JFU1BPTlNFX09LKQorICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorICAgIHJldHVybiBmYWxzZTsKK30KKworTXRwT2JqZWN0SGFuZGxlIE10cERldmljZTo6Z2V0UGFyZW50KE10cE9iamVjdEhhbmRsZSBoYW5kbGUpIHsKKyAgICBNdHBPYmplY3RJbmZvKiBpbmZvID0gZ2V0T2JqZWN0SW5mbyhoYW5kbGUpOworICAgIGlmIChpbmZvKQorICAgICAgICByZXR1cm4gaW5mby0+bVBhcmVudDsKKyAgICBlbHNlCisgICAgICAgIHJldHVybiAtMTsKK30KKworTXRwT2JqZWN0SGFuZGxlIE10cERldmljZTo6Z2V0U3RvcmFnZUlEKE10cE9iamVjdEhhbmRsZSBoYW5kbGUpIHsKKyAgICBNdHBPYmplY3RJbmZvKiBpbmZvID0gZ2V0T2JqZWN0SW5mbyhoYW5kbGUpOworICAgIGlmIChpbmZvKQorICAgICAgICByZXR1cm4gaW5mby0+bVN0b3JhZ2VJRDsKKyAgICBlbHNlCisgICAgICAgIHJldHVybiAtMTsKK30KKworTXRwUHJvcGVydHkqIE10cERldmljZTo6Z2V0RGV2aWNlUHJvcERlc2MoTXRwRGV2aWNlUHJvcGVydHkgY29kZSkgeworICAgIG1SZXF1ZXN0LnJlc2V0KCk7CisgICAgbVJlcXVlc3Quc2V0UGFyYW1ldGVyKDEsIGNvZGUpOworICAgIGlmICghc2VuZFJlcXVlc3QoTVRQX09QRVJBVElPTl9HRVRfREVWSUNFX1BST1BfREVTQykpCisgICAgICAgIHJldHVybiBOVUxMOworICAgIGlmICghcmVhZERhdGEoKSkKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgTXRwUmVzcG9uc2VDb2RlIHJldCA9IHJlYWRSZXNwb25zZSgpOworICAgIGlmIChyZXQgPT0gTVRQX1JFU1BPTlNFX09LKSB7CisgICAgICAgIE10cFByb3BlcnR5KiBwcm9wZXJ0eSA9IG5ldyBNdHBQcm9wZXJ0eTsKKyAgICAgICAgcHJvcGVydHktPnJlYWQobURhdGEsIHRydWUpOworICAgICAgICByZXR1cm4gcHJvcGVydHk7CisgICAgfQorICAgIHJldHVybiBOVUxMOworfQorCisKK2Jvb2wgTXRwRGV2aWNlOjpzZW5kUmVxdWVzdChNdHBPcGVyYXRpb25Db2RlIG9wZXJhdGlvbikgeworICAgIExPR0QoInNlbmRSZXF1ZXN0OiAlc1xuIiwgTXRwRGVidWc6OmdldE9wZXJhdGlvbkNvZGVOYW1lKG9wZXJhdGlvbikpOworICAgIG1SZXF1ZXN0LnNldE9wZXJhdGlvbkNvZGUob3BlcmF0aW9uKTsKKyAgICBpZiAobVRyYW5zYWN0aW9uSUQgPiAwKQorICAgICAgICBtUmVxdWVzdC5zZXRUcmFuc2FjdGlvbklEKG1UcmFuc2FjdGlvbklEKyspOworICAgIGludCByZXQgPSBtUmVxdWVzdC53cml0ZShtRW5kcG9pbnRPdXQpOworICAgIG1SZXF1ZXN0LmR1bXAoKTsKKyAgICByZXR1cm4gKHJldCA+IDApOworfQorCitib29sIE10cERldmljZTo6c2VuZERhdGEoTXRwT3BlcmF0aW9uQ29kZSBvcGVyYXRpb24pIHsKKyAgICBMT0dEKCJzZW5kRGF0YVxuIik7CisgICAgbURhdGEuc2V0T3BlcmF0aW9uQ29kZShtUmVxdWVzdC5nZXRPcGVyYXRpb25Db2RlKCkpOworICAgIG1EYXRhLnNldFRyYW5zYWN0aW9uSUQobVJlcXVlc3QuZ2V0VHJhbnNhY3Rpb25JRCgpKTsKKyAgICBpbnQgcmV0ID0gbURhdGEud3JpdGUobUVuZHBvaW50T3V0KTsKKyAgICBtRGF0YS5kdW1wKCk7CisgICAgcmV0dXJuIChyZXQgPiAwKTsKK30KKworYm9vbCBNdHBEZXZpY2U6OnJlYWREYXRhKCkgeworICAgIG1EYXRhLnJlc2V0KCk7CisgICAgaW50IHJldCA9IG1EYXRhLnJlYWQobUVuZHBvaW50SW4pOworICAgIExPR0QoInJlYWREYXRhIHJldHVybmVkICVkXG4iLCByZXQpOworICAgIGlmIChyZXQgPj0gTVRQX0NPTlRBSU5FUl9IRUFERVJfU0laRSkgeworICAgICAgICBtRGF0YS5kdW1wKCk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKyAgICBlbHNlIHsKKyAgICAgICAgTE9HRCgicmVhZFJlc3BvbnNlIGZhaWxlZFxuIik7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9Cit9CisKK010cFJlc3BvbnNlQ29kZSBNdHBEZXZpY2U6OnJlYWRSZXNwb25zZSgpIHsKKyAgICBMT0dEKCJyZWFkUmVzcG9uc2VcbiIpOworICAgIGludCByZXQgPSBtUmVzcG9uc2UucmVhZChtRW5kcG9pbnRJbik7CisgICAgaWYgKHJldCA+PSBNVFBfQ09OVEFJTkVSX0hFQURFUl9TSVpFKSB7CisgICAgICAgIG1SZXNwb25zZS5kdW1wKCk7CisgICAgICAgIHJldHVybiBtUmVzcG9uc2UuZ2V0UmVzcG9uc2VDb2RlKCk7CisgICAgfQorICAgIGVsc2UgeworICAgICAgICBMT0dEKCJyZWFkUmVzcG9uc2UgZmFpbGVkXG4iKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KK30KKworfSAgLy8gbmFtZXNwYWNlIGFuZHJvaWQKZGlmZiAtLWdpdCBhL21lZGlhL210cC9NdHBEZXZpY2UuaCBiL21lZGlhL210cC9NdHBEZXZpY2UuaApuZXcgZmlsZSBtb2RlIDEwMDY0NA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XQuaCIKKyNpbmNsdWRlICJNdHBSZXNwb25zZVBhY2tldC5oIgorI2luY2x1ZGUgIk10cFR5cGVzLmgiCisKK3N0cnVjdCB1c2JfZGV2aWNlOworCituYW1lc3BhY2UgYW5kcm9pZCB7CisKK2NsYXNzIE10cERldmljZUluZm87CitjbGFzcyBNdHBPYmplY3RJbmZvOworY2xhc3MgTXRwU3RvcmFnZUluZm87CisKK2NsYXNzIE10cERldmljZSB7Citwcml2YXRlOgorICAgIHN0cnVjdCB1c2JfZGV2aWNlKiAgICAgIG1EZXZpY2U7CisgICAgaW50ICAgICAgICAgICAgICAgICAgICAgbUludGVyZmFjZTsKKyAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50KiAgICBtRW5kcG9pbnRJbjsKKyAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50KiAgICBtRW5kcG9pbnRPdXQ7CisgICAgc3RydWN0IHVzYl9lbmRwb2ludCogICAgbUVuZHBvaW50SW50cjsKKyAgICBNdHBEZXZpY2VJbmZvKiAgICAgICAgICBtRGV2aWNlSW5mbzsKKyAgICBNdHBQcm9wZXJ0eUxpc3QgICAgICAgICBtRGV2aWNlUHJvcGVydGllczsKKworICAgIC8vIGEgdW5pcXVlIElEIGZvciB0aGUgZGV2aWNlCisgICAgaW50ICAgICAgICAgICAgICAgICAgICAgbUlEOworCisgICAgLy8gY3VycmVudCBzZXNzaW9uIElECisgICAgTXRwU2Vzc2lvbklEICAgICAgICAgICAgbVNlc3Npb25JRDsKKyAgICAvLyBjdXJyZW50IHRyYW5zYWN0aW9uIElECisgICAgTXRwVHJhbnNhY3Rpb25JRCAgICAgICAgbVRyYW5zYWN0aW9uSUQ7CisKKyAgICBNdHBSZXF1ZXN0UGFja2V0ICAgICAgICBtUmVxdWVzdDsKKyAgICBNdHBEYXRhUGFja2V0ICAgICAgICAgICBtRGF0YTsKKyAgICBNdHBSZXNwb25zZVBhY2tldCAgICAgICBtUmVzcG9uc2U7CisKK3B1YmxpYzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEZXZpY2Uoc3RydWN0IHVzYl9kZXZpY2UqIGRldmljZSwgaW50IGludGVyZmFjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB1c2JfZW5kcG9pbnQgKmVwX2luLCBzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcF9vdXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50ICplcF9pbnRyKTsKKyAgICB2aXJ0dWFsICAgICAgICAgICAgICAgICB+TXRwRGV2aWNlKCk7CisKKyAgICBpbmxpbmUgaW50ICAgICAgICAgICAgICBnZXRJRCgpIGNvbnN0IHsgcmV0dXJuIG1JRDsgfQorCisgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgaW5pdGlhbGl6ZSgpOworICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIGNsb3NlKCk7CisgICAgY29uc3QgY2hhciogICAgICAgICAgICAgZ2V0RGV2aWNlTmFtZSgpOworCisgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgb3BlblNlc3Npb24oKTsKKyAgICBib29sICAgICAgICAgICAgICAgICAgICBjbG9zZVNlc3Npb24oKTsKKworICAgIE10cERldmljZUluZm8qICAgICAgICAgIGdldERldmljZUluZm8oKTsKKyAgICBNdHBTdG9yYWdlSURMaXN0KiAgICAgICBnZXRTdG9yYWdlSURzKCk7CisgICAgTXRwU3RvcmFnZUluZm8qICAgICAgICAgZ2V0U3RvcmFnZUluZm8oTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCk7CisgICAgTXRwT2JqZWN0SGFuZGxlTGlzdCogICAgZ2V0T2JqZWN0SGFuZGxlcyhNdHBTdG9yYWdlSUQgc3RvcmFnZUlELCBNdHBPYmplY3RGb3JtYXQgZm9ybWF0LCBNdHBPYmplY3RIYW5kbGUgcGFyZW50KTsKKyAgICBNdHBPYmplY3RJbmZvKiAgICAgICAgICBnZXRPYmplY3RJbmZvKE10cE9iamVjdEhhbmRsZSBoYW5kbGUpOworICAgIHZvaWQqICAgICAgICAgICAgICAgICAgIGdldFRodW1ibmFpbChNdHBPYmplY3RIYW5kbGUgaGFuZGxlLCBpbnQmIG91dExlbmd0aCk7CisgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgZGVsZXRlT2JqZWN0KE10cE9iamVjdEhhbmRsZSBoYW5kbGUpOworICAgIE10cE9iamVjdEhhbmRsZSAgICAgICAgIGdldFBhcmVudChNdHBPYmplY3RIYW5kbGUgaGFuZGxlKTsKKyAgICBNdHBPYmplY3RIYW5kbGUgICAgICAgICBnZXRTdG9yYWdlSUQoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSk7CisKKyAgICBNdHBQcm9wZXJ0eSogICAgICAgICAgICBnZXREZXZpY2VQcm9wRGVzYyhNdHBEZXZpY2VQcm9wZXJ0eSBjb2RlKTsKKworcHJpdmF0ZToKKyAgICBib29sICAgICAgICAgICAgICAgICAgICBzZW5kUmVxdWVzdChNdHBPcGVyYXRpb25Db2RlIG9wZXJhdGlvbik7CisgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgc2VuZERhdGEoTXRwT3BlcmF0aW9uQ29kZSBvcGVyYXRpb24pOworICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIHJlYWREYXRhKCk7CisgICAgTXRwUmVzcG9uc2VDb2RlICAgICAgICAgcmVhZFJlc3BvbnNlKCk7CisKK307CisKK307IC8vIG5hbWVzcGFjZSBhbmRyb2lkCisKKyNlbmRpZiAvLyBfTVRQX0RFVklDRV9ICmRpZmYgLS1naXQgYS9tZWRpYS9tdHAvTXRwRGV2aWNlSW5mby5jcHAgYi9tZWRpYS9tdHAvTXRwRGV2aWNlSW5mby5jcHAKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMDI1YjhlYgotLS0gL2Rldi9udWxsCisrKyBiL21lZGlhL210cC9NdHBEZXZpY2VJbmZvL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YW5kcm9pZCB7CisKK010cERldmljZUluZm86Ok10cERldmljZUluZm8oKQorICAgIDogICBtU3RhbmRhcmRWZXJzaW9uKDApLAorICAgICAgICBtVmVuZG9yRXh0ZW5zaW9uSUQoMCksCisgICAgICAgIG1WZW5kb3JFeHRlbnNpb25WZXJzaW9uKDApLAorICAgICAgICBtVmVuZG9yRXh0ZW5zaW9uRGVzYyhOVUxMKSwKKyAgICAgICAgbUZ1bmN0aW9uYWxDb2RlKDApLAorICAgICAgICBtT3BlcmF0aW9ucyhOVUxMKSwKKyAgICAgICAgbUV2ZW50cyhOVUxMKSwKKyAgICAgICAgbURldmljZVByb3BlcnRpZXMoTlVMTCksCisgICAgICAgIG1DYXB0dXJlRm9ybWF0cyhOVUxMKSwKKyAgICAgICAgbVBsYXliYWNrRm9ybWF0cyhOVUxMKSwKKyAgICAgICAgbU1hbnVmYWN0dXJlcihOVUxMKSwKKyAgICAgICAgbU1vZGVsKE5VTEwpLAorICAgICAgICBtVmVyc2lvbihOVUxMKSwKKyAgICAgICAgbVNlcmlhbChOVUxMKQoreworfQorCitNdHBEZXZpY2VJbmZvOjp+TXRwRGV2aWNlSW5mbygpIHsKKyAgICBpZiAobVZlbmRvckV4dGVuc2lvbkRlc2MpCisgICAgICAgIGZyZWUobVZlbmRvckV4dGVuc2lvbkRlc2MpOworICAgIGRlbGV0ZSBtT3BlcmF0aW9uczsKKyAgICBkZWxldGUgbUV2ZW50czsKKyAgICBkZWxldGUgbURldmljZVByb3BlcnRpZXM7CisgICAgZGVsZXRlIG1DYXB0dXJlRm9ybWF0czsKKyAgICBkZWxldGUgbVBsYXliYWNrRm9ybWF0czsKKyAgICBpZiAobU1hbnVmYWN0dXJlcikKKyAgICAgICAgZnJlZShtTWFudWZhY3R1cmVyKTsKKyAgICBpZiAobU1vZGVsKQorICAgICAgICBmcmVlKG1Nb2RlbCk7CisgICAgaWYgKG1WZXJzaW9uKQorICAgICAgICBmcmVlKG1WZXJzaW9uKTsKKyAgICBpZiAobVNlcmlhbCkKKyAgICAgICAgZnJlZShtU2VyaWFsKTsKK30KKwordm9pZCBNdHBEZXZpY2VJbmZvOjpyZWFkKE10cERhdGFQYWNrZXQmIHBhY2tldCkgeworICAgIE10cFN0cmluZ0J1ZmZlciBzdHJpbmc7CisKKyAgICAvLyByZWFkIHRoZSBkZXZpY2UgaW5mbworICAgIG1TdGFuZGFyZFZlcnNpb24gPSBwYWNrZXQuZ2V0VUludDE2KCk7CisgICAgbVZlbmRvckV4dGVuc2lvbklEID0gcGFja2V0LmdldFVJbnQzMigpOworICAgIG1WZW5kb3JFeHRlbnNpb25WZXJzaW9uID0gcGFja2V0LmdldFVJbnQxNigpOworCisgICAgcGFja2V0LmdldFN0cmluZyhzdHJpbmcpOworICAgIG1WZW5kb3JFeHRlbnNpb25EZXNjID0gc3RyZHVwKChjb25zdCBjaGFyICopc3RyaW5nKTsKKworICAgIG1GdW5jdGlvbmFsQ29kZSA9IHBhY2tldC5nZXRVSW50MTYoKTsKKyAgICBtT3BlcmF0aW9ucyA9IHBhY2tldC5nZXRBVUludDE2KCk7CisgICAgbUV2ZW50cyA9IHBhY2tldC5nZXRBVUludDE2KCk7CisgICAgbURldmljZVByb3BlcnRpZXMgPSBwYWNrZXQuZ2V0QVVJbnQxNigpOworICAgIG1DYXB0dXJlRm9ybWF0cyA9IHBhY2tldC5nZXRBVUludDE2KCk7CisgICAgbVBsYXliYWNrRm9ybWF0cyA9IHBhY2tldC5nZXRBVUludDE2KCk7CisKKyAgICBwYWNrZXQuZ2V0U3RyaW5nKHN0cmluZyk7CisgICAgbU1hbnVmYWN0dXJlciA9IHN0cmR1cCgoY29uc3QgY2hhciAqKXN0cmluZyk7CisgICAgcGFja2V0LmdldFN0cmluZyhzdHJpbmcpOworICAgIG1Nb2RlbCA9IHN0cmR1cCgoY29uc3QgY2hhciAqKXN0cmluZyk7CisgICAgcGFja2V0LmdldFN0cmluZyhzdHJpbmcpOworICAgIG1WZXJzaW9uID0gc3RyZHVwKChjb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DE2X3QgICAgICAgICAgICAgICAgbVZlbmRvckV4dGVuc2lvblZlcnNpb247CisgICAgY2hhciogICAgICAgICAgICAgICAgICAgbVZlbmRvckV4dGVuc2lvbkRlc2M7CisgICAgdWludDE2X3QgICAgICAgICAgICAgICAgbUZ1bmN0aW9uYWxDb2RlOworICAgIFVJbnQxNkxpc3QqICAgICAgICAgICAgIG1PcGVyYXRpb25zOworICAgIFVJbnQxNkxpc3QqICAgICAgICAgICAgIG1FdmVudHM7CisgICAgTXRwRGV2aWNlUHJvcGVydHlMaXN0KiAgbURldmljZVByb3BlcnRpZXM7CisgICAgTXRwT2JqZWN0Rm9ybWF0TGlzdCogICAgbUNhcHR1cmVGb3JtYXRzOworICAgIE10cE9iamVjdEZvcm1hdExpc3QqICAgIG1QbGF5YmFja0Zvcm1hdHM7CisgICAgY2hhciogICAgICAgICAgICAgICAgICAgbU1hbnVmYWN0dXJlcjsKKyAgICBjaGFyKiAgICAgICAgICAgICAgICAgICBtTW9kZWw7CisgICAgY2hhciogICAgICAgICAgICAgICAgICAgbVZlcnNpb247CisgICAgY2hhciogICAgICAgICAgICAgICAgICAgbVNlcmlhbDsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cERldmljZUluZm8oKTsKKyAgICB2aXJ0dWFsICAgICAgICAgICAgICAgICB+TXRwRGV2aWNlSW5mbygpOworCisgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgcmVhZChNdHBEYXRhUGFja2V0JiBwYWNrZXQpOworCisgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgcHJpbnQoKTsKK307CisKK307IC8vIG5hbWVzcGFjZSBhbmRyb2lkCisKKyNlbmRpZiAvLyBfTVRQX0RFVklDRV9JTkZPX0gKZGlmZiAtLWdpdCBhL21lZGlhL210cC9NdHBNZWRpYVNjYW5uZXIuY3BwIGIvbWVkaWEvbXRwL010cE1lZGlhU2Nhbm5lci5jcHAKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZ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SB2YWx1ZTsKKyAgICAgICAgICAgIG1IYXNDb21wb3NlciA9IHRydWU7CisgICAgICAgIH0gZWxzZSBpZiAgKCFzdHJjbXAobmFtZSwgInRyYWNrbnVtYmVyIikpIHsKKyAgICAgICAgICAgIGlmIChzc2NhbmYodmFsdWUsICIlZCIsICZ0ZW1wKSA9PSAxKQorICAgICAgICAgICAgICAgIG1UcmFjayA9IHRlbXA7CisgICAgICAgIH0gZWxzZSBpZiAgKCFzdHJjbXAobmFtZSwgImRpc2NudW1iZXIiKSkgeworICAgICAgICAgICAgLy8gY3VycmVudGx5IHVudXNlZAorICAgICAgICB9IGVsc2UgaWYgICghc3RyY21wKG5hbWUsICJ5ZWFyIikgfHwgIXN0cmNtcChuYW1lLCAiZGF0ZSIpKSB7CisgICAgICAgICAgICBpZiAoc3NjYW5mKHZhbHVlLCAiJWQiLCAmdGVtcCkgPT0gMSkKKyAgICAgICAgICAgICAgICBtWWVhciA9IHRlbXA7CisgICAgICAgIH0gZWxzZSBpZiAgKCFzdHJjbXAobmFtZSwgImR1cmF0aW9uIikpIHsKKyAgICAgICAgICAgIGlmIChzc2NhbmYodmFsdWUsICIlZCIsICZ0ZW1wKSA9PSAxKQorICAgICAgICAgICAgICAgIG1EdXJhdGlvbiA9IHRlbXA7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBMT0dWKCJoYW5kbGVTdHJpbmdUYWcgJXMgOiAlcyIsIG5hbWUsIHZhbHVlKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICAvLyByZXR1cm5zIHRydWUgaWYgaXQgc3VjY2VlZGVkLCBmYWxzZSBpZiBhbiBleGNlcHRpb24gb2NjdXJlZCBpbiB0aGUgSmF2YSBjb2RlCisgICAgdmlydHVhbCBib29sIHNldE1pbWVUeXBlKGNvbnN0IGNoYXIqIG1pbWVUeXBlKQorICAgIHsKKyAgICAgICAgbU1pbWVUeXBlID0gbWltZVR5cGU7CisgICAg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DsgfQorICAgIGlubGluZSBjb25zdCBjaGFyKiBnZXRBbGJ1bUFydGlzdCgpIGNvbnN0IHsgcmV0dXJuIG1IYXNBbGJ1bUFydGlzdCA/IChjb25zdCBjaGFyICopbUFsYnVtQXJ0aXN0IDogTlVMTDsgfQorICAgIGlubGluZSBjb25zdCBjaGFyKiBnZXRHZW5yZSgpIGNvbnN0IHsgcmV0dXJuIG1IYXNHZW5yZSA/IChjb25zdCBjaGFyICopbUdlbnJlIDogTlVMTDsgfQorICAgIGlubGluZSBjb25zdCBjaGFyKiBnZXRDb21wb3NlcigpIGNvbnN0IHsgcmV0dXJuIG1IYXNDb21wb3NlciA/IChjb25zdCBjaGFyICopbUNvbXBvc2VyIDogTlVMTDsgfQorICAgIGlubGluZSBjb25zdCBjaGFyKiBnZXRNaW1lVHlwZSgpIGNvbnN0IHsgcmV0dXJuIG1IYXNNaW1lVHlwZSA/IChjb25zdCBjaGFyICopbU1pbWVUeXBlIDogTlVMTDsgfQorICAgIGlubGluZSBpbnQgZ2V0VHJhY2soKSBjb25zdCB7IHJldHVybiBtVHJhY2s7IH0KKyAgICBpbmxpbmUgaW50IGdldFllYXIoKSBjb25zdCB7IHJldHVybiBtWWVhcjsgfQorICAgIGlubGluZSBpbnQgZ2V0RHVyYXRpb24oKSBjb25zdCB7IHJldHVybiBtRHVyYXRpb247IH0KKworcHJpdmF0ZToKKyAgICBNdHBTdHJpbmcgICBtVGl0bGU7CisgICAgTXRwU3RyaW5nICAgbUFydGlzdDsKKyAgICBNdHBTdHJpbmcgICBtQWxidW07CisgICAgTXRwU3RyaW5nICAgbUFsYnVtQXJ0aXN0OworICAgIE10cFN0cmluZyAgIG1HZW5yZTsKKyAgICBNdHBTdHJpbmcgICBtQ29tcG9zZXI7CisgICAgTXRwU3RyaW5nICAgbU1pbWVUeXBlOworCisgICAgYm9vbCAgICAgICAgbUhhc1RpdGxlOworICAgIGJvb2wgICAgICAgIG1IYXNBcnRpc3Q7CisgICAgYm9vbCAgICAgICAgbUhhc0FsYnVtOworICAgIGJvb2wgICAgICAgIG1IYXNBbGJ1bUFydGlzdDsKKyAgICBib29sICAgICAgICBtSGFzR2VucmU7CisgICAgYm9vbCAgICAgICAgbUhhc0NvbXBvc2VyOworICAgIGJvb2wgICAgICAgIG1IYXNNaW1lVHlwZTsKKworICAgIGludCAgICAgICAgIG1UcmFjazsKKyAgICBpbnQgICAgICAgICBtWWVhcjsKKyAgICBpbnQgICAgICAgICBtRHVyYXRpb247Cit9OworCisKK010cE1lZGlhU2Nhbm5lcjo6TXRwTWVkaWFTY2FubmVyKE10cFN0b3JhZ2VJRCBpZCwgY29uc3QgY2hhciogZmlsZVBhdGgsIE10cERhdGFiYXNlKiBkYikKKyAgICA6ICAgbVN0b3JhZ2VJRChpZCksCisgICAgICAgIG1GaWxlUGF0aChmaWxlUGF0aCksCisgICAgICAgIG1EYXRhYmFzZShkYiksCisgICAgICAgIG1NZWRpYVNjYW5uZXIoTlVMTCksCisgICAgICAgIG1NZWRpYVNjYW5uZXJDbGllbnQoTlVMTCksCisgICAgICAgIG1GaWxlTGlzdChOVUxMKSwKKyAgICAgICAgbUZpbGVDb3VudCgwKQoreworICAgIG1NZWRpYVNjYW5uZXIgPSBuZXcgU3RhZ2VmcmlnaHRNZWRpYVNjYW5uZXI7CisgICAgbU1lZGlhU2Nhbm5lckNsaWVudCA9IG5ldyBNdHBNZWRpYVNjYW5uZXJDbGllbnQ7Cit9CisKK010cE1lZGlhU2Nhbm5lcjo6fk10cE1lZGlhU2Nhbm5lcigpIHsKK30KKworYm9vbCBNdHBNZWRpYVNjYW5uZXI6OnNjYW5GaWxlcygpIHsKKyAgICBtRGF0YWJhc2UtPmJlZ2luVHJhbnNhY3Rpb24oKTsKKyAgICBtRmlsZUNvdW50ID0gMDsKKyAgICBtRmlsZUxpc3QgPSBtRGF0YWJhc2UtPmdldEZpbGVMaXN0KG1GaWxlQ291bnQpOworCisgICAgaW50IHJldCA9IHNjYW5EaXJlY3RvcnkobUZpb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GUgPSBtRGF0YWJhc2UtPmdldE9iamVjdEhhbmRsZShidWZmZXIpOworICAgICAgICAgICAgaWYgKGhhbmRsZSkgeworICAgICAgICAgICAgICAgIG1hcmtGaWxlKGhhbmRsZSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGhhbmRsZSA9IG1EYXRhYmFzZS0+YWRkRmlsZShidWZmZXIsIE1UUF9GT1JNQVRfQVNTT0NJQVRJT04sCisgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnQsIG1TdG9yYWdlSUQsIDAsIHN0YXRidWYuc3RfbXRpbWUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2NhbkRpcmVjdG9yeShidWZmZXIsIGhhbmRsZSk7CisgICAgICAgIH0gZWxzZSBpZiAoU19JU1JFRyhzdGF0YnVmLnN0X21vZGUpKSB7CisgICAgICAgICAgICBzY2FuRmlsZShidWZmZXIsIHBhcmVudCwgc3RhdGJ1Zik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBjbG9zZWRpcihkaXIpOworICAgIHJldHVybiAwOworfQorCit2b2lkIE10cE1lZGlhU2Nhbm5lcjo6c2NhbkZpbGUoY29uc3QgY2hhciogcGF0aCwgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCwgc3RydWN0IHN0YXQmIHN0YXRidWYpIHsKKyAgICB1aW50MzJfdCB0YWJsZTsKKyAgICBNdHBPYmplY3RGb3JtYXQgZm9ybWF0ID0gZ2V0RmlsZUZvcm1hdChwYXRoLCB0YWJsZSk7CisgICAgLy8gZG9uJ3Qgc2NhbiB1bmtub3duIGZpbGUgdHlwZXMKKyAgICBpZiAoZm9ybWF0ID09IE1UUF9GT1JNQVRfVU5ERUZJTkVEKQorICAgICAgICByZXR1cm47CisgICAgTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSA9IG1EYXRhYmFzZS0+Z2V0T2JqZWN0SGFuZGxlKHBhdGgpOworICAgIC8vIGZpeG1lIC0gcmVzY2FuIGlmIG1vZCBkYXRlIGNoYW5nZWQKKyAgICBpZiAoaGFuZGxlKSB7CisgICAgICAgIG1hcmtGaWxlKGhhbmRsZSk7CisgICAgfSBlbHNlIHsKKyAgICAgICAgbURhdGFiYXNlLT5iZWdpblRyYW5zYWN0aW9uKCk7CisgICAgICAgIGhhbmRsZSA9IG1EYXRhYmFzZS0+YWRkRmlsZShwYXRoLCBmb3JtYXQsIHBhcmVudCwgbVN0b3JhZ2VJRCwKKyAgICAgICAgICAgICAgICBzdGF0YnVmLnN0X3NpemUsIHN0YXRidWYuc3RfbXRpbWUpOworICAgICAgICBpZiAoaGFuZGxlIDw9IDApIHsKKyAgICAgICAgICAgIExPR0UoImFkZEZpbGUgZmFpbGVkIGluIE10cE1lZGlhU2Nhbm5lcjo6c2NhbkZpbGUoKSIpOworICAgICAgICAgICAgbURhdGFiYXNlLT5yb2xsYmFja1RyYW5zYWN0aW9uKCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAodGFibGUgPT0ga09iamVjdEhhbmRsZVRhYmxlQXVkaW8pIHsKKyAgICAgICAgICAgIG1NZWRpYVNjYW5uZXJDbGllbnQtPnJlc2V0KCk7CisgICAgICAgICAgICBtTWVkaWFTY2FubmVyLT5wcm9jZXNzRmlsZShwYXRoLCBOVUxMLCAqbU1lZGlhU2Nhbm5lckNsaWVudCk7CisgICAgICAgICAgICBoYW5kbGUgPSBtRGF0YWJhc2UtPmFkZEF1ZGlvRmlsZShoYW5kbGUsCisgICAgICAgICAgICAgICAgICAgIG1NZWRpYVNjYW5uZXJDbGllbnQtPmdldFRpdGxlKCksCisgICAgICAgICAgICAgICAgICAgIG1NZWRpYVNjYW5uZXJDbGllbnQtPmdldEFydGlzdCgpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRBbGJ1bSgpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRBbGJ1bUFydGlzdCgpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRHZW5yZSgpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRDb21wb3NlcigpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRNaW1lVHlwZSgpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRUcmFjaygpLAorICAgICAgICAgICAgICAgICAgICBtTWVkaWFTY2FubmVyQ2xpZW50LT5nZXRZZWFyKCksCisgICAgICAgICAgICAgICAgICAgIG1NZWRpYVNjYW5uZXJDbGllbnQtPmdldER1cmF0aW9uKCkpOworICAgICAgICB9CisgICAgICAgIG1EYXRhYmFzZS0+Y29tbWl0VHJhbnNhY3Rpb24oKTsKKyAgICB9Cit9CisKK3ZvaWQgTXRwTWVkaWFTY2FubmVyOjptYXJrRmlsZShNdHBPYmplY3RIYW5kbGUgaGFuZGxlKSB7CisgICAgaWYgKG1GaWxlTGlzdCkgeworICAgICAgICBoYW5kbGUgJj0ga09iamVjdEhhbmRsZUluZGV4TWFzazsKKyAgICAgICAgLy8gYmluYXJ5IHNlYXJjaCBmb3IgdGhlIGZpbGUgaW4gbUZpbGVMaXN0CisgICAgICAgIGludCBsb3cgPSAwOworICAgICAgICBpbnQgaGlnaCA9IG1GaWxlQ291bnQ7CisgICAgICAgIGludCBpbmRleDsKKworICAgICAgICB3aGlsZSAobG93IDwgaGlnaCkgeworICAgICAgICAgICAgaW5kZXggPSAobG93ICsgaGlnaCkgPj4gMTsKKyAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSB0ZXN0ID0gKG1GaWxlTGlzdFtpbmRleF0gJiBrT2JqZWN0SGFuZGxlSW5kZXhNYXNrKTsKKyAgICAgICAgICAgIGlmIChoYW5kbGUgPCB0ZXN0KQorICAgICAgICAgICAgICAgIGhpZ2ggPSBpbmRle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GxlY3RpbmcgbWlzc2luZyBmaWxlcworICAgIE10cE9iamVjdEhhbmRsZSogICAgICAgIG1GaWxlTGlzdDsKKyAgICBpbnQgICAgICAgICAgICAgICAgICAgICBtRmlsZUNvdW50OworCitwdWJsaWM6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwTWVkaWFTY2FubmVyKE10cFN0b3JhZ2VJRCBpZCwgY29uc3QgY2hhciogZmlsZVBhdGgsIE10cERhdGFiYXNlKiBkYik7CisgICAgdmlydHVhbCAgICAgICAgICAgICAgICAgfk10cE1lZGlhU2Nhbm5lcigpOworCisgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgc2NhbkZpbGVzKCk7CisKK3ByaXZhdGU6CisgICAgTXRwT2JqZWN0Rm9ybWF0ICAgICAgICAgZ2V0RmlsZUZvcm1hdChjb25zdCBjaGFyKiBwYXRoLCB1aW50MzJfdCYgdGFibGUpOworICAgIGludCAgICAgICAgICAgICAgICAgICAgIHNjYW5EaXJlY3RvcnkoY29uc3QgY2hhciogcGF0aCwgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCk7CisgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgc2NhbkZpbGUoY29uc3QgY2hhciogcGF0aCwgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCwgc3RydWN0IHN0YXQmIHN0YXRidWYpOworICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIG1hcmtGaWxlKE10cE9iamVjdEhhbmRsZSBoYW5kbGUpOworfTsKKworfTsgLy8gbmFtZXNwYWNlIGFuZHJvaWQKKworI2VuZGlmIC8vIF9NVFBfTUVESUFfU0NBTk5FUl9ICmRpZmYgLS1naXQgYS9tZWRpYS9tdHAvTXRwT2JqZWN0SW5mby5jcHAgYi9tZWRpYS9tdHAvTXRwT2JqZWN0SW5mby5jcHAKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZGQ0MzA0ZQotLS0gL2Rldi9udWxsCisrKyBiL21lZG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dHJpbmdCdWZmZXIuaCIKKyNpbmNsdWRlICJNdHBVdGlscy5oIgorCituYW1lc3BhY2UgYW5kcm9pZCB7CisKK010cE9iamVjdEluZm86Ok10cE9iamVjdEluZm8oTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSkKKyAgICA6ICAgbUhhbmRsZShoYW5kbGUpLAorICAgICAgICBtU3RvcmFnZUlEKDApLAorICAgICAgICBtRm9ybWF0KDApLAorICAgICAgICBtUHJvdGVjdGlvblN0YXR1cygwKSwKKyAgICAgICAgbUNvbXByZXNzZWRTaXplKDApLAorICAgICAgICBtVGh1bWJGb3JtYXQoMCksCisgICAgICAgIG1UaHVtYkNvbXByZXNzZWRTaXplKDApLAorICAgICAgICBtVGh1bWJQaXhXaWR0aCgwKSwKKyAgICAgICAgbVRodW1iUGl4SGVpZ2h0KDApLAorICAgICAgICBtSW1hZ2VQaXhXaWR0aCgwKSwKKyAgICAgICAgbUltYWdlUGl4SGVpZ2h0KDApLAorICAgICAgICBtSW1hZ2VQaXhEZXB0aCgwKSwKKyAgICAgICAgbVBhcmVudCgwKSwKKyAgICAgICAgbUFzc29jaWF0aW9uVHlwZSgwKSwKKyAgICAgICAgbUFzc29jaWF0aW9uRGVzYygwKSwKKyAgICAgICAgbVNlcXVlbmNlTnVtYmVyKDApLAorICAgICAgICBtTmFtZShOVUxMKSwKKyAgICAgICAgbURhdGVDcmVhdGVkKDApLAorICAgICAgICBtRGF0ZU1vZGlmaWVkKDApLAorICAgICAgICBtS2V5d29yZHMoTlVMTCkKK3sKK30KKworTXRwT2JqZWN0SW5mbzo6fk10cE9iamVjdEluZm8oKSB7CisgICAgaWYgKG1OYW1lKQorICAgICAgICBmcmVlKG1OYW1lKTsKKyAgICBpZiAobUtleXdvcmRzKQorICAgICAgICBmcmVlKG1LZXl3b3Jkcyk7Cit9CisKK3ZvaWQgTXRwT2JqZWN0SW5mbzo6cmVhZChNdHBEYXRhUGFja2V0JiBwYWNrZXQpIHsKKyAgICBNdHBTdHJ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ICAgbUltYWdlUGl4V2lkdGg7CisgICAgdWludDMyX3QgICAgICAgICAgICBtSW1hZ2VQaXhIZWlnaHQ7CisgICAgdWludDMyX3QgICAgICAgICAgICBtSW1hZ2VQaXhEZXB0aDsKKyAgICBNdHBPYmplY3RIYW5kbGUgICAgIG1QYXJlbnQ7CisgICAgdWludDE2X3QgICAgICAgICAgICBtQXNzb2NpYXRpb25UeXBlOworICAgIHVpbnQzMl90ICAgICAgICAgICAgbUFzc29jaWF0aW9uRGVzYzsKKyAgICB1aW50MzJfdCAgICAgICAgICAgIG1TZXF1ZW5jZU51bWJlcjsKKyAgICBjaGFyKiAgICAgICAgICAgICAgIG1OYW1lOworICAgIHRpbWVfdCAgICAgICAgICAgICAgbURhdGVDcmVhdGVkOworICAgIHRpbWVfdCAgICAgICAgICAgICAgbURhdGVNb2RpZmllZDsKKyAgICBjaGFyKiAgICAgICAgICAgICAgIG1LZXl3b3JkczsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SW5mbyhNdHBPYmplY3RIYW5kbGUgaGFuZGxlKTsKKyAgICB2aXJ0dWFsICAgICAgICAgICAgIH5NdHBPYmplY3RJbmZvKCk7CisKKyAgICB2b2lkICAgICAgICAgICAgICAgIHJlYWQoTXRwRGF0YVBhY2tldCYgcGFja2V0KTsKKworICAgIHZvaWQgICAgICAgICAgICAgICAgcHJpbnQoKTsKK307CisKK307IC8vIG5hbWVzcGFjZSBhbmRyb2lkCisKKyNlbmRpZiAvLyBfTVRQX09CSkVDVF9JTkZPX0gKZGlmZiAtLWdpdCBhL21lZGlhL210cC9NdHBQYWNrZXQuY3BwIGIvbWVkaWEvbXRwL010cFBhY2tldC5jcHAKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNDJiZjhiYQotLS0gL2Rldi9udWxsCisrKyBiL21lZGlhL210cC9NdHBQYWNrZXQuY3BwCkBAIC0wLDAgKzEsMTU0IEBACisvKgorICogQ29we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AgIH0KKyAgICAgICAgbUJ1ZmZlclNpemUgPSBuZXdMZW5ndGg7CisgICAgfQorfQorCit2b2lkIE10cFBhY2tldDo6ZHVtcCgpIHsKKyNkZWZpbmUgRFVNUF9CWVRFU19QRVJfUk9XICAxNgorICAgIGNoYXIgYnVmZmVyWzUwMF07CisgICAgY2hhciogYnVmcHRyID0gYnVmZmVyOworCisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtUGFja2V0U2l6ZTsgaSsrKSB7CisgICAgICAgIHNwcmludGYoYnVmcHRyLCAiJTAyWCAiLCBtQnVmZmVyW2ldKTsKKyAgICAgICAgYnVmcHRyICs9IHN0cmxlbihidWZwdHIpOworICAgICAgICBpZiAoaSAlIERVTVBfQllURVNfUEVSX1JPVyA9PSAoRFVNUF9CWVRFU19QRVJfUk9XIC0gMSkpIHsKKyAgICAgICAgICAgIExPR1YoIiVzIiwgYnVmZmVyKTsKKyAgICAgICAgICAgIGJ1ZnB0ciA9IGJ1ZmZlcjsKKyAgICAgICAgfQorICAgIH0KKyAgICBpZiAoYnVmcHRyICE9IGJ1ZmZlcikgeworICAgICAgICAvLyBwcmludCBsYXN0IGxpbmUKKyAgICAgICAgTE9HVigiJXMiLCBidWZmZXIpOworICAgIH0KKyAgICBMT0dWKCJcbiIpOworfQorCit1aW50MTZfdCBNdHBQYWNrZXQ6OmdldFVJbnQxNihpbnQgb2Zmc2V0KSBjb25zdCB7CisgICAgcmV0dXJuICgodWludDE2X3QpbUJ1ZmZlcltvZmZzZXQgKyAxXSA8PCA4KSB8ICh1aW50MTZfdCltQnVmZmVyW29mZnNldF07Cit9CisKK3VpbnQzMl90IE10cFBhY2tldDo6Z2V0VUludDMyKGludCBvZmZzZXQpIGNvbnN0IHsKKyAgICByZXR1cm4gKCh1aW50MzJfdCltQnVmZmVyW29mZnNldCArIDNdIDw8IDI0KSB8ICgodWludDMyX3QpbUJ1ZmZlcltvZmZzZXQgKyAyXSA8PCAxNikgfAorICAgICAgICAgICAoKHVpb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ldFNpemU7CisKK3B1YmxpYzoKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cFBhY2tldChpbnQgYnVmZmVyU2l6ZSk7CisgICAgdmlydHVhbCAgICAgICAgICAgICB+TXRwUGFja2V0KCk7CisKKyAgICAvLyBzZXRzIHBhY2tldCBzaXplIHRvIHRoZSBkZWZhdWx0IGNvbnRhaW5lciBzaXplIGFuZCBzZXRzIGJ1ZmZlciB0byB6ZXJvCisgICAgdmlydHVhbCB2b2lkICAgICAgICByZXNldCgpOworCisgICAgdm9pZCAgICAgICAgICAgICAgICBhbGxvY2F0ZShpbnQgbGVuZ3RoKTsKKyAgICB2b2lkICAgICAgICAgICAgICAgIGR1bXAoKTsKKworICAgIHVpbnQxNl90ICAgICAgICAgICAgZ2V0Q29udGFpbmVyQ29kZSgpIGNvbnN0OworICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0Q29udGFpbmVyQ29kZSh1aW50MTZfdCBjb2RlKTsKKworICAgIE10cFRyYW5zYWN0aW9uSUQgICAgZ2V0VHJhbnNhY3Rpb25JRCgpIGNvbnN0OworICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0VHJhbnNhY3Rpb25JRChNdHBUcmFuc2FjdGlvbklEIGlkKTsKKworICAgIHVpbnQzMl90ICAgICAgICAgICAgZ2V0UGFyYW1ldGVyKGludCBpbmRleCkgY29uc3Q7CisgICAgdm9pZCAgICAgICAgICAgICAgICBzZXRQYXJhbWV0ZXIoaW50IGluZGV4LCB1aW50MzJfdCB2YWx1ZSk7CisKKyNpZmRlZiBNVFBfSE9TVAorICAgIGludCAgICAgICAgICAgICAgICAgdHJhbnNmZXIoc3RydWN0IHVzYl9lbmRwb2ludCAqZXAsIHZvaWQqIGJ1ZmZlciwgaW50IGxlbmd0aCk7CisjZW5kaWYKKworcHJvdGVjdGVkOgorICAgIHVpbnQxNl90ICAgICAgICAgICAgZ2V0VUludDE2KGludCBvZmZzZXQpIGNvbnN0OworICAgIHVpbnQzMl90ICAgICAgICAg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GVydHkoTXRwUHJvcGVydHlDb2RlIHByb3BDb2RlLAorICAgICAgICAgICAgICAgICAgICAgICAgIE10cERhdGFUeXBlIHR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCB3cml0ZWFibGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRlZmF1bHRWYWx1ZSkKKyAgICA6ICAgbUNvZGUocHJvcENvZGUpLAorICAgICAgICBtVHlwZSh0eXBlKSwKKyAgICAgICAgbVdyaXRlYWJsZSh3cml0ZWFibGUpLAorICAgICAgICBtRGVmYXVsdEFycmF5TGVuZ3RoKDApLAorICAgICAgICBtRGVmYXVsdEFycmF5VmFsdWVzKE5VTEwpLAorICAgICAgICBtQ3VycmVudEFycmF5TGVuZ3RoKDApLAorICAgICAgICBtQ3VycmVudEFycmF5VmFsdWVzKE5VTEwpLAorICAgICAgICBtRm9ybUZsYWcoa0Zvcm1Ob25lKSwKKyAgICAgICAgbUVudW1MZW5ndGgoMCksCisgICAgICAgIG1FbnVtVmFsdWVzKE5VTEwpCit7CisgICAgbWVtc2V0KCZtRGVmYXVsdFZhbHVlLCAwLCBzaXplb2YobURlZmF1bHRWYWx1ZSkpOworICAgIG1lbXNldCgmbUN1cnJlbnRWYWx1ZSwgMCwgc2l6ZW9mKG1DdXJyZW50VmFsdWUpKTsKKyAgICBtZW1zZXQoJm1NaW5pbXVtVmFsdWUsIDAsIHNpemVvZihtTWluaW11bVZhbHVlKSk7CisgICAgbWVtc2V0KCZtTWF4aW11bVZhbHVlLCAwLCBzaXplb2YobU1heGltdW1WYWx1ZSkpOworCisgICAgaWYgKGRlZmF1bHRWYWx1ZSkgeworICAgICAgICBzd2l0Y2ggKHR5cGUpIHsKKyAgICAgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UODoKKyAgICAgICAgICAgICAgICBtRGVmYXVsdFZhbHVlLmk4ID0gZGVmYXVsdFZhbHVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UODoKKyAgICAgICAgICAgICAgICBtRGVmYXVsdFZhbHVlLnU4ID0gZGVmYXVsdFZhbHVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQxNjoKKyAgICAgICAgICAgICAgICBtRGVmYXVsdFZhbHVlLmkxNiA9IGRlZmF1bHRWYWx1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDE2OgorICAgICAgICAgICAgICAgIG1EZWZhdWx0VmFsdWUudTE2ID0gZGVmYXVsdFZhbHVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQzMjoKKyAgICAgICAgICAgICAgICBtRGVmYXVsdFZhbHVlLmkzMiA9IGRlZmF1bHRWYWx1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDMyOgorICAgICAgICAgICAgICAgIG1EZWZhdWx0VmFsdWUudTMyID0gZGVmYXVsdFZhbHVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQ2NDoKKyAgICAgICAgICAgICAgICBtRGVmYXVsdFZhbHVlLmk2NCA9IGRlZmF1bHRWYWx1ZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDY0OgorICAgICAgICAgICAgICAgIG1EZWZhdWx0VmFsdWUudTY0ID0gZGVmYXVsdFZhbHVlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBMT0dFKCJ1bmtub3duIHR5cGUgJWQgaW4gTXRwUHJvcGVydHk6Ok10cFByb3BlcnR5IiwgdHlwZSk7CisgICAgICAgIH0KKyAgICB9Cit9CisKK010cFByb3BlcnR5Ojp+TXRwUHJvcGVydHkoKSB7CisgICAgaWYgKG1UeXBlID09IE1UUF9UWVBFX1NUUikgeworICAgICAgICAvLyBmcmVlIGFsbCBzdHJpbmdzCisgICAgICAgIGZyZWUobURlZmF1bHRWYWx1ZS5zdHIpOworICAgICAgICBmcmVlKG1DdXJyZW50VmFsdWUuc3RyKTsKKyAgICAgICAgZnJlZShtTWluaW11bVZhbHVlLnN0cik7CisgICAgICAgIGZyZWUobU1heGltdW1WYWx1ZS5zdHIpOworICAgICAgICBpZiAobURlZmF1bHRBcnJheVZhbHVlcykgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtRGVmYXVsdEFycmF5TGVuZ3RoOyBpKyspCisgICAgICAgICAgICAgICAgZnJlZShtRGVmYXVsdEFycmF5VmFsdWVzW2ldLnN0cik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1DdXJyZW50QXJyYXlWYWx1ZXMpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbUN1cnJlbnRBcnJheUxlbmd0aDsgaSsrKQorICAgICAgICAgICAgICAgIGZyZWUobUN1cnJlbnRBcnJheVZhbHVlc1tpXS5zdHIpOworICAgICAgICB9CisgICAgICAgIGlmIChtRW51bVZhbHVlcykgeworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtRW51bUxlbmd0aDsgaSsrKQorICAgICAgICAgICAgICAgIGZyZWUobUVudW1WYWx1ZXNbaV0uc3RyKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBkZWxldGVbXSBtRGVmYXVsdEFycmF5VmFsdWVzOworICAgIGRlbGV0ZVtdIG1DdXJyZW50QXJyYXlWYWx1ZXM7CisgICAgZGVsZXRlW10gbUVudW1WYWx1ZXM7Cit9CisKK3ZvaWQgTXRwUHJvcGVydHk6OnJlYWQoTXRwRGF0YVBhY2tldCYgcGFja2V0LCBib29sIGRldmljZVByb3ApIHsKKyAgICBNdHBT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yAidHJ1ZSIgOiAiZmFsc2UiKSk7Cit9CisKK3ZvaWQgTXRwUHJvcGVydHk6OnJlYWRWYWx1ZShNdHBEYXRhUGFja2V0JiBwYWNrZXQsIE10cFByb3BlcnR5VmFsdWUmIHZhbHVlKSB7CisgICAgc3dpdGNoIChtVHlwZSkgeworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDg6CisgICAgICAgICAgICB2YWx1ZS5pOCA9IHBhY2tldC5nZXRJbnQ4KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UODoKKyAgICAgICAgICAgIHZhbHVlLnU4ID0gcGFja2V0LmdldFVJbnQ4KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQxNjoKKyAgICAgICAgICAgIHZhbHVlLmkxNiA9IHBhY2tldC5nZXRJbnQxNigpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDE2OgorICAgICAgICAgICAgdmFsdWUudTE2ID0gcGFja2V0LmdldFVJbnQxNigpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMzI6CisgICAgICAgICAgICB2YWx1ZS5pMzIgPSBwYWNrZXQuZ2V0SW50MzIoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQzMjoKKyAgICAgICAgICAgIHZhbHVlLnUzMiA9IHBhY2tldC5nZXRVSW50MzIoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDY0OgorICAgICAgICAgICAgdmFsdWUuaTY0ID0gcGFja2V0LmdldEludDY0KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UNjQ6CisgICAgICAgICAgICB2YWx1ZS51NjQgPSBwYWNrZXQuZ2V0VUludDY0KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQxMjg6CisgICAgICAgICAgICBwYWNrZXQuZ2V0SW50MTI4KHZhbHVlLmkxMjgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDEyODoKKyAgICAgICAgICAgIHBhY2tldC5nZXRVSW50MTI4KHZhbHVlLnUxMjgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICBMT0dFKCJ1bmtub3duIHR5cGUgJWQgaW4gTXRwUHJvcGVydHk6OnJlYWRWYWx1ZSIsIG1UeXBlKTsKKyAgICB9Cit9CisKK3ZvaWQgTXRwUHJvcGVydHk6OndyaXRlVmFsdWUoTXRwRGF0YVBhY2tldCYgcGFja2V0LCBNdHBQcm9wZXJ0eVZhbHVlJiB2YWx1ZSkgeworICAgIHN3aXRjaCAobVR5cGUpIHsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQ4OgorICAgICAgICAgICAgcGFja2V0LnB1dEludDgodmFsdWUuaTgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDg6CisgICAgICAgICAgICBwYWNrZXQucHV0VUludDgodmFsdWUudTgpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMTY6CisgICAgICAgICAgICBwYWNrZXQucHV0SW50MTYodmFsdWUuaTE2KTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQxNjoKKyAgICAgICAgICAgIHBhY2tldC5wdXRVSW50MTYodmFsdWUudTE2KTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDMyOgorICAgICAgICAgICAgcGFja2V0LnB1dEludDMyKHZhbHVlLmkzMik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UMzI6CisgICAgICAgICAgICBwYWNrZXQucHV0VUludDMyKHZhbHVlLnUzMik7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQ2NDoKKyAgICAgICAgICAgIHBhY2tldC5wdXRJbnQ2NCh2YWx1ZS5pNjQpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDY0OgorICAgICAgICAgICAgcGFja2V0LnB1dFVJbnQ2NCh2YWx1ZS51NjQpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMTI4OgorICAgICAgICAgICAgcGFja2V0LnB1dEludDEyOCh2YWx1ZS5pMTI4KTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQxMjg6CisgICAgICAgICAgICBwYWNrZXQucHV0VUludDEyOCh2YWx1ZS51MTI4KTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgTE9HRSgidW5rbm93biB0eXBlICVkIGluIE10cFByb3BlcnR5OjpyZWFkVmFsdWUiLCBtVHlwZSk7CisgICAgfQorfQorCitNdHBQcm9wZXJ0eVZhbHVlKiBNdHBQcm9wZXJ0eTo6cmVhZEFycmF5VmFsdWVzKE10cERhdGFQYWNrZXQmIHBhY2tldCwgaW50JiBsZW5ndGgpIHsKKyAgICBsZW5ndGggPSBwYWNrZXQuZ2V0VUludDMyKCk7CisgICAgaWYgKGxlbmd0aCA9PSAwKQorICAgICAgICByZXR1cm4gTlVMTDsKKyAgICBNdHBQcm9wZXJ0eVZhbHVlKiByZXN1bHQgPSBuZXcgTXRwUHJvcGVydHlWYWx1ZVtsZW5ndGhdOworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspCisgICAgICAgIHJlYWRWYWx1ZShw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R3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqLworCisjaWZuZGVmIF9NVFBfUFJPUEVSVFlfSAorI2RlZmluZSBfTVRQX1BST1BFUlRZX0gKKworI2luY2x1ZGUgIk10cFR5cGVzLmgiCisKK25hbWVzcGFjZSBhbmRyb2lkIHsKKworY2xhc3MgTXRwRGF0YVBhY2tldDsKKworY2xhc3MgTXRwUHJvcGVydHkgeworcHVibGljOgorICAgIE10cFByb3BlcnR5Q29kZSAgICAgbUNvZGU7CisgICAgTXRwRGF0YVR5cGUgICAgICAgICBtVHlwZTsKKyAgICBib29sICAgICAgICAgICAgICAgIG1Xcml0ZWFibGU7CisgICAgTXRwUHJvcGVydHlWYWx1ZSAgICBtRGVmYXVsdFZhbHVlOworICAgIE10cFByb3BlcnR5VmFsdWUgICAgbUN1cnJlbnRWYWx1ZTsKKworICAgIC8vIGZvciBhcnJheSB0eXBlcworICAgIGludCAgICAgICAgICAgICAgICAgbURlZmF1bHRBcnJheUxlbmd0aDsKKyAgICBNdHBQcm9wZXJ0eVZhbHVlKiAgIG1EZWZhdWx0QXJyYXlWYWx1ZXM7CisgICAgaW50ICAgICAgICAgICAgICAgICBtQ3VycmVudEFycmF5TGVuZ3RoOworICAgIE10cFByb3BlcnR5VmFsdWUqICAgbUN1cnJlbnRBcnJheVZhbHVlczsKKworICAgIGVudW0geworICAgICAgICBrRm9ybU5vbmUgPSAwLAorICAgICAgICBrRm9ybVJhbmdlID0gMSwKKyAgICAgICAga0Zvcm1FbnVtID0gMiwKKyAgICB9OworICAgIHVpbnQ4X3QgICAgICAgICAgICAgbUZvcm1GbGFnOworCisgICAgLy8gZm9yIHJhbmdlIGZvcm0KKyAgICBNdHBQcm9wZXJ0eVZhbHVlICAgIG1NaW5pbXVtVmFsdWU7CisgICAgTXRwUHJvcGVydHlWYWx1ZSAgICBtTWF4aW11bVZhbHVlOworICAgIE10cFByb3BlcnR5VmFsdWUgICAgbVN0ZXBTaXplOworCisgICAgLy8gZm9yIGVudW0gZm9ybQorICAgIGludCAgICAgICAgICAgICAgICAgbUVudW1MZW5ndGg7CisgICAgTXRwUHJvcGVydHlWYWx1ZSogICBtRW51bVZhbHVlczsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgTXRwUHJvcGVydHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cFByb3BlcnR5KE10cFByb3BlcnR5Q29kZSBwcm9wQ29kZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhVHlwZSB0eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgd3JpdGVhYmxlID0gZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRlZmF1bHRWYWx1ZSA9IDApOworICAgIHZpcnR1YWwgICAgICAgICAgICAgfk10cFByb3BlcnR5KCk7CisKKyAgICBpbmxpbmUgTXRwUHJvcGVydHlDb2RlIGdldFByb3BlcnR5Q29kZSgpIGNvbnN0IHsgcmV0dXJuIG1Db2RlOyB9CisKKyAgICB2b2lkICAgICAgICAgICAgICAgIHJlYWQoTXRwRGF0YVBhY2tldCYgcGFja2V0LCBib29sIGRldmljZVByb3ApOworICAgIHZvaWQgICAgICAgICAgICAgICAgd3JpdGUoTXRwRGF0YVBhY2tldCYgcGFja2V0KTsKKworICAgIHZvaWQgICAgICAgIC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itNdHBTdG9yYWdlKiBNdHBTZXJ2ZXI6OmdldFN0b3JhZ2UoTXRwU3RvcmFnZUlEIGlkKSB7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtU3RvcmFnZXMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgTXRwU3RvcmFnZSogc3RvcmFnZSA9ICBtU3RvcmFnZXNbaV07CisgICAgICAgIGlmIChzdG9yYWdlLT5nZXRTdG9yYWdlSUQoKSA9PSBpZCkKKyAgICAgICAgICAgIHJldHVybiBzdG9yYWdlOworICAgIH0KKyAgICByZXR1cm4gTlVMTDsKK30KKwordm9pZCBNdHBTZXJ2ZXI6OnNjYW5TdG9yYWdlKCkgeworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbVN0b3JhZ2VzLnNpemUoKTsgaSsrKSB7CisgICAgICAgIE10cFN0b3JhZ2UqIHN0b3JhZ2UgPSAgbVN0b3JhZ2VzW2ldOworICAgICAgICBzdG9yYWdlLT5zY2FuRmlsZXMoKTsKKyAgICB9Cit9CisKK3ZvaWQgTXRwU2VydmVyOjpydW4oKSB7CisgICAgaW50IGZkID0gbUZEOworCisgICAgTE9HVigiTXRwU2VydmVyOjpydW4gZmQ6ICVkXG4iLCBmZCk7CisKKyAgICB3aGlsZSAoMSkgeworICAgICAgICBpbnQgcmV0ID0gbVJlcXVlc3QucmVhZChmZCk7CisgICAgICAgIGlmIChyZXQgPCAwKSB7CisgICAgICAgICAgICBMT0dFKCJyZXF1ZXN0IHJlYWQgcmV0dXJuZWQgJWQsIGVycm5vOiAlZCIsIHJldCwgZXJybm8pOworICAgICAgICAgICAgaWYgKGVycm5vID09IEVDQU5DRUxFRCkgeworICAgICAgICAgICAgICAgIC8vIHJldHVybiB0byB0b3Agb2YgbG9vcCBhbmQgd2FpdCBmb3IgbmV4dCBjb21tYW5kCisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBNdHBPcGVyYXRpb25Db2RlIG9wZXJhdGlvbiA9IG1SZXF1ZXN0LmdldE9wZXJhdGlvbkNvZGUoKTsKKyAgICAgICAgTXRwVHJhbnNhY3Rpb25JRCB0cmFuc2FjdGlvbiA9IG1SZXF1ZXN0LmdldFRyYW5zYWN0aW9uSUQoKTsKKworICAgICAgICBMT0dWKCJvcGVyYXRpb246ICVzIiwgTXRwRGVidWc6OmdldE9wZXJhdGlvbkNvZGVOYW1lKG9wZXJhdGlvbikpOworICAgICAgICBtUmVxdWVzdC5kdW1wKCk7CisKKyAgICAgICAgLy8gRklYTUUgbmVlZCB0byBnZW5lcmFsaXplIHRoaXMKKyAgICAgICAgYm9vbCBkYXRhSW4gPSAob3BlcmF0aW9uID09IE1UUF9PUEVSQVRJT05fU0VORF9PQkpFQ1RfSU5GTyk7CisgICAgICAgIGlmIChkYXRhSW4pIHsKKyAgICAgICAgICAgIGludCByZXQgPSBtRGF0YS5yZWFkKGZkKTsKKyAgICAgICAgICAgIGlmIChyZXQgPCAwKSB7CisgICAgICAgICAgICAgICAgTE9HRSgiZGF0YSByZWFkIHJldHVybmVkICVkLCBlcnJubzogJWQiLCByZXQsIGVycm5vKTsKKyAgICAgICAgICAgICAgICBpZiAoZXJybm8gPT0gRUNBTkNFTEVEKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHJldHVybiB0byB0b3Agb2YgbG9vcCBhbmQgd2FpdCBmb3IgbmV4dCBjb21tYW5kCisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIExPR1YoInJlY2VpdmVkIGRhdGE6Iik7CisgICAgICAgICAgICBtRGF0YS5kdW1wKCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtRGF0YS5yZXNldCgpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGhhbmRsZVJlcXVlc3QoKSkgeworICAgICAgICAgICAgaWYgKCFkYXRhSW4gJiYgbURhdGEuaGFzRGF0YSgpKSB7CisgICAgICAgICAgICAgICAgbURhdGEuc2V0T3BlcmF0aW9uQ29kZShvcGVyYXRpb24pOworICAgICAgICAgICAgICAgIG1EYXRhLnNldFRyYW5zYWN0aW9uSUQodHJhbnNhY3Rpb24pOworICAgICAgICAgICAgICAgIExPR1YoInNlbmRpbmcgZGF0YToiKTsKKyAgICAgICAgICAgICAgICBtRGF0YS5kdW1wKCk7CisgICAgICAgICAgICAgICAgcmV0ID0gbURhdGEud3JpdGUoZmQpOworICAgICAgICAgICAgICAgIGlmIChyZXQgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgIExPR0UoInJlcXVlc3Qgd3JpdGUgcmV0dXJuZWQgJWQsIGVycm5vOiAlZCIsIHJldCwgZXJybm8pOworICAgICAgICAgICAgICAgICAgICBpZiAoZXJybm8gPT0gRUNBTkNFTEVEKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyByZXR1cm4gdG8gdG9wIG9mIGxvb3AgYW5kIHdhaXQgZm9yIG5leHQgY29tbWFuZAorICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtUmVzcG9uc2Uuc2V0VHJhbnNhY3Rpb25JRCh0cmFuc2FjdGlvbik7CisgICAgICAgICAgICBMT0dWKCJzZW5kaW5nIHJlc3BvbnNlICUwNFgiLCBtUmVzcG9uc2UuZ2V0UmVzcG9uc2VDb2RlKCkpOworICAgICAgICAgICAgcmV0ID0gbVJlc3BvbnNlLndyaXRlKGZkKTsKKyAgICAgICAgICAgIGlmIChyZXQgPCAwKSB7CisgICAgICAgICAgICAgICAgTE9HRSgicmVxdWVzdCB3cml0ZSByZXR1cm5lZCAlZCwgZXJybm86ICVkIiwgcmV0LCBlcnJubyk7CisgICAgICAgICAgICAgICAgaWYgKGVycm5vID09IEVDQU5DRUxFRCkgeworICAgICAgICAgICAgICAgICAgICAvLyByZXR1cm4gdG8gdG9wIG9mIGxvb3AgYW5kIHdhaXQgZm9yIG5leHQgY29tbWFuZAorICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBMT0dWKCJza2lwcGluZyByZXNwb25zZVxuIik7CisgICAgICAgIH0KKyAgICB9Cit9CisKK010cFByb3BlcnR5KiBNdHBTZXJ2ZXI6OmdldE9iamVjdFByb3BlcnR5KE10cFByb3BlcnR5Q29kZSBwcm9wQ29kZSkgeworICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbU9iamVjdFByb3BlcnRpZXMuc2l6ZSgpOyBpKyspIHsKKyAgICAgICAgTXRwUHJvcGVydHkqIHByb3BlcnR5ID0gbU9iamVjdFByb3BlcnRpZXNbaV07CisgICAgICAgIGlmIChwcm9wZXJ0eS0+Z2V0UHJvcGVydHlDb2RlKCkgPT0gcHJvcENvZGUpCisgICAgICAgICAgICByZXR1cm4gcHJvcGVydHk7CisgICAgfQorICAgIHJldHVybiBOVUxMOworfQorCitNdHBQcm9wZXJ0eSogTXRwU2VydmVyOjpnZXREZXZpY2VQcm9wZXJ0eShNdHBQcm9wZXJ0eUNvZGUgcHJvcENvZGUpIHsKKyAgICBmb3IgKGludCBpID0gMDsgaSA8IG1EZXZpY2VQcm9wZXJ0aWVzLnNpemUoKTsgaSsrKSB7CisgICAgICAgIE10cFByb3BlcnR5KiBwcm9wZXJ0eSA9IG1EZXZpY2VQcm9wZXJ0aWVzW2ldOworICAgICAgICBpZiAocHJvcGVydHktPmdldFByb3BlcnR5Q29kZSgpID09IHByb3BDb2RlKQorICAgICAgICAgICAgcmV0dXJuIHByb3BlcnR5OworICAgIH0KKyAgICByZX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FuZGxlIGZyb20gdGhlIGRhdGFiYXNlCisgICAgICAgIExPR0UoImV4cGVjdGVkIFNlbmRPYmplY3QgYWZ0ZXIgU2VuZE9iamVjdEluZm8iKTsKKyAgICAgICAgbVNlbmRPYmplY3RIYW5kbGUgPSBrSW52YWxpZE9iamVjdEhhbmRsZTsKKyAgICB9CisKKyAgICBzd2l0Y2ggKG9wZXJhdGlvbikgeworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX0RFVklDRV9JTkZPOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldERldmljZUluZm8oKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fT1BFTl9TRVNTSU9OOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb09wZW5TZXNzaW9uKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0NMT1NFX1NFU1NJT046CisgICAgICAgICAgICByZXNwb25zZSA9IGRvQ2xvc2VTZXNzaW9uKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9TVE9SQUdFX0lEUzoKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9HZXRTdG9yYWdlSURzKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9HRVRfU1RPUkFHRV9JTkZPOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldFN0b3JhZ2VJbmZvKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfUFJPUFNfU1VQUE9SVEVEOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldE9iamVjdFByb3BzU3VwcG9ydGVkKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfSEFORExFUzoKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9HZXRPYmplY3RIYW5kbGVzKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfUFJPUF9WQUxVRToKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9HZXRPYmplY3RQcm9wVmFsdWUoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9JTkZPOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldE9iamVjdEluZm8oKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVDoKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9HZXRPYmplY3QoKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fU0VORF9PQkpFQ1RfSU5GTzoKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9TZW5kT2JqZWN0SW5mbygpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9TRU5EX09CSkVDVDoKKyAgICAgICAgICAgIHJlc3BvbnNlID0gZG9TZW5kT2JqZWN0KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0RFTEVURV9PQkpFQ1Q6CisgICAgICAgICAgICByZXNwb25zZSA9IGRvRGVsZXRlT2JqZWN0KCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfUFJPUF9ERVNDOgorICAgICAgICAgICAgcmVzcG9uc2UgPSBkb0dldE9iamVjdFByb3BEZXNjKCk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgZGVm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gc3RvcmFnZUlELCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TZW5kT2JqZWN0RmlsZVNpemUsIG1vZGlmaWVkVGltZSk7CisgICAgaWYgKGhhbmRsZSA9PSBrSW52YWxpZE9iamVjdEhhbmRsZSkgeworICAgICAgICBtRGF0YWJhc2UtPnJvbGxiYWNrVHJhbnNhY3Rpb24oKTsKKyAgICAgICAgcmV0dXJuIE1UUF9SRVNQT05TRV9HRU5FUkFMX0VSUk9SOworICAgIH0KKyAgICB1aW50MzJfdCB0YWJsZSA9IE10cERhdGFiYXNlOjpnZXRUYWJsZUZvckZpbGUoZm9ybWF0KTsKKyAgICBpZiAodGFibGUgPT0ga09iamVjdEhhbmRsZVRhYmxlQXVkaW8pCisgICAgICAgIGhhbmRsZSA9IG1EYXRhYmFzZS0+YWRkQXVkaW9GaWxlKGhhbmRsZSk7CisgICAgbURhdGFiYXNlLT5jb21taXRUcmFuc2FjdGlvbigpOworCisgIGlmIChmb3JtYXQgPT0gTVRQX0ZPUk1BVF9BU1NPQ0lBVElPTikgeworICAgICAgICBtb2RlX3QgbWFzayA9IHVtYXNrKDApOworICAgICAgICBpbnQgcmV0ID0gbWtkaXIoKGNvbnN0IGNoYXIgKilwYXRoLCBTX0lSV1hVIHwgU19JUldYRyB8IFNfSVJXWE8pOworICAgICAgICB1bWFzayhtYXNrKTsKKyAgICAgICAgaWYgKHJldCAmJiByZXQgIT0gLUVFWElTVCkKKyAgICAgICAgICAgIHJldHVybiBNVFBfUkVTUE9OU0VfR0VORVJBTF9FUlJPUjsKKyAgICB9IGVsc2UgeworICAgICAgICBtU2VuZE9iamVjdEZpbGVQYXRoID0gcGF0aDsKKyAgICAgICAgLy8gc2F2ZSB0aGUgaGFuZGxlIGZvciB0aGUgU2VuZE9iamVjdCBjYWxsLCB3aGljaCBzaG91bGQgZm9sbG93CisgICAgICAgIG1TZW5kT2JqZWN0SGFuZGxlID0gaGFuZGxlOworICAgIH0KKworICAgIG1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VydHlMaXN0ICAgICBtRGV2aWNlUHJvcGVydGllczsKKworICAgIC8vIGhhbmRsZSBmb3IgbmV3IG9iamVjdCwgc2V0IGJ5IFNlbmRPYmplY3RJbmZvIGFuZCB1c2VkIGJ5IFNlbmRPYmplY3QKKyAgICBNdHBPYmplY3RIYW5kbGUgICAgIG1TZW5kT2JqZWN0SGFuZGxlOworICAgIE10cFN0cmluZyAgICAgICAgICAgbVNlbmRPYmplY3RGaWxlUGF0aDsKKyAgICBzaXplX3QgICAgICAgICAgICAgIG1TZW5kT2JqZWN0RmlsZVNpemU7CisKK3B1YmxpYzoKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cFNlcnZlcihpbnQgZmQsIGNvbnN0IGNoYXIqIGRhdGFiYXNlUGF0aCk7CisgICAgdmlydHVhbCAgICAgICAgICAgICB+TXRwU2VydmVyKCk7CisKKyAgICB2b2lkICAgICAgICAgICAgICAgIGFkZFN0b3JhZ2UoY29uc3QgY2hhciogZmlsZVBhdGgpOworICAgIGlubGluZSB2b2lkICAgICAgICAgYWRkU3RvcmFnZShNdHBTdG9yYWdlKiBzdG9yYWdlKSB7IG1TdG9yYWdlcy5wdXNoKHN0b3JhZ2UpOyB9CisgICAgTXRwU3RvcmFnZSogICAgICAgICBnZXRTdG9yYWdlKE10cFN0b3JhZ2VJRCBpZCk7CisgICAgdm9pZCAgICAgICAgICAgICAgICBzY2FuU3RvcmFnZSgpOworICAgIHZvaWQgICAgICAgICAgICAgICAgcnVuKCk7CisKKyAgICBNdHBQcm9wZXJ0eSogICAgICAgIGdldE9iamVjdFByb3BlcnR5KE10cFByb3BlcnR5Q29kZSBwcm9wQ29kZSk7CisgICAgTXRwUHJvcGVydHkqICAgICAgICBnZXREZXZpY2VQcm9wZXJ0eShNdHBQcm9wZXJ0eUNvZGUgcHJvcENvZGUpOworCitwcml2YXRlOgorICAgIHZvaWQgICAgICAgICAgICAgICAgaW5pdE9iamVjdFByb3BlcnRpZXMoKTsKKworICAgIGJvb2wgICA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OgorICAgIE10cFN0b3JhZ2VJRCAgICAgICAgICAgIG1TdG9yYWdlSUQ7CisgICAgY29uc3QgY2hhciogICAgICAgICAgICAgbUZpbGVQYXRoOworICAgIE10cERhdGFiYXNlKiAgICAgICAgICAgIG1EYXRhYmFzZTsKKyAgICB1aW50NjRfdCAgICAgICAgICAgICAgICBtTWF4Q2FwYWNpdHk7CisKK3B1YmxpYzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBTdG9yYWdlKE10cFN0b3JhZ2VJRCBpZCwgY29uc3QgY2hhciogZmlsZVBhdGgsIE10cERhdGFiYXNlKiBkYik7CisgICAgdmlydHVhbCAgICAgICAgICAgICAgICAgfk10cFN0b3JhZ2UoKTsKKworICAgIGlubGluZSBNdHBTdG9yYWdlSUQgICAgIGdldFN0b3JhZ2VJRCgpIGNvbnN0IHsgcmV0dXJuIG1TdG9yYWdlSUQ7IH0KKyAgICBpbnQgICAgICAgICAgICAgICAgICAgICBnZXRUeXBlKCkgY29uc3Q7CisgICAgaW50ICAgICAgICAgICAgICAgICAgICAgZ2V0RmlsZVN5c3RlbVR5cGUoKSBjb25zdDsKKyAgICBpbnQgICAgICAgICAgICAgICAgICAgICBnZXRBY2Nlc3NDYXBhYmlsaXR5KCkgY29uc3Q7CisgICAgdWludDY0X3QgICAgICAgICAgICAgICAgZ2V0TWF4Q2FwYWNpdHkoKTsKKyAgICB1aW50NjRfdCAgICAgICAgICAgICAgICBnZXRGcmVlU3BhY2UoKTsKKyAgICBjb25zdCBjaGFyKiAgICAgICAgICAgICBnZXREZXNjcmlwdGlvbigpIGNvbnN0OworICAgIGlubGluZSBjb25zdCBjaGFyKiAgICAgIGdldFBhdGgoKSBjb25zdCB7IHJldHVybiBtRmlsZVBhdGg7IH0KKworICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIHNjYW5GaWxlcygpOworfTsKKworfTsgLy8gbmFtZXNwYWNlIGFuZHJvaWQKKworI2VuZGlmIC8vIF9NVFBfU1RPUkFHR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sYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqLworCisjaWZuZGVmIF9NVFBfU1RPUkFHRV9JTkZPX0gKKyNkZWZpbmUgX01UUF9TVE9SQUdFX0lORk9fSAorCisjaW5jbHVkZSAiTXRwVHlwZXMuaCIKKworbmFtZXNwYWNlIGFuZHJvaWQgeworCitjbGFzcyBNdHBEYXRhUGFja2V0OworCitjbGFzcyBNdHBTdG9yYWdlSW5mbyB7CitwdWJsaWM6CisgICAgTXRwU3RvcmFnZUlEICAgICAgICBtU3RvcmFnZUlEOworICAgIHVpbnQxNl90ICAgICAgICAgICAgbVN0b3JhZ2VUeXBlOworICAgIHVpbnQxNl90ICAgICAgICAgICAgbUZpbGVTeXN0ZW1UeXBlOworICAgIHVpbnQxNl90ICAgICAgICAgICAgbUFjY2Vzc0NhcGFiaWxpdHk7CisgICAgdWludDY0X3QgICAgICAgICAgICBtTWF4Q2FwYWNpdHk7CisgICAgdWludDY0X3QgICAgICAgICAgICBtRnJlZVNwYWNlQnl0ZXM7CisgICAgdWludDMyX3QgICAgICAgICAgICBtRnJlZVNwYWNlT2JqZWN0czsKKyAgICBjaGFyKiAgICAgICAgICAgICAgIG1TdG9yYWdlRGVzY3JpcHRpb247CisgICAgY2hhciogICAgICAgICAgICAgICBtVm9sdW1lSWRlbnRpZmllcjsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICAgICAgTXRwU3RvcmFnZUluZm8oTXRwU3RvcmFnZUlEIGlkKTsKKyAgICB2aXJ0dWFsICAgICAgICAgICAgIH5NdHBTdG9yYWdlSW5mbygpOworCisgICAgdm9pZCAgICAgICAgICAgICAgICByZWFkKE10cERhdGFQYWNrZXQmIHBhY2tldCk7CisKKyAgICB2b2lkICAgICAgICAgICAgICAgIHByaW50KCk7Cit9OworCit9OyAvLyBuYW1lc3BhY2UgYW5kcm9pZAorCisjZW5kaWYg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pOworCisgICAgLy8gY291bnQgdGhlIGNoYXJhY3RlcnMKKyAgICBpbnQgY291bnQgPSAwOworICAgIGNoYXIgY2g7CisgICAgd2hpbGUgKChjaCA9ICpzcmMrKykgIT0gMCkgeworICAgICAgICBpZiAoKGNoICYgMHg4MCkgPT0gMCkgeworICAgICAgICAgICAgLy8gc2luZ2xlIGJ5dGUgY2hhcmFjdGVyCisgICAgICAgIH0gZWxzZSBpZiAoKGNoICYgMHhFMCkgPT0gMHhDMCkgeworICAgICAgICAgICAgLy8gdHdvIGJ5dGUgY2hhcmFjdGVyCisgICAgICAgICAgICBpZiAoISAqc3JjKyspIHsKKyAgICAgICAgICAgICAgICAvLyBsYXN0IGNoYXJhY3RlciB3YXMgdHJ1bmNhdGVkLCBzbyBpZ25vcmUgbGFzdCBieXRlCisgICAgICAgICAgICAgICAgbGVuZ3RoLS07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAoKGNoICYgMHhGMCkgPT0gMHhFMCkgeworICAgICAgICAgICAgLy8gMyBieXRlIGNoYXIKKyAgICAgICAgICAgIGlmICghICpzcmMrKykgeworICAgICAgICAgICAgICAgIC8vIGxhc3QgY2hhcmFjdGVyIHdhcyB0cnVuY2F0ZWQsIHNvIGlnbm9yZSBsYXN0IGJ5dGUKKyAgICAgICAgICAgICAgICBsZW5ndGgtLTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmICghICpzcmMrKykgeworICAgICAgICAgICAgICAgIC8vIGxhc3QgY2hhcmFjdGVyIHdhcyB0cnVuY2F0ZWQsIHNvIGlnbm9yZSBsYXN0IHR3byBieXRlcworICAgICAgICAgICAgICAgIGxlbmd0aCAtPSAyOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGNvdW50Kys7CisgICAgfQorCisgICAgbUJ5dGVDb3VudCA9IGxlbmd0aCArIDE7CisgICAgbUJ1ZmZlcltsZW5ndGhdID0gMDsKKyAgICBtQ2hhckNvdW50ID0gY291bnQ7Cit9CisKK3ZvaWQgTXRwU3RyaW5nQnVmZmVyOjpyZWFkRnJvbVBhY2tldChNdHBEYXRhUGFja2V0KiBwYWNrZXQpIHsKKyAgICBpbnQgY291bnQgPSBwYWNrZXQtPmdldFVJbnQ4KCk7CisgICAgdWludDhfdCogZGVzdCA9IG1CdWZmZXI7CisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgIHVpbnQxNl90IGNoID0gcGFja2V0LT5nZXRVSW50MTYoKTsKKyAgICAgICAgaWYgKGNoID49IDB4MDgwMCkgeworICAgICAgICAgICAgKmRlc3QrKyA9ICh1aW50OF90KSgweEUwIHwgKGNoID4+IDEyKSk7CisgICAgICAgICAgICAqZGVzdCsrID0gKHVpbnQ4X3QpKDB4ODAgfCAoKGNoID4+IDYpICYgMHgzRikpOworICAgICAgICAgICAgKmRlc3QrKyA9ICh1aW50OF90KSgweDgwIHwgKGNoICYgMHgzRikpOworICAgICAgICB9IGVsc2UgaWYgKGNoID49IDB4ODApIHsKKyAgICAgICAgICAgICpkZXN0KysgPSAodWludDhfdCkoMHhDMCB8IChjaCA+PiA2KSk7CisgICAgICAgICAgICAqZGVzdCsrID0gKHVpbnQ4X3QpKDB4ODAgfCAoY2ggJiAweDNGKSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAqZGVzdCsrID0gY2g7CisgICAgICAgIH0KKyAgICB9CisgICAgKmRlc3QrKyA9IDA7CisgICAgbUNoYXJDb3VudCA9IGNvdW50OworICAgIG1CeXRlQ291bnQgPSBkZXN0IC0gbUJ1ZmZlcjsKK30KKwordm9pZCBNdHBTdHJpbmdCdWZmZXI6OndyaXRlVG9QYWNrZXQoTXRwRGF0YVBhY2tldCogcGFja2V0KSBjb25zdCB7CisgICAgaW50IGNvdW50ID0gbUNoYXJDb3VudDsKKyAgICBjb25zdCB1aW50OF90KiBzcmMgPSBtQnVmZmVyOworICAgIHBhY2tldC0+cHV0VUludDgoY291bnQpOworCisgICAgLy8gZXhwYW5kIHV0ZjggdG8gMTYgYml0IGNoYXJzCisgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7CisgICAgICAgIHVpbnQxNl90IGNoOworICAgICAgICB1aW50MTZfdCBjaDEgPSAqc3JjKys7CisgICAgICAgIGlmICgoY2gxICYgMHg4MCkgPT0gMCkgeworICAgICAgICAgICAgLy8gc2luZ2xlIGJ5dGUgY2hhcmFjdGVyCisgICAgICAgICAgICBjaCA9IGNoMTsKKyAgICAgICAgfSBlbHNlIGlmICgoY2gxICYgMHhFMCkgPT0gMHhDMCkgeworICAgICAgICAgICAgLy8gdHdvIGJ5dGUgY2hhcmFjdGVyCisgICAgICAgICAgICB1aW50MTZfdCBjaDIgPSAqc3JjKys7CisgICAgICAgICAgICBjaCA9ICgoY2gxICYgMHgxRikgPDwgNikgfCAoY2gyICYgMHgzRik7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyB0aHJlZSBieXRlIGNoYXJhY3RlcgorICAgICAgICAgICAgdWludDE2X3QgY2gyID0gKnNyYysrOworICAgICAgICAgICAgdWludDE2X3QgY2gzID0gKnNyYysrOworICAgICAgICAgICAgY2ggPSAoKGNoMSAmIDB4MEYpIDw8IDEyKSB8ICgoY2gyICYgMHgzRikgPDwgNikgfCAoY2gzICYgMHgzRik7CisgICAgICAgIH0KKyAgICAgICAgcGFja2V0LT5wdXRVSW50MTYoY2gpOworICAgIH0KK30KKworfSAgLy8gbmFtZXNwYWNlIGFuZHJvaWQKZGlmZiAtLWdpdCBhL21lZGlhL210cC9NdHBTdHJpbmdCdWZmZXIuaCBiL21lZGlhL210cC9NdHBTdHJpbmdCdWZmZXIuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi40NjQxYzNmCi0tLSAvZGV2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GFja2V0OworCisvLyBSZXByZXNlbnRzIGEgdXRmOCBzdHJpbmcsIHdpdGggYSBtYXhpbXVtIG9mIDI1NSBjaGFyYWN0ZXJzCitjbGFzcyBNdHBTdHJpbmdCdWZmZXIgeworCitwcml2YXRlOgorICAgIC8vIG1heGltdW0gMyBieXRlcy9jaGFyYWN0ZXIsIHdpdGggMSBleHRyYSBmb3IgemVybyB0ZXJtaW5hdGlvbgorICAgIHVpbnQ4X3QgICAgICAgICBtQnVmZmVyWzI1NSAqIDMgKyAxXTsKKyAgICBpbnQgICAgICAgICAgICAgbUNoYXJDb3VudDsKKyAgICBpbnQgICAgICAgICAgICAgbUJ5dGVDb3VudDsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICBNdHBTdHJpbmdCdWZmZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgTXRwU3RyaW5nQnVmZmVyKGNvbnN0IGNoYXIqIHNyYyk7CisgICAgICAgICAgICAgICAgICAgIE10cFN0cmluZ0J1ZmZlcihjb25zdCBNdHBTdHJpbmdCdWZmZXImIHNyYyk7CisgICAgdmlydHVhbCAgICAgICAgIH5NdHBTdHJpbmdCdWZmZXIoKTsKKworICAgIHZvaWQgICAgICAgICAgICBzZXQoY29uc3QgY2hhciogc3JjKTsKKworICAgIHZvaWQgICAgICAgICAgICByZWFkRnJvbVBhY2tldChNdHBEYXRhUGFja2V0KiBwYWNrZXQpOworICAgIHZvaWQgICAgICAgICAgICB3cml0ZVRvUGFja2V0KE10cERhdGFQYWNrZXQqIHBhY2tldCkgY29uc3Q7CisKKyAgICBpbmxpbmUgaW50ICAgICAgZ2V0Q2hhckNvdW50KCkgY29uc3QgeyByZXR1cm4gbUNoYXJDb3VudDsgfQorICAgIGlubGluZSBpbnQgICAgICBnZXRCeXRlQ291bnQoKSBjb25zdCB7IHJldHVybiBtQnl0ZUNvdW50OyB9CisKKwlpbmxpbmUgb3BlcmF0b3IgY29uc3QgY2hhciooKSBjb25zdCB7IHJldHVybiAoY29uc3Q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RkZGRiBhcmUgcmVzZXJ2ZWQgZm9yIHNwZWNpYWwgcHVycG9zZXMuCit0eXBlZGVmIHVpbnQzMl90IE10cE9iamVjdEhhbmRsZTsKKwordW5pb24gTXRwUHJvcGVydHlWYWx1ZSB7CisgICAgaW50OF90ICAgICAgICAgIGk4OworICAgIHVpbnQ4X3QgICAgICAgICB1ODsKKyAgICBpbnQxNl90ICAgICAgICAgaTE2OworICAgIHVpbnQxNl90ICAgICAgICB1MTY7CisgICAgaW50MzJfdCAgICAgICAgIGkzMjsKKyAgICB1aW50MzJfdCAgICAgICAgdTMyOworICAgIGludDY0X3QgICAgICAgICBpNjQ7CisgICAgdWludDY0X3QgICAgICAgIHU2NDsKKyAgICBpbnQxMjhfdCAgICAgICAgaTEyODsKKyAgICB1aW50MTI4X3QgICAgICAgdTEyODsKKyAgICBjaGFyKiAgICAgICAgICAgc3RyOworfTsKKworLy8gU3BlY2lhbCB2YWx1ZXMKKyNkZWZpbmUgTVRQX1BBUkVOVF9ST09UICAgICAgICAgMHhGRkZGRkZGRiAgICAgICAvLyBwYXJlbnQgaXMgcm9vdCBvZiB0aGUgc3RvcmFnZQorI2RlZmluZSBrSW52YWxpZE9iamVjdEhhbmRsZSAgICAweEZGRkZGRkZGCisKKy8vIE10cE9iamVjdEhhbmRsZSBiaXRzIGFuZCBtYXNrcworI2RlZmluZSBrT2JqZWN0SGFuZGxlTWFya0JpdCAgICAgICAgMHg4MDAwMDAwMCAgICAgIC8vIHVzZWQgZm9yIG1hcmsgJiBzd2VlcCBieSBNdHBNZWRpYVNjYW5uZXIKKyNkZWZpbmUga09iamVjdEhhbmRsZVRhYmxlTWFzayAgICAgIDB4NzAwMDAwMDAgICAgICAvLyBtYXNrIGZvciBvYmplY3QgdGFibGUKKyNkZWZpbmUga09iamVjdEhhbmRsZVRhYmxlRmlsZSAgICAgIDB4MDAwMDAwMDAgICAgICAvLyBvYmplY3QgaXMgb25seSBpbiB0aGUgZmlsZSB0YWJsZQorI2RlZmluZ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MgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKi8KKworI2lmbmRlZiBfU1FMSVRFX1NUQVRFTUVOVF9ICisjZGVmaW5lIF9TUUxJVEVfU1RBVEVNRU5UX0gKKworI2luY2x1ZGUgPHN0ZGludC5oPgorCit0eXBlZGVmIHN0cnVjdCBzcWxpdGUzIHNxbGl0ZTM7Cit0eXBlZGVmIHN0cnVjdCBzcWxpdGUzX3N0bXQgc3FsaXRlM19zdG10OworCituYW1lc3BhY2UgYW5kcm9pZCB7CisKK2NsYXNzIFNxbGl0ZURhdGFiYXNlOworCitjbGFzcyBTcWxpdGVTdGF0ZW1lbnQgeworcHJpdmF0ZToKKyAgICBzcWxpdGUzKiAgICAgICAgbURhdGFiYXNlSGFuZGxlOworICAgIHNxbGl0ZTNfc3RtdCogICBtU3RhdGVtZW50OworICAgIGJvb2wgICAgICAgICAgICBtRG9uZTsKKworcHVibGljOgorICAgICAgICAgICAgICAgICAgICBTcWxpdGVTdGF0ZW1lbnQoU3FsaXRlRGF0YWJhc2UqIGRiKTsKKyAgICB2aXJ0dWFsICAgICAgICAgflNxbGl0ZVN0YXRlbWVudCgpOworCisgICAgYm9vbCAgICAgICAgICAgIHByZXBhcmUoY29uc3QgY2hhciogc3FsKTsKKyAgICBib29sICAgICAgICAgICAgc3RlcCgpOworICAgIHZvaWQgICAgICAgICAgICByZXNldCgpOworICAgIHZvaWQgICAgICAgICAgICBmaW5hbGl6ZSgpOworCisgICAgdm9pZCAgICAgICAgICAgIGJpbmQoaW50IGNvbHVtbiwgaW50IHZhbHVlKTsKKyAgICB2b2lkICAgICAgICAgICAgYmluZChpbnQgY29sdW1uLCBjb25zdCBjaGFyKiB2YWx1ZSk7CisKKyAgICBpbnQgICAgICAgICAgICAgZ2V0Q29sdW1uSW50KGludCBjb2x1bW4pOworICAgIGludDY0X3QgICAgICAgICBnZXRDb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aW5lIE1UUF9UWVBFX1NUUiAgICAgICAgICAgIDB4RkZGRiAgICAgICAgICAvLyBWYXJpYWJsZS1sZW5ndGggVW5pY29kZSBzdHJpbmcKKworLy8gTVRQIEZvcm1hdCBDb2RlcworI2RlZmluZSBNVFBfRk9STUFUX1VOREVGSU5FRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDAgICAvLyBVbmRlZmluZWQgb2JqZWN0CisjZGVmaW5lIE1UUF9GT1JNQVRfQVNTT0NJQVRJT04gICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwMSAgIC8vIEFzc29jaWF0aW9uIChmb3IgZXhhbXBsZSwgYSBmb2xkZXIpCisjZGVmaW5lIE1UUF9GT1JNQVRfU0NSSVBUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwMiAgIC8vIERldmljZSBtb2RlbC1zcGVjaWZpYyBzY3JpcHQKKyNkZWZpbmUgTVRQX0ZPUk1BVF9FWEVDVVRBQkxFICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDAzICAgLy8gRGV2aWNlIG1vZGVsLXNwZWNpZmljIGJpbmFyeSBleGVjdXRhYmxlCisjZGVmaW5lIE1UUF9GT1JNQVRfVEVYVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwNCAgIC8vIFRleHQgZmlsZQorI2RlZmluZSBNVFBfRk9STUFUX0hUTUwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDUgICAvLyBIeXBlcnRleHQgTWFya3VwIExhbmd1YWdlIGZpbGUgKHRleHQpCisjZGVmaW5lIE1UUF9GT1JNQVRfRFBPRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwNiAgIC8vIERpZ2l0YWwgUHJpbnQgT3JkZXIgRm9ybWF0IGZpbGUgKHRleHQpCisjZGVmaW5lIE1UUF9GT1JNQVRfQUlGRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwNyAgIC8vIEF1ZGlvIGNsaXAKKyNkZWZpbmUgTVRQX0ZPUk1BVF9XQVYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA4ICAgLy8gQXVkaW8gY2xpcAorI2RlZmluZSBNVFBfRk9STUFUX01QMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDkgICAvLyBBdWRpbyBjbGlwCisjZGVmaW5lIE1UUF9GT1JNQVRfQVZJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwQSAgIC8vIFZpZGVvIGNsaXAKKyNkZWZpbmUgTVRQX0ZPUk1BVF9NUEVHICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDBCICAgLy8gVmlkZW8gY2xpcAorI2RlZmluZSBNVFBfRk9STUFUX0FTRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMEMgICAvLyBNaWNyb3NvZnQgQWR2YW5jZWQgU3RyZWFtaW5nIEZvcm1hdCAodmlkZW8pCisjZGVmaW5lIE1UUF9GT1JNQVRfREVGSU5FRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwMCAgIC8vIFVua25vd24gaW1hZ2Ugb2JqZWN0CisjZGVmaW5lIE1UUF9GT1JNQVRfRVhJRl9KUEVHICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwMSAgIC8vIEV4Y2hhbmdlYWJsZSBGaWxlIEZvcm1hdCwgSkVJREEgc3RhbmRhcmQKKyNkZWZpbmUgTVRQX0ZPUk1BVF9USUZGX0VQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODAyICAgLy8gVGFnIEltYWdlIEZpbGUgRm9ybWF0IGZvciBFbGVjdHJvbmljIFBob3RvZ3JhcGh5CisjZGVmaW5lIE1UUF9GT1JNQVRfRkxBU0hQSVggICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwMyAgIC8vIFN0cnVjdHVyZWQgU3RvcmFnZSBJbWFnZSBGb3JtYXQKKyNkZWZpbmUgTVRQX0ZPUk1BVF9CTVAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODA0ICAgLy8gTWljcm9zb2Z0IFdpbmRvd3MgQml0bWFwIGZpbGUKKyNkZWZpbmUgTVRQX0ZPUk1BVF9DSUZGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODA1ICAgLy8gQ2Fub24gQ2FtZXJhIEltYWdlIEZpbGUgRm9ybWF0CisjZGVmaW5lIE1UUF9GT1JNQVRfR0lGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwNyAgIC8vIEdyYXBoaWNzIEludGVyY2hhbmdlIEZvcm1hdAorI2RlZmluZSBNVFBfRk9STUFUX0pGSUYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDggICAvLyBKUEVHIEZpbGUgSW50ZXJjaGFuZ2UgRm9ybWF0CisjZGVmaW5lIE1UUF9GT1JNQVRfQ0QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwOSAgIC8vIFBob3RvQ0QgSW1hZ2UgUGFjCisjZGVmaW5lIE1UUF9GT1JNQVRfUElDVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwQSAgIC8vIFF1aWNrZHJhdyBJbWFnZSBGb3JtYXQKKyNkZWZpbmUgTVRQX0ZPUk1BVF9QTkcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODBCICAgLy8gUG9ydGFibGUgTmV0d29yayBHcmFwaGljcworI2RlZmluZSBNVFBfRk9STUFUX1RJRkYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MEQgICAvLyBUYWcgSW1hZ2UgRmlsZSBGb3JtYXQKKyNkZWZpbmUgTVRQX0ZPUk1BVF9USUZGX0lUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODBFICAgLy8gVGFnIEltYWdlIEZpbGUgRm9ybWF0IGZvciBJbmZvcm1hdGlvbiBUZWNobm9sb2d5IChncmFwaGljIGFydHMpCisjZGVmaW5lIE1UUF9GT1JNQVRfSlAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwRiAgIC8vIEpQRUcyMDAwIEJhc2VsaW5lIEZpbGUgRm9ybWF0CisjZGVmaW5lIE1UUF9GT1JNQVRfSlBYICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgxMCAgIC8vIEpQRUcyMDAwIEV4dGVuZGVkIEZpbGUgRm9ybWF0CisjZGVmaW5lIE1UUF9GT1JNQVRfVU5ERUZJTkVEX0ZJUk1XQVJFICAgICAgICAgICAgICAgICAgIDB4QjgwMgorI2RlZmluZSBNVFBfRk9STUFUX1dJTkRPV1NfSU1BR0VfRk9STUFUICAgICAgICAgICAgICAgICAweEI4ODEKKyNkZWZpbmUgTVRQX0ZPUk1BVF9VTkRFRklORURfQVVESU8gICAgICAgICAgICAgICAgICAgICAgMHhCOTAwCisjZGVmaW5lIE1UUF9GT1JNQVRfV01BICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4QjkwMQorI2RlZmluZSBNVFBfRk9STUFUX09HRyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5MDIKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BQUMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTAzCisjZGVmaW5lIE1UUF9GT1JNQVRfQVVESUJMRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4QjkwNAorI2RlZmluZSBNVFBfRk9STUFUX0ZMQUMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5MDYKKyNkZWZpbmUgTVRQX0ZPUk1BVF9VTkRFRklORURfVklERU8gICAgICAgICAgICAgICAgICAgICAgMHhCOTgwCisjZGVmaW5lIE1UUF9GT1JNQVRfV01WICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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ICAgICAgIDB4QkEwNgorI2RlZmluZSBNVFBfRk9STUFUX0FCU1RSQUNUX01FU1NBR0VfRk9MREVSICAgICAgICAgICAgICAweEJBMDcKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BQlNUUkFDVF9DSEFQVEVSRURfUFJPRFVDVElPTiAgICAgICAgMHhCQTA4CisjZGVmaW5lIE1UUF9GT1JNQVRfQUJTVFJBQ1RfQVVESU9fUExBWUxJU1QgICAgICAgICAgICAgIDB4QkEwOQorI2RlZmluZSBNVFBfRk9STUFUX0FCU1RSQUNUX1ZJREVPX1BMQVlMSVNUICAgICAgICAgICAgICAweEJBMEEKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BQlNUUkFDVF9NRURJQUNBU1QgICAgICAgICAgICAgICAgICAgMHhCQTBCIC8vIEZvciB1c2Ugd2l0aCBtZWRpYWNhc3RzOyByZWZlcmVuY2VzIG11bHRpbWVkaWEgZW5jbG9zdXJlcyBvZiBSU1MgZmVlZHMgb3IgZXBpc29kaWMgY29udGVudAorI2RlZmluZSBNVFBfRk9STUFUX1dQTF9QTEFZTElTVCAgICAgICAgICAgICAgICAgICAgICAgICAweEJBMTAKKyNkZWZpbmUgTVRQX0ZPUk1BVF9NM1VfUExBWUxJU1QgICAgICAgICAgICAgICAgICAgICAgICAgMHhCQTExCisjZGVmaW5lIE1UUF9GT1JNQVRfTVBMX1BMQVlMSVNUICAgICAgICAgICAgICAgICAgICAgICAgIDB4QkExMgorI2RlZmluZSBNVFBfRk9STUFUX0FTWF9QTEFZTElTVCAgICAgICAgICAgICAgICAgICAgICAgICAweEJBMTMKKyNkZWZpbmUgTVRQX0ZPUk1BVF9QTFNfUExBWUxJU1QgICAgICAgICAgICAgICAgICAgICAgICAgMHhCQTE0CisjZGVmaW5lIE1UUF9GT1JNQVRfVU5ERUZJTkVEX0RPQ1VNRU5UICAgICAgICAgICAgICAgICAgIDB4QkE4MAorI2RlZmluZSBNVFBfRk9STUFUX0FCU1RSQUNUX0RPQ1VNRU5UICAgICAgICAgICAgICAgICAgICAweEJBODEKKyNkZWZpbmUgTVRQX0ZPUk1BVF9YTUxfRE9DVU1FTlQgICAgICAgICAgICAgICAgICAgICAgICAgMHhCQTgyCisjZGVmaW5lIE1UUF9GT1JNQVRfTVNfV09SRF9ET0NVTUVOVCAgICAgICAgICAgICAgICAgICAgIDB4QkE4MworI2RlZmluZSBNVFBfRk9STUFUX01IVF9DT01QSUxFRF9IVE1MX0RPQ1VNRU5UICAgICAgICAgICAweEJBODQKKyNkZWZpbmUgTVRQX0ZPUk1BVF9NU19FWENFTF9TUFJFQURTSEVFVCAgICAgICAgICAgICAgICAgMHhCQTg1CisjZGVmaW5lIE1UUF9GT1JNQVRfTVNfUE9XRVJQT0lOVF9QUkVTRU5UQVRJT04gICAgICAgICAgIDB4QkE4NgorI2RlZmluZSBNVFBfRk9STUFUX1VOREVGSU5FRF9NRVNTQUdFICAgICAgICAgICAgICAgICAgICAweEJCMDAKKyNkZWZpbmUgTVRQX0ZPUk1BVF9BQlNUUkFDVF9NRVNTU0FHRSAgICAgICAgICAgICAgICAgICAgMHhCQjAxCisjZGVmaW5lIE1UUF9GT1JNQVRfVU5ERUZJTkVEX0NPTlRBQ1QgICAgICAgICAgICAgICAgICAgIDB4QkI4MAorI2RlZmluZSBNVFBfRk9STUFUX0FCU1RSQUNUX0NPTlRBQ1QgICAgICAgICAgICAgICAgICAgICAweEJCODEKKyNkZWZpbmUgTVRQX0ZPUk1BVF9WQ0FSRF8yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCQjgyCisKKy8vIE1UUCBPYmplY3QgUHJvcGVydHkgQ29kZXMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1NUT1JBR0VfSUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwMQorI2RlZmluZSBNVFBfUFJPUEVSVFlfT0JKRUNUX0ZPUk1BVCAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzAyCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QUk9URUNUSU9OX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgICAweERDMDMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX09CSkVDVF9TSVpFICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwNAorI2RlZmluZSBNVFBfUFJPUEVSVFlfQVNTT0NJQVRJT05fVFlQRSAgICAgICAgICAgICAgICAgICAgICAgMHhEQzA1CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BU1NPQ0lBVElPTl9ERVNDICAgICAgICAgICAgICAgICAgICAgICAweERDMDYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX09CSkVDVF9GSUxFX05BTUUgICAgICAgICAgICAgICAgICAgICAgIDB4REMwNworI2RlZmluZSBNVFBfUFJPUEVSVFlfREFURV9DUkVBVEVEICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzA4CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9EQVRFX01PRElGSUVEICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMDkKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0tFWVdPUkRTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwQQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUEFSRU5UX09CSkVDVCAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzBCCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BTExPV0VEX0ZPTERFUl9DT05URU5UUyAgICAgICAgICAgICAgICAweERDMEMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0hJRERFTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwRAorI2RlZmluZSBNVFBfUFJPUEVSVFlfU1lTVEVNX09CSkVDVCAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzBFCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QRVJTSVNURU5UX1VJRCAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1NZTkNfSUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0MgorI2RlZmluZSBNVFBfUFJPUEVSVFlfUFJPUEVSVFlfQkFHICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzQzCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9OQU1FICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0NSRUFURURfQlkgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0NQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQVJUSVNUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzQ2CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9EQVRFX0FVVEhPUkVEICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDcKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0RFU0NSSVBUSU9OICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0OAorI2RlZmluZSBNVFBfUFJPUEVSVFlfVVJMX1JFRkVSRU5DRSAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzQ5CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9MQU5HVUFHRV9MT0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAweERDNEEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0NPUFlSSUdIVF9JTkZPUk1BVElPTiAgICAgICAgICAgICAgICAgIDB4REM0QgorI2RlZmluZSBNVFBfUFJPUEVSVFlfU09VUkNFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzRDCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9PUklHSU5fTE9DQVRJT04gICAgICAgICAgICAgICAgICAgICAgICAweERDNEQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0RBVEVfQURERUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0RQorI2RlZmluZSBNVFBfUFJPUEVSVFlfTk9OX0NPTlNVTUFCTEUgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzRGCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9DT1JSVVBUX1VOUExBWUFCTEUgICAgICAgICAgICAgICAgICAgICAweERDNTAKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BST0RVQ0VSX1NFUklBTF9OVU1CRVIgICAgICAgICAgICAgICAgIDB4REM1MQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX0ZPUk1BVCAgICAgICAgICAgMHhEQzgxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfU0laRSAgICAgICAgICAgICAweERDODIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1JFUFJFU0VOVEFUSVZFX1NBTVBMRV9IRUlHSFQgICAgICAgICAgIDB4REM4MworI2RlZmluZSBNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX1dJRFRIICAgICAgICAgICAgMHhEQzg0CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfRFVSQVRJT04gICAgICAgICAweERDODUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1JFUFJFU0VOVEFUSVZFX1NBTVBMRV9EQVRBICAgICAgICAgICAgIDB4REM4NgorI2RlZmluZSBNVFBfUFJPUEVSVFlfV0lEVEggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzg3CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9IRUlHSFQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDODgKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0RVUkFUSU9OICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4OQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUkFUSU5HICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzhBCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9UUkFDSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOEIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0dFTlJFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4QworI2RlZmluZSBNVFBfUFJPUEVSVFlfQ1JFRElUUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzhECisjZGVmaW5lIE1UUF9QUk9QRVJUWV9MWVJJQ1MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOEUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1NVQlNDUklQVElPTl9DT05URU5UX0lEICAgICAgICAgICAgICAgIDB4REM4RgorI2RlZmluZSBNVFBfUFJPUEVSVFlfUFJPRFVDRURfQlkgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzkwCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9VU0VfQ09VTlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1NLSVBfQ09VTlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5MgorI2RlZmluZSBNVFBfUFJPUEVSVFlfTEFTVF9BQ0NFU1NFRCAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzkzCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QQVJFTlRBTF9SQVRJTkcgICAgICAgICAgICAgICAgICAgICAgICAweERDOTQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX01FVEFfR0VOUkUgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5NQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQ09NUE9TRVIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzk2CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9FRkZFQ1RJVkVfUkFUSU5HICAgICAgICAgICAgICAgICAgICAgICAweERDOTcKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1NVQlRJVExFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5OAorI2RlZmluZSBNVFBfUFJPUEVSVFlfT1JJR0lOQUxfUkVMRUFTRV9EQVRFICAgICAgICAgICAgICAgICAgMHhEQzk5CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BTEJVTV9OQU1FICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOUEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FMQlVNX0FSVElTVCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5QgorI2RlZmluZSBNVFBfUFJPUEVSVFlfTU9PRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzlDCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9EUk1fU1RBVFVTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOUQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1NVQl9ERVNDUklQVElPTiAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5RQorI2RlZmluZSBNVFBfUFJPUEVSVFlfSVNfQ1JPUFBFRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQ0QxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9JU19DT0xPVVJfQ09SUkVDVEVEICAgICAgICAgICAgICAgICAgICAweERDRDIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0lNQUdFX0JJVF9ERVBUSCAgICAgICAgICAgICAgICAgICAgICAgIDB4RENEMworI2RlZmluZSBNVFBfUFJPUEVSVFlfRl9OVU1CRVIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQ0Q0CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9FWFBPU1VSRV9USU1FICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRDUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0VYUE9TVVJFX0lOREVYICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENENgorI2RlZmluZSBNVFBfUFJPUEVSVFlfVE9UQUxfQklUUkFURSAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERTkxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9CSVRSQVRFX1RZUEUgICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOTIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1NBTVBMRV9SQVRFICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5MworI2RlZmluZSBNVFBfUFJPUEVSVFlfTlVNQkVSX09GX0NIQU5ORUxTICAgICAgICAgICAgICAgICAgICAgMHhERTk0CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BVURJT19CSVRfREVQVEggICAgICAgICAgICAgICAgICAgICAgICAweERFOTUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1NDQU5fVFlQRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5NworI2RlZmluZSBNVFBfUFJPUEVSVFlfQVVESU9fV0FWRV9DT0RFQyAgICAgICAgICAgICAgICAgICAgICAgMHhERTk5CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BVURJT19CSVRSQVRFICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOUEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1ZJREVPX0ZPVVJDQ19DT0RFQyAgICAgICAgICAgICAgICAgICAgIDB4REU5QgorI2RlZmluZSBNVFBfUFJPUEVSVFlfVklERU9fQklUUkFURSAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERTlDCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9GUkFNRVNfUEVSX1RIT1VTQU5EX1NFQ09ORFMgICAgICAgICAgICAweERFOUQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0tFWUZSQU1FX0RJU1RBTkNFICAgICAgICAgICAgICAgICAgICAgIDB4REU5RQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQlVGRkVSX1NJWkUgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERTlGCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9FTkNPRElOR19RVUFMSVRZICAgICAgICAgICAgICAgICAgICAgICAweERFQTAKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0VOQ09ESU5HX1BST0ZJTEUgICAgICAgICAgICAgICAgICAgICAgIDB4REVBMQorI2RlZmluZSBNVFBfUFJPUEVSVFlfRElTUExBWV9OQU1FICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQ0UwCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9CT0RZX1RFWFQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRTEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1NVQkpFQ1QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENFMgorI2RlZmluZSBNVFBfUFJPUEVSVFlfUFJJT1JJVFkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQ0UzCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9HSVZFTl9OQU1FICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDAKKyNkZWZpbmUgTVRQX1BST1BFUlRZX01JRERMRV9OQU1FUyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwMQorI2RlZmluZSBNVFBfUFJPUEVSVFlfRkFNSUxZX05BTUUgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDAyCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QUkVGSVggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1NVRkZJWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwNAorI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVUSUNfR0lWRU5fTkFNRSAgICAgICAgICAgICAgICAgICAgMHhERDA1CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORVRJQ19GQU1JTFlfTkFNRSAgICAgICAgICAgICAgICAgICAweEREMDYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0VNQUlMX1BSSU1BUlkgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwNworI2RlZmluZSBNVFBfUFJPUEVSVFlfRU1BSUxfUEVSU09OQUxfMSAgICAgICAgICAgICAgICAgICAgICAgMHhERDA4CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9FTUFJTF9QRVJTT05BTF8yICAgICAgICAgICAgICAgICAgICAgICAweEREMDkKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0VNQUlMX0JVU0lORVNTXzEgICAgICAgICAgICAgICAgICAgICAgIDB4REQwQQorI2RlZmluZSBNVFBfUFJPUEVSVFlfRU1BSUxfQlVTSU5FU1NfMiAgICAgICAgICAgICAgICAgICAgICAgMHhERDBCCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9FTUFJTF9PVEhFUlMgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMEMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FX05VTUJFUl9QUklNQVJZICAgICAgICAgICAgICAgICAgIDB4REQwRAorI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX1BFUlNPTkFMICAgICAgICAgICAgICAgICAgMHhERDBFCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfUEVSU09OQUxfMiAgICAgICAgICAgICAgICAweEREMEYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FX05VTUJFUl9CVVNJTkVTUyAgICAgICAgICAgICAgICAgIDB4REQxMAorI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX0JVU0lORVNTXzIgICAgICAgICAgICAgICAgMHhERDExCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfTU9CSUxFICAgICAgICAgICAgICAgICAgICAweEREMTIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FX05VTUJFUl9NT0JJTEVfMiAgICAgICAgICAgICAgICAgIDB4REQxMworI2RlZmluZSBNVFBfUFJPUEVSVFlfRkFYX05VTUJFUl9QUklNQVJZICAgICAgICAgICAgICAgICAgICAgMHhERDE0CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9GQVhfTlVNQkVSX1BFUlNPTkFMICAgICAgICAgICAgICAgICAgICAweEREMTUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0ZBWF9OVU1CRVJfQlVTSU5FU1MgICAgICAgICAgICAgICAgICAgIDB4REQxNgorI2RlZmluZSBNVFBfUFJPUEVSVFlfUEFHRVJfTlVNQkVSICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDE3CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfT1RIRVJTICAgICAgICAgICAgICAgICAgICAweEREMTgKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BSSU1BUllfV0VCX0FERFJFU1MgICAgICAgICAgICAgICAgICAgIDB4REQxOQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUEVSU09OQUxfV0VCX0FERFJFU1MgICAgICAgICAgICAgICAgICAgMHhERDFBCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9CVVNJTkVTU19XRUJfQUREUkVTUyAgICAgICAgICAgICAgICAgICAweEREMUIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0lOU1RBTlRfTUVTU0FOR0VSX0FERFJFU1MgICAgICAgICAgICAgIDB4REQxQworI2RlZmluZSBNVFBfUFJPUEVSVFlfSU5TVEFOVF9NRVNTQU5HRVJfQUREUkVTU18yICAgICAgICAgICAgMHhERDFECisjZGVmaW5lIE1UUF9QUk9QRVJUWV9JTlNUQU5UX01FU1NBTkdFUl9BRERSRVNTXzMgICAgICAgICAgICAweEREMUUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BPU1RBTF9BRERSRVNTX1BFUlNPTkFMX0ZVTEwgICAgICAgICAgIDB4REQxRgorI2R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UE9TVEFMX0FERFJFU1NfQlVTSU5FU1NfQ09VTlRSWSAgICAgICAgMHhERDJDCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19PVEhFUl9GVUxMICAgICAgICAgICAgICAweEREMkQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BPU1RBTF9BRERSRVNTX09USEVSX0xJTkVfMSAgICAgICAgICAgIDB4REQyRQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfT1RIRVJfTElORV8yICAgICAgICAgICAgMHhERDJGCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19PVEhFUl9DSVRZICAgICAgICAgICAgICAweEREMzAKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1BPU1RBTF9BRERSRVNTX09USEVSX1JFR0lPTiAgICAgICAgICAgIDB4REQzMQorI2RlZmluZSBNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfT1RIRVJfUE9TVEFMX0NPREUgICAgICAgMHhERDMyCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19PVEhFUl9DT1VOVFJZICAgICAgICAgICAweEREMzMKKyNkZWZpbmUgTVRQX1BST1BFUlRZX09SR0FOSVpBVElPTl9OQU1FICAgICAgICAgICAgICAgICAgICAgIDB4REQzNAorI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVUSUNfT1JHQU5JWkFUSU9OX05BTUUgICAgICAgICAgICAgMHhERDM1CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9ST0xFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMzYKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0JJUlRIREFURSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQzNworI2RlZmluZSBNVFBfUFJPUEVSVFlfTUVTU0FHRV9UTyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDQwCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9NRVNTQUdFX0NDICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENDEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX01FU1NBR0VfQkNDICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ0MgorI2RlZmluZSBNVFBfUFJPUEVSVFlfTUVTU0FHRV9SRUFEICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDQzCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9NRVNTQUdFX1JFQ0VJVkVEX1RJTUUgICAgICAgICAgICAgICAgICAweERENDQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX01FU1NBR0VfU0VOREVSICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ0NQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfQkVHSU5fVElNRSAgICAgICAgICAgICAgICAgICAgMHhERDUwCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9FTkRfVElNRSAgICAgICAgICAgICAgICAgICAgICAweERENTEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX0xPQ0FUSU9OICAgICAgICAgICAgICAgICAgICAgIDB4REQ1MgorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfUkVRVUlSRURfQVRURU5ERUVTICAgICAgICAgICAgMHhERDU0CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9PUFRJT05BTF9BVFRFTkRFRVMgICAgICAgICAgICAweERENTUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX1JFU09VUkNFUyAgICAgICAgICAgICAgICAgICAgIDB4REQ1NgorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfQUNDRVBURUQgICAgICAgICAgICAgICAgICAgICAgMHhERDU3CisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9URU5UQVRJVkUgICAgICAgICAgICAgICAgICAgICAweERENTgKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX0RFQ0xJTkVEICAgICAgICAgICAgICAgICAgICAgIDB4REQ1OQorI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfUkVNQUlOREVSX1RJTUUgICAgICAgICAgICAgICAgMHhERDVBCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9PV05FUiAgICAgICAgICAgICAgICAgICAgICAgICAweERENUIKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ1QworI2RlZmluZSBNVFBfUFJPUEVSVFlfT1dORVIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDVECisjZGVmaW5lIE1UUF9QUk9QRVJUWV9FRElUT1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENUUKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1dFQk1BU1RFUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ1RgorI2RlZmluZSBNVFBfUFJPUEVSVFlfVVJMX1NPVVJDRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDYwCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9VUkxfREVTVElOQVRJT04gICAgICAgICAgICAgICAgICAgICAgICAweERENjEKKyNkZWZpbmUgTVRQX1BST1BFUlRZX1RJTUVfQk9PS01BUksgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ2MgorI2RlZmluZSBNVFBfUFJPUEVSVFlfT0JKRUNUX0JPT0tNQVJLICAgICAgICAgICAgICAgICAgICAgICAgMHhERDYzCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9CWVRFX0JPT0tNQVJLICAgICAgICAgICAgICAgICAgICAgICAgICAweERENjQKKyNkZWZpbmUgTVRQX1BST1BFUlRZX0xBU1RfQlVJTERfREFURSAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ3MAorI2RlZmluZSBNVFBfUFJPUEVSVFlfVElNRV9UT19MSVZFICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDcxCisjZGVmaW5lIE1UUF9QUk9QRVJUWV9NRURJQV9HVUlEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENzIKKworLy8gTVRQIERldmljZSBQcm9wZXJ0eSBDb2RlcworI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX1VOREVGSU5FRCAgICAgICAgICAgICAgICAgICAgICAgMHg1MDAwCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfQkFUVEVSWV9MRVZFTCAgICAgICAgICAgICAgICAgICAweDUwMDEKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9GVU5DVElPTkFMX01PREUgICAgICAgICAgICAgICAgIDB4NTAwMgorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0lNQUdFX1NJWkUgICAgICAgICAgICAgICAgICAgICAgMHg1MDAzCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfQ09NUFJFU1NJT05fU0VUVElORyAgICAgICAgICAgICAweDUwMDQKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9XSElURV9CQUxBTkNFICAgICAgICAgICAgICAgICAgIDB4NTAwNQorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX1JHQl9HQUlOICAgICAgICAgICAgICAgICAgICAgICAgMHg1MDA2CisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfRl9OVU1CRVIgICAgICAgICAgICAgICAgICAgICAgICAweDUwMDcKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9GT0NBTF9MRU5HVEggICAgICAgICAgICAgICAgICAgIDB4NTAwOAorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0ZPQ1VTX0RJU1RBTkNFICAgICAgICAgICAgICAgICAgMHg1MDA5CisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfRk9DVVNfTU9ERSAgICAgICAgICAgICAgICAgICAgICAweDUwMEEKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9FWFBPU1VSRV9NRVRFUklOR19NT0RFICAgICAgICAgIDB4NTAwQgorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0ZMQVNIX01PREUgICAgICAgICAgICAgICAgICAgICAgMHg1MDBDCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfRVhQT1NVUkVfVElNRSAgICAgICAgICAgICAgICAgICAweDUwMEQKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9FWFBPU1VSRV9QUk9HUkFNX01PREUgICAgICAgICAgIDB4NTAwRQorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0VYUE9TVVJFX0lOREVYICAgICAgICAgICAgICAgICAgMHg1MDBGCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfRVhQT1NVUkVfQklBU19DT01QRU5TQVRJT04gICAgICAweDUwMTAKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9EQVRFVElNRSAgICAgICAgICAgICAgICAgICAgICAgIDB4NTAxMQorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0NBUFRVUkVfREVMQVkgICAgICAgICAgICAgICAgICAgMHg1MDEyCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfU1RJTExfQ0FQVFVSRV9NT0RFICAgICAgICAgICAgICAweDUwMTMKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9DT05UUkFTVCAgICAgICAgICAgICAgICAgICAgICAgIDB4NTAxNAorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX1NIQVJQTkVTUyAgICAgICAgICAgICAgICAgICAgICAgMHg1MDE1CisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfRElHSVRBTF9aT09NICAgICAgICAgICAgICAgICAgICAweDUwMTYKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9FRkZFQ1RfTU9ERSAgICAgICAgICAgICAgICAgICAgIDB4NTAxNworI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0JVUlNUX05VTUJFUiAgICAgICAgICAgICAgICAgICAgMHg1MDE4CisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfQlVSU1RfSU5URVJWQUwgICAgICAgICAgICAgICAgICAweDUwMTkKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9USU1FTEFQU0VfTlVNQkVSICAgICAgICAgICAgICAgIDB4NTAxQQorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX1RJTUVMQVBTRV9JTlRFUlZBTCAgICAgICAgICAgICAgMHg1MDFCCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfRk9DVVNfTUVURVJJTkdfTU9ERSAgICAgICAgICAgICAweDUwMUMKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9VUExPQURfVVJMICAgICAgICAgICAgICAgICAgICAgIDB4NTAxRAorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0FSVElTVCAgICAgICAgICAgICAgICAgICAgICAgICAgMHg1MDFFCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfQ09QWVJJR0hUX0lORk8gICAgICAgICAgICAgICAgICAweDUwMUYKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9TWU5DSFJPTklaQVRJT05fUEFSVE5FUiAgICAgICAgIDB4RDQwMQorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0RFVklDRV9GUklFTkRMWV9OQU1FICAgICAgICAgICAgMHhENDAyCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfVk9MVU1FICAgICAgICAgICAgICAgICAgICAgICAgICAweEQ0MDMKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9TVVBQT1JURURfRk9STUFUU19PUkRFUkVEICAgICAgIDB4RDQwNAorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX0RFVklDRV9JQ09OICAgICAgICAgICAgICAgICAgICAgMHhENDA1CisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfUExBWUJBQ0tfUkFURSAgICAgICAgICAgICAgICAgICAweEQ0MTAKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9QTEFZQkFDS19PQkpFQ1QgICAgICAgICAgICAgICAgIDB4RDQxMQorI2RlZmluZSBNVFBfREVWSUNFX1BST1BFUlRZX1BMQVlCQUNLX0NPTlRBSU5FUl9JTkRFWCAgICAgICAgMHhENDEyCisjZGVmaW5lIE1UUF9ERVZJQ0VfUFJPUEVSVFlfU0VTU0lPTl9JTklUSUFUT1JfVkVSU0lPTl9JTkZPICAweEQ0MDYKKyNkZWZpbmUgTVRQX0RFVklDRV9QUk9QRVJUWV9QRVJDRUlWRURfREVWSUNFX1RZUEUgICAgICAgICAgIDB4RDQwNworCisvLyBNVFAgT3BlcmF0aW9uIENvZGVzCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX0RFVklDRV9JTkZPICAgICAgICAgICAgICAgICAgICAgICAweDEwMDEKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9PUEVOX1NFU1NJT04gICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwMgorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0NMT1NFX1NFU1NJT04gICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDAzCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX1NUT1JBR0VfSURTICAgICAgICAgICAgICAgICAgICAgICAweDEwMDQKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfU1RPUkFHRV9JTkZPICAgICAgICAgICAgICAgICAgICAgIDB4MTAwNQorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9OVU1fT0JKRUNUUyAgICAgICAgICAgICAgICAgICAgICAgMHgxMDA2CisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9IQU5ETEVTICAgICAgICAgICAgICAgICAgICAweDEwMDcKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfT0JKRUNUX0lORk8gICAgICAgICAgICAgICAgICAgICAgIDB4MTAwOAorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1QgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDA5CisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX1RIVU1CICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMEEKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9ERUxFVEVfT0JKRUNUICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwQgorI2RlZmluZSBNVFBfT1BFUkFUSU9OX1NFTkRfT0JKRUNUX0lORk8gICAgICAgICAgICAgICAgICAgICAgMHgxMDBDCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fU0VORF9PQkpFQ1QgICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMEQKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9JTklUSUFURV9DQVBUVVJFICAgICAgICAgICAgICAgICAgICAgIDB4MTAwRQorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0ZPUk1BVF9TVE9SRSAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDBGCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fUkVTRVRfREVWSUNFICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMTAKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9TRUxGX1RFU1QgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAxMQorI2RlZmluZSBNVFBfT1BFUkFUSU9OX1NFVF9PQkpFQ1RfUFJPVEVDVElPTiAgICAgICAgICAgICAgICAgMHgxMDEyCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fUE9XRVJfRE9XTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMTMKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfREVWSUNFX1BST1BfREVTQyAgICAgICAgICAgICAgICAgIDB4MTAxNAorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9ERVZJQ0VfUFJPUF9WQUxVRSAgICAgICAgICAgICAgICAgMHgxMDE1CisjZGVmaW5lIE1UUF9PUEVSQVRJT05fU0VUX0RFVklDRV9QUk9QX1ZBTFVFICAgICAgICAgICAgICAgICAweDEwMTYKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9SRVNFVF9ERVZJQ0VfUFJPUF9WQUxVRSAgICAgICAgICAgICAgIDB4MTAxNworI2RlZmluZSBNVFBfT1BFUkFUSU9OX1RFUk1JTkFURV9PUEVOX0NBUFRVUkUgICAgICAgICAgICAgICAgMHgxMDE4CisjZGVmaW5lIE1UUF9PUEVSQVRJT05fTU9WRV9PQkpFQ1QgICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMTkKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9DT1BZX09CSkVDVCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAxQQorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9QQVJUSUFMX09CSkVDVCAgICAgICAgICAgICAgICAgICAgMHgxMDFCCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fSU5JVElBVEVfT1BFTl9DQVBUVVJFICAgICAgICAgICAgICAgICAweDEwMUMKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfT0JKRUNUX1BST1BTX1NVUFBPUlRFRCAgICAgICAgICAgIDB4OTgwMQorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfUFJPUF9ERVNDICAgICAgICAgICAgICAgICAgMHg5ODAyCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9QUk9QX1ZBTFVFICAgICAgICAgICAgICAgICAweDk4MDMKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9TRVRfT0JKRUNUX1BST1BfVkFMVUUgICAgICAgICAgICAgICAgIDB4OTgwNAorI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1RfUkVGRVJFTkNFUyAgICAgICAgICAgICAgICAgMHg5ODEwCisjZGVmaW5lIE1UUF9PUEVSQVRJT05fU0VUX09CSkVDVF9SRUZFUkVOQ0VTICAgICAgICAgICAgICAgICAweDk4MTEKKyNkZWZpbmUgTVRQX09QRVJBVElPTl9TS0lQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4OTgyMAorCisvLyBNVFAgUmVzcG9uc2UgQ29kZXMKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1VOREVGSU5FRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDAKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX09LICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDEKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0dFTkVSQUxfRVJST1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDIKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1NFU1NJT05fTk9UX09QRU4gICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDMKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfVFJBTlNBQ1RJT05fSUQgICAgICAgICAgICAgICAgICAgICAweDIwMDQKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX09QRVJBVElPTl9OT1RfU1VQUE9SVEVEICAgICAgICAgICAgICAgICAgICAweDIwMDUKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1BBUkFNRVRFUl9OT1RfU1VQUE9SVEVEICAgICAgICAgICAgICAgICAgICAweDIwMDYKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOQ09NUExFVEVfVFJBTlNGRVIgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDcKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfU1RPUkFHRV9JRCAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMDgKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfT0JKRUNUX0hBTkRMRSAgICAgICAgICAgICAgICAgICAgICAweDIwMDkKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0RFVklDRV9QUk9QX05PVF9TVVBQT1JURUQgICAgICAgICAgICAgICAgICAweDIwMEEKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfT0JKRUNUX0ZPUk1BVF9DT0RFICAgICAgICAgICAgICAgICAweDIwMEIKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1NUT1JBR0VfRlVMTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMEMKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX09CSkVDVF9XUklURV9QUk9URUNURUQgICAgICAgICAgICAgICAgICAgICAweDIwMEQKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1NUT1JFX1JFQURfT05MWSAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMEUKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0FDQ0VTU19ERU5JRUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMEYKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX05PX1RIVU1CTkFJTF9QUkVTRU5UICAgICAgICAgICAgICAgICAgICAgICAweDIwMTAKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1NFTEZfVEVTVF9GQUlMRUQgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMTEKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1BBUlRJQUxfREVMRVRJT04gICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMTIKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1NUT1JFX05PVF9BVkFJTEFCTEUgICAgICAgICAgICAgICAgICAgICAgICAweDIwMTMKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1NQRUNJRklDQVRJT05fQllfRk9STUFUX1VOU1VQUE9SVEVEICAgICAgICAweDIwMTQKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX05PX1ZBTElEX09CSkVDVF9JTkZPICAgICAgICAgICAgICAgICAgICAgICAweDIwMTUKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfQ09ERV9GT1JNQVQgICAgICAgICAgICAgICAgICAgICAgICAweDIwMTYKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1VOS05PV05fVkVORE9SX0NPREUgICAgICAgICAgICAgICAgICAgICAgICAweDIwMTcKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0NBUFRVUkVfQUxSRUFEWV9URVJNSU5BVEVEICAgICAgICAgICAgICAgICAweDIwMTgKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0RFVklDRV9CVVNZICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMTkKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfUEFSRU5UX09CSkVDVCAgICAgICAgICAgICAgICAgICAgICAweDIwMUEKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfREVWSUNFX1BST1BfRk9STUFUICAgICAgICAgICAgICAgICAweDIwMUIKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfREVWSUNFX1BST1BfVkFMVUUgICAgICAgICAgICAgICAgICAweDIwMUMKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfUEFSQU1FVEVSICAgICAgICAgICAgICAgICAgICAgICAgICAweDIwMUQKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1NFU1NJT05fQUxSRUFEWV9PUEVOICAgICAgICAgICAgICAgICAgICAgICAweDIwMUUKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1RSQU5TQUNUSU9OX0NBTkNFTExFRCAgICAgICAgICAgICAgICAgICAgICAweDIwMUYKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1NQRUNJRklDQVRJT05fT0ZfREVTVElOQVRJT05fVU5TVVBQT1JURUQgICAweDIwMjAKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfT0JKRUNUX1BST1BfQ09ERSAgICAgICAgICAgICAgICAgICAweEE4MDEKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfT0JKRUNUX1BST1BfRk9STUFUICAgICAgICAgICAgICAgICAweEE4MDIKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfT0JKRUNUX1BST1BfVkFMVUUgICAgICAgICAgICAgICAgICAweEE4MDMKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfT0JKRUNUX1JFRkVSRU5DRSAgICAgICAgICAgICAgICAgICAweEE4MDQKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0dST1VQX05PVF9TVVBQT1JURUQgICAgICAgICAgICAgICAgICAgICAgICAweEE4MDUKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX0lOVkFMSURfREFUQVNFVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEE4MDYKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1NQRUNJRklDQVRJT05fQllfR1JPVVBfVU5TVVBQT1JURUQgICAgICAgICAweEE4MDcKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX1NQRUNJRklDQVRJT05fQllfREVQVEhfVU5TVVBQT1JURUQgICAgICAgICAweEE4MDgKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX09CSkVDVF9UT09fTEFSR0UgICAgICAgICAgICAgICAgICAgICAgICAgICAweEE4MDkKKyNkZWZpbmUgTVRQX1JFU1BPTlNFX09CSkVDVF9QUk9QX05PVF9TVVBQT1JURUQgICAgICAgICAgICAgICAgICAweEE4MEEKKworLy8g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GZhbHNlOworICAgIH0KKyAgICB3cml0ZShmZCwgZW5hYmxlID8gIjEiIDogIjAiLCAyKTsKKyAgICBjbG9zZShmZCk7CisgICAgcmV0dXJuIHRydWU7Cit9CisKK2ludCBtYWluKGludCBhcmdjLCBjaGFyKiBhcmd2W10pIHsKKyAgICBib29sIHVzZVBUUCA9IGZhbHNlOworICAgIGNvbnN0IGNoYXIqIHN0b3JhZ2VQYXRoID0gIi9zZGNhcmQiOworCisgICAgZm9yIChpbnQgaSA9IDE7IGkgPCBhcmdjOyBpKyspIHsKKyAgICAgICAgY29uc3QgY2hhciogYXJnID0gYXJndltpXTsKKyAgICAgICAgaWYgKCFzdHJjbXAoYXJnLCAiLXAiKSkKKyAgICAgICAgICAgIHVzZVBUUCA9IHRydWU7CisgICAgICAgIGVsc2UgaWYgKGFyZ1swXSA9PSAnLycpCisgICAgICAgICAgICBzdG9yYWdlUGF0aCA9IGFyZzsKKyAgICB9CisKKyAgICBpbnQgZmQgPSBvcGVuKCIvZGV2L210cF91c2IiLCBPX1JEV1IpOworICAgIHByaW50Zigib3BlbiByZXR1cm5lZCAlZFxuIiwgZmQpOworICAgIGlmIChmZCA8IDApIHsKKyAgICAgICAgZnByaW50ZihzdGRlcnIsICJjb3VsZCBub3Qgb3BlbiBNVFAgZHJpdmVyXG4iKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgIH0KKworICAgIGlmICh1c2VQVFApIHsKKyAgICAgICAgLy8gc2V0IGRyaXZlciBtb2RlIHRvIFBUUAorICAgICAgICBpbnQgcmV0ID0gaW9jdGwoZmQsIE1UUF9TRVRfSU5URVJGQUNFX01PREUsIE1UUF9JTlRFUkZBQ0VfTU9ERV9QVFApOworICAgICAgICBpZiAocmV0KSB7CisgICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIk1UUF9TRVRfSU5URVJGQUNFX01PREUgZmFpbGVkXG4iKTsKKyAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgfQorICAgIH0KKworICA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OworICAgIHByaXZhdGUgQ29udGVudFJlc29sdmVyIG1SZXNvbHZlcjsKKyAgICBwcml2YXRlIERldmljZU9ic2VydmVyIG1EZXZpY2VPYnNlcnZlcjsKKyAgICBwcml2YXRlIEN1cnNvciBtQ3Vyc29yOworCisgICAgcHJpdmF0ZSBjbGFzcyBEZXZpY2VPYnNlcnZlciBleHRlbmRzIENvbnRlbnRPYnNlcnZlciB7CisgICAgICAgIERldmljZU9ic2VydmVyKEhhbmRsZXIgaGFuZGxlcikgeworICAgICAgICAgICAgc3VwZXIoaGFuZGxlcik7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgb25DaGFuZ2UoYm9vbGVhbiBzZWxmQ2hhbmdlKSB7CisgICAgICAgICAgICBMb2cuZChUQUcsICJEZXZpY2VPYnNlcnZlci5vbkNoYW5nZSIpOworICAgICAgICAgICAgaWYgKG1DdXJzb3IgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1DdXJzb3IucmVxdWVyeSgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nW10gREVWSUNFX0NPTFVNTlMgPQorICAgICAgICAgbmV3IFN0cmluZ1tdIHsgTXRwLkRldmljZS5fSUQsIE10cC5EZXZpY2UuTUFOVUZBQ1RVUkVSLCBNdHAuRGV2aWNlLk1PREVMIH07CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBvbkNyZWF0ZShCdW5kbGUgc2F2ZWRJbnN0YW5jZVN0YXRlKSB7CisgICAgICAgIHN1cGVyLm9uQ3JlYXRlKHNhdmVkSW5zdGFuY2VTdGF0ZSk7CisgICAgICAgIG1SZXNvbHZlciA9IGdldENvbnRlbnRSZXNvbHZlcigpOworICAgICAgICBtRGV2aWNlT2JzZXJ2ZXIgPSBuZXcgRGV2aWNlT2JzZXJ2ZXIobmV3IEhh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ZSBzdGF0aWMgZmluYWwgU3RyaW5nW10gT0JKRUNUX0NPTFVNTlMgPQorICAgICAgICBuZXcgU3RyaW5nW10geyBNdHAuT2JqZWN0Ll9JRCwgTXRwLk9iamVjdC5OQU1FLCBNdHAuT2JqZWN0LkZPUk1BVCwgTXRwLk9iamVjdC5USFVNQiB9OworCisgICAgc3RhdGljIGZpbmFsIGludCBJRF9DT0xVTU4gPSAwOworICAgIHN0YXRpYyBmaW5hbCBpbnQgTkFNRV9DT0xVTU4gPSAxOworICAgIHN0YXRpYyBmaW5hbCBpbnQgRk9STUFUX0NPTFVNTiA9IDI7CisgICAgc3RhdGljIGZpbmFsIGludCBUSFVNQl9DT0xVTU4gPSAzOworCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25DcmVhdGUoQnVuZGxlIHNhdmVkSW5zdGFuY2VTdGF0ZSkgeworICAgICAgICBzdXBlci5vbkNyZWF0ZShzYXZlZEluc3RhbmNlU3RhdGUpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uUmVzdW1lKCkgeworICAgICAgICBzdXBlci5vblJlc3VtZSgpOworCisgICAgICAgIG1EZXZpY2VJRCA9IGdldEludGVudCgpLmdldEludEV4dHJhKCJkZXZpY2UiLCAwKTsKKyAgICAgICAgbVN0b3JhZ2VJRCA9IGdldEludGVudCgpLmdldEludEV4dHJhKCJzdG9yYWdlIiwgMCk7CisgICAgICAgIG1PYmplY3RJRCA9IGdldEludGVudCgpLmdldEludEV4dHJhKCJvYmplY3QiLCAwKTsKKyAgICAgICAgaWYgKG1EZXZpY2VJRCAhPSAwICYmIG1TdG9yYWdlSUQgIT0gMCkgeworICAgICAgICAgICAgQ3Vyc29yIGM7CisgICAgICAgICAgICBVcmkgdXJpOworICAgICAgICAgICAgaWYgKG1PYmplY3RJRCA9PSAwKSB7CisgICAgICAgICAgICAgICAgdXJpID0gTXRwLk9iamVjdC5nZXRDb250ZW50VXJpRm9yU3RvcmFnZUNoaWxkcmVuKG1EZXZpY2VJRCwgbVN0b3JhZ2VJRCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHVyaSA9IE10cC5PYmplY3QuZ2V0Q29udGVudFVyaUZvck9iamVjdENoaWxkcmVuKG1EZXZpY2VJRCwgbU9iamVjdElEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIExvZy5kKFRBRywgInF1ZXJ5ICIgKyB1cmkpOworICAgICAgICAgICAgYyA9IGdldENvbnRlbnRSZXNvbHZlcigpLnF1ZXJ5KHVyaSwgT0JKRUNUX0NPTFVNTlMsIG51bGwsIG51bGwsIG51bGwpOworICAgICAgICAgICAgc3RhcnRNYW5hZ2luZ0N1cnNvcihjKTsKKyAgICAgICAgICAgIG1DdXJzb3IgPSBjOworCisgICAgICAgICAgICAvLyBNYXAgQ3Vyc29yIGNvbHVtbnMgdG8gdmlld3MgZGVmaW5lZCBpbiBzaW1wbGVfbGlzdF9pdGVtXzEueG1sCisgICAgICAgICAgICBtQWRhcHRlciA9IG5ldyBPYmplY3RDdXJzb3JBZGFwdGVyKHRoaXMsIGMpOworICAgICAgICAgICAgc2V0TGlzdEFkYXB0ZXIobUFkYXB0ZXIpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25MaXN0SXRlbUNsaWNrKExpc3RWaWV3IGwsIFZpZXcgdiwgaW50IHBvc2l0aW9uLCBsb25nIGlkKSB7CisgICAgICAgIGludCByb3dJRCA9IChpbnQpbUFkYXB0ZXIuZ2V0SXRlbUlkKHBvc2l0aW9uKTsKKyAgICAgICAgQ3Vyc29yIGMgPSBnZXRDb250ZW50UmVzb2x2ZXIoKS5xdWVyeSgKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuZ2V0Q29udGVudFVyaShtRGV2aWNlSUQsIHJvd0lEKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIE9CSkVDVF9DT0xVTU5TLCBudWxsLCBudWxsLCBudWxsKTsKKyAgICAgICAgTG9nLmQoVEFHLCAicXVlcnkgcmV0dXJuZWQgIiArIGMgKyAiIGNvdW50OiAiICsgYy5nZXRDb3VudCgpKTsKKyAgICAgICAgbG9uZyBmb3JtYXQgPSAwOworICAgICAgICBpZiAoYyAhPSBudWxsICYmIGMuZ2V0Q291bnQoKSA9PSAxKSB7CisgICAgICAgICAgICBjLm1vdmVUb0ZpcnN0KCk7CisgICAgICAgICAgICBsb25nIHJvd0lkID0gYy5nZXRMb25nKElEX0NPTFVNTik7CisgICAgICAgICAgICBTdHJpbmcgbmFtZSA9IGMuZ2V0U3RyaW5nKE5BTUVfQ09MVU1OKTsKKyAgICAgICAgICAgIGZvcm1hdCA9IGMuZ2V0TG9uZyhGT1JNQVRfQ09MVU1OKTsKKyAgICAgICAgICAgIExvZy5kKFRBRywgInJvd0lkOiAiICsgcm93SWQgKyAiIG5hbWU6ICIgKyBuYW1lICsgIiBmb3JtYXQ6ICIgKyBmb3JtYXQpOworICAgICAgICB9CisgICAgICAgIGlmIChmb3JtYXQgPT0gTXRwLk9iamVjdC5GT1JNQVRfSkZJRikgeworICAgICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQodGhpcywgT2JqZWN0Vmlld2VyLmNsYXNzKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgiZGV2aWNlIiwgbURldmljZUlEKTsKKyAgICAgICAgICAgIGludGVudC5wdXRFeHRyYSgic3RvcmFnZSIsIG1TdG9yYWdlSUQpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKCJvYmplY3QiLHJvd0lEKTsKKyAgICAgICAgICAgIHN0YXJ0QWN0aXZpdHkoaW50ZW50KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIEludGVudCBpbnRlbnQgPSBuZXcgSW50ZW50KHRoaXMsIE9iamVjdEJyb3dzZXIuY2xhc3MpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKCJkZXZpY2UiLCBtRGV2aWNlSUQpOworICAgICAgICAgICAgaW50ZW50LnB1dEV4dHJhKCJzdG9yYWdlIiwgbVN0b3JhZ2VJRCk7CisgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmEoIm9iamVjdCIsIHJvd0lEKTsKKyAgICAgICAgICAgIHN0YXJ0QWN0aXZpdHkoaW50ZW50KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uQ3JlYXRlT3B0aW9uc01lbnUoTWVudSBtZW51KSB7CisgICAgICAgIE1lbnVJbmZsYXRlciBpbmZsYXRlciA9IGdldE1lbnVJbmZsYXRlcigpOworICAgICAgICBpbmZsYXRlci5pbmZsYXRlKFIubWVudS5vYmplY3RfbWVudSwgbWVudSk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBib29sZWFuIG9uUHJlcGFyZU9wdGlvbnNNZW51KE1lbnUgbWVudSkgeworICAgICAgICBpbnQgcG9zaXRpb24gPSBtTGlzdC5nZXRTZWxlY3RlZEl0ZW1Qb3NpdGlvbigpOworICAgICAgICBNZW51SXRlbSBpdGVtID0gbWVudS5maW5kSXRlbShSLmlkLmRlbGV0ZSk7CisgICAgICAgIGl0ZW0uc2V0RW5hYmxlZChwb3NpdGlvbiAhPSBBZGFwdGVyVmlldy5JTlZBTElEX1BPU0lUSU9OKTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gb25PcHRpb25zSXRlbVNlbGVjdGVkKE1lbnVJdGVtIGl0ZW0pIHsKKyAgICAgICAgc3dpdGNoIChpdGVtLmdldEl0ZW1JZCgpKSB7CisgICAgICAgICAgICBjYXNlIFIuaWQuZGVsZXRlOgorICAgICAgICAgICAgICAgIGRlbGV0ZVNlbGVjdGVkKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBkZWxldGVTZWxlY3RlZCgpIHsKKyAgICAgICAgaW50IHBvc2l0aW9uID0gbUxpc3QuZ2V0U2VsZWN0ZWRJdGVtUG9zaXRpb24oKTsKKyAgICAgICAgaW50IHJvd0lEID0gKGludCltQWRhcHRlci5nZXRJdGVtSWQocG9zaXRpb24pOworICAgICAgICBVcmkgdXJpID0gTXRwLk9iamVjdC5nZXRDb250ZW50VXJpKG1EZXZpY2VJRCwgcm93SUQpOworCisgICAgICAgIExvZy5kKFRBRywgImRlbGV0aW5nICIgKyB1cmkpOworCisgICAgICAgIGludCByZXN1bHQgPSBnZXRDb250ZW50UmVzb2x2ZXIoKS5kZWxldGUodXJpLCBudWxsLCBudWxsKTsKKyAgICAgICAgaWYgKHJlc3VsdCA+IDApIHsKKyAgICAgICAgICAgIFRvYXN0Lm1ha2VUZXh0KHRoaXMsIFIuc3RyaW5nLm9iamVjdF9kZWxldGVkX21lc3NhZ2UsIFRvYXN0LkxFTkdUSF9TSE9SVCkuc2hvdygpOworICAgICAgICAgICAgbUN1cnNvci5yZXF1ZXJ5KCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBUb2FzdC5tYWtlVGV4dCh0aGlzLCBSLnN0cmluZy5kZWxldGVfZmFpbGVkX21lc3NhZ2UsIFRvYXN0LkxFTkdUSF9TSE9SVCkuc2hvdygpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBjbGFzcyBPYmplY3RDdXJzb3JBZGFwdGVyIGV4dGVuZHMgUmVzb3VyY2VDdXJzb3JBZGFwdGVyIHsKKworICAgICAgICBwdWJsaWMgT2JqZWN0Q3Vyc29yQWRhcHRlcihDb250ZXh0IGNvbnRleHQsIEN1cnNvciBjKSB7CisgICAgICAgICAgICBzdXBlcihjb250ZXh0LCBSLmxheW91dC5vYmplY3RfbGlzdCwgYyk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgYmluZFZpZXcoVmlldyB2aWV3LCBDb250ZXh0IGNvbnRleHQsIEN1cnNvciBjdXJzb3IpIHsKKyAgICAgICAgICAgIEltYWdlVmlldyB0aHVtYlZpZXcgPSAoSW1hZ2VWaWV3KXZpZXcuZmluZFZpZXdCeUlkKFIuaWQudGh1bWJuYWlsKTsKKyAgICAgICAgICAgIFRleHRWaWV3IG5hbWVWaWV3ID0gKFRleHRWaWV3KXZpZXcuZmluZFZpZXdCeUlkKFIuaWQubmFtZSk7CisKKyAgICAgICAgICAgIC8vIGdldCB0aGUgdGh1bWJuYWlsCisgICAgICAgICAgICBieXRlW10gdGh1bWJuYWlsID0gY3Vyc29yLmdldEJsb2IoVEhVTUJfQ09MVU1OKTsKKyAgICAgICAgICAgIGlmICh0aHVtYm5haWwgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIEJpdG1hcCBiaXRtYXAgPSBCaXRtYXBGYWN0b3J5LmRlY29kZUJ5dGVBcnJheSh0aHVtYm5haWwsIDAsIHRodW1ibmFpbC5sZW5ndGgpOworICAgICAgICAgICAgICAgIGlmIChiaXRtYXAgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICB0aHVtYlZpZXcuc2V0SW1hZ2VCaXRtYXAoYml0bWFwKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIGdldCB0aGUgbmFtZQorICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBjdXJzb3IuZ2V0U3RyaW5nKE5BTUVfQ09MVU1OKTsKKyAgICAgICAgICAgIGlmIChuYW1lID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBuYW1lID0gIiI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBuYW1lVmlldy5zZXRUZXh0KG5hbWUpOworICAgICAgICB9CisgIC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lSUQ7CisgICAgcHJpdmF0ZSBpbnQgbU9iamVjdElEOworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nW10gT0JKRUNUX0NPTFVNTlMgPQorICAgICAgICBuZXcgU3RyaW5nW10geyAgTXRwLk9iamVjdC5fSUQsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0Lk5BTUUsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LlNJWkUsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LlRIVU1CX1dJRFRILAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5USFVNQl9IRUlHSFQsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LlRIVU1CX1NJWkUsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LklNQUdFX1dJRFRILAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5JTUFHRV9IRUlHSFQsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LklNQUdFX0RFUFRILAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5TRVFVRU5DRV9OVU1CRVIsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LkRBVEVfQ1JFQVRFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuREFURV9NT0RJRklFRCwKKyAgICAgICAgICAgICAgICAgICAgICAgIE10cC5PYmplY3QuS0VZV09SRFMsCisgICAgICAgICAgICAgICAgICAgICAgICBNdHAuT2JqZWN0LlRIVU1CLAorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIG9uQ3JlYXRlKEJ1bmRsZSBzYXZlZEluc3RhbmNlU3RhdGUpIHsKKyAgICAgICAgc3VwZXIub25DcmVhdGUoc2F2ZWRJbnN0YW5jZVN0YXRlKTsKKworICAgICAgICBzZXRDb250ZW50VmlldyhSLmxheW91dC5vYmplY3RfaW5mbyk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25SZXN1bWUoKSB7CisgICAgICAgIHN1cGVyLm9uUmVzdW1lKCk7CisKKyAgICAgICAgbURldmljZUlEID0gZ2V0SW50ZW50KCkuZ2V0SW50RXh0cmEoImRldmljZSIsIDApOworICAgICAgICBtU3RvcmFnZUlEID0gZ2V0SW50ZW50KCkuZ2V0SW50RXh0cmEoInN0b3JhZ2UiLCAwKTsKKyAgICAgICAgbU9iamVjdElEID0gZ2V0SW50ZW50KCkuZ2V0SW50RXh0cmEoIm9iamVjdCIsIDApOworCisgICAgICAgIGlmIChtRGV2aWNlSUQgIT0gMCAmJiBtT2JqZWN0SUQgIT0gMCkgeworICAgICAgICBDdXJzb3IgYyA9IGdldENvbnRlbnRSZXNvbHZlcigpLnF1ZXJ5KAorICAgICAgICAgICAgICAgICAgICAgICAgTXRwLk9iamVjdC5nZXRDb250ZW50VXJpKG1EZXZpY2VJRCwgbU9iamVjdElEKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIE9CSkVDVF9DT0xVTU5TLCBudWxsLCBudWxsLCBudWxsKTsKKyAgICAgICAgICAgIGMubW92ZVRvRmlyc3QoKTsKKyAgICAgICAgICAgIFRleHRWaWV3IHZpZXcgPSAoVGV4dFZpZXcpZmluZFZpZXdCeUlkKFIuaWQubmFtZSk7CisgICAgICAgICAgICB2aWV3LnNldFRleHQoYy5nZXRTdHJpbmcoMSkpOworICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC5zaXplKTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChMb25nLnRvU3RyaW5nKGMuZ2V0TG9uZygyKSkpOworICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC50aHVtYl93aWR0aCk7CisgICAgICAgICAgICB2aWV3LnNldFRleHQoTG9uZy50b1N0cmluZyhjLmdldExvbmcoMykpKTsKKyAgICAgICAgICAgIHZpZXcgPSAoVGV4dFZpZXcpZmluZFZpZXdCeUlkKFIuaWQudGh1bWJfaGVpZ2h0KTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChMb25nLnRvU3RyaW5nKGMuZ2V0TG9uZyg0KSkpOworICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC50aHVtYl9zaXplKTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChMb25nLnRvU3RyaW5nKGMuZ2V0TG9uZyg1KSkpOworICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC53aWR0aCk7CisgICAgICAgICAgICB2aWV3LnNldFRleHQoTG9uZy50b1N0cmluZyhjLmdldExvbmcoNikpKTsKKyAgICAgICAgICAgIHZpZXcgPSAoVGV4dFZpZXcpZmluZFZpZXdCeUlkKFIuaWQuaGVpZ2h0KTsKKyAgICAgICAgICAgIHZpZXcuc2V0VGV4dChMb25nLnRvU3RyaW5nKGMuZ2V0TG9uZyg3KSkpOworICAgICAgICAgICAgdmlldyA9IChUZXh0VmlldylmaW5kVmlld0J5SWQoUi5pZC5kZXB0aCk7CisgICAgICAgICAgICB2aWV3LnNldFRleHQoTG9uZy50b1N0cmluZyhjLmdldExvbmcoOCkpKTsKKyAgICAgICAgICAgIHZpZXcgPSAoVGV4dFZpZXcpZmluZFZpZXdCeUlkKFIuaWQuc2VxdWVuY2UpOworICAgICAgICAgICAgdmlldy5zZXRUZXh0KExvbmcudG9TdHJpbmcoYy5nZXRMb25nKDkpKSk7CisgICAgICAgICAgICB2aWV3ID0gKFRleHRWaWV3KWZpbmRWaWV3QnlJZChSLmlkLmNyZWF0ZWQpOworICAgICAgICAgICAgRGF0ZSBkYXRlID0gbmV3IERhdGUoYy5nZXRMb25nKDEwKSAqIDEwMDApOworICAgICAgICAgICAgdmlldy5zZXRUZXh0KGRhdGUudG9TdHJpbmcoKSk7CisgICAgICAgICAgICB2aWV3ID0gKFRleHRWaWV3KWZpbmRWaWV3QnlJZChSLmlkLm1vZGlmaWVkKTsKKyAgICAgICAgICAgIGRhdGUgPSBuZXcgRGF0ZShjLmdldExvbmcoMTEpICogMTAwMCk7CisgICAgICAgICAgICB2aWV3LnNldFRleHQoZGF0ZS50b1N0cmluZygpKTsKKyAgICAgICAgICAgIHZpZXcgPSAoVGV4dFZpZXcpZmluZFZpZXdCeUlkKFIuaWQua2V5d29yZHMpOworICAgICAgICAgICAgdmlldy5zZXRUZXh0KGMuZ2V0U3RyaW5nKDEyKSk7CisgICAgICAgICAgICBieXRlW10gdGh1bWJuYWlsID0gYy5nZXRCbG9iKDEzKTsKKyAgICAgICAgICAgIGlmICh0aHVtYm5haWwgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIExvZy5kKFRBRywgImdvdCB0aHVtYm5haWwsIGxlbmd0aDogIiArIHRodW1ibmFpbC5sZW5ndGgpOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgNTA7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICIgICAgIiArIEludGVnZXIudG9IZXhTdHJpbmcodGh1bWJuYWlsW2ldKSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgSW1hZ2VWaWV3IHRodW1iVmlldyA9IChJbWFnZVZpZXcpZmluZFZpZXdCeUlkKFIuaWQudGh1bWJuYWlsKTsKKyAgICAgICAgICAgICAgICBCaXRtYXAgYml0bWFwID0gQml0bWFwRmFjdG9yeS5kZWNvZGVCeXRlQXJyYXkodGh1bWJuYWlsLCAwLCB0aHVtYm5haWwubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJiaXRtYXA6ICIgKyBiaXRtYXApOworICAgICAgICAgICAgICAgIGlmIChiaXRtYXAgIT0gbnVsbCk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7CisKK3R5cGVkZWYgZW51bSB7CisgICAgQU5EUk9JRF9UVFNfTEFOR19DT1VOVFJZX1ZBUl9BVkFJTEFCTEUgPSAyLAorICAgIEFORFJPSURfVFRTX0xBTkdfQ09VTlRSWV9BVkFJTEFCTEUgICAgPSAxLAorICAgIEFORFJPSURfVFRTX0xBTkdfQVZBSUxBQkxFICAgICAgICAgICAgPSAwLAorICAgIEFORFJPSURfVFRTX0xBTkdfTUlTU0lOR19EQVRBICAgICAgICAgPSAtMSwKKyAgICBBTkRST0lEX1RUU19MQU5HX05PVF9TVVBQT1JURUQgICAgICAgID0gLTIKK30gYW5kcm9pZF90dHNfc3VwcG9ydF9yZXN1bHRfdDsKKwordHlwZWRlZiBlbnVtIHsKKyAgICBBTkRST0lEX1RUU19TWU5USF9ET05FICAgICAgICAgICAgICA9IDAsCisgICAgQU5EUk9JRF9UVFNfU1lOVEhfUEVORElORyAgICAgICAgICAgPSAxCit9IGFuZHJvaWRfdHRzX3N5bnRoX3N0YXR1c190OworCit0eXBlZGVmIGVudW0geworICAgIEFORFJPSURfVFRTX0NBTExCQUNLX0hBTFQgICAgICAgICAgID0gMCwKKyAgICBBTkRST0lEX1RUU19DQUxMQkFDS19DT05USU5VRSAgICAgICA9IDEKK30gYW5kcm9pZF90dHNfY2FsbGJhY2tfc3RhdHVzX3Q7CisKKy8vIFN1cHBvcnRlZCBhdWRpbyBmb3JtYXRzCit0eXBlZGVmIGVudW0geworICAgIEFORFJPSURfVFRTX0FVRElPX0ZPUk1BVF9JTlZBTElEICAgID0gLTEsCisgICAgQU5EUk9JRF9UVFNfQVVESU9fRk9STUFUX0RFRkFVTFQgICAgPSAwLAorICAgIEFORFJPSURfVFRTX0FVRElPX0ZPUk1BVF9QQ01fMTZfQklUID0gMSwKKyAgICBBTkRST0lEX1RUU19BVURJT19GT1JNQVRfUENNXzhfQklUICA9IDIsCit9IGFuZHJvaWRfdHRzX2F1ZGlvX2Zvcm1hdF90OworCisKKy8qIEFuIGFuZHJ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QUxVRV9JTlZBTElECisgICAgYW5kcm9pZF90dHNfcmVzdWx0X3QgKCpzZXRQcm9wZXJ0eSkKKyAgICAgICAgICAgICh2b2lkICplbmdpbmUsCisgICAgICAgICAgICAgY29uc3QgY2hhciAqcHJvcGVydHksCisgICAgICAgICAgICAgY29uc3QgY2hhciAqdmFsdWUsCisgICAgICAgICAgICAgY29uc3Qgc2l6ZV90IHNpemUpOworCisgICAgLy8gUmV0cmlldmUgYSBwcm9wZXJ0eSBmcm9tIHRoZSBUVFMgZW5naW5lCisgICAgLy8gQHBhcmFtICAgICAgICBwcm9wZXJ0eSBwb2ludGVyIHRvIHRoZSBwcm9wZXJ0eSBuYW1lCisgICAgLy8gQHBhcmFtW291dF0gICB2YWx1ZSAgICBwb2ludGVyIHRvIHRoZSByZXRyaWV2ZWQgbGFuZ3VhZ2UgdmFsdWUKKyAgICAvLyBAcGFyYW1baW5vdXRdIGlvc2l6ZSAgIGluOiBzdG9yZXMgdGhlIHNpemUgYXZhaWxhYmxlIHRvIHN0b3JlIHRoZQorICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eSB2YWx1ZS4KKyAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgIG91dDogc3RvcmVzIHRoZSBzaXplIHJlcXVpcmVkIHRvIGhvbGQgdGhlIGxhbmd1YWdlCisgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlIGlmIGdldExhbmd1YWdlKCkgcmV0dXJuZWQKKyAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgVFRTX1BST1BFUlRZX1NJWkVfVE9PX1NNQUxMLCB1bmNoYW5nZWQgb3RoZXJ3aXNlCisgICAgLy8gQHJldHVybiBUVFNfUFJPUEVSVFlfVU5TVVBQT1JURUQsIG9yIFRUU19TVUNDRVNTLAorICAgIC8vICAgICAgICAgb3IgVFRTX1BST1BFUlRZX1NJWkVfVE9PX1NNQUxMCisgICAgYW5kcm9pZF90dHNfcmVzdWx0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VydGV4QnVmZmVyOworICAgICAgIHByaXZhdGUgQ2hhckJ1ZmZlciBtSW5kZXhCdWZmZXI7CisKKyAgICAgICBwcml2YXRlIGludCBtVzsKKyAgICAgICBwcml2YXRlIGludCBtSDsKKyAgICAgICBwcml2YXRlIGludCBtSW5kZXhDb3VudDsKKworICAgICAgIHB1YmxpYyBHcmlkKGludCB3LCBpbnQgaCkgeworICAgICAgICAgICBpZiAodyA8IDAgfHwgdyA+PSA2NTUzNikgeworICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigidyIpOworICAgICAgICAgICB9CisgICAgICAgICAgIGlmIChoIDwgMCB8fCBoID49IDY1NTM2KSB7CisgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJoIik7CisgICAgICAgICAgIH0KKyAgICAgICAgICAgaWYgKHcgKiBoID49IDY1NTM2KSB7CisgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJ3ICogaCA+PSA2NTUzNiIpOworICAgICAgICAgICB9CisKKyAgICAgICAgICAgbVcgPSB3OworICAgICAgICAgICBtSCA9IGg7CisgICAgICAgICAgIGludCBzaXplID0gdyAqIGg7CisKKyAgICAgICAgICAgbVZlcnRleEJ5dGVCdWZmZXIgPSBCeXRlQnVmZmVyLmFsbG9jYXRlRGlyZWN0KFZFUlRFWF9TSVpFICogc2l6ZSkKKyAgICAgICAgICAgICAgIC5vcmRlcihCeXRlT3JkZXIubmF0aXZlT3JkZXIoKSk7CisgICAgICAgICAgIG1WZXJ0ZXhCdWZmZXIgPSBtVmVydGV4Qnl0ZUJ1ZmZlci5hc0Zsb2F0QnVmZmVyKCk7CisKKyAgICAgICAgICAgaW50IHF1YWRXID0gbVcgLSAxOworICAgICAgICAgICBpbnQgcXVhZEggPSBtSCAtIDE7CisgICAgICAgICAgIGludCBxdWFkQ291bnQgPSBxdWFkVyAqIHF1YWRIOworICAgICAgICAgICBpbnQgaW5kZXhDb3VudCA9IHF1YWRDb3VudCAqIDY7CisgICAgICAgICAgIG1JbmRleENvdW50ID0gaW5kZXhDb3VudDsKKyAgICAgICAgICAgbUluZGV4QnVmZmVyID0gQnl0ZUJ1ZmZlci5hbGxvY2F0ZURpcmVjdChDSEFSX1NJWkUgKiBpbmRleENvdW50KQorICAgICAgICAgICAgICAgLm9yZGVyKEJ5dGVPcmRlci5uYXRpdmVPcmRlcigpKS5hc0NoYXJCdWZmZXIoKTsKKworICAgICAgICAgICAvKgorICAgICAgICAgICAgKiBJbml0aWFsaXplIHRyaWFuZ2xlIGxpc3QgbWVzaC4KKyAgICAgICAgICAgICoKKyAgICAgICAgICAgICogICAgIFswXS0tLS0tWyAgMV0gLi4uCisgICAgICAgICAgICAqICAgICAgfCAgICAvICAgfAorICAgICAgICAgICAgKiAgICAgIHwgICAvICAgIHwKKyAgICAgICAgICAgICogICAgICB8ICAvICAgICB8CisgICAgICAgICAgICAqICAgICBbd10tLS0tLVt3KzFdIC4uLgorICAgICAgICAgICAgKiAgICAgIHwgICAgICAgfAorICAgICAgICAgICAgKgorICAgICAgICAgICAgKi8KKworICAgICAgICAgICB7CisgICAgICAgICAgICAgICBpbnQgaSA9IDA7CisgICAgICAgICAgICAgICBmb3IgKGludCB5ID0gMDsgeSA8IHF1YWRIOyB5KyspIHsKKyAgICAgICAgICAgICAgICAgICBmb3IgKGludCB4ID0gMDsgeCA8IHF1YWRXOyB4KyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgY2hhciBhID0gKGNoYXIpICh5ICogbVcgKyB4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgY2hhciBiID0gKGNoYXIpICh5ICogbVcgKyB4ICsgMSk7CisgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgYyA9IChjaGFyKSAoKHkgKyAxKSAqIG1XICsgeCk7CisgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgZCA9IChjaGFyKSAoKHkgKyAxKSAqIG1XICsgeCArIDEpOworCisgICAgICAgICAgICAgICAgICAgICAgIG1JbmRleEJ1ZmZlci5wdXQoaSsrLCBhKTsKKyAgICAgICAgICAgICAgICAgICAgICAgbUluZGV4QnVmZmVyLnB1dChpKyssIGMpOworICAgICAgICAgICAgICAgICAgICAgICBtSW5kZXhCdWZmZXIucHV0KGkrKywgYik7CisKKyAgICAgICAgICAgICAgICAgICAgICAgbUluZGV4QnVmZmVyLnB1dChpKyssIGIpOworICAgICAgICAgICAgICAgICAgICAgICBtSW5kZXhCdWZmZXIucHV0KGkrKywgYyk7CisgICAgICAgICAgICAgICAgICAgICAgIG1JbmRleEJ1ZmZlci5wdXQoaSsrLCBkKTsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgIH0KKworICAgICAgIH0KKworICAgICAgIHB1YmxpYyB2b2lkIHNldChpbnQgaSwgaW50IGosIGZsb2F0IHgsIGZsb2F0IHksIGZsb2F0IHopIHsKKyAgICAgICAgICAgaWYgKGkgPCAwIHx8IGkgPj0gbVcpIHsKKyAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImkiKTsKKyAgICAgICAgICAgfQorICAgICAgICAgICBpZiAoaiA8IDAgfHwgaiA+PSBtSCkgeworICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiaiIpOworICAgICAgICAgICB9CisKKyAgICAgICAgICAgaW50IGluZGV4ID0gbVcgKiBqICsgaTsKKworICAgICAgICAgICBtVmVydGV4QnVmZmVyLnBvc2l0aW9uKGluZGV4ICogVkVSVEVYX1NJWkUgLyBGTE9BVF9TSVpFKTsKKyAgICAgICAgICAgbVZlcnRleEJ1ZmZlci5wdXQoeCk7CisgICAgICAgICAgIG1WZXJ0ZXhCdWZmZXIucHV0KHkpOworICAgICAgICAgICBtVmVydGV4QnVmZmVyLnB1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Xg9IiArIGluZGV4ICsgIiB2aWV3SW5kZXg9IiArIHZpZXdJbmRleAorICAgICAgICBpZiAoU1BFVykgU2xvZy5kKFRBRywgImFkZEljb24gc2xvdD0iICsgc2xvdCArICIgaW5kZXg9IiArIGluZGV4ICsgIiB2aWV3SW5kZXg9IiArIHZpZXdJbmRleAogICAgICAgICAgICAgICAgICsgIiBpY29uPSIgKyBpY29uKTsKICAgICAgICAgU3RhdHVzQmFySWNvblZpZXcgdmlldyA9IG5ldyBTdGF0dXNCYXJJY29uVmlldyh0aGlzLCBzbG90KTsKICAgICAgICAgdmlldy5zZXQoaWNvbik7CkBAIC0zODMsMTQgKzM4MywxNCBAQAogCiAgICAgcHVibGljIHZvaWQgdXBkYXRlSWNvbihTdHJpbmcgc2xvdCwgaW50IGluZGV4LCBpbnQgdmlld0luZGV4LAogICAgICAgICAgICAgU3RhdHVzQmFySWNvbiBvbGQsIFN0YXR1c0Jhckljb24gaWNvbikgewotICAgICAgICBTbG9nLmQoVEFHLCAidXBkYXRlSWNvbiBzbG90PSIgKyBzbG90ICsgIiBpbmRleD0iICsgaW5kZXggKyAiIHZpZXdJbmRleD0iICsgdmlld0luZGV4CisgICAgICAgIGlmIChTUEVXKSBTbG9nLmQoVEFHLCAidXBkYXRlSWNvbiBzbG90PSIgKyBzbG90ICsgIiBpbmRleD0iICsgaW5kZXggKyAiIHZpZXdJbmRleD0iICsgdmlld0luZGV4CiAgICAgICAgICAgICAgICAgKyAiIG9sZD0iICsgb2xkICsgIiBpY29uPSIgKyBpY29uKTsKICAgICAgICAgU3RhdHVzQmFySWNvblZpZXcgdmlldyA9IChTdGF0dXNCYXJJY29uVmlldyltU3RhdHVzSWNvbnMuZ2V0Q2hpbGRBdCh2aWV3SW5kZXgpOwogICAgICAgICB2aWV3LnNldChpY29uKTsKICAgICB9CiAKICAgICBwdWJsaWMgdm9pZCByZW1vdmVJY29uKFN0cmluZyBzbG90LCBpbnQgaW5kZXgsIGludCB2aWV3SW5kZXgpIHs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OwogICAgICAgICBpbnQ4X3QgICAgICAgICAgICAgICAgICAgIG1QbGF5U3RhdGU7CkBAIC0xNjgsNyArMTY4LDcgQEAKIAogICAgICAgICBTeW50aFByb3h5Sm5pU3RvcmFnZSgpIHsKICAgICAgICAgICAgIHR0c19yZWYgPSBOVUxMOwotICAgICAgICAgICAgbU5hdGl2ZVN5bnRoSW50ZXJmYWNlID0gTlVMTDsKKyAgICAgICAgICAgIG1FbmdpbmUgPSBOVUxMOwogICAgICAgICAgICAgbUVuZ2luZUxpYkhhbmRsZSA9IE5VTEw7CiAgICAgICAgICAgICBtQXVkaW9PdXQgPSBOVUxMOwogICAgICAgICAgICAgbVBsYXlTdGF0ZSA9ICBTWU5USFBMQVlTVEFURV9JU19TVE9QUEVEOwpAQCAtMTg0LDkgKzE4NCw5IEBACiAgICAgICAgIH5TeW50aFByb3h5Sm5pU3RvcmFnZSgpIHsKICAgICAgICAgICAgIC8vTE9HVigiZW50ZXJpbmcgflN5bnRoUHJveHlKbmlTdG9yYWdlKCkiKTsKICAgICAgICAgICAgIGtpbGxBdWRpbygpOwotICAgICAgICAgICAgaWYgKG1OYXRpdmVTeW50aEludGVyZmFjZSkgewotICAgICAgICAgICAgICAgIG1OYXRpdmVTeW50aEludGVyZmFjZS0+c2h1dGRvd24oKTsKLSAgICAgICAgICAgICAgICBtTmF0aXZlU3ludGhJbnRlcmZhY2UgPSBOVUxMOworICAgICAgICAgICAgaWYgKG1FbmdpbmUpIHsKKyAgICAgICAgICAgICAgICBtRW5naW5lLT5mdW5jcy0+c2h1dGRvd24obUVuZ2luZSk7CisgICAgICAgICAgICAgICAgbUVuZ2luZSA9IE5VTEw7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAobUVuZ2luZUxpYkhhbmRsZSkgewogICAgICAgICAgICAgICAgIC8vTE9HRSgiflN5bnRoUHJveHlKbmlTdG9yYWdlKCk6IGJlZm9yZSBjbG9zZSBsaWJyYXJ5Iik7CkBAIC0yNzMsMjggKzI3Myw0NSBAQAogICogQ2FsbGJhY2sgZnJvbSBUVFMgZW5naW5lLgogICogRGlyZWN0bHkgc3BlYWtzIHVzaW5nIEF1ZGlvVHJhY2sgb3Igd3JpdGUgdG8gZmlsZQogICovCi1zdGF0aWMgdHRzX2NhbGxiYWNrX3N0YXR1cyB0dHNTeW50aERvbmVDQih2b2lkIComIHVzZXJkYXRhLCB1aW50MzJfdCByYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZm9ybWF0LCBpbnQgY2hhbm5lbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDhfdCAqJndhdiwgc2l6ZV90ICZidWZmZXJTaXplLCB0dHNfc3ludGhfc3RhdHVzIHN0YXR1cykgeworZXh0ZXJuICJDIiBhbmRyb2lkX3R0c19jYWxsYmFja19zdGF0dXNfdAorX190dHNTeW50aERvbmVDQih2b2lkICoqIHBVc2VyZGF0YSwgdWludDMyX3QgcmF0ZSwKKyAgICAgICAgICAgICAgIGFuZHJvaWRfdHRzX2F1ZGlvX2Zvcm1hdF90IGZvcm1hdCwgaW50IGNoYW5uZWwsCisgICAgICAgICAgICAgICBpbnQ4X3QgKipwV2F2LCBzaXplX3QgKnBCdWZmZXJTaXplLAorICAgICAgICAgICAgICAgYW5kcm9pZF90dHNfc3ludGhfc3RhdHVzX3Qgc3RhdHVzKSAKK3sKICAgICAvL0xPR1YoInR0c1N5bnRoRG9uZUNhbGxiYWNrOiAlZCBieXRlcyIsIGJ1ZmZlclNpemUpOworICAgIEF1ZGlvU3lzdGVtOjphdWRpb19mb3JtYXQgIGVuY29kaW5nOwogCi0gICAgaWYgKHVzZXJkYXRhID09IE5VTEwpeworICAgIGlmICgqcFVzZXJkYXRhID09IE5VTEwpewogICAgICAgICBMT0dFKCJ1c2VyZGF0YSA9PSBOVUxMIik7Ci0gICAgICAgIHJldHVybiBUVFNfQ0FMTEJBQ0tfSEFMVDsKKyAgICAgICAgcmV0dXJuIEFORFJPSURfVFRTX0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ZXRlZCIpOworICAgICAgICAgICAgcmV0dXJuIEFORFJPSURfVFRTX0NBTExCQUNLX0hBTFQ7CiAgICAgICAgIH0KIAotICAgICAgICBpZiAoYnVmZmVyU2l6ZSA+IDApIHsKLSAgICAgICAgICAgIHByZXBBdWRpb1RyYWNrKHBKbmlEYXRhLCBwRm9yQWZ0ZXItPnN0cmVhbVR5cGUsIHJhdGUsIChBdWRpb1N5c3RlbTo6YXVkaW9fZm9ybWF0KWZvcm1hdCwgY2hhbm5lbCk7CisgICAgICAgIGlmICgqcEJ1ZmZlclNpemUgPiAwKSB7CisgICAgICAgICAgICBwcmVwQXVkaW9UcmFjayhwSm5pRGF0YSwgcEZvckFmdGVyLT5zdHJlYW1UeXBlLCByYXRlLCBlbmNvZGluZywgY2hhbm5lbCk7CiAgICAgICAgICAgICBpZiAocEpuaURhdGEtPm1BdWRpb091dCkgewogICAgICAgICAgICAgICAgIHBKbmlEYXRhLT5tUGxheUxvY2subG9jaygpOwogICAgICAgICAgICAgICAgIGlmKHBKbmlEYXRhLT5tQXVkaW9PdXQtPnN0b3BwZWQoKQpAQCAtMzAzLDI4ICszMjAsMzEgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgcEpuaURhdGEtPm1QbGF5TG9jay51bmxvY2soKTsKICAgICAgICAgICAgICAgICBpZiAoYlVzZUZpbHRlcikgewotICAgICAgICAgICAgICAgICAgICBhcHBseUZpbHRlcigoaW50MTZfdCopd2F2LCBidWZmZXJTaXplLzIpOworICAgICAgICAgICAgICAgICAgICBhcHBseUZpbHRlcigoaW50MTZfdCopKnBXYXYsICpwQnVmZmVyU2l6ZS8yKTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcEpuaURhdGEtPm1BdWRpb091dC0+d3JpdGUod2F2LCBidWZmZXJTaXplKTsKLSAgICAgICAgICAgICAgICBtZW1zZXQod2F2LCAwLCBidWZmZXJTaXplKTsKKyAgICAgICAgICAgICAgICBwSm5pRGF0YS0+bUF1ZGlvT3V0LT53cml0ZSgqcFdhdiwgKnBCdWZmZXJTaXplKTsKKyAgICAgICAgICAgICAgICBtZW1zZXQoKnBXYXYsIDAsICpwQnVmZmVyU2l6ZSk7CiAgICAgICAgICAgICAgICAgLy9MT0dWKCJBdWRpb1RyYWNrIHdyb3RlOiAlZCBieXRlcyIsIGJ1ZmZlclNpemUpOwogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBMT0dFKCJDYW4ndCBwbGF5LCBudWxsIGF1ZGlvdHJhY2siKTsKKyAgICAgICAgICAgICAgICBkZWxldGUgcEZvckFmdGVyOworICAgICAgICAgICAgICAgIHBGb3JBZnRlciA9IE5VTEw7CisgICAgICAgICAgICAgICAgcmV0dXJuIEFORFJPSURfVFRTX0NBTExCQUNLX0hBTFQ7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9IGVsc2UgIGlmIChwRm9yQWZ0ZXItPnVzYWdlTW9kZSA9PSBVU0FHRU1PREVfV1JJVEVfVE9fRklMRSkgewogICAgICAgICAvL0xPR1YoIlNhdmUgdG8gZmlsZSIpOwotICAgICAgICBpZiAod2F2ID09IE5VTEwpIHsKKyAgICAgICAgaWYgKCpwV2F2ID09IE5VTEwpIHsKICAgICAgICAgICAgIGRlbGV0ZSBwRm9yQWZ0ZXI7CiAgICAgICAgICAgICBMT0dWKCJOdWxsOiBzcGVlY2ggaGFzIGNvbXBsZXRlZCIpOwotICAgICAgICAgICAgcmV0dXJuIFRUU19DQUxMQkFDS19IQUxUOworICAgICAgICAgICAgcmV0dXJuIEFORFJPSURfVFRTX0NBTExCQUNLX0hBTFQ7CiAgICAgICAgIH0KLSAgICAgICAgaWYgKGJ1ZmZlclNpemUgPiAwKXsKKyAgICAgICAgaWYgKCpwQnVmZmVyU2l6ZSA+IDApewogICAgICAgICAgICAgaWYgKGJVc2VGaWx0ZXIpIHsKLSAgICAgICAgICAgICAgICBhcHBseUZpbHRlcigoaW50MTZfdCopd2F2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JveHlfc3RvcChKTklFbnYgKmVudiwgam9iamVjdCB0aGl6LCBqaW50IGpuaURhdGEpCiB7Ci0gICAgaW50IHJlc3VsdCA9IFRUU19GQUlMVVJFOworICAgIGludCByZXN1bHQgPSBBTkRST0lEX1RUU19GQUlMVVJFOwogCiAgICAgaWYgKGpuaURhdGEgPT0gMCkgewogICAgICAgICBMT0dFKCJhbmRyb2lkX3R0c19TeW50aFByb3h5X3N0b3AoKTogaW52YWxpZCBKTkkgZGF0YSIpOwpAQCAtNzkwLDggKzg0MCw5IEBACiAgICAgfQogICAgIHBTeW50aERhdGEtPm1QbGF5TG9jay51bmxvY2soKTsKIAotICAgIGlmIChwU3ludGhEYXRhLT5tTmF0aXZlU3ludGhJbnRlcmZhY2UpIHsKLSAgICAgICAgcmVzdWx0ID0gcFN5bnRoRGF0YS0+bU5hdGl2ZVN5bnRoSW50ZXJmYWNlLT5zdG9wKCk7CisgICAgYW5kcm9pZF90dHNfZW5naW5lX3QgKmVuZ2luZSA9IHBTeW50aERhdGEtPm1FbmdpbmU7CisgICAgaWYgKGVuZ2luZSkgeworICAgICAgICByZXN1bHQgPSBlbmdpbmUtPmZ1bmNzLT5zdG9wKGVuZ2luZSk7CiAgICAgfQogCiAgICAgcmV0dXJuIHJlc3VsdDsKQEAgLTgwMSw3ICs4NTIsNyBAQAogc3RhdGljIGludAogYW5kcm9pZF90dHNfU3ludGhQcm94eV9zdG9wU3luYyhKTklFbnYgKmVudiwgam9iamVjdCB0aGl6LCBqaW50IGpuaURhdGEpCiB7Ci0gICAgaW50IHJlc3VsdCA9IFRUU19GQUlMVVJFOworICAgIGludCByZXN1bHQgPSBBTkRST0lEX1RUU19GQUlMVVJFOwogCiAgICAgaWYgKGpuaURhdGEgPT0gMCkgewogICAgICAgICBMT0dFKCJhbmRyb2lkX3R0c19TeW50aFByb3h5X3N0b3AoKTogaW52YWxpZCBKTkkgZGF0YSIpOwpAQCAtODI5LDcgKzg4MCw3IEBACiAKICAgICBTeW50aFByb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pdGxlOwogICAgIH0KQEAgLTMwMSw3ICszMDYsNyBAQAogICAgICAgICAvLyBBbHJlYWR5IHByZXBhcmVkIChpc1ByZXBhcmVkIHdpbGwgYmUgcmVzZXQgdG8gZmFsc2UgbGF0ZXIpCiAgICAgICAgIGlmIChzdC5pc1ByZXBhcmVkKQogICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0KKyAgICAgICAgCiAgICAgICAgIGlmICgobVByZXBhcmVkUGFuZWwgIT0gbnVsbCkgJiYgKG1QcmVwYXJlZFBhbmVsICE9IHN0KSkgewogICAgICAgICAgICAgLy8gQW5vdGhlciBQYW5lbCBpcyBwcmVwYXJlZCBhbmQgcG9zc2libHkgb3Blbiwgc28gY2xvc2UgaXQKICAgICAgICAgICAgIGNsb3NlUGFuZWwobVByZXBhcmVkUGFuZWwsIGZhbHNlKTsKQEAgLTMxNSw5ICszMjAsMTEgQEAKIAogICAgICAgICBpZiAoc3QuY3JlYXRlZFBhbmVsVmlldyA9PSBudWxsKSB7CiAgICAgICAgICAgICAvLyBJbml0IHRoZSBwYW5lbCBzdGF0ZSdzIG1lbnUtLXJldHVybiBmYWxzZSBpZiBpbml0IGZhaWxlZAotICAgICAgICAgICAgaWYgKHN0Lm1lbnUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIGlmICghaW5pdGlhbGl6ZVBhbmVsTWVudShzdCkgfHwgKHN0Lm1lbnUgPT0gbnVsbCkpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgaWYgKHN0Lm1lbnUgPT0gbnVsbCB8fCBzdC5yZWZyZXNoTWVudUNvbnRlbnQpIHsKKyAgICAgICAgICAgICAgICBpZiAoc3QubWVudSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghaW5pdGlhbGl6ZVBhbmVsTWVudShzdCkgfHwgKHN0Lm1lbnUgPT0gbnVsbCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAvLyBDYWxsIGNhbGxiYWNrLCBhbmQgcmV0dXJuIGlmIGl0IGRvZXNuJ3Qgd2FudCB0byBkaXNwbGF5IG1lbnUKICAgICAgICAgICAgICAgICBpZiAoKGNiID09IG51bGwpIHx8ICFjYi5vbkNyZWF0ZVBhbmVsTWVudShzdC5mZWF0dXJlSWQsIHN0Lm1lbnUpKSB7CkBAIC0zMjYsNiArMzMzLDEyIEBACiAKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBzdC5yZWZyZXNoTWVudUNvbnRlbnQgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgIGlmIChtQWN0aW9uQmFyICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGlvbkJhci5zZXRNZW51KHN0Lm1lbnUpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgLy8gQ2FsbGJhY2sgYW5kIHJldHVybiBpZiB0aGUgY2FsbGJhY2sgZG9lcyBub3Qgd2FudCB0byBzaG93IHRoZSBtZW51CkBAIC0zNzQsMTEgKzM4Nyw5IEBACiAgICAgICAgICAgICAgICAgY2xlYXJNZW51Vmlld3Moc3QpOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0KICAgICB9CiAKICAgICBwcml2YXRlIHN0YXRpYyB2b2lkIGNsZWFyTWVudVZpZXdzKFBhbmVsRmVhdHVyZVN0YXRlIHN0KSB7Ci0KICAgICAgICAgLy8gVGhpcyBjYW4gYmUgY2FsbGVkIG9uIGNvbmZpZyBjaGFuZ2VzLCBzbyB3ZSBzaG91bGQgbWFrZSBzdXJlCiAgICAgICAgIC8vIHRoZSB2aWV3cyB3aWxsIGJlIHJlY29uc3RydWN0ZWQgYmFzZWQ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UNUSU9OX0JBUikpICE9IDApIHsKKyAgICAgICAgICAgICAgICBDb25maWd1cmF0aW9uIGNvbmZpZyA9IGdldENvbnRleHQoKS5nZXRSZXNvdXJjZXMoKS5nZXRDb25maWd1cmF0aW9uKCk7CisgICAgICAgICAgICAgICAgaWYgKChjb25maWcuc2NyZWVuTGF5b3V0ICYgQ29uZmlndXJhdGlvbi5TQ1JFRU5MQVlPVVRfU0laRV9YTEFSR0UpID09CisgICAgICAgICAgICAgICAgICAgIENvbmZpZ3VyYXRpb24uU0NSRUVOTEFZT1VUX1NJWkVfWExBUkdFKSB7CisgICAgICAgICAgICAgICAgICAgIGxheW91dFJlc291cmNlID0gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5sYXlvdXQuc2NyZWVuX3hsYXJnZV9hY3Rpb25fYmFyOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGxheW91dFJlc291cmNlID0gY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5sYXlvdXQuc2NyZWVuX2FjdGlvbl9iYXI7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBsYXlvdXRSZXNvdXJjZSA9IGNvbS5hbmRyb2lkLmludGVybmFsLlIubGF5b3V0LnNjcmVlbl90aXRsZTsKICAgICAgICAgICAgIH0KQEAgLTIyNzMsNiArMjMxNSwxMSBAQAogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIG1UaXRsZVZpZXcuc2V0VGV4dChtVGl0bGUpOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbUFjdGlvbkJhciA9IChBY3Rpb25CYXJWaWV3KSBmaW5kVmlld0J5SWQoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pZC5hY3Rpb25fYmFyKTsKKyAgICAgICAgICAgICAgICBpZiAobUFjdGlvbkJhciAh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29tLmFuZHJvaWQuaW50ZXJuYWwuUi5pbnRlZ2VyLmNvbmZpZ19uZXR3b3JrVHJhbnNpdGlvblRpbWVvdXQpOworCiAgICAgICAgIG1OZXRUcmFja2VycyA9IG5ldyBOZXR3b3JrU3RhdGVUcmFja2VyWwogICAgICAgICAgICAgICAgIENvbm5lY3Rpdml0eU1hbmFnZXIuTUFYX05FVFdPUktfVFlQRSsxXTsKICAgICAgICAgbUhhbmRsZXIgPSBuZXcgTXlIYW5kbGVyKCk7CkBAIC01OTcsMTUgKzYxMSw3IEBACiAgICAgICAgICAgICAgICAgbmV0d29yay5yZWNvbm5lY3QoKTsKICAgICAgICAgICAgICAgICByZXR1cm4gUGhvbmUuQVBOX1JFUVVFU1RfU1RBUlRFRDsKICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc3luY2hyb25pemVkKHRoaXMpIHsKLSAgICAgICAgICAgICAgICAgICAgbUZlYXR1cmVVc2Vycy5hZGQoZik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRNZXNzYWdlRGVsYXllZChtSGFuZGxlci5vYnRhaW5NZXNzYWdlKAotICAgICAgICAgICAgICAgICAgICAgICAgTmV0d29ya1N0YXRlVHJhY2tlci5FVkVOVF9SRVNUT1JFX0RFRkFVTFRfTkVUV09SSywKLSAgICAgICAgICAgICAgICAgICAgICAgIGYpLCBnZXRSZXN0b3JlRGVmYXVsdE5ldHdvcmtEZWxheSgpKTsKLQotICAgICAgICAgICAgICAgIHJldHVybiBuZXR3b3JrLnN0YXJ0VXNpbmdOZXR3b3JrRmVhdHVyZShmZWF0dXJlLAotICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q2FsbGluZ1BpZCgpLCBnZXRDYWxsaW5nVWlkKCkpOworICAgICAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICByZXR1cm4gUGhvbmUuQVBOX1RZUEVfTk9UX0FWQUlMQUJMRTsKQEAgLTcyNCw4ICs3MzAsNyBAQAogICAgICAgICAgICAgdHJhY2tlci50ZWFyZG93bigpOwogICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAvLyBkbyBpdCB0aGUgb2xkIGZhc2hpb25lZCB3YXkKLSAgICAgICAgICAgIHJldHVybiB0cmFja2VyLnN0b3BVc2luZ05ldHdvcmtGZWF0dXJlKGZlYXR1cmUsIHBpZCwgdWlkKTsKKyAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICAgfQogICAgIH0KIApAQCAtNzUyLDcgKzc1NywzMiBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9Ci0gICAgICAgIHJldHVybiB0cmFja2VyLnJlcXVlc3RSb3V0ZVRvSG9zdChob3N0QWRkcmVzcyk7CisgICAgICAgIHJldHVybiBhZGRIb3N0Um91dGUodHJhY2tlciwgaG9zdEFkZHJlc3MpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEVuc3VyZSB0aGF0IGEgbmV0d29yayByb3V0ZSBleGlzdHMgdG8gZGVsaXZlciB0cmFmZmljIHRvIHRoZSBzcGVjaWZpZWQKKyAgICAgKiBob3N0IHZpYSB0aGUgbW9iaWxlIGRhdGEgbmV0d29yay4KKyAgICAgKiBAcGFyYW0gaG9zdEFkZHJlc3MgdGhlIElQIGFkZHJlc3Mgb2YgdGhlIGhvc3QgdG8gd2hpY2ggdGhlIHJvdXRlIGlzIGRlc2lyZWQsCisgICAgICogaW4gbmV0d29yayBieXRlIG9yZGVyLgorICAgICAqIEByZXR1cm4ge0Bjb2RlIHRydWV9IG9uIHN1Y2Nlc3MsIHtAY29kZSBmYWxzZX0gb24gZmFpbHVyZQorICAgICAqLworICAgIHByaXZhdGUgYm9vbGVhbiBhZGRIb3N0Um91dGUoTmV0d29ya1N0YXRlVHJhY2tlciBudCwgaW50IGhvc3RBZGRyZXNzKSB7CisgICAgICAgIGlmIChudC5nZXROZXR3b3JrSW5mbygpLmdldFR5cGUoKSA9PSBDb25uZWN0aXZpdHlNYW5hZ2VyLlRZUEVfV0lGSSkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgU3RyaW5nIGludGVyZmFjZU5hbWUgPSBudC5nZXRJbnRlcmZhY2VOYW1lKCk7CisKKyAgICAgICAgaWYgKERCRykgeworICAgICAgICAgICAgU2xvZy5kKFRBRywgIlJlcXVlc3RlZCBob3N0IHJvdXRlIHRvICIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGhvc3RBZGRyZXNzKSArCisgICAgICAgICAgICAgICAgICAgICAiKCIgKyBpbnRlcmZhY2VOYW1lICsgIikiKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoaW50ZXJmYWNlTmFtZSAhPSBudWxsICYmIGhvc3RBZGRyZXNzICE9IC0xKSB7CisgICAgICAgICAgICByZXR1cm4gTmV0d29ya1V0aWxzLmFkZEhvc3RSb3V0ZShpbnRlcmZhY2VOYW1lLCBob3N0QWRkcmVzcykgPT0gMDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQogICAgIH0KIAogICAgIC8qKgpAQCAtODU5LDYgKzg4OSwxMiBAQAogICAgICAgICAgICAgICAgICJDb25uZWN0aXZpdHlTZXJ2aWNlIik7CiAgICAgfQogCisgICAgcHJpdmF0ZSB2b2lkIGVuZm9yY2VDb25uZWN0aXZpdHlJbnRlcm5hbFBlcm1pc3Npb24oKSB7CisgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbigKKyAgICAgICAgICAgICAgICBhbmRyb2lkLk1hbmlmZXN0LnBlcm1pc3Npb24uQ09OTkVDVElWSVRZX0lOVEVSTkFMLAorICAgICAgICAgICAgICAgICJDb25uZWN0aXZpdHlTZXJ2aWNlIik7CisgICAgfQorCiAgICAgLyoqCiAgICAgICogSGFuZGxlIGEge0Bjb2RlIERJU0NPTk5FQ1RFRH0gZXZlbnQuIElmIHRoaXMgcGVydGFpbnMgdG8gdGhlIG5vbi1hY3RpdmUKICAgICAgKiBuZXR3b3JrLCB3ZSBpZ25vcmUgaXQuIElmIGl0IGlzIGZvciB0aGUgYWN0aXZlIG5ldHdvcmssIHdlIHNlbmQgb3V0IGEKQEAgLTExMzQsMTUgKzExNzAsMjMgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJOZXR3b3JrIGRlY2xpbmVkIHRlYXJkb3duIHJlcXVlc3QiKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoaXNGYWlsb3ZlcikgewotICAgICAgICAgICAgICAgICAgICAgICAgb3RoZXJOZXQucmVsZWFzZVdha2VMb2NrKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKENvbm5lY3Rpdml0eVNlcnZpY2UudGhpcykgeworICAgICAgICAgICAgICAgIC8vIGhhdmUgYSBuZXcgZGVmYXVsdCBuZXR3b3JrLCByZWxlYXNlIHRoZSB0cmFuc2l0aW9uIHdha2Vsb2NrIGluIGEgc2Vjb25kCisgICAgICAgICAgICAgICAgLy8gaWYgaXQncyBoZWxkLiAgVGhlIHNlY29uZCBwYXVzZSBpcyB0byBhbGxvdyBhcHBzIHRvIHJlY29ubmVjdCBvdmVyIHRoZQorICAgICAgICAgICAgICAgIC8vIG5ldyBuZXR3b3JrCisgICAgICAgICAgICAgICAgaWYgKG1OZXRUcmFuc2l0aW9uV2FrZUxvY2suaXNIZWxkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgbUhhbmRsZXIuc2VuZE1lc3NhZ2VEZWxheWVkKG1IYW5kbGVyLm9idGFpbk1lc3NhZ2UoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTmV0d29ya1N0YXRlVHJhY2tlci5FVkVOVF9DTEVBUl9ORVRfVFJBTlNJVElPTl9XQUtFTE9DSywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTmV0VHJhbnNpdGlvbldha2VMb2NrU2VyaWFsTnVtYmVyLCAwKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDAwKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBtQWN0aXZlRGVmYXVsdE5ldHdvcmsgPSB0eXBlOwogICAgICAgICB9CiAgICAgICAgIHRoaXNOZXQuc2V0VGVhcmRvd25SZXF1ZXN0ZWQoZmFsc2UpOwotICAgICAgICB0aGlzTmV0LnVwZGF0ZU5ldHdvcmtTZXR0aW5ncygpOworICAgICAgICB1cGRhdGVOZXR3b3JrU2V0dGluZ3ModGhpc05ldCk7CiAgICAgICAgIGhhbmRsZUNvbm5lY3Rpdml0eUNoYW5nZSgpOwogICAgICAgICBzZW5kQ29ubmVjdGVkQnJvYWRjYXN0KGluZm8pOwogICAgIH0KQEAgLTExOTIsMjAgKzEyMzYsMTg1IEBACiAgICAgICAgIGZvciAoaW50IG5ldFR5cGUgOiBtUHJpb3JpdHlMaXN0KSB7CiAgICAgICAgICAgICBpZiAobU5ldFRyYWNrZXJzW25ldFR5cGVdLmdldE5ldHdvcmtJbmZvKCkuaXNDb25uZWN0ZWQoKSkgewogICAgICAgICAgICAgICAgIGlmIChtTmV0QXR0cmlidXRlc1tuZXRUeXBlXS5pc0RlZmF1bHQoKSkgewotICAgICAgICAgICAgICAgICAgICBtTmV0VHJhY2tlcnNbbmV0VHlwZV0uYWRkRGVmYXVsdFJvdXRlKCk7CisgICAgICAgICAgICAgICAgICAgIGFkZERlZmF1bHRSb3V0ZShtTmV0VHJhY2tlcnNbbmV0VHlwZV0pOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1OZXRUcmFja2Vyc1tuZXRUeXBlXS5hZGRQcml2YXRlRG5zUm91dGVzKCk7CisgICAgICAgICAgICAgICAgICAgIGFkZFByaXZhdGVEbnNSb3V0ZXMobU5ldFRyYWNrZXJzW25ldFR5cGVdKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIGlmIChtTmV0QXR0cmlidXRlc1tuZXRUeXBlXS5pc0RlZmF1bHQoKSkgewotICAgICAgICAgICAgICAgICAgICBtTmV0VHJhY2tlcnNbbmV0VHlwZV0ucmVtb3ZlRGVmYXVsdFJvdXRlKCk7CisgICAgICAgICAgICAgICAgICAgIHJlbW92ZURlZmF1bHRSb3V0ZShtTmV0VHJhY2tlcnNbbmV0VHlwZV0pOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1OZXRUcmFja2Vyc1tuZXRUeXBlXS5yZW1vdmVQcml2YXRlRG5zUm91dGVzKCk7CisgICAgICAgICAgICAgICAgICAgIHJlbW92ZVByaXZhdGVEbnNSb3V0ZXMobU5ldFRyYWNrZXJzW25ldFR5cGVdKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CiAKKyAgICBwcml2YXRlIHZvaWQgYWRkUHJpdmF0ZURuc1JvdXRlcyhOZXR3b3JrU3RhdGVUcmFja2VyIG50KSB7CisgICAgICAgIFN0cmluZyBpbnRlcmZhY2VOYW1lID0gbnQuZ2V0SW50ZXJmYWNlTmFtZSgpOworICAgICAgICBib29sZWFuIHByaXZhdGVEbnNSb3V0ZVNldCA9IG50LmlzUHJpdmF0ZURuc1JvdXRlU2V0KCk7CisKKyAgICAgICAgaWYgKERCRykgeworICAgICAgICAgICAgU2xvZy5kKFRBRywgImFkZFByaXZhdGVEbnNSb3V0ZXMgZm9yICIgKyBudCArCisgICAgICAgICAgICAgICAgICAgICIoIiArIGludGVyZmFjZU5hbWUgKyAiKSAtIG1Qcml2YXRlRG5zUm91dGVTZXQgPSAiICsgcHJpdmF0ZURuc1JvdXRlU2V0KTsKKyAgICAgICAgfQorICAgICAgICBTdHJpbmdbXSBkbnNMaXN0ID0gZ2V0TmFtZVNlcnZlckxpc3QobnQuZ2V0RG5zUHJvcE5hbWVzKCkpOworICAgICAgICBpZiAoaW50ZXJmYWNlTmFtZSAhPSBudWxsICYmICFwcml2YXRlRG5zUm91dGVTZXQpIHsKKyAgICAgICAgICAgIGZvciAoU3RyaW5nIGFkZHJTdHJpbmcgOiBkbnNMaXN0KSB7CisgICAgICAgICAgICAgICAgaW50IGFkZHIgPSBOZXR3b3JrVXRpbHMubG9va3VwSG9zdChhZGRyU3RyaW5nKTsKKyAgICAgICAgICAgICAgICBpZiAoYWRkciAhPSAtMSAmJiBhZGRyICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgU2xvZy5kKFRBRywgIiAgYWRkaW5nICIrYWRkclN0cmluZysiICgiK2FkZHIrIikiKTsKKyAgICAgICAgICAgICAgICAgICAgTmV0d29ya1V0aWxzLmFkZEhvc3RSb3V0ZShpbnRlcmZhY2VOYW1lLCBhZGRyKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBudC5wcml2YXRlRG5zUm91dGVTZXQodHJ1ZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcmVtb3ZlUHJpdmF0ZURuc1JvdXRlcyhOZXR3b3JrU3RhdGVUcmFja2VyIG50KSB7CisgICAgICAgIC8vIFRPRE8gLSB3ZSBzaG91bGQgZG8gdGhpcyBleHBsaWNpdGx5IGJ1dCB0aGUgTmV0VXRpbHMgYXBpIGRvZXNudAorICAgICAgICAvLyBzdXBwb3J0IHRoaXMgeWV0IC0gbXVzdCByZW1vdmUgYWxsLiAgTm8gd29yc2UgdGhhbiBiZ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JmYWNlTmFtZSA9IG50LmdldEludGVyZmFjZU5hbWUoKTsKKyAgICAgICAgaW50IGRlZmF1bHRHYXRld2F5QWRkciA9IG50LmdldERlZmF1bHRHYXRld2F5QWRkcigpOworICAgICAgICBib29sZWFuIGRlZmF1bHRSb3V0ZVNldCA9IG50LmlzRGVmYXVsdFJvdXRlU2V0KCk7CisgICAgICAgIE5ldHdvcmtJbmZvIG5ldHdvcmtJbmZvID0gbnQuZ2V0TmV0d29ya0luZm8oKTsKKworICAgICAgICBpZiAoKGludGVyZmFjZU5hbWUgIT0gbnVsbCkgJiYgKGRlZmF1bHRHYXRld2F5QWRkciAhPSAwKSAmJgorICAgICAgICAgICAgICAgIGRlZmF1bHRSb3V0ZVNldCA9PSBmYWxzZSkgeworICAgICAgICAgICAgaWYgKERCRykgeworICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJhZGREZWZhdWx0Um91dGUgZm9yICIgKyBuZXR3b3JrSW5mby5nZXRUeXBlTmFtZSgpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICIgKCIgKyBpbnRlcmZhY2VOYW1lICsgIiksIEdhdGV3YXlBZGRyPSIgKyBkZWZhdWx0R2F0ZXdheUFkZHIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgTmV0d29ya1V0aWxzLnNldERlZmF1bHRSb3V0ZShpbnRlcmZhY2VOYW1lLCBkZWZhdWx0R2F0ZXdheUFkZHIpOworICAgICAgICAgICAgbnQuZGVmYXVsdFJvdXRlU2V0KHRydWUpOworICAgICAgICB9CisgICAgfQorCisKKyAgICBwdWJsaWMgdm9pZCByZW1vdmVEZWZhdWx0Um91dGUoTmV0d29ya1N0YXRlVHJhY2tlciBudCkgeworICAgICAgICBTdHJpbmcgaW50ZXJmYWNlTmFtZSA9IG50LmdldEludGVyZmFjZU5hbWUoKTsKKyAgICAgICAgYm9vbGVhbiBkZWZhdWx0Um91dGVTZXQgPSBudC5pc0RlZmF1bHRSb3V0ZVNldCgpOworICAgICAgICBOZXR3b3JrSW5mbyBuZXR3b3JrSW5mbyA9IG50LmdldE5ldHdvcmtJbmZvKCk7CisKKyAgICAgICAgaWYgKGludGVyZmFjZU5hbWUgIT0gbnVsbCAmJiBkZWZhdWx0Um91dGVTZXQgPT0gdHJ1ZSkgeworICAgICAgICAgICAgaWYgKERCRykgeworICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJyZW1vdmVEZWZhdWx0Um91dGUgZm9yICIgKyBuZXR3b3JrSW5mby5nZXRUeXBlTmFtZSgpICsgIiAoIiArCisgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcmZhY2VOYW1lICsgIikiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIE5ldHdvcmtVdGlscy5yZW1vdmVEZWZhdWx0Um91dGUoaW50ZXJmYWNlTmFtZSk7CisgICAgICAgICAgICBudC5kZWZhdWx0Um91dGVTZXQoZmFsc2UpOworICAgICAgICB9CisgICAgfQorCisgICAvKioKKyAgICAgKiBSZWFkcyB0aGUgbmV0d29yayBzcGVjaWZpYyBUQ1AgYnVmZmVyIHNpemVzIGZyb20gU3lzdGVtUHJvcGVydGllcworICAgICAqIG5ldC50Y3AuYnVmZmVyc2l6ZS5bZGVmYXVsdHx3aWZpfHVtdHN8ZWRnZXxncHJzXSBhbmQgc2V0IHRoZW0gZm9yIHN5c3RlbQorICAgICAqIHdpZGUgdXNlCisgICAgICovCisgICBwdWJsaWMgdm9pZCB1cGRhdGVOZXR3b3JrU2V0dGluZ3MoTmV0d29ya1N0YXRlVHJhY2tlciBudCkgeworICAgICAgICBTdHJpbmcga2V5ID0gbnQuZ2V0VGNwQnVmZmVyU2l6ZXNQcm9wTmFtZSgpOworICAgICAgICBTdHJpbmcgYnVmZmVyU2l6ZXMgPSBTeXN0ZW1Qcm9wZXJ0aWVzLmdldChrZXkpOworCisgICAgICAgIGlmIChidWZmZXJTaXplcy5sZW5ndGgoKSA9PSAwKSB7CisgICAgICAgICAgICBTbG9nLmUoVEFHLCBrZXkgKyAiIG5vdCBmb3VuZCBpbiBzeXN0ZW0gcHJvcGVydGllcy4gVXNpbmcgZGVmYXVsdHMiKTsKKworICAgICAgICAgICAgLy8gU2V0dGluZyB0byBkZWZhdWx0IHZhbHVlcyBzbyB3ZSB3b24ndCBiZSBzdHVjayB0byBwcmV2aW91cyB2YWx1ZXMKKyAgICAgICAgICAgIGtleSA9ICJuZXQudGNwLmJ1ZmZlcnNpemUuZGVmYXVsdCI7CisgICAgICAgICAgICBidWZmZXJTaXplcyA9IFN5c3RlbVByb3BlcnRpZXMuZ2V0KGtleSk7CisgICAgICAgIH0KKworICAgICAgICAvLyBTZXQgdmFsdWVzIGluIGtlcm5lbAorICAgICAgICBpZiAoYnVmZmVyU2l6ZXMubGVuZ3RoKCkgIT0gMCkgeworICAgICAgICAgICAgaWYgKERCRykgeworICAgICAgICAgICAgICAgIFNsb2cudihUQUcsICJTZXR0aW5nIFRDUCB2YWx1ZXM6IFsiICsgYnVmZmVyU2l6ZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIl0gd2hpY2ggY29tZXMgZnJvbSBbIiArIGtleSArICJdIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzZXRCdWZmZXJTaXplKGJ1ZmZlclNpemVzKTsKKyAgICAgICAgfQorICAgIH0KKworICAgLyoqCisgICAgICogV3JpdGVzIFRDUCBidWZmZXIgc2l6ZXMgdG8gL3N5cy9rZXJuZWwvaXB2NC90Y3BfW3Ivd11tZW1fW21pbi9kZWYvbWF4XQorICAgICAqIHdoaWNoIG1hcHMgdG8gL3Byb2Mvc3lzL25ldC9pcHY0L3RjcF9ybWVtIGFuZCB0Y3B3bWVtCisgICAgICoKKyAgICAgKiBAcGFyYW0gYnVmZmVyU2l6ZXMgaW4gdGhlIGZvcm1hdCBvZiAicmVhZE1pbiwgcmVhZEluaXRpYWwsIHJlYWRNYXgsCisgICAgICogICAgICAgIHdyaXRlTWluLCB3cml0ZUluaXRpYWwsIHdyaXRlTWF4IgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBzZXRCdWZmZXJTaXplKFN0cmluZyBidWZmZXJTaXplcykgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgU3RyaW5nW10gdmFsdWVzID0gYnVmZmVyU2l6ZXMuc3BsaXQoIiwiKTsKKworICAgICAgICAgICAgaWYgKHZhbHVlcy5sZW5ndGggPT0gNikgeworICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgcHJlZml4ID0gIi9zeXMva2VybmVsL2lwdjQvdGNwXyI7CisgICAgICAgICAgICAgICAgc3RyaW5nVG9GaWxlKHByZWZpeCArICJybWVtX21pbiIsIHZhbHVlc1swXSk7CisgICAgICAgICAgICAgICAgc3RyaW5nVG9GaWxlKHByZWZpeCArICJybWVtX2RlZiIsIHZhbHVlc1sxXSk7CisgICAgICAgICAgICAgICAgc3RyaW5nVG9GaWxlKHByZWZpeCArICJybWVtX21heCIsIHZhbHVlc1syXSk7CisgICAgICAgICAgICAgICAgc3RyaW5nVG9GaWxlKHByZWZpeCArICJ3bWVtX21pbiIsIHZhbHVlc1szXSk7CisgICAgICAgICAgICAgICAgc3RyaW5nVG9GaWxlKHByZWZpeCArICJ3bWVtX2RlZiIsIHZhbHVlc1s0XSk7CisgICAgICAgICAgICAgICAgc3RyaW5nVG9GaWxlKHByZWZpeCArICJ3bWVtX21heCIsIHZhbHVlc1s1XSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJJbnZhbGlkIGJ1ZmZlcnNpemUgc3RyaW5nOiAiICsgYnVmZmVyU2l6ZXMpOworICAgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBTbG9nLmUoVEFHLCAiQ2FuJ3Qgc2V0IHRjcCBidWZmZXIgc2l6ZXM6IiArIGUpOworICAgICAgICB9CisgICAgfQorCisgICAvKioKKyAgICAgKiBXcml0ZXMgc3RyaW5nIHRvIGZpbGUuIEJhc2ljYWxseSBzYW1lIGFzICJlY2hvIC1uICRzdHJpbmcgPiAkZmlsZW5hbWUiCisgICAgICoKKyAgICAgKiBAcGFyYW0gZmlsZW5hbWUKKyAgICAgKiBAcGFyYW0gc3RyaW5nCisgICAgICogQHRocm93cyBJT0V4Y2VwdGlvbgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBzdHJpbmdUb0ZpbGUoU3RyaW5nIGZpbGVuYW1lLCBTdHJpbmcgc3RyaW5nKSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgICAgICBGaWxlV3JpdGVyIG91dCA9IG5ldyBGaWxlV3JpdGVyKGZpbGVuYW1lKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG91dC53cml0ZShzdHJpbmcpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgb3V0LmNsb3NlKCk7CisgICAgICAgIH0KKyAgICB9CisKKwogICAgIC8qKgogICAgICAqIEFkanVzdCB0aGUgcGVyLXByb2Nlc3MgZG5zIGVudHJpZXMgKG5ldC5kbnM8eD4uPHBpZD4pIGJhc2VkCiAgICAgICogb24gdGhlIGhpZ2hlc3QgcHJpb3JpdHkgYWN0aXZlIG5ldCB3aGljaCB0aGlzIHByb2Nlc3MgcmVxdWVzdGVkLgpAQCAtMTIyNSw3ICsxNDM0LDcgQEAKICAgICAgICAgICAgICAgICBmb3IgKGludCBqPTA7IGo8cGlkcy5zaXplKCk7IGorKykgewogICAgICAgICAgICAgICAgICAgICBJbnRlZ2VyIHBpZCA9IChJbnRlZ2VyKXBpZHMuZ2V0KGopOwogICAgICAgICAgICAgICAgICAgICBpZiAocGlkLmludFZhbHVlKCkgPT0gbXlQaWQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZ1tdIGRuc0xpc3QgPSBudC5nZXROYW1lU2VydmVycygpOworICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nW10gZG5zTGlzdCA9IGdldE5hbWVTZXJ2ZXJMaXN0KG50LmdldERuc1Byb3BOYW1lcygpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlUGlkRG5zKGRuc0xpc3QsIG15UGlkKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkb0J1bXApIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidW1wRG5zKCk7CkBAIC0xMjc5LDcgKzE0ODgsNyBAQAogICAgICAgICAgICAgTmV0d29ya1N0YXRlVHJhY2tlciBudCA9IG1OZXRUcmFja2Vyc1tuZXRUeXBlXTsKICAgICAgICAgICAgIGlmIChudCAhPSBudWxsICYmIG50LmdldE5ldHdvcmtJbmZvKCkuaXNDb25uZWN0ZWQoKSAmJgogICAgICAgICAgICAgICAgICAgICAhbnQuaXNUZWFyZG93blJlcXVlc3RlZCgpKSB7Ci0gICAgICAgICAgICAgICAgU3RyaW5nW10gZG5zTGlzdCA9IG50LmdldE5hbWVTZXJ2ZXJzKCk7CisgICAgICAgICAgICAgICAgU3RyaW5nW10gZG5zTGlzdCA9IGdldE5hbWVTZXJ2ZXJMaXN0KG50LmdldERuc1Byb3BOYW1lcygpKTsKICAgICAgICAgICAgICAgICBpZiAobU5ldEF0dHJpYnV0ZXNbbmV0VHlwZV0uaXNEZWZhdWx0KCkpIHsKICAgICAgICAgICAgICAgICAgICAgaW50IGogPSAxOwogICAgICAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBkbnMgOiBkbnNMaXN0KSB7CkBAIC0xMzYyLDYgKzE1NzEsMTMgQEAKICAgICAgICAgfQogICAgICAgICBwdy5wcmludGxuKCk7CiAKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBwdy5wcmludGxuKCJOZXR3b3JrVHJhbnN0aW9uV2FrZUxvY2sgaXMgY3VycmVudGx5ICIgKworICAgICAgICAgICAgICAgICAgICAobU5ldFRyYW5zaXRpb25XYWtlTG9jay5pc0hlbGQoKSA/ICIiIDogIm5vdCAiKSArICJoZWxkLiIpOworICAgICAgICAgICAgcHcucHJpbnRsbigiSXQgd2FzIGxhc3QgcmVxdWVzdGVkIGZvciAiK21OZXRUcmFuc2l0aW9uV2FrZUxvY2tDYXVzZWRCeSk7CisgICAgICAgIH0KKyAgICAgICAgcHcucHJpbnRsbigpOworCiAgICAgICAgIG1UZXRoZXJpbmcuZHVtcChmZCwgcHcsIGFyZ3MpOwogICAgIH0KIApAQCAtMTQ1Myw2ICsxNjY5LDIwIEBACiAgICAgICAgICAgICAgICAgICAgIEZlYXR1cmVVc2VyIHUgPSAoRmVhdHVyZVVzZXIpbXNnLm9iajsKICAgICAgICAgICAgICAgICAgICAgdS5leHBpcmUoKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBOZXR3b3JrU3RhdGVUcmFja2VyLkVWRU5UX0NMRUFSX05FVF9UUkFOU0lUSU9OX1dBS0VMT0NLOgorICAgICAgICAgICAgICAgICAgICBTdHJpbmcgY2F1c2VkQnkgPSBudWxsOworICAgICAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKENvbm5lY3Rpdml0eVNlcnZpY2UudGhpcykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1zZy5hcmcxID09IG1OZXRUcmFuc2l0aW9uV2FrZUxvY2tTZXJpYWxOdW1iZXIgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU5ldFRyYW5zaXRpb25XYWtlTG9jay5pc0hlbGQoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1OZXRUcmFuc2l0aW9uV2FrZUxvY2sucmVsZWFzZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdXNlZEJ5ID0gbU5ldFRyYW5zaXRpb25XYWtlTG9ja0NhdXNlZEJ5OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChjYXVzZWRCeSAhPSBudWxsKSB7CisgIC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KLQotICAgIHByaXZhdGUgZmluYWwgdm9pZCBhZGREZWZhdWx0SW1hZ2VzKCkKLSAgICB7Ci0gICAgICAgIEZpbGUgcm9vdERpcmVjdG9yeSA9IEVudmlyb25tZW50LmdldFJvb3REaXJlY3RvcnkoKTsKLSAgICAgICAgU3RyaW5nIFtdIGZpbGVzCi0gICAgICAgICAgICA9IG5ldyBGaWxlKHJvb3REaXJlY3RvcnksICJpbWFnZXMiKS5saXN0KCk7Ci0gICAgICAgIGludCBjb3VudCA9IGZpbGVzLmxlbmd0aDsKLQotICAgICAgICBpZiAoY291bnQgPT0gMCkgewotICAgICAgICAgICAgU2xvZy5pKExPR19UQUcsICJhZGREZWZhdWx0SW1hZ2VzOiBubyBpbWFnZXMgZm91bmQhIik7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIFN0cmluZyBuYW1lID0gZmlsZXNbaV07Ci0gICAgICAgICAgICBTdHJpbmcgcGF0aCA9IHJvb3REaXJlY3RvcnkgKyAiLyIgKyBuYW1lOwotICAgICAgICAgICAgCi0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIEltYWdlcy5NZWRpYS5pbnNlcnRJbWFnZShtQ29udGVudFJlc29sdmVyLCBwYXRoLCBuYW1lLCBudWxsKTsKLSAgICAgICAgICAgIH0gY2F0Y2ggKEZpbGVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgU2xvZy5lKExPR19UQUcsICJGYWlsZWQgdG8gaW1wb3J0IGltYWdlICIgKyBwYXRoLCBlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICAKLSAgICBwcml2YXRlIGZpbmFsIHZvaWQgYWRkRGVmYXVsdERhdGEoKQotICAgIHsKLSAgICAgICAgU2xvZy5pKExPR19UQUcsICJBZGRpbmcg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0U3RyZWFtKHVybCk7Ci0KLSAgICAgICAgICAgIGZpbmFsIGludCBzaXplID0gOCAqIDEwMjQ7Ci0gICAgICAgICAgICBieXRlW10gYnVmID0gbmV3IGJ5dGVbc2l6ZV07Ci0KLSAgICAgICAgICAgIGludCBjb3VudCA9IDA7Ci0gICAgICAgICAgICBkbwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNvdW50ID0gaW4ucmVhZChidWYsIDAsIHNpemUpOwotICAgICAgICAgICAgICAgIGlmIChjb3VudCA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgb3V0LndyaXRlKGJ1ZiwgMCwgY291bnQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gd2hpbGUgKGNvdW50ID4gMCk7Ci0gICAgICAgIH0KLSAgICAgICAgY2F0Y2ggKEV4Y2VwdGlvbiBlKQotICAgICAgICB7Ci0gICAgICAgICAgICBTbG9nLmUoTE9HX1RBRywgIkZhaWxlZCB0byBpbnNlcnQgaW1hZ2UgJyIgKyBmaWxlICsgIiciLCBlKTsKLSAgICAgICAgICAgIHVybCA9IG51bGw7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gdXJsOwotICAgIH0KLQotICAgIHByaXZhdGUgZmluYWwgVXJpIGFkZFNob3J0Y3V0KFN0cmluZyBzaG9ydGN1dCwgSW50ZW50IGludGVudCkKLSAgICB7Ci0gICAgICAgIGlmIChDb25maWcuTE9HVikgU2xvZy52KExPR19UQUcsICJhZGRTaG9ydGN1dDogc2hvcnRjdXQ9IiArIHNob3J0Y3V0ICsgIiwgaW50ZW50PSIgKyBpbnRlbnQpOwotICAgICAgICByZXR1cm4gU2V0dGluZ3MuQm9va21hcmtzLmFkZChtQ29udGVudFJlc29sdmVyLCBpbnRlbnQsIG51bGwsIG51bGwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3J0Y3V0ICE9IG51bGwgPyBzaG9ydGN1dC5jaGFyQXQoMCkgOiA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A9IDA7CisgICAgaW50IG1BY3RpdmVQYXNzd29yZExldHRlcnMgPSAwOworICAgIGludCBtQWN0aXZlUGFzc3dvcmROdW1lcmljID0gMDsKKyAgICBpbnQgbUFjdGl2ZVBhc3N3b3JkU3ltYm9scyA9IDA7CisgICAgaW50IG1BY3RpdmVQYXNzd29yZE5vbkxldHRlciA9IDA7CiAgICAgaW50IG1GYWlsZWRQYXNzd29yZEF0dGVtcHRzID0gMDsKLSAgICAKKwogICAgIGludCBtUGFzc3dvcmRPd25lciA9IC0xOwotICAgIAorCiAgICAgZmluYWwgSGFzaE1hcDxDb21wb25lbnROYW1lLCBBY3RpdmVBZG1pbj4gbUFkbWluTWFwCiAgICAgICAgICAgICA9IG5ldyBIYXNoTWFwPENvbXBvbmVudE5hbWUsIEFjdGl2ZUFkbWluPigpOwogICAgIGZpbmFsIEFycmF5TGlzdDxBY3RpdmVBZG1pbj4gbUFkbWluTGlzdAogICAgICAgICAgICAgPSBuZXcgQXJyYXlMaXN0PEFjdGl2ZUFkbWluPigpOwotICAgIAorCiAgICAgc3RhdGljIGNsYXNzIEFjdGl2ZUFkbWluIHsKICAgICAgICAgZmluYWwgRGV2aWNlQWRtaW5JbmZvIGluZm87Ci0gICAgICAgIAorCiAgICAgICAgIGludCBwYXNzd29yZFF1YWxpdHkgPSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfVU5TUEVDSUZJRUQ7CiAgICAgICAgIGludCBtaW5pbXVtUGFzc3dvcmRMZW5ndGggPSAwOworICAgICAgICBpbnQgcGFzc3dvcmRIaXN0b3J5TGVuZ3RoID0gMDsKKyAgICAgICAgaW50IG1pbmltdW1QYXNzd29yZFVwcGVyQ2FzZSA9IDA7CisgICAgICAgIGludCBtaW5pbXVtUGFzc3dvcmRMb3dlckNhc2UgPSAwOworICAgICAgICBpbnQgbWluaW11bVBhc3N3b3JkTGV0dGVycyA9IDE7CisgICAgICAgIGludCBtaW5pbXVtUGFzc3dvcmROdW1lcmljID0gMTsKKyAgICAgICAgaW50IG1pbmltdW1QYXNzd29yZFN5bWJvbHMgPSAxOworICAgICAgICBpbnQgbWluaW11bVBhc3N3b3JkTm9uTGV0dGVyID0gMDsKICAgICAgICAgbG9uZyBtYXhpbXVtVGltZVRvVW5sb2NrID0gMDsKICAgICAgICAgaW50IG1heGltdW1GYWlsZWRQYXNzd29yZHNGb3JXaXBlID0gMDsKLSAgICAgICAgCisKICAgICAgICAgQWN0aXZlQWRtaW4oRGV2aWNlQWRtaW5JbmZvIF9pbmZvKSB7CiAgICAgICAgICAgICBpbmZvID0gX2luZm87CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgaW50IGdldFVpZCgpIHsgcmV0dXJuIGluZm8uZ2V0QWN0aXZpdHlJbmZvKCkuYXBwbGljYXRpb25JbmZvLnVpZDsgfQotICAgICAgICAKKwogICAgICAgICB2b2lkIHdyaXRlVG9YbWwoWG1sU2VyaWFsaXplciBvdXQpCiAgICAgICAgICAgICAgICAgdGhyb3dzIElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbiwgSWxsZWdhbFN0YXRlRXhjZXB0aW9uLCBJT0V4Y2VwdGlvbiB7CiAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgInBvbGljaWVzIik7CkBAIC0xMTAsNyArMTIzLDQyIEBACiAgICAgICAgICAgICAgICAgaWYgKG1pbmltdW1QYXNzd29yZExlbmd0aCA+IDApIHsKICAgICAgICAgICAgICAgICAgICAgb3V0LnN0YXJ0VGFnKG51bGwsICJtaW4tcGFzc3dvcmQtbGVuZ3RoIik7CiAgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhtaW5pbXVtUGFzc3dvcmRMZW5ndGgpKTsKLSAgICAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibW4tcGFzc3dvcmQtbGVuZ3RoIik7CisgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1sZW5ndGgiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYocGFzc3dvcmRIaXN0b3J5TGVuZ3RoID4gMCkgeworICAgICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgInBhc3N3b3JkLWhpc3RvcnktbGVuZ3RoIik7CisgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhwYXNzd29yZEhpc3RvcnlMZW5ndGgpKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAicGFzc3dvcmQtaGlzdG9yeS1sZW5ndGgiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG1pbmltdW1QYXNzd29yZFVwcGVyQ2FzZSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgb3V0LnN0YXJ0VGFnKG51bGwsICJtaW4tcGFzc3dvcmQtdXBwZXJjYXNlIik7CisgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhtaW5pbXVtUGFzc3dvcmRVcHBlckNhc2UpKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAibWluLXBhc3N3b3JkLXVwcGVyY2FzZSIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAobWluaW11bVBhc3N3b3JkTG93ZXJDYXNlID4gMCkgeworICAgICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1sb3dlcmNhc2UiKTsKKyAgICAgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAidmFsdWUiLCBJbnRlZ2VyLnRvU3RyaW5nKG1pbmltdW1QYXNzd29yZExvd2VyQ2FzZSkpOworICAgICAgICAgICAgICAgICAgICBvdXQuZW5kVGFnKG51bGwsICJtaW4tcGFzc3dvcmQtbG93ZXJjYXNlIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtaW5pbXVtUGFzc3dvcmRMZXR0ZXJzID4gMCkgeworICAgICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1sZXR0ZXJzIik7CisgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhtaW5pbXVtUGFzc3dvcmRMZXR0ZXJzKSk7CisgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1sZXR0ZXJzIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtaW5pbXVtUGFzc3dvcmROdW1lcmljID4gMCkgeworICAgICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1udW1lcmljIik7CisgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhtaW5pbXVtUGFzc3dvcmROdW1lcmljKSk7CisgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1udW1lcmljIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtaW5pbXVtUGFzc3dvcmRTeW1ib2xzID4gMCkgeworICAgICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1zeW1ib2xzIik7CisgICAgICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgInZhbHVlIiwgSW50ZWdlci50b1N0cmluZyhtaW5pbXVtUGFzc3dvcmRTeW1ib2xzKSk7CisgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1zeW1ib2xzIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChtaW5pbXVtUGFzc3dvcmROb25MZXR0ZXIgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAibWluLXBhc3N3b3JkLW5vbmxldHRlciIpOworICAgICAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJ2YWx1ZSIsIEludGVnZXIudG9TdHJpbmcobWluaW11bVBhc3N3b3JkTm9uTGV0dGVyKSk7CisgICAgICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgIm1pbi1wYXNzd29yZC1ub25sZXR0ZXIiKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAobWF4aW11bVRpbWVUb1VubG9jayAhPSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfVU5TUEVDSUZJRUQpIHsKQEAgLTEyNCw3ICsxNzIsNyBAQAogICAgICAgICAgICAgICAgIG91dC5lbmRUYWcobnVsbCwgIm1heC1mYWlsZWQtcGFzc3dvcmQtd2lwZSIpOwogICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIHZvaWQgcmVhZEZyb21YbWwoWG1sUHVsbFBhcnNlciBwYXJzZXIpCiAgICAgICAgICAgICAgICAgdGhyb3dzIFhtbFB1bGxQYXJzZXJFeGNlcHRpb24sIElPRXhjZXB0aW9uIHsKICAgICAgICAgICAgIGludCBvdXRlckRlcHRoID0gcGFyc2VyLmdldERlcHRoKCk7CkBAIC0xNDMsNiArMTkxLDI3IEBACiAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgibWluLXBhc3N3b3JkLWxlbmd0aCIuZXF1YWxzKHRhZykpIHsKICAgICAgICAgICAgICAgICAgICAgbWluaW11bVBhc3N3b3JkTGVuZ3RoID0gSW50ZWdlci5wYXJzZUludCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInZhbHVlIikpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoInBhc3N3b3JkLWhpc3RvcnktbGVuZ3RoIi5lcXVhbHModGFnKSkgeworICAgICAgICAgICAgICAgICAgICBwYXNzd29yZEhpc3RvcnlMZW5ndGggPSBJbnRlZ2VyLnBhcnNlSW50KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAidmFsdWUiKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgibWluLXBhc3N3b3JkLXVwcGVyY2FzZSIuZXF1YWxzKHRhZykpIHsKKyAgICAgICAgICAgICAgICAgICAgbWluaW11bVBhc3N3b3JkVXBwZXJDYXNlID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInZhbHVlIikpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIm1pbi1wYXNzd29yZC1sb3dlcmNhc2UiLmVxdWFscyh0YWcpKSB7CisgICAgICAgICAgICAgICAgICAgIG1pbmltdW1QYXNzd29yZExvd2VyQ2FzZSA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJ2YWx1ZSIpKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJtaW4tcGFzc3dvcmQtbGV0dGVycyIuZXF1YWxzKHRhZykpIHsKKyAgICAgICAgICAgICAgICAgICAgbWluaW11bVBhc3N3b3JkTGV0dGVycyA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJ2YWx1ZSIpKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJtaW4tcGFzc3dvcmQtbnVtZXJpYyIuZXF1YWxzKHRhZykpIHsKKyAgICAgICAgICAgICAgICAgICAgbWluaW11bVBhc3N3b3JkTnVtZXJpYyA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJ2YWx1ZSIpKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJtaW4tcGFzc3dvcmQtc3ltYm9scyIuZXF1YWxzKHRhZykpIHsKKyAgICAgICAgICAgICAgICAgICAgbWluaW11bVBhc3N3b3JkU3ltYm9scyA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJ2YWx1ZSIpKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJtaW4tcGFzc3dvcmQtbm9ubGV0dGVyIi5lcXVhbHModGFnKSkgeworICAgICAgICAgICAgICAgICAgICBtaW5pbXVtUGFzc3dvcmROb25MZXR0ZXIgPSBJbnRlZ2VyLnBhcnNlSW50KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAidmFsdWUiKSk7CiAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgibWF4LXRpbWUtdG8tdW5sb2NrIi5lcXVhbHModGFnKSkgewogICAgICAgICAgICAgICAgICAgICBtYXhpbXVtVGltZVRvVW5sb2NrID0gTG9uZy5wYXJzZUxvbmcoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJ2YWx1ZSIpKTsKQEAgLTE1NSw3ICsyMjQsNyBAQAogICAgICAgICAgICAgICAgIFhtbFV0aWxzLnNraXBDdXJyZW50VGFnKHBhcnNlcik7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgdm9pZCBkdW1wKFN0cmluZyBwcmVmaXgsIFByaW50V3JpdGVyIHB3KSB7CiAgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgidWlkPSIpOyBwdy5wcmludGxuKGdldFVpZCgpKTsKICAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50bG4oInBvbGljaWVzOiIpOwpAQCAtMTY2LDIzICsyMzUsMzcgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgicGFzc3dvcmRRdWFsaXR5PTB4Iik7Ci0gICAgICAgICAgICAgICAgICAgIHB3LnByaW50KEludGVnZXIudG9IZXhTdHJpbmcocGFzc3dvcmRRdWFsaXR5KSk7Ci0gICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgbWluaW11bVBhc3N3b3JkTGVuZ3RoPSIpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKEludGVnZXIudG9IZXhTdHJpbmcocGFzc3dvcmRRdWFsaXR5KSk7CisgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibWluaW11bVBhc3N3b3JkTGVuZ3RoPSIpOwogICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1pbmltdW1QYXNzd29yZExlbmd0aCk7CisgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgicGFzc3dvcmRIaXN0b3J5TGVuZ3RoPSIpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKHBhc3N3b3JkSGlzdG9yeUxlbmd0aCk7CisgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibWluaW11bVBhc3N3b3JkVXBwZXJDYXNlPSIpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1pbmltdW1QYXNzd29yZFVwcGVyQ2FzZSk7CisgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibWluaW11bVBhc3N3b3JkTG93ZXJDYXNlPSIpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1pbmltdW1QYXNzd29yZExvd2VyQ2FzZSk7CisgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibWluaW11bVBhc3N3b3JkTGV0dGVycz0iKTsKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbihtaW5pbXVtUGFzc3dvcmRMZXR0ZXJzKTsKKyAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtaW5pbXVtUGFzc3dvcmROdW1lcmljPSIpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1pbmltdW1QYXNzd29yZE51bWVyaWMpOworICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoIm1pbmltdW1QYXNzd29yZFN5bWJvbHM9Iik7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4obWluaW11bVBhc3N3b3JkU3ltYm9scyk7CisgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibWluaW11bVBhc3N3b3JkTm9uTGV0dGVyPSIpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludGxuKG1pbmltdW1QYXNzd29yZE5vbkxldHRlcik7CiAgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibWF4aW11bVRpbWVUb1VubG9jaz0iKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbihtYXhpbXVtVGltZVRvVW5sb2NrKTsKICAgICAgICAgICAgIHB3LnByaW50KHByZWZpeCk7IHB3LnByaW50KCJtYXhpbXVtRmFpbGVkUGFzc3dvcmRzRm9yV2lwZT0iKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbihtYXhpbXVtRmFpbGVkUGFzc3dvcmRzRm9yV2lwZSk7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBjbGFzcyBNeVBhY2thZ2VNb25pdG9yIGV4dGVuZHMgUGFja2FnZU1vbml0b3IgewogICAgICAgICBwdWJsaWMgdm9pZCBvblNvbWVQYWNrYWdlc0NoYW5nZWQoKSB7CiAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKERldmljZVBvbGljeU1hbmFnZXJTZXJ2aWNlLnRoaXMpIHsKICAgICAgICAgICAgICAgICBib29sZWFuIHJlbW92ZWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgICBmb3IgKGludCBpPW1BZG1pbkxpc3Quc2l6ZSgpLTE7IGk+PTA7IGktLSkgewogICAgICAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhYSA9IG1BZG1pbkxpc3QuZ2V0KGkpOwotICAgICAgICAgICAgICAgICAgICBpbnQgY2hhbmdlID0gaXNQYWNrYWdlRGlzYXBwZWFyaW5nKGFhLmluZm8uZ2V0UGFja2FnZU5hbWUoKSk7IAorICAgICAgICAgICAgICAgICAgICBpbnQgY2hhbmdlID0gaXNQYWNrYWdlRGlzYXBwZWFyaW5nKGFhLmluZm8uZ2V0UGFja2FnZU5hbWUoKSk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChjaGFuZ2UgPT0gUEFDS0FHRV9QRVJNQU5FTlRfQ0hBTkdFCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgY2hhbmdlID09IFBBQ0tBR0VfVEVNUE9SQVJZX0NIQU5HRSkgewogICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgIkFkbWluIHVuZXhwZWN0ZWRseSB1bmluc3RhbGxlZDogIgpAQCAtMjA3LDcgKzI5MCw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICAvKioKICAgICAgKiBJbnN0YW50aWF0ZXMgdGhlIHNlcnZpY2UuCiAgICAgICovCkBAIC0yMjQsNyArMzA3LDcgQEAKICAgICAgICAgfQogICAgICAgICByZXR1cm4gbUlQb3dlck1hbmFnZXI7CiAgICAgfQotICAgIAorCiAgICAgQWN0aXZlQWRtaW4gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQoQ29tcG9uZW50TmFtZSB3aG8pIHsKICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBtQWRtaW5NYXAuZ2V0KHdobyk7CiAgICAgICAgIGlmIChhZG1pbiAhPSBudWxsCkBAIC0yMzQsNyArMzE3LDcgQEAKICAgICAgICAgfQogICAgICAgICByZXR1cm4gbnVsbDsKICAgICB9Ci0gICAgCisKICAgICBBY3RpdmVBZG1pbiBnZXRBY3RpdmVBZG1pbkZvckNhbGxlckxvY2tlZChDb21wb25lbnROYW1lIHdobywgaW50IHJlcVBvbGljeSkKICAgICAgICAgICAgIHRocm93cyBTZWN1cml0eUV4Y2VwdGlvbiB7CiAgICAgICAgIGZpbmFsIGludCBjYWxsaW5nVWlkID0gQmluZGVyLmdldENhbGxpbmdVaWQoKTsKQEAgLTI2NSwxMyArMzQ4LDEzIEBACiAgICAgICAgICAgICAgICAgICAgICsgQmluZGVyLmdldENhbGxpbmdVaWQoKSArICIgZm9yIHBvbGljeSAjIiArIHJlcVBvbGljeSk7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICB2b2lkIHNlbmRBZG1pbkNvbW1hbmRMb2NrZWQoQWN0aXZlQWRtaW4gYWRtaW4sIFN0cmluZyBhY3Rpb24pIHsKICAgICAgICAgSW50ZW50IGludGVudCA9IG5ldyBJbnRlbnQoYWN0aW9uKTsKICAgICAgICAgaW50ZW50LnNldENvbXBvbmVudChhZG1pbi5pbmZvLmdldENvbXBvbmVudCgpKTsKICAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChpbnRlbnQpOwogICAgIH0KLSAgICAKKwogICAgIHZvaWQgc2VuZEFkbWluQ29tbWFuZExvY2tlZChTdHJpbmcgYWN0aW9uLCBpbnQgcmVxUG9saWN5KSB7CiAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CiAgICAgICAgIGlmIChOID4gMCkgewpAQCAtMjgzLDcgKzM2Niw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICB2b2lkIHJlbW92ZUFjdGl2ZUFkbWluTG9ja2VkKENvbXBvbmVudE5hbWUgYWRtaW5SZWNlaXZlcikgewogICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKGFkbWluUmVjZWl2ZXIpOwogICAgICAgICBpZiAoYWRtaW4gIT0gbnVsbCkgewpAQCAtMjk1LDcgKzM3OCw3IEBACiAgICAgICAgICAgICB2YWxpZGF0ZVBhc3N3b3JkT3duZXJMb2NrZWQoKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBEZXZpY2VBZG1pbkluZm8gZmluZEFkbWluKENvbXBvbmVudE5hbWUgYWRtaW5OYW1lKSB7CiAgICAgICAgIEludGVudCByZXNvbHZlSW50ZW50ID0gbmV3IEludGVudCgpOwogICAgICAgICByZXNvbHZlSW50ZW50LnNldENvbXBvbmVudChhZG1pbk5hbWUpOwpAQCAtMzA0LDcgKzM4Nyw3IEBACiAgICAgICAgIGlmIChpbmZvcyA9PSBudWxsIHx8IGluZm9zLnNpemUoKSA8PSAwKSB7CiAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmtub3duIGFkbWluOiAiICsgYWRtaW5OYW1lKTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICB0cnkgewogICAgICAgICAgICAgcmV0dXJuIG5ldyBEZXZpY2VBZG1pbkluZm8obUNvbnRleHQsIGluZm9zLmdldCgwKSk7CiAgICAgICAgIH0gY2F0Y2ggKFhtbFB1bGxQYXJzZXJFeGNlcHRpb24gZSkgewpAQCAtMzE1LDcgKzM5OCw3IEBACiAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHByaXZhdGUgc3RhdGljIEpvdXJuYWxlZEZpbGUgbWFrZUpvdXJuYWxlZEZpbGUoKSB7CiAgICAgICAgIGZpbmFsIFN0cmluZyBiYXNlID0gIi9kYXRhL3N5c3RlbS9kZXZpY2VfcG9saWNpZXMueG1sIjsKICAgICAgICAgcmV0dXJuIG5ldyBKb3VybmFsZWRGaWxlKG5ldyBGaWxlKGJhc2UpLCBuZXcgRmlsZShiYXNlICsgIi50bXAiKSk7CkBAIC0zMzEsNyArNDE0LDcgQEAKICAgICAgICAgICAgIG91dC5zdGFydERvY3VtZW50KG51bGwsIHRydWUpOwogCiAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgInBvbGljaWVzIik7Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKICAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhcCA9IG1BZG1pbkxpc3QuZ2V0KGkpOwpAQCAtMzQyLDI2ICs0MjUsMzYgQEAKICAgICAgICAgICAgICAgICAgICAgb3V0LmVuZFRhZyhudWxsLCAiYWRtaW4iKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgaWYgKG1QYXNzd29yZE93bmVyID49IDApIHsKICAgICAgICAgICAgICAgICBvdXQuc3RhcnRUYWcobnVsbCwgInBhc3N3b3JkLW93bmVyIik7CiAgICAgICAgICAgICAgICAgb3V0LmF0dHJpY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IgIT0gMCkgewogICAgICAgICAgICAgICAgIG91dC5zdGFydFRhZyhudWxsLCAiYWN0aXZlLXBhc3N3b3JkIik7CiAgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAicXVhbGl0eSIsIEludGVnZXIudG9TdHJpbmcobUFjdGl2ZVBhc3N3b3JkUXVhbGl0eSkpOwogICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgImxlbmd0aCIsIEludGVnZXIudG9TdHJpbmcobUFjdGl2ZVBhc3N3b3JkTGVuZ3RoKSk7CisgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAidXBwZXJjYXNlIiwgSW50ZWdlci50b1N0cmluZyhtQWN0aXZlUGFzc3dvcmRVcHBlckNhc2UpKTsKKyAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJsb3dlcmNhc2UiLCBJbnRlZ2VyLnRvU3RyaW5nKG1BY3RpdmVQYXNzd29yZExvd2VyQ2FzZSkpOworICAgICAgICAgICAgICAgIG91dC5hdHRyaWJ1dGUobnVsbCwgImxldHRlcnMiLCBJbnRlZ2VyLnRvU3RyaW5nKG1BY3RpdmVQYXNzd29yZExldHRlcnMpKTsKKyAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJudW1lcmljIiwgSW50ZWdlcgorICAgICAgICAgICAgICAgICAgICAgICAgLnRvU3RyaW5nKG1BY3RpdmVQYXNzd29yZE51bWVyaWMpKTsKKyAgICAgICAgICAgICAgICBvdXQuYXR0cmlidXRlKG51bGwsICJzeW1ib2xzIiwgSW50ZWdlci50b1N0cmluZyhtQWN0aXZlUGFzc3dvcmRTeW1ib2xzKSk7CisgICAgICAgICAgICAgICAgb3V0LmF0dHJpYnV0ZShudWxsLCAibm9ubGV0dGVyIiwgSW50ZWdlci50b1N0cmluZyhtQWN0aXZlUGFzc3dvcmROb25MZXR0ZXIpKTsKICAgICAgICAgICAgICAgICBvdXQuZW5kVGFnKG51bGwsICJhY3RpdmUtcGFzc3dvcmQiKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBvdXQuZW5kVGFnKG51bGwsICJwb2xpY2llcyIpOwogCiAgICAgICAgICAgICBvdXQuZW5kRG9jdW1lbnQoKTsKQEAgLTQzOSw2ICs1MzIsMTggQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInF1YWxpdHkiKSk7CiAgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZExlbmd0aCA9IEludGVnZXIucGFyc2VJbnQoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJsZW5ndGgiKSk7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZFVwcGVyQ2FzZSA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJ1cHBlcmNhc2UiKSk7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZExvd2VyQ2FzZSA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJsb3dlcmNhc2UiKSk7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZExldHRlcnMgPSBJbnRlZ2VyLnBhcnNlSW50KAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlci5nZXRBdHRyaWJ1dGVWYWx1ZShudWxsLCAibGV0dGVycyIpKTsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTnVtZXJpYyA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJudW1lcmljIikpOworICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRTeW1ib2xzID0gSW50ZWdlci5wYXJzZUludCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXIuZ2V0QXR0cmlidXRlVmFsdWUobnVsbCwgInN5bWJvbHMiKSk7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZE5vbkxldHRlciA9IEludGVnZXIucGFyc2VJbnQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VyLmdldEF0dHJpYnV0ZVZhbHVlKG51bGwsICJub25sZXR0ZXIiKSk7CiAgICAgICAgICAgICAgICAgICAgIFhtbFV0aWxzLnNraXBDdXJyZW50VGFnKHBhcnNlcik7CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgIlVua25vd24gdGFnOiAiICsgdGFnKTsKQEAgLTQ3NiwxMCArNTgxLDE2IEBACiAgICAgICAgICAgICAgICAgICAgICsgSW50ZWdlci50b0hleFN0cmluZyh1dGlscy5nZXRBY3RpdmVQYXNzd29yZFF1YWxpdHkoKSkpOwogICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkUXVhbGl0eSA9IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9VTlNQRUNJRklFRDsKICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZExlbmd0aCA9IDA7CisgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRVcHBlckNhc2UgPSAwOworICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTG93ZXJDYXNlID0gMDsKKyAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZExldHRlcnMgPSAwOworICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTnVtZXJpYyA9IDA7CisgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRTeW1ib2xzID0gMDsKKyAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZE5vbkxldHRlciA9IDA7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgdmFsaWRhdGVQYXNzd29yZE93bmVyTG9ja2VkKCk7Ci0gICAgICAgIAorCiAgICAgICAgIGxvbmcgdGltZU1zID0gZ2V0TWF4aW11bVRpbWVUb0xvY2sobnVsbCk7CiAgICAgICAgIGlmICh0aW1lTXMgPD0gMCkgewogICAgICAgICAgICAgdGltZU1zID0gSW50ZWdlci5NQVhfVkFMVUU7CkBAIC00OTgsMTIgKzYwOSwxMyBAQAogICAgICAgICAgICAgY2FzZSBEZXZpY2VQb2xpY3lNYW5hZ2VyLlBBU1NXT1JEX1FVQUxJVFlfTlVNRVJJQzoKICAgICAgICAgICAgIGNhc2UgRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX0FMUEhBQkVUSUM6CiAgICAgICAgICAgICBjYXNlIERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9BTFBIQU5VTUVSSUM6CisgICAgICAgICAgICBjYXNlIERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9DT01QTEVYOgogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJJbnZhbGlkIHF1YWxpdHkgY29uc3RhbnQ6IDB4IgogICAgICAgICAgICAgICAgICsgSW50ZWdlci50b0hleFN0cmluZyhxdWFsaXR5KSk7CiAgICAgfQotICAgIAorCiAgICAgdm9pZCB2YWxpZGF0ZVBhc3N3b3JkT3duZXJMb2NrZWQoKSB7CiAgICAgICAgIGlmIChtUGFzc3dvcmRPd25lciA+PSAwKSB7CiAgICAgICAgICAgICBib29sZWFuIGhhdmVPd25lciA9IGZhbHNlOwpAQCAtNTIwLDE3ICs2MzIsMTcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIHN5c3RlbVJlYWR5KCkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGxvYWRTZXR0aW5nc0xvY2tlZCgpOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgc2V0QWN0aXZlQWRtaW4oQ29tcG9uZW50TmFtZSBhZG1pblJlY2VpdmVyKSB7CiAgICAgICAgIG1Db250ZXh0LmVuZm9yY2VDYWxsaW5nT3JTZWxmUGVybWlzc2lvbigKICAgICAgICAgICAgICAgICBhbmRyb2lkLk1hbmlmZXN0LnBlcm1pc3Npb24uQklORF9ERVZJQ0VfQURNSU4sIG51bGwpOwotICAgICAgICAKKwogICAgICAgICBEZXZpY2VBZG1pbkluZm8gaW5mbyA9IGZpbmRBZG1pbihhZG1pblJlY2VpdmVyKTsKICAgICAgICAgaWYgKGluZm8gPT0gbnVsbCkgewogICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQmFkIGFkbWluOiAiICsgYWRtaW5SZWNlaXZlcik7CkBAIC01NTIsMTMgKzY2NCwxMyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIGJvb2xlYW4gaXNBZG1pbkFjdGl2ZShDb21wb25lbnROYW1lIGFkbWluUmVjZWl2ZXIpIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICByZXR1cm4gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQoYWRtaW5SZWNlaXZlcikgIT0gbnVsbDsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBMaXN0PENvbXBvbmVudE5hbWU+IGdldEFjdGl2ZUFkbWlucygpIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOwpAQCAtNTcyLDcgKzY4NCw3IEBACiAgICAgICAgICAgICByZXR1cm4gcmVzOwogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIGJvb2xlYW4gcGFja2FnZUhhc0FjdGl2ZUFkbWlucyhTdHJpbmcgcGFja2FnZU5hbWUpIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOwpAQCAtNTg0LDcgKzY5Niw3IEBACiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCByZW1vdmVBY3RpdmVBZG1pbihDb21wb25lbnROYW1lIGFkbWluUmVjZWl2ZXIpIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKGFkbWluUmVjZWl2ZXIpOwpAQCAtNjAzLDEwICs3MTUsMTAgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIHNldFBhc3N3b3JkUXVhbGl0eShDb21wb25lbnROYW1lIHdobywgaW50IHF1YWxpdHkpIHsKICAgICAgICAgdmFsaWRhdGVRdWFsaXR5Q29uc3RhbnQocXVhbGl0eSk7Ci0gICAgICAgIAorCiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgaWYgKHdobyA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJDb21wb25lbnROYW1lIGlzIG51bGwiKTsKQEAgLTYxOSwxNiArNzMxLDE2IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkUXVhbGl0eShDb21wb25lbnROYW1lIHdobykgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGludCBtb2RlID0gRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX1VOU1BFQ0lGSUVEOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGlmICh3aG8gIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQod2hvKTsKICAgICAgICAgICAgICAgICByZXR1cm4gYWRtaW4gIT0gbnVsbCA/IGFkbWluLnBhc3N3b3JkUXVhbGl0eSA6IG1vZGU7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAKKwogICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQWRtaW5MaXN0LnNpemUoKTsKICAgICAgICAgICAgIGZvciAgKGludCBpPTA7IGk8TjsgaSsrKSB7CiAgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBtQWRtaW5MaXN0LmdldChpKTsKQEAgLTYzOSw3ICs3NTEsNyBAQAogICAgICAgICAgICAgcmV0dXJuIG1vZGU7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCBzZXRQYXNzd29yZE1pbmltdW1MZW5ndGgoQ29tcG9uZW50TmFtZSB3aG8sIGludCBsZW5ndGgpIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBpZiAod2hvID09IG51bGwpIHsKQEAgLTY1MywxNiArNzY1LDE2IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkTWluaW11bUxlbmd0aChDb21wb25lbnROYW1lIHdobykgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIGludCBsZW5ndGggPSAwOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGlmICh3aG8gIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQod2hvKTsKICAgICAgICAgICAgICAgICByZXR1cm4gYWRtaW4gIT0gbnVsbCA/IGFkbWluLm1pbmltdW1QYXNzd29yZExlbmd0aCA6IGxlbmd0aDsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOwogICAgICAgICAgICAgZm9yICAoaW50IGk9MDsgaTxOOyBpKyspIHsKICAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IG1BZG1pbkxpc3QuZ2V0KGkpOwpAQCAtNjczLDE4ICs3ODUsMjY3IEBACiAgICAgICAgICAgICByZXR1cm4gbGVuZ3RoOwogICAgICAgICB9CiAgICAgfQotICAgIAorCisgICAgcHVibGljIHZvaWQgc2V0UGFzc3dvcmRIaXN0b3J5TGVuZ3RoKENvbXBvbmVudE5hbWUgd2hvLCBpbnQgbGVuZ3RoKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaWYgKHdobyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJDb21wb25lbnROYW1lIGlzIG51bGwiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFwID0gZ2V0QWN0aXZlQWRtaW5Gb3JDYWxsZXJMb2NrZWQod2hvLAorICAgICAgICAgICAgICAgICAgICBEZXZpY2VBZG1pbkluZm8uVVNFU19QT0xJQ1lfTElNSVRfUEFTU1dPUkQpOworICAgICAgICAgICAgaWYgKGFwLnBhc3N3b3JkSGlzdG9yeUxlbmd0aCAhPSBsZW5ndGgpIHsKKyAgICAgICAgICAgICAgICBhcC5wYXNzd29yZEhpc3RvcnlMZW5ndGggPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgc2F2ZVNldHRpbmdzTG9ja2VkKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkSGlzdG9yeUxlbmd0aChDb21wb25lbnROYW1lIHdobykgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGludCBsZW5ndGggPSAwOworCisgICAgICAgICAgICBpZiAod2hvICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKHdobyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGFkbWluICE9IG51bGwgPyBhZG1pbi5wYXNzd29yZEhpc3RvcnlMZW5ndGggOiBsZW5ndGg7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47IGkrKykgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gbUFkbWluTGlzdC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA8IGFkbWluLnBhc3N3b3JkSGlzdG9yeUxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBhZG1pbi5wYXNzd29yZEhpc3RvcnlMZW5ndGg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGxlbmd0aDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFBhc3N3b3JkTWluaW11bVVwcGVyQ2FzZShDb21wb25lbnROYW1lIHdobywgaW50IGxlbmd0aCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGlmICh3aG8gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigiQ29tcG9uZW50TmFtZSBpcyBudWxsIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBBY3RpdmVBZG1pbiBhcCA9IGdldEFjdGl2ZUFkbWluRm9yQ2FsbGVyTG9ja2VkKHdobywKKyAgICAgICAgICAgICAgICAgICAgRGV2aWNlQWRtaW5JbmZvLlVTRVNfUE9MSUNZX0xJTUlUX1BBU1NXT1JEKTsKKyAgICAgICAgICAgIGlmIChhcC5taW5pbXVtUGFzc3dvcmRVcHBlckNhc2UgIT0gbGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgYXAubWluaW11bVBhc3N3b3JkVXBwZXJDYXNlID0gbGVuZ3RoOworICAgICAgICAgICAgICAgIHNhdmVTZXR0aW5nc0xvY2tlZCgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRQYXNzd29yZE1pbmltdW1VcHBlckNhc2UoQ29tcG9uZW50TmFtZSB3aG8pIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpbnQgbGVuZ3RoID0gMDsKKworICAgICAgICAgICAgaWYgKHdobyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZCh3aG8pOworICAgICAgICAgICAgICAgIHJldHVybiBhZG1pbiAhPSBudWxsID8gYWRtaW4ubWluaW11bVBhc3N3b3JkVXBwZXJDYXNlIDogbGVuZ3RoOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gbUFkbWluTGlzdC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA8IGFkbWluLm1pbmltdW1QYXNzd29yZFVwcGVyQ2FzZSkgeworICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBhZG1pbi5taW5pbXVtUGFzc3dvcmRVcHBlckNhc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGxlbmd0aDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFBhc3N3b3JkTWluaW11bUxvd2VyQ2FzZShDb21wb25lbnROYW1lIHdobywgaW50IGxlbmd0aCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGlmICh3aG8gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigiQ29tcG9uZW50TmFtZSBpcyBudWxsIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBBY3RpdmVBZG1pbiBhcCA9IGdldEFjdGl2ZUFkbWluRm9yQ2FsbGVyTG9ja2VkKHdobywKKyAgICAgICAgICAgICAgICAgICAgRGV2aWNlQWRtaW5JbmZvLlVTRVNfUE9MSUNZX0xJTUlUX1BBU1NXT1JEKTsKKyAgICAgICAgICAgIGlmIChhcC5taW5pbXVtUGFzc3dvcmRMb3dlckNhc2UgIT0gbGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgYXAubWluaW11bVBhc3N3b3JkTG93ZXJDYXNlID0gbGVuZ3RoOworICAgICAgICAgICAgICAgIHNhdmVTZXR0aW5nc0xvY2tlZCgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRQYXNzd29yZE1pbmltdW1Mb3dlckNhc2UoQ29tcG9uZW50TmFtZSB3aG8pIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpbnQgbGVuZ3RoID0gMDsKKworICAgICAgICAgICAgaWYgKHdobyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBnZXRBY3RpdmVBZG1pblVuY2hlY2tlZExvY2tlZCh3aG8pOworICAgICAgICAgICAgICAgIHJldHVybiBhZG1pbiAhPSBudWxsID8gYWRtaW4ubWluaW11bVBhc3N3b3JkTG93ZXJDYXNlIDogbGVuZ3RoOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOworICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gbUFkbWluTGlzdC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA8IGFkbWluLm1pbmltdW1QYXNzd29yZExvd2VyQ2FzZSkgeworICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBhZG1pbi5taW5pbXVtUGFzc3dvcmRMb3dlckNhc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGxlbmd0aDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFBhc3N3b3JkTWluaW11bUxldHRlcnMoQ29tcG9uZW50TmFtZSB3aG8sIGludCBsZW5ndGgpIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpZiAod2hvID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oIkNvbXBvbmVudE5hbWUgaXMgbnVsbCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgQWN0aXZlQWRtaW4gYXAgPSBnZXRBY3RpdmVBZG1pbkZvckNhbGxlckxvY2tlZCh3aG8sCisgICAgICAgICAgICAgICAgICAgIERldmljZUFkbWluSW5mby5VU0VTX1BPTElDWV9MSU1JVF9QQVNTV09SRCk7CisgICAgICAgICAgICBpZiAoYXAubWluaW11bVBhc3N3b3JkTGV0dGVycyAhPSBsZW5ndGgpIHsKKyAgICAgICAgICAgICAgICBhcC5taW5pbXVtUGFzc3dvcmRMZXR0ZXJzID0gbGVuZ3RoOworICAgICAgICAgICAgICAgIHNhdmVTZXR0aW5nc0xvY2tlZCgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRQYXNzd29yZE1pbmltdW1MZXR0ZXJzKENvbXBvbmVudE5hbWUgd2hvKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaW50IGxlbmd0aCA9IDA7CisKKyAgICAgICAgICAgIGlmICh3aG8gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQod2hvKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gYWRtaW4gIT0gbnVsbCA/IGFkbWluLm1pbmltdW1QYXNzd29yZExldHRlcnMgOiBsZW5ndGg7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBtQWRtaW5MaXN0LmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAobGVuZ3RoIDwgYWRtaW4ubWluaW11bVBhc3N3b3JkTGV0dGVycykgeworICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBhZG1pbi5taW5pbXVtUGFzc3dvcmRMZXR0ZXJzOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBsZW5ndGg7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRQYXNzd29yZE1pbmltdW1OdW1lcmljKENvbXBvbmVudE5hbWUgd2hvLCBpbnQgbGVuZ3RoKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaWYgKHdobyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJDb21wb25lbnROYW1lIGlzIG51bGwiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFwID0gZ2V0QWN0aXZlQWRtaW5Gb3JDYWxsZXJMb2NrZWQod2hvLAorICAgICAgICAgICAgICAgICAgICBEZXZpY2VBZG1pbkluZm8uVVNFU19QT0xJQ1lfTElNSVRfUEFTU1dPUkQpOworICAgICAgICAgICAgaWYgKGFwLm1pbmltdW1QYXNzd29yZE51bWVyaWMgIT0gbGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgYXAubWluaW11bVBhc3N3b3JkTnVtZXJpYyA9IGxlbmd0aDsKKyAgICAgICAgICAgICAgICBzYXZlU2V0dGluZ3NMb2NrZWQoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0UGFzc3dvcmRNaW5pbXVtTnVtZXJpYyhDb21wb25lbnROYW1lIHdobykgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGludCBsZW5ndGggPSAwOworCisgICAgICAgICAgICBpZiAod2hvICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKHdobyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGFkbWluICE9IG51bGwgPyBhZG1pbi5taW5pbXVtUGFzc3dvcmROdW1lcmljIDogbGVuZ3RoOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOworICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBOOyBpKyspIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IG1BZG1pbkxpc3QuZ2V0KGkpOworICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPCBhZG1pbi5taW5pbXVtUGFzc3dvcmROdW1lcmljKSB7CisgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IGFkbWluLm1pbmltdW1QYXNzd29yZE51bWVyaWM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGxlbmd0aDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFBhc3N3b3JkTWluaW11bVN5bWJvbHMoQ29tcG9uZW50TmFtZSB3aG8sIGludCBsZW5ndGgpIHsKKyAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CisgICAgICAgICAgICBpZiAod2hvID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oIkNvbXBvbmVudE5hbWUgaXMgbnVsbCIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgQWN0aXZlQWRtaW4gYXAgPSBnZXRBY3RpdmVBZG1pbkZvckNhbGxlckxvY2tlZCh3aG8sCisgICAgICAgICAgICAgICAgICAgIERldmljZUFkbWluSW5mby5VU0VTX1BPTElDWV9MSU1JVF9QQVNTV09SRCk7CisgICAgICAgICAgICBpZiAoYXAubWluaW11bVBhc3N3b3JkU3ltYm9scyAhPSBsZW5ndGgpIHsKKyAgICAgICAgICAgICAgICBhcC5taW5pbXVtUGFzc3dvcmRTeW1ib2xzID0gbGVuZ3RoOworICAgICAgICAgICAgICAgIHNhdmVTZXR0aW5nc0xvY2tlZCgpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRQYXNzd29yZE1pbmltdW1TeW1ib2xzKENvbXBvbmVudE5hbWUgd2hvKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaW50IGxlbmd0aCA9IDA7CisKKyAgICAgICAgICAgIGlmICh3aG8gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gZ2V0QWN0aXZlQWRtaW5VbmNoZWNrZWRMb2NrZWQod2hvKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gYWRtaW4gIT0gbnVsbCA/IGFkbWluLm1pbmltdW1QYXNzd29yZFN5bWJvbHMgOiBsZW5ndGg7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CisgICAgICAgICAgICBmb3IgIChpbnQgaT0wOyBpPE47IGkrKykgeworICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gbUFkbWluTGlzdC5nZXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA8IGFkbWluLm1pbmltdW1QYXNzd29yZFN5bWJvbHMpIHsKKyAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gYWRtaW4ubWluaW11bVBhc3N3b3JkU3ltYm9sczsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbGVuZ3RoOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0UGFzc3dvcmRNaW5pbXVtTm9uTGV0dGVyKENvbXBvbmVudE5hbWUgd2hvLCBpbnQgbGVuZ3RoKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgeworICAgICAgICAgICAgaWYgKHdobyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJDb21wb25lbnROYW1lIGlzIG51bGwiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFwID0gZ2V0QWN0aXZlQWRtaW5Gb3JDYWxsZXJMb2NrZWQod2hvLAorICAgICAgICAgICAgICAgICAgICBEZXZpY2VBZG1pbkluZm8uVVNFU19QT0xJQ1lfTElNSVRfUEFTU1dPUkQpOworICAgICAgICAgICAgaWYgKGFwLm1pbmltdW1QYXNzd29yZE5vbkxldHRlciAhPSBsZW5ndGgpIHsKKyAgICAgICAgICAgICAgICBhcC5taW5pbXVtUGFzc3dvcmROb25MZXR0ZXIgPSBsZW5ndGg7CisgICAgICAgICAgICAgICAgc2F2ZVNldHRpbmdzTG9ja2VkKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldFBhc3N3b3JkTWluaW11bU5vbkxldHRlcihDb21wb25lbnROYW1lIHdobykgeworICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKKyAgICAgICAgICAgIGludCBsZW5ndGggPSAwOworCisgICAgICAgICAgICBpZiAod2hvICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKHdobyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGFkbWluICE9IG51bGwgPyBhZG1pbi5taW5pbXVtUGFzc3dvcmROb25MZXR0ZXIgOiBsZW5ndGg7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CisgICAgICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICAgICAgQWN0aXZlQWRtaW4gYWRtaW4gPSBtQWRtaW5MaXN0LmdldChpKTsKKyAgICAgICAgICAgICAgICBpZiAobGVuZ3RoIDwgYWRtaW4ubWluaW11bVBhc3N3b3JkTm9uTGV0dGVyKSB7CisgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IGFkbWluLm1pbmltdW1QYXNzd29yZE5vbkxldHRlcjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gbGVuZ3RoOworICAgICAgICB9CisgICAgfQorCiAgICAgcHVibGljIGJvb2xlYW4gaXNBY3RpdmVQYXNzd29yZFN1ZmZpY2llbnQoKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgLy8gVGhpcyBBUEkgY2FuIG9ubHkgYmUgY2FsbGVkIGJ5IGFuIGFjdGl2ZSBkZXZpY2UgYWRtaW4sCiAgICAgICAgICAgICAvLyBzbyB0cnkgdG8gcmV0cmlldmUgaXQgdG8gY2hlY2sgdGhhdCB0aGUgY2FsbGVyIGlzIG9uZS4KICAgICAgICAgICAgIGdldEFjdGl2ZUFkbWluRm9yQ2FsbGVyTG9ja2VkKG51bGwsCiAgICAgICAgICAgICAgICAgICAgIERldmljZUFkbWluSW5mby5VU0VTX1BPTElDWV9MSU1JVF9QQVNTV09SRCk7Ci0gICAgICAgICAgICByZXR1cm4gbUFjdGl2ZVBhc3N3b3JkUXVhbGl0eSA+PSBnZXRQYXNzd29yZFF1YWxpdHkobnVsbCkKLSAgICAgICAgICAgICAgICAgICAgJiYgbUFjdGl2ZVBhc3N3b3JkTGVuZ3RoID49IGdldFBhc3N3b3JkTWluaW11bUxlbmd0aChudWxsKTsKKyAgICAgICAgICAgIGlmIChtQWN0aXZlUGFzc3dvcmRRdWFsaXR5IDwgZ2V0UGFzc3dvcmRRdWFsaXR5KG51bGwpCisgICAgICAgICAgICAgICAgICAgIHx8IG1BY3RpdmVQYXNzd29yZExlbmd0aCA8IGdldFBhc3N3b3JkTWluaW11bUxlbmd0aChudWxsKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKG1BY3RpdmVQYXNzd29yZFF1YWxpdHkgIT0gRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX0NPTVBMRVgpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBtQWN0aXZlUGFzc3dvcmRVcHBlckNhc2UgPj0gZ2V0UGFzc3dvcmRNaW5pbXVtVXBwZXJDYXNlKG51bGwpCisgICAgICAgICAgICAgICAgICAgICYmIG1BY3RpdmVQYXNzd29yZExvd2VyQ2FzZSA+PSBnZXRQYXNzd29yZE1pbmltdW1Mb3dlckNhc2UobnVsbCkKKyAgICAgICAgICAgICAgICAgICAgJiYgbUFjdGl2ZVBhc3N3b3JkTGV0dGVycyA+PSBnZXRQYXNzd29yZE1pbmltdW1MZXR0ZXJzKG51bGwpCisgICAgICAgICAgICAgICAgICAgICYmIG1BY3RpdmVQYXNzd29yZE51bWVyaWMgPj0gZ2V0UGFzc3dvcmRNaW5pbXVtTnVtZXJpYyhudWxsKQorICAgICAgICAgICAgICAgICAgICAmJiBtQWN0aXZlUGFzc3dvcmRTeW1ib2xzID49IGdldFBhc3N3b3JkTWluaW11bVN5bWJvbHMobnVsbCkKKyAgICAgICAgICAgICAgICAgICAgJiYgbUFjdGl2ZVBhc3N3b3JkTm9uTGV0dGVyID49IGdldFBhc3N3b3JkTWluaW11bU5vbkxldHRlcihudWxsKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBpbnQgZ2V0Q3VycmVudEZhaWxlZFBhc3N3b3JkQXR0ZW1wdHMoKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgLy8gVGhpcyBBUEkgY2FuIG9ubHkgYmUgY2FsbGVkIGJ5IGFuIGFjdGl2ZSBkZXZpY2UgYWRtaW4sCkBAIC02OTQsNyArMTA1NSw3IEBACiAgICAgICAgICAgICByZXR1cm4gbUZhaWxlZFBhc3N3b3JkQXR0ZW1wdHM7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCBzZXRNYXhpbXVtRmFpbGVkUGFzc3dvcmRzRm9yV2lwZShDb21wb25lbnROYW1lIHdobywgaW50IG51bSkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIC8vIFRoaXMgQVBJIGNhbiBvbmx5IGJlIGNhbGxlZCBieSBhbiBhY3RpdmUgZGV2aWNlIGFkbWluLApAQCAtNzA5LDE2ICsxMDcwLDE2IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgaW50IGdldE1heGltdW1GYWlsZWRQYXNzd29yZHNGb3JXaXBlKENvbXBvbmVudE5hbWUgd2hvKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgaW50IGNvdW50ID0gMDsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBpZiAod2hvICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKHdobyk7CiAgICAgICAgICAgICAgICAgcmV0dXJuIGFkbWluICE9IG51bGwgPyBhZG1pbi5tYXhpbXVtRmFpbGVkUGFzc3dvcmRzRm9yV2lwZSA6IGNvdW50OwogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIGZpbmFsIGludCBOID0gbUFkbWluTGlzdC5zaXplKCk7CiAgICAgICAgICAgICBmb3IgIChpbnQgaT0wOyBpPE47IGkrKykgewogICAgICAgICAgICAgICAgIEFjdGl2ZUFkbWluIGFkbWluID0gbUFkbWluTGlzdC5nZXQoaSk7CkBAIC03MzIsNyArMTA5Myw3IEBACiAgICAgICAgICAgICByZXR1cm4gY291bnQ7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgYm9vbGVhbiByZXNldFBhc3N3b3JkKFN0cmluZyBwYXNzd29yZCwgaW50IGZsYWdzKSB7CiAgICAgICAgIGludCBxdWFsaXR5OwogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKQEAgLTc0MywxNCArMTEwNCwxNSBAQAogICAgICAgICAgICAgcXVhbGl0eSA9IGdldFBhc3N3b3JkUXVhbGl0eShudWxsKTsKICAgICAgICAgICAgIGlmIChxdWFsaXR5ICE9IERldmljZVBvbGljeU1hbmFnZXIuUEFTU1dPUkRfUVVBTElUWV9VTlNQRUNJRklFRCkgewogICAgICAgICAgICAgICAgIGludCByZWFsUXVhbGl0eSA9IExvY2tQYXR0ZXJuVXRpbHMuY29tcHV0ZVBhc3N3b3JkUXVhbGl0eShwYXNzd29yZCk7Ci0gICAgICAgICAgICAgICAgaWYgKHJlYWxRdWFsaXR5IDwgcXVhbGl0eSkgeworICAgICAgICAgICAgICAgIGlmIChyZWFsUXVhbGl0eSA8IHF1YWxpdHkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIHF1YWxpdHkgIT0gRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX0NPTVBMRVgpIHsKICAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgInJlc2V0UGFzc3dvcmQ6IHBhc3N3b3JkIHF1YWxpdHkgMHgiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKHF1YWxpdHkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRvZXMgbm90IG1lZXQgcmVxdWlyZWQgcXVhbGl0eSAweCIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIEludGVnZXIudG9IZXhTdHJpbmcocXVhbGl0eSkpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHF1YWxpdHkgPSByZWFsUXVhbGl0eTsKKyAgICAgICAgICAgICAgICBxdWFsaXR5ID0gTWF0aC5tYXgocmVhbFF1YWxpdHksIHF1YWxpdHkpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaW50IGxlbmd0aCA9IGdldFBhc3N3b3JkTWluaW11bUxlbmd0aChudWxsKTsKICAgICAgICAgICAgIGlmIChwYXNzd29yZC5sZW5ndGgoKSA8IGxlbmd0aCkgewpAQCAtNzU4LDE0ICsxMTIwLDg2IEBACiAgICAgICAgICAgICAgICAgICAgICAgICArICIgZG9lcyBub3QgbWVldCByZXF1aXJlZCBsZW5ndGggIiArIGxlbmd0aCk7CiAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHF1YWxpdHkgPT0gRGV2aWNlUG9saWN5TWFuYWdlci5QQVNTV09SRF9RVUFMSVRZX0NPTVBMRVgpIHsKKyAgICAgICAgICAgICAgICBpbnQgbGV0dGVycyA9IDA7CisgICAgICAgICAgICAgICAgaW50IHVwcGVyY2FzZSA9IDA7CisgICAgICAgICAgICAgICAgaW50IGxvd2VyY2FzZSA9IDA7CisgICAgICAgICAgICAgICAgaW50IG51bWJlcnMgPSAwOworICAgICAgICAgICAgICAgIGludCBzeW1ib2xzID0gMDsKKyAgICAgICAgICAgICAgICBpbnQgbm9ubGV0dGVyID0gMDsKKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHBhc3N3b3JkLmxlbmd0aCgpOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgY2hhciBjID0gcGFzc3dvcmQuY2hhckF0KGkpOworICAgICAgICAgICAgICAgICAgICBpZiAoYyA+PSAnQScgJiYgYyA8PSAnWicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxldHRlcnMrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHVwcGVyY2FzZSsrOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGMgPj0gJ2EnICYmIGMgPD0gJ3onKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsZXR0ZXJzKys7CisgICAgICAgICAgICAgICAgICAgICAgICBsb3dlcmNhc2UrKzsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjID49ICcwJyAmJiBjIDw9ICc5JykgeworICAgICAgICAgICAgICAgICAgICAgICAgbnVtYmVycysrOworICAgICAgICAgICAgICAgICAgICAgICAgbm9ubGV0dGVyKys7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzeW1ib2xzKys7CisgICAgICAgICAgICAgICAgICAgICAgICBub25sZXR0ZXIrKzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbnQgbmVlZGVkTGV0dGVycyA9IGdldFBhc3N3b3JkTWluaW11bUxldHRlcnMobnVsbCk7CisgICAgICAgICAgICAgICAgaWYobGV0dGVycyA8IG5lZWRlZExldHRlcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgInJlc2V0UGFzc3dvcmQ6IG51bWJlciBvZiBsZXR0ZXJzICIgKyBsZXR0ZXJzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRvZXMgbm90IG1lZXQgcmVxdWlyZWQgbnVtYmVyIG9mIGxldHRlcnMgIiArIG5lZWRlZExldHRlcnMpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGludCBuZWVkZWROdW1iZXJzID0gZ2V0UGFzc3dvcmRNaW5pbXVtTnVtZXJpYyhudWxsKTsKKyAgICAgICAgICAgICAgICBpZiAobnVtYmVycyA8IG5lZWRlZE51bWJlcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC53KFRBRywgInJlc2V0UGFzc3dvcmQ6IG51bWJlciBvZiBudW1lcmljYWwgZGlnaXRzICIgKyBudW1iZXJzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZG9lcyBub3QgbWVldCByZXF1aXJlZCBudW1iZXIgb2YgbnVtZXJpY2FsIGRpZ2l0cyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG5lZWRlZE51bWJlcnMpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGludCBuZWVkZWRMb3dlckNhc2UgPSBnZXRQYXNzd29yZE1pbmltdW1Mb3dlckNhc2UobnVsbCk7CisgICAgICAgICAgICAgICAgaWYgKGxvd2VyY2FzZSA8IG5lZWRlZExvd2VyQ2FzZSkgeworICAgICAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAicmVzZXRQYXNzd29yZDogbnVtYmVyIG9mIGxvd2VyY2FzZSBsZXR0ZXJzICIgKyBsb3dlcmNhc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgZG9lcyBub3QgbWVldCByZXF1aXJlZCBudW1iZXIgb2YgbG93ZXJjYXNlIGxldHRlcnMgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbmVlZGVkTG93ZXJDYXNlKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpbnQgbmVlZGVkVXBwZXJDYXNlID0gZ2V0UGFzc3dvcmRNaW5pbXVtVXBwZXJDYXNlKG51bGwpOworICAgICAgICAgICAgICAgIGlmICh1cHBlcmNhc2UgPCBuZWVkZWRVcHBlckNhc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgInJlc2V0UGFzc3dvcmQ6IG51bWJlciBvZiB1cHBlcmNhc2UgbGV0dGVycyAiICsgdXBwZXJjYXNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRvZXMgbm90IG1lZXQgcmVxdWlyZWQgbnVtYmVyIG9mIHVwcGVyY2FzZSBsZXR0ZXJzICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICArIG5lZWRlZFVwcGVyQ2FzZSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaW50IG5lZWRlZFN5bWJvbHMgPSBnZXRQYXNzd29yZE1pbmltdW1TeW1ib2xzKG51bGwpOworICAgICAgICAgICAgICAgIGlmIChzeW1ib2xzIDwgbmVlZGVkU3ltYm9scykgeworICAgICAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAicmVzZXRQYXNzd29yZDogbnVtYmVyIG9mIHNwZWNpYWwgc3ltYm9scyAiICsgc3ltYm9scworICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBkb2VzIG5vdCBtZWV0IHJlcXVpcmVkIG51bWJlciBvZiBzcGVjaWFsIHN5bWJvbHMgIiArIG5lZWRlZFN5bWJvbHMpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGludCBuZWVkZWROb25MZXR0ZXIgPSBnZXRQYXNzd29yZE1pbmltdW1Ob25MZXR0ZXIobnVsbCk7CisgICAgICAgICAgICAgICAgaWYgKG5vbmxldHRlciA8IG5lZWRlZE5vbkxldHRlcikgeworICAgICAgICAgICAgICAgICAgICBTbG9nLncoVEFHLCAicmVzZXRQYXNzd29yZDogbnVtYmVyIG9mIG5vbi1sZXR0ZXIgY2hhcmFjdGVycyAiICsgbm9ubGV0dGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGRvZXMgbm90IG1lZXQgcmVxdWlyZWQgbnVtYmVyIG9mIG5vbi1sZXR0ZXIgY2hhcmFjdGVycyAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBuZWVkZWROb25MZXR0ZXIpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBMb2NrUGF0dGVyblV0aWxzIHV0aWxzID0gbmV3IExvY2tQYXR0ZXJuVXRpbHMobUNvbnRleHQpOworICAgICAgICAgICAgaWYodXRpbHMuY2hlY2tQYXNzd29yZEhpc3RvcnkocGFzc3dvcmQpKSB7CisgICAgICAgICAgICAgICAgU2xvZy53KFRBRywgInJlc2V0UGFzc3dvcmQ6IHBhc3N3b3JkIGlzIHRoZSBzYW1lIGFzIG9uZSBvZiB0aGUgbGFzdCAiCisgICAgICAgICAgICAgICAgICAgICAgICArIGdldFBhc3N3b3JkSGlzdG9yeUxlbmd0aChudWxsKSArICIgcGFzc3dvcmRzIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQogICAgICAgICB9Ci0gICAgICAgIAorCiAgICAgICAgIGludCBjYWxsaW5nVWlkID0gQmluZGVyLmdldENhbGxpbmdVaWQoKTsKICAgICAgICAgaWYgKG1QYXNzd29yZE93bmVyID49IDAgJiYgbVBhc3N3b3JkT3duZXIgIT0gY2FsbGluZ1VpZCkgewogICAgICAgICAgICAgU2xvZy53KFRBRywgInJlc2V0UGFzc3dvcmQ6IGFscmVhZHkgc2V0IGJ5IGFub3RoZXIgdWlkIGFuZCBub3QgZW50ZXJlZCBieSB1c2VyIik7CiAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgLy8gRG9uJ3QgZG8gdGhpcyB3aXRoIHRoZSBsb2NrIGhlbGQsIGJlY2F1c2UgaXQgaXMgZ29pbmcgdG8gY2FsbAogICAgICAgICAvLyBiYWNrIGluIHRvIHRoZSBzZXJ2aWNlLgogICAgICAgICBsb25nIGlkZW50ID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CkBAIC03ODMsMTAgKzEyMTcsMTAgQEAKICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgIEJpbmRlci5yZXN0b3JlQ2FsbGluZ0lkZW50aXR5KGlkZW50KTsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCBzZXRNYXhpbXVtVGltZVRvTG9jayhDb21wb25lbnROYW1lIHdobywgbG9uZyB0aW1lTXMpIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBpZiAod2hvID09IG51bGwpIHsKQEAgLTc5NiwxNiArMTIzMCwxNiBAQAogICAgICAgICAgICAgICAgICAgICBEZXZpY2VBZG1pbkluZm8uVVNFU19QT0xJQ1lfRk9SQ0VfTE9DSyk7CiAgICAgICAgICAgICBpZiAoYXAubWF4aW11bVRpbWVUb1VubG9jayAhPSB0aW1lTXMpIHsKICAgICAgICAgICAgICAgICBhcC5tYXhpbXVtVGltZVRvVW5sb2NrID0gdGltZU1zOwotICAgICAgICAgICAgICAgIAorCiAgICAgICAgICAgICAgICAgbG9uZyBpZGVudCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwogICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgIHNhdmVTZXR0aW5nc0xvY2tlZCgpOwotICAgICAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgICAgICB0aW1lTXMgPSBnZXRNYXhpbXVtVGltZVRvTG9jayhudWxsKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKHRpbWVNcyA8PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lTXMgPSBJbnRlZ2VyLk1BWF9WQUxVRTsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAKKwogICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICAgZ2V0SVBvd2VyTWFuYWdlcigpLnNldE1heGltdW1TY3JlZW5PZmZUaW1lb3VudCgoaW50KXRpbWVNcyk7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBlKSB7CkBAIC04MTcsMTYgKzEyNTEsMTYgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyBsb25nIGdldE1heGltdW1UaW1lVG9Mb2NrKENvbXBvbmVudE5hbWUgd2hvKSB7CiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgbG9uZyB0aW1lID0gMDsKLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBpZiAod2hvICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKHdobyk7CiAgICAgICAgICAgICAgICAgcmV0dXJuIGFkbWluICE9IG51bGwgPyBhZG1pbi5tYXhpbXVtVGltZVRvVW5sb2NrIDogdGltZTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIAorCiAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOwogICAgICAgICAgICAgZm9yICAoaW50IGk9MDsgaTxOOyBpKyspIHsKICAgICAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IG1BZG1pbkxpc3QuZ2V0KGkpOwpAQCAtODQwLDcgKzEyNzQsNyBAQAogICAgICAgICAgICAgcmV0dXJuIHRpbWU7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCBsb2NrTm93KCkgewogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgIC8vIFRoaXMgQVBJIGNhbiBvbmx5IGJlIGNhbGxlZCBieSBhbiBhY3RpdmUgZGV2aWNlIGFkbWluLApAQCAtODU3LDcgKzEyOTEsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgdm9pZCB3aXBlRGF0YUxvY2tlZChpbnQgZmxhZ3MpIHsKICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIFJlY292ZXJ5U3lzdGVtLnJlYm9vdFdpcGVVc2VyRGF0YShtQ29udGV4dCk7CkBAIC04NjUsNyArMTI5OSw3IEBACiAgICAgICAgICAgICBTbG9nLncoVEFHLCAiRmFpbGVkIHJlcXVlc3RpbmcgZGF0YSB3aXBlIiwgZSk7CiAgICAgICAgIH0KICAgICB9Ci0gICAgCisKICAgICBwdWJsaWMgdm9pZCB3aXBlRGF0YShpbnQgZmxhZ3MpIHsKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICAvLyBUaGlzIEFQSSBjYW4gb25seSBiZSBjYWxsZWQgYnkgYW4gYWN0aXZlIGRldmljZSBhZG1pbiwKQEAgLTg4MCwxMSArMTMxNCwxMSBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgZ2V0UmVtb3ZlV2FybmluZyhDb21wb25lbnROYW1lIGNvbXAsIGZpbmFsIFJlbW90ZUNhbGxiYWNrIHJlc3VsdCkgewogICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oCiAgICAgICAgICAgICAgICAgYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLkJJTkRfREVWSUNFX0FETUlOLCBudWxsKTsKLSAgICAgICAgCisKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBBY3RpdmVBZG1pbiBhZG1pbiA9IGdldEFjdGl2ZUFkbWluVW5jaGVja2VkTG9ja2VkKGNvbXApOwogICAgICAgICAgICAgaWYgKGFkbWluID09IG51bGwpIHsKQEAgLTkwNywyMCArMTM0MSwzMCBAQAogICAgICAgICAgICAgfSwgbnVsbCwgQWN0aXZpdHkuUkVTVUxUX09LLCBudWxsLCBudWxsKTsKICAgICAgICAgfQogICAgIH0KLSAgICAKLSAgICBwdWJsaWMgdm9pZCBzZXRBY3RpdmVQYXNzd29yZFN0YXRlKGludCBxdWFsaXR5LCBpbnQgbGVuZ3RoKSB7CisKKyAgICBwdWJsaWMgdm9pZCBzZXRBY3RpdmVQYXNzd29yZFN0YXRlKGludCBxdWFsaXR5LCBpbnQgbGVuZ3RoLCBpbnQgbGV0dGVycywgaW50IHVwcGVyY2FzZSwKKyAgICAgICAgICAgIGludCBsb3dlcmNhc2UsIGludCBudW1iZXJzLCBpbnQgc3ltYm9scywgaW50IG5vbmxldHRlcikgewogICAgICAgICBtQ29udGV4dC5lbmZvcmNlQ2FsbGluZ09yU2VsZlBlcm1pc3Npb24oCiAgICAgICAgICAgICAgICAgYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLkJJTkRfREVWSUNFX0FETUlOLCBudWxsKTsKLSAgICAgICAgCisKICAgICAgICAgdmFsaWRhdGVRdWFsaXR5Q29uc3RhbnQocXVhbGl0eSk7Ci0gICAgICAgIAorCiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgaWYgKG1BY3RpdmVQYXNzd29yZFF1YWxpdHkgIT0gcXVhbGl0eSB8fCBtQWN0aXZlUGFzc3dvcmRMZW5ndGggIT0gbGVuZ3RoCi0gICAgICAgICAgICAgICAgICAgIHx8IG1GYWlsZWRQYXNzd29yZEF0dGVtcHRzICE9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgfHwgbUZhaWxlZFBhc3N3b3JkQXR0ZW1wdHMgIT0gMCB8fCBtQWN0aXZlUGFzc3dvcmRMZXR0ZXJzICE9IGxldHRlcnMKKyAgICAgICAgICAgICAgICAgICAgfHwgbUFjdGl2ZVBhc3N3b3JkVXBwZXJDYXNlICE9IHVwcGVyY2FzZQorICAgICAgICAgICAgICAgICAgICB8fCBtQWN0aXZlUGFzc3dvcmRMb3dlckNhc2UgIT0gbG93ZXJjYXNlIHx8IG1BY3RpdmVQYXNzd29yZE51bWVyaWMgIT0gbnVtYmVycworICAgICAgICAgICAgICAgICAgICB8fCBtQWN0aXZlUGFzc3dvcmRTeW1ib2xzICE9IHN5bWJvbHMgfHwgbUFjdGl2ZVBhc3N3b3JkTm9uTGV0dGVyICE9IG5vbmxldHRlcikgewogICAgICAgICAgICAgICAgIGxvbmcgaWRlbnQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRRdWFsaXR5ID0gcXVhbGl0eTsKICAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTGVuZ3RoID0gbGVuZ3RoOworICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRMZXR0ZXJzID0gbGV0dGVyczsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTG93ZXJDYXNlID0gbG93ZXJjYXNlOworICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRVcHBlckNhc2UgPSB1cHBlcmNhc2U7CisgICAgICAgICAgICAgICAgICAgIG1BY3RpdmVQYXNzd29yZE51bWVyaWMgPSBudW1iZXJzOworICAgICAgICAgICAgICAgICAgICBtQWN0aXZlUGFzc3dvcmRTeW1ib2xzID0gc3ltYm9sczsKKyAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVBhc3N3b3JkTm9uTGV0dGVyID0gbm9ubGV0dGVyOwogICAgICAgICAgICAgICAgICAgICBtRmFpbGVkUGFzc3dvcmRBdHRlbXB0cyA9IDA7CiAgICAgICAgICAgICAgICAgICAgIHNhdmVTZXR0aW5nc0xvY2tlZCgpOwogICAgICAgICAgICAgICAgICAgICBzZW5kQWRtaW5Db21tYW5kTG9ja2VkKERldmljZUFkbWluUmVjZWl2ZXIuQUNUSU9OX1BBU1NXT1JEX0NIQU5HRUQsCkBAIC05MzEsMTEgKzEzNzUsMTEgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIHB1YmxpYyB2b2lkIHJlcG9ydEZhaWxlZFBhc3N3b3JkQXR0ZW1wdCgpIHsKICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKAogICAgICAgICAgICAgICAgIGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5CSU5EX0RFVklDRV9BRE1JTiwgbnVsbCk7Ci0gICAgICAgIAorCiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgbG9uZyBpZGVudCA9IEJpbmRlci5jbGVhckNhbGxpbmdJZGVudGl0eSgpOwogICAgICAgICAgICAgdHJ5IHsKQEAgLTk1MiwxMSArMTM5NiwxMSBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQotICAgIAorCiAgICAgcHVibGljIHZvaWQgcmVwb3J0U3VjY2Vzc2Z1bFBhc3N3b3JkQXR0ZW1wdCgpIHsKICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKAogICAgICAgICAgICAgICAgIGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5CSU5EX0RFVklDRV9BRE1JTiwgbnVsbCk7Ci0gICAgICAgIAorCiAgICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewogICAgICAgICAgICAgaWYgKG1GYWlsZWRQYXNzd29yZEF0dGVtcHRzICE9IDAgfHwgbVBhc3N3b3JkT3duZXIgPj0gMCkgewogICAgICAgICAgICAgICAgIGxvbmcgaWRlbnQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKQEAgLTk3Miw3ICsxNDE2LDcgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KLSAgICAKKwogICAgIEBPdmVycmlkZQogICAgIHByb3RlY3RlZCB2b2lkIGR1bXAoRmlsZURlc2NyaXB0b3IgZmQsIFByaW50V3JpdGVyIHB3LCBTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgIGlmIChtQ29udGV4dC5jaGVja0NhbGxpbmdPclNlbGZQZXJtaXNzaW9uKGFuZHJvaWQuTWFuaWZlc3QucGVybWlzc2lvbi5EVU1QKQpAQCAtOTgzLDEyICsxNDI3LDEyIEBACiAgICAgICAgICAgICAgICAgICAgICsgIiwgdWlkPSIgKyBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpKTsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBmaW5hbCBQcmludGVyIHAgPSBuZXcgUHJpbnRXcml0ZXJQcmludGVyKHB3KTsKLSAgICAgICAgCisKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICBwLnByaW50bG4oIkN1cnJlbnQgRGV2aWNlIFBvbGljeSBNYW5hZ2VyIHN0YXRlOiIpOwotICAgICAgICAgICAgCisKICAgICAgICAgICAgIHAucHJpbnRsbigiICBFbmFibGVkIERldmljZSBBZG1pbnM6Iik7CiAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1BZG1pbkxpc3Quc2l6ZSgpOwogICAgICAgICAgICAgZm9yIChpbnQgaT0wOyBpPE47IGkrKykgewpAQCAtOTk5LDExICsxNDQzLDE3IEBACiAgICAgICAgICAgICAgICAgICAgIGFwLmR1bXAoIiAgICAiLCBwdyk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgCisKICAgICAgICAgICAgIHB3LnByaW50bG4oIiAiKTsKICAgICAgICAgICAgIHB3LnByaW50KCIgIG1BY3RpdmVQYXNzd29yZFF1YWxpdHk9MHgiKTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbihJbnRlZ2VyLnRvSGV4U3RyaW5nKG1BY3RpdmVQYXNzd29yZFF1YWxpdHkpKTsKICAgICAgICAgICAgIHB3LnByaW50KCIgIG1BY3RpdmVQYXNzd29yZExlbmd0aD0iKTsgcHcucHJpbnRsbihtQWN0aXZlUGFzc3dvcmRMZW5ndGgpOworICAgICAgICAgICAgcHcucHJpbnQoIiAgbUFjdGl2ZVBhc3N3b3JkVXBwZXJDYXNlPSIpOyBwdy5wcmludGxuKG1BY3RpdmVQYXNzd29yZFVwcGVyQ2FzZSk7CisgICAgICAgICAgICBwdy5wcmludCgiICBtQWN0aXZlUGFzc3dvcmRMb3dlckNhc2U9Iik7IHB3LnByaW50bG4obUFjdGl2ZVBhc3N3b3JkTG93ZXJDYXNlKTsKKyAgICAgICAgICAgIHB3LnByaW50KCIgIG1BY3RpdmVQYXNzd29yZExldHRlcnM9Iik7IHB3LnByaW50bG4obUFjdGl2ZVBhc3N3b3JkTGV0dGVycyk7CisgICAgICAgICAgICBwdy5wcmludCgiICBtQWN0aXZlUGFzc3dvcmROdW1lcmljPSIpOyBwdy5wcmludGxuKG1BY3RpdmVQYXNzd29yZE51bWVyaWMpOworICAgICAgICAgICAgcHcucHJpbnQoIiAgbUFjdGl2ZVBhc3N3b3JkU3ltYm9scz0iKTsgcHcucHJpbnRsbihtQWN0aXZlUGFzc3dvcmRTeW1ib2xzKTsKKyAgICAgICAgICAgIHB3LnByaW50KCIgIG1BY3RpdmVQYXNzd29yZE5vbkxldHRlcj0iKTsgcHcucHJpbnRsbihtQWN0aXZlU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QgZmlsZXMgYWZ0ZXIgd3JpdGluZyB0aGVtIQorICAgICAgICBzbmFwc2hvdE9ic2VydmVyID0gbmV3IEZpbGVPYnNlcnZlcihTTkFQU0hPVF9ESVIsIEZpbGVPYnNlcnZlci5BVFRSSUIpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIHZvaWQgb25FdmVudChpbnQgZXZlbnQsIFN0cmluZyBwYXRoKSB7CisgICAgICAgICAgICAgICAgaGFuZGxlU25hcHNob3RGaWxlKG5ldyBGaWxlKFNOQVBTSE9UX0RJUiwgcGF0aCksIGRyb3Bib3gpOworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgICBzbmFwc2hvdE9ic2VydmVyLnN0YXJ0V2F0Y2hpbmcoKTsKKworICAgICAgICBpZiAoTE9DQUxfTE9HVikgU2xvZy52KFRBRywgIlNhbXBsaW5nUHJvZmlsZXJTZXJ2aWNlIGFjdGl2YXRlZCIpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBoYW5kbGVTbmFwc2hvdEZpbGUoRmlsZSBmaWxlLCBEcm9wQm94TWFuYWdlciBkcm9wYm94KSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBkcm9wYm94LmFkZEZpbGUoVEFHLCBmaWxlLCAwKTsKKyAgICAgICAgICAgIGlmIChMT0NBTF9MT0dWKSBTbG9nLnYoVEFHLCBmaWxlLmdldFBhdGgoKSArICIgYWRkZWQgdG8gZHJvcGJveCIpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBTbG9nLmUoVEFHLCAiQ2FuJ3QgYWRkICIgKyBmaWxlLmdldFBhdGgoKSArICIgdG8gZHJvcGJveCIsIGUpOworICAgICAgICB9IGZpbmFsbHkgeworICAgICAgICAgICAgZmlsZS5kZWxldGUoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZWdpc3RlclNldHRpbmdPYnNlc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ICAgICBpZiAoSU5DTFVERV9ERU1PKSB7Ci0gICAgICAgICAgICAgICAgU2xvZy5pKFRBRywgIkluc3RhbGxpbmcgZGVtbyBkYXRhLi4uIik7Ci0gICAgICAgICAgICAgICAgKG5ldyBEZW1vVGhyZWFkKGNvbnRleHQpKS5zdGFydCgpOwotICAgICAgICAgICAgfQotCiAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgIFNsb2cuaShUQUcsICJEcm9wQm94IFNlcnZpY2UiKTsKICAgICAgICAgICAgICAgICBTZXJ2aWNlTWFuYWdlci5hZGRTZXJ2aWNlKENvbnRleHQuRFJPUEJPWF9TRVJWSUNFLApAQCAtNDE5LDYgKzQxMSwxOCBAQAogICAgICAgICAgICAgfSBjYXRjaCAoVGhyb3dhYmxlIGUpIHsKICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAiRmFpbHVyZSBzdGFydGluZyBEaXNrU3RhdHMgU2VydmljZSIsIGUpOwogICAgICAgICAgICAgfQorCisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIC8vIG5lZWQgdG8gYWRkIHRoaXMgc2VydmljZSBldmVuIGlmIFNhbXBsaW5nUHJvZmlsZXJJbnRlZ3JhdGlvbi5pc0VuYWJsZWQoKQorICAgICAgICAgICAgICAgIC8vIGlzIGZhbHNlLCBiZWNhdXNlIGl0IGlzIHRoaXMgc2VydmljZSB0aGF0IGRldGVjdHMgc3lzdGVtIHByb3BlcnR5IGNoYW5nZSBhbmQKKyAgICAgICAgICAgICAgICAvLyB0dXJucyBvbiBTYW1wbGluZ1Byb2ZpbGVySW50ZWdyYXRpb24uIFBsdXMsIHdoZW4gc2FtcGxpbmcgcHJvZmlsZXIgZG9lc24ndCB3b3JrLAorICAgICAgICAgICAgICAgIC8vIHRoZXJlIGlzIGxpdHRsZSBvdmVyaGVhZCBmb3IgcnVubmluZyB0aGlzIHNlcnZpY2UuCisgICAgICAgICAgICAgICAgU2xvZy5pKFRBRywgIlNhbXBsaW5nUHJvZmlsZXIgU2VydmljZSIpOworICAgICAgICAgICAgICAgIFNlcnZpY2VNYW5hZ2VyLmFkZFNlcnZpY2UoInNhbXBsaW5ncHJvZmlsZXIiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBTYW1wbGluZ1Byb2ZpbGVyU2VydmljZShjb250ZXh0KSk7CisgICAgICAgICAgICB9IGNhdGNoIChUaHJvd2FibGUgZSkgeworICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJGYWlsdXJlIHN0YXJ0aW5nIFNhbXBsaW5nUHJvZmlsZXIgU2VydmljZSIsIGUpOworICAgICAgICAgICAgfQogICAgICAgICB9CiAKICAgICAgICAgLy8gbWFrZSBzdXJlIHRoZSBBREJfRU5BQkxFRCBzZXR0aW5nIHZhbHVlIG1hdGNoZXMgdGhlIHNlY3VyZSBwcm9wZXJ0eSB2YWx1ZQpAQCAtNTE1LDM3ICs1MTksNyBAQAogICAgIH0KIH0KIAotY2xhc3MgRGVtb1RocmVhZCBleHRlbmRzIFRocmVhZAotewotICAgIERlbW9UaHJlYWQoQ29udGV4dCBjb250ZXh0KQotICAgIHsKLSAgICAgICAgbUNvbnRleHQgPSBjb250ZXh0OwotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHB1YmxpYyB2b2lkIHJ1bigpCi0gICAgewotICAgICAgICB0cnkgewotICAgICAgICAgICAgQ3Vyc29yIGMgPSBtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKS5xdWVyeShQZW9wbGUuQ09OVEVOVF9VUkksIG51bGwsIG51bGwsIG51bGwsIG51bGwpOwotICAgICAgICAgICAgYm9vbGVhbiBoYXNEYXRhID0gYyAhPSBudWxsICYmIGMubW92ZVRvRmlyc3QoKTsKLSAgICAgICAgICAgIGlmIChjICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICBjLmRlYWN0aXZhdGUoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICghaGFzRGF0YSkgewotICAgICAgICAgICAgICAgIERlbW9EYXRhU2V0IGRhdGFzZXQgPSBuZXcgRGVtb0RhdGFTZXQoKTsKLSAgICAgICAgICAgICAgICBkYXRhc2V0LmFkZChtQ29udGV4dCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gY2F0Y2ggKFRocm93YWJsZSBlKSB7Ci0gICAgICAgICAgICBTbG9nLmUoIlN5c3RlbVNlcnZlciIsICJGYWlsdXJlIGluc3RhbGxpbmcgZGVtbyBkYXRhIiwgZSk7Ci0gICAgICAgIH0KLQotICAgIH0KLQotICAgIENvbnRleHQgbUNvbnRleHQ7Ci19Ci0KLXB1YmxpYyBjbGFzcyBTeXN0ZW1TZXJ2ZXIKLXsKK3B1YmxpYyBjbGFzcyBTeXN0ZW1TZXJ2ZXIgewogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyBUQUcgPSAiU3lzdGVtU2VydmVyIjsKIAogICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IEZBQ1RPUllfVEVTVF9PRkYgPSAwOwpAQCAtNTY5LDcgKzU0Myw3IEBACiAgICAgICAgICAgICB0aW1lci5zY2hlZHVsZShuZXcgVGltZXJUYXNrKCkgewogICAgICAgICAgICAgICAgIEBPdmVycmlkZQogICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIHJ1bigpIHsKLSAgICAgICAgICAgICAgICAgICAgU2FtcGxpbmdQcm9maWxlckludGVncmF0aW9uLndyaXRlU25hcHNob3QoInN5c3RlbV9zZXJ2ZXIiKTsKKyAgICAgICAgICAgICAgICAgICAgU2FtcGxpbmdQcm9maWxlckludGVncmF0aW9uLndyaXRlU25hcHNob3QoInN5c3RlbV9zZXJ2ZXIiLCBudWxsKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9LCBTTkFQU0hPVF9JTlRFUlZBTCwgU05BUFNIT1RfSU5URVJWQUwpOwogICAgICAgICB9CkBAIC01NzcsNyArNTUxLDcgQEAKICAgICAgICAgLy8g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AgICAgIG1Db250ZXh0ID0gY29udGV4dDsKICAgICAgICAgbUJhdHRlcnlTdGF0cyA9IEJhdHRlcnlTdGF0c1NlcnZpY2UuZ2V0U2VydmljZSgpOworICAgICAgICBtQ29ubmVjdGVkQXBucyA9IG5ldyBBcnJheUxpc3Q8U3RyaW5nPigpOwogICAgIH0KIAogICAgIHB1YmxpYyB2b2lkIGxpc3RlbihTdHJpbmcgcGtnRm9yRGVidWcsIElQaG9uZVN0YXRlTGlzdGVuZXIgY2FsbGJhY2ssIGludCBldmVudHMsCkBAIC0yMzIsMTkgKzIzMywyMCBAQAogICAgICAgICBpZiAoIWNoZWNrTm90aWZ5UGVybWlzc2lvbigibm90aWZ5Q2FsbFN0YXRlKCkiKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CisgICAgICAgIEFycmF5TGlzdDxJQmluZGVyPiByZW1vdmVMaXN0ID0gbmV3IEFycmF5TGlzdDxJQmluZGVyPigpOwogICAgICAgICBzeW5jaHJvbml6ZWQgKG1SZWNvcmRzKSB7CiAgICAgICAgICAgICBtQ2FsbFN0YXRlID0gc3RhdGU7CiAgICAgICAgICAgICBtQ2FsbEluY29taW5nTnVtYmVyID0gaW5jb21pbmdOdW1iZXI7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gbVJlY29yZHMuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pIHsKLSAgICAgICAgICAgICAgICBSZWNvcmQgciA9IG1SZWNvcmRzLmdldChpKTsKKyAgICAgICAgICAgIGZvciAoUmVjb3JkIHIgOiBtUmVjb3JkcykgewogICAgICAgICAgICAgICAgIGlmICgoci5ldmVudHMgJiBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX0NBTExfU1RBVEUpICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgIHIuY2FsbGJhY2sub25DYWxsU3RhdGVDaGFuZ2VkKHN0YXRlLCBpbmNvbWluZ051bWJlcik7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlKHIuYmluZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZUxpc3QuYWRkKHIuYmluZGVyKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZvciAoSUJpbmRlciBiIDogcmVtb3ZlTGlzdCkgcmVtb3ZlKGIpOwogICAgICAgICB9CiAgICAgICAgIGJyb2FkY2FzdENhbGxTdGF0ZUNoYW5nZWQoc3RhdGUsIGluY29taW5nTnVtYmVyKTsKICAgICB9CkBAIC0yNTUsOCArMjU3LDcgQEAKICAgICAgICAgfQogICAgICAgICBzeW5jaHJvbml6ZWQgKG1SZWNvcmRzKSB7CiAgICAgICAgICAgICBtU2VydmljZVN0YXRlID0gc3RhdGU7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gbVJlY29yZHMuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pIHsKLSAgICAgICAgICAgICAgICBSZWNvcmQgciA9IG1SZWNvcmRzLmdldChpKTsKKyAgICAgICAgICAgIGZvciAoUmVjb3JkIHIgOiBtUmVjb3JkcykgewogICAgICAgICAgICAgICAgIGlmICgoci5ldmVudHMgJiBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX1NFUlZJQ0VfU1RBVEUpICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgc2VuZFNlcnZpY2VTdGF0ZShyLCBzdGF0ZSk7CiAgICAgICAgICAgICAgICAgfQpAQCAtMjY5LDEwICsyNzAsMTAgQEAKICAgICAgICAgaWYgKCFjaGVja05vdGlmeVBlcm1pc3Npb24oIm5vdGlmeVNpZ25hbFN0cmVuZ3RoKCkiKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CisgICAgICAgIEFycmF5TGlzdDxJQmluZGVyPiByZW1vdmVMaXN0ID0gbmV3IEFycmF5TGlzdDxJQmluZGVyPigpOwogICAgICAgICBzeW5jaHJvbml6ZWQgKG1SZWNvcmRzKSB7CiAgICAgICAgICAgICBtU2lnbmFsU3RyZW5ndGggPSBzaWduYWxTdHJlbmd0aDsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSBtUmVjb3Jkcy5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgICAgIFJlY29yZCByID0gbVJlY29yZHMuZ2V0KGkpOworICAgICAgICAgICAgZm9yIChSZWNvcmQgciA6IG1SZWNvcmRzKSB7CiAgICAgICAgICAgICAgICAgaWYgKChyLmV2ZW50cyAmIFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fU0lHTkFMX1NUUkVOR1RIUykgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICBzZW5kU2lnbmFsU3RyZW5ndGgociwgc2lnbmFsU3RyZW5ndGgpOwogICAgICAgICAgICAgICAgIH0KQEAgLTI4MiwxMCArMjgzLDExIEBACiAgICAgICAgICAgICAgICAgICAgICAgICByLmNhbGxiYWNrLm9uU2lnbmFsU3RyZW5ndGhDaGFuZ2VkKChnc21TaWduYWxTdHJlbmd0aCA9PSA5OSA/IC0xCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogZ3NtU2lnbmFsU3RyZW5ndGgpKTsKICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZW1vdmUoci5iaW5kZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlTGlzdC5hZGQoci5iaW5kZXIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgZm9yIChJQmluZGVyIGIgOiByZW1vdmVMaXN0KSByZW1vdmUoYik7CiAgICAgICAgIH0KICAgICAgICAgYnJvYWRjYXN0U2lnbmFsU3RyZW5ndGhDaGFuZ2VkKHNpZ25hbFN0cmVuZ3RoKTsKICAgICB9CkBAIC0yOTQsMTggKzI5NiwxOSBAQAogICAgICAgICBpZiAoIWNoZWNrTm90aWZ5UGVybWlzc2lvbigibm90aWZ5TWVzc2FnZVdhaXRpbmdDaGFuZ2VkKCkiKSkgewogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CisgICAgICAgIEFycmF5TGlzdDxJQmluZGVyPiByZW1vdmVMaXN0ID0gbmV3IEFycmF5TGlzdDxJQmluZGVyPigpOwogICAgICAgICBzeW5jaHJvbml6ZWQgKG1SZWNvcmRzKSB7CiAgICAgICAgICAgICBtTWVzc2FnZVdhaXRpbmcgPSBtd2k7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gbVJlY29yZHMuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pIHsKLSAgICAgICAgICAgICAgICBSZWNvcmQgciA9IG1SZWNvcmRzLmdldChpKTsKKyAgICAgICAgICAgIGZvciAoUmVjb3JkIHIgOiBtUmVjb3JkcykgewogICAgICAgICAgICAgICAgIGlmICgoci5ldmVudHMgJiBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX01FU1NBR0VfV0FJVElOR19JTkRJQ0FUT1IpICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgIHIuY2FsbGJhY2sub25NZXNzYWdlV2FpdGluZ0luZGljYXRvckNoYW5nZWQobXdpKTsKICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZW1vdmUoci5iaW5kZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlTGlzdC5hZGQoci5iaW5kZXIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQorICAgICAgICAgICAgZm9yIChJQmluZGVyIGIgOiByZW1vdmVMaXN0KSByZW1vdmUoYik7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTMxMywxOCArMzE2LDE5IEBACiAgICAgICAgIGlmICghY2hlY2tOb3RpZnlQZXJtaXNzaW9uKCJub3RpZnlDYWxsRm9yd2FyZGluZ0NoYW5nZWQoKSIpKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KKyAgICAgICAgQXJyYXlMaXN0PElCaW5kZXI+IHJlbW92ZUxpc3QgPSBuZXcgQXJyYXlMaXN0PElCaW5kZXI+KCk7CiAgICAgICAgIHN5bmNocm9uaXplZCAobVJlY29yZHMpIHsKICAgICAgICAgICAgIG1DYWxsRm9yd2FyZGluZyA9IGNmaTsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSBtUmVjb3Jkcy5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgICAgIFJlY29yZCByID0gbVJlY29yZHMuZ2V0KGkpOworICAgICAgICAgICAgZm9yIChSZWNvcmQgciA6IG1SZWNvcmRzKSB7CiAgICAgICAgICAgICAgICAgaWYgKChyLmV2ZW50cyAmIFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fQ0FMTF9GT1JXQVJESU5HX0lORElDQVRPUikgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICAgci5jYWxsYmFjay5vbkNhbGxGb3J3YXJkaW5nSW5kaWNhdG9yQ2hhbmdlZChjZmkpOwogICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZXgpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZShyLmJpbmRlcik7CisgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVMaXN0LmFkZChyLmJpbmRlcik7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBmb3IgKElCaW5kZXIgYiA6IHJlbW92ZUxpc3QpIHJlbW92ZShiKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMzMyLDU2ICszMzYsODAgQEAKICAgICAgICAgaWYgKCFjaGVja05vdGlmeVBlcm1pc3Npb24oIm5vdGlmeURhdGFBY3Rpdml0eSgpIiApKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KKyAgICAgICAgQXJyYXlMaXN0PElCaW5kZXI+IHJlbW92ZUxpc3QgPSBuZXcgQXJyYXlMaXN0PElCaW5kZXI+KCk7CiAgICAgICAgIHN5bmNocm9uaXplZCAobVJlY29yZHMpIHsKICAgICAgICAgICAgIG1EYXRhQWN0aXZpdHkgPSBzdGF0ZTsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSBtUmVjb3Jkcy5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgewotICAgICAgICAgICAgICAgIFJlY29yZCByID0gbVJlY29yZHMuZ2V0KGkpOworICAgICAgICAgICAgZm9yIChSZWNvcmQgciA6IG1SZWNvcmRzKSB7CiAgICAgICAgICAgICAgICAgaWYgKChyLmV2ZW50cyAmIFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fREFUQV9BQ1RJVklUWSkgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICAgci5jYWxsYmFjay5vbkRhdGFBY3Rpdml0eShzdGF0ZSk7CiAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiBleCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlKHIuYmluZGVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZUxpc3QuYWRkKHIuYmluZGVyKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGZvciAoSUJpbmRlciBiIDogcmVtb3ZlTGlzdCkgcmVtb3ZlKGIpOwogICAgICAgICB9CiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgbm90aWZ5RGF0YUNvbm5lY3Rpb24oaW50IHN0YXRlLCBib29sZWFuIGlzRGF0YUNvbm5lY3Rpdml0eVBvc3NpYmxlLAotICAgICAgICAgICAgU3RyaW5nIHJlYXNvbiwgU3RyaW5nIGFwbiwgU3RyaW5nW10gYXBuVHlwZXMsIFN0cmluZyBpbnRlcmZhY2VOYW1lLCBpbnQgbmV0d29ya1R5cGUpIHsKKyAgICAgICAgICAgIFN0cmluZyByZWFzb24sIFN0cmluZyBhcG4sIFN0cmluZyBhcG5UeXBlLCBTdHJpbmcgaW50ZXJmYWNlTmFtZSwgaW50IG5ldHdvcmtUeXBlKSB7CiAgICAgICAgIGlmICghY2hlY2tOb3RpZnlQZXJtaXNzaW9uKCJub3RpZnlEYXRhQ29ubmVjdGlvbigpIiApKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KICAgICAgICAgc3luY2hyb25pemVkIChtUmVjb3JkcykgewotICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uU3RhdGUgPSBzdGF0ZTsKKyAgICAgICAgICAgIGJvb2xlYW4gbW9kaWZpZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIGlmIChzdGF0ZSA9PSBUZWxlcGhvbnlNYW5hZ2VyLkRBVEFfQ09OTkVDVEVEKSB7CisgICAgICAgICAgICAgICAgaWYgKCFtQ29ubmVjdGVkQXBucy5jb250YWlucyhhcG5UeXBlKSkgeworICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGVkQXBucy5hZGQoYXBuVHlwZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtRGF0YUNvbm5lY3Rpb25TdGF0ZSAhPSBzdGF0ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uU3RhdGUgPSBzdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1vZGlmaWVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbUNvbm5lY3RlZEFwbnMucmVtb3ZlKGFwblR5cGUpOworICAgICAgICAgICAgICAgIGlmIChtQ29ubmVjdGVkQXBucy5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uU3RhdGUgPSBzdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgbW9kaWZpZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHdlJ3JlIHN0aWxsIGNvbm5lY3RlZCwgc28gc2VuZCB0aGF0IG91dCBpZiB3ZSBzZW5kIGFueXRoaW5nLgorICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IG1EYXRhQ29ubmVjdGlvblN0YXRlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIG1EYXRhQ29ubmVjdGlvblBvc3NpYmxlID0gaXNEYXRhQ29ubmVjdGl2aXR5UG9zc2libGU7CiAgICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25SZWFzb24gPSByZWFzb247CiAgICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25BcG4gPSBhcG47Ci0gICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25BcG5UeXBlcyA9IGFwblR5cGVzOwogICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uSW50ZXJmYWNlTmFtZSA9IGludGVyZmFjZU5hbWU7Ci0gICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25OZXR3b3JrVHlwZSA9IG5ldHdvcmtUeXBlOwotICAgICAgICAgICAgZm9yIChpbnQgaSA9IG1SZWNvcmRzLnNpemUoKSAtIDE7IGkgPj0gMDsgaS0tKSB7Ci0gICAgICAgICAgICAgICAgUmVjb3JkIHIgPSBtUmVjb3Jkcy5nZXQoaSk7Ci0gICAgICAgICAgICAgICAgaWYgKChyLmV2ZW50cyAmIFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fREFUQV9DT05ORUNUSU9OX1NUQVRFKSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHRyeSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByLmNhbGxiYWNrLm9uRGF0YUNvbm5lY3Rpb25TdGF0ZUNoYW5nZWQoc3RhdGUsIG5ldHdvcmtUeXBlKTsKLSAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZW1vdmUoci5iaW5kZXIpOworICAgICAgICAgICAgaWYgKG1EYXRhQ29ubmVjdGlvbk5ldHdvcmtUeXBlICE9IG5ldHdvcmtUeXBlKSB7CisgICAgICAgICAgICAgICAgbURhdGFDb25uZWN0aW9uTmV0d29ya1R5cGUgPSBuZXR3b3JrVHlwZTsKKyAgICAgICAgICAgICAgICBtb2RpZmllZCA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobW9kaWZpZWQpIHsKKyAgICAgICAgICAgICAgICBBcnJheUxpc3Q8SUJpbmRlcj4gcmVtb3ZlTGlzdCA9IG5ldyBBcnJheUxpc3Q8SUJpbmRlcj4oKTsKKyAgICAgICAgICAgICAgICBmb3IgKFJlY29yZCByIDogbVJlY29yZHMpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKChyLmV2ZW50cyAmIFBob25lU3RhdGVMaXN0ZW5lci5MSVNURU5fREFUQV9DT05ORUNUSU9OX1NUQVRFKSAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHIuY2FsbGJhY2sub25EYXRhQ29ubmVjdGlvblN0YXRlQ2hhbmdlZChzdGF0ZSwgbmV0d29ya1R5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlTGlzdC5hZGQoci5iaW5kZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZvciAoSUJpbmRlciBiIDogcmVtb3ZlTGlzdCkgcmVtb3ZlKGIpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIGJyb2FkY2FzdERhdGFDb25uZWN0aW9uU3RhdGVDaGFuZ2VkKHN0YXRlLCBpc0RhdGFDb25uZWN0aXZpdHlQb3NzaWJsZSwgcmVhc29uLCBhcG4sCi0gICAgICAgICAgICAgICAgYXBuVHlwZXMsIGludGVyZmFjZU5hbWUpOworICAgICAgICAgICAgICAgIGFwblR5cGUsIGludGVyZmFjZU5hbWUpOwogICAgIH0KIAotICAgIHB1YmxpYyB2b2lkIG5vdGlmeURhdGFDb25uZWN0aW9uRmFpbGVkKFN0cmluZyByZWFzb24pIHsKKyAgICBwdWJsaWMgdm9pZCBub3RpZnlEYXRhQ29ubmVjdGlvbkZhaWxlZChTdHJpbmcgcmVhc29uLCBTdHJpbmcgYXBuVHlwZSkgewogICAgICAgICBpZiAoIWNoZWNrTm90aWZ5UGVybWlzc2lvbigibm90aWZ5RGF0YUNvbm5lY3Rpb25GYWlsZWQoKSIpKSB7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KICAgICAgICAgLyoKLSAgICAgICAgICogVGhpcyBpcyBjb21tZW50ZWQgb3V0IGJlY2F1c2UgdGhlcmUgaXMgb24gb25EYXRhQ29ubmVjdGlvbkZhaWxlZCBjYWxsYmFjawotICAgICAgICAgKiBvbiBQaG9uZVN0YXRlTGlzdGVuZXIuIFRoZXJlIHNob3VsZCBiZQorICAgICAgICAgKiBUaGlzIGlzIGNvbW1lbnRlZCBvdXQgYmVjYXVzZSB0aGVyZSBpcyBubyBvbkRhdGFDb25uZWN0aW9uRmFpbGVkIGNhbGxiYWNrCisgICAgICAgICAqIGluIFBob25lU3RhdGVMaXN0ZW5lci4gVGhlcmUgc2hvdWxkIGJlLgogICAgICAgICBzeW5jaHJvbml6ZWQgKG1SZWNvcmRzKSB7CiAgICAgICAgICAgICBtRGF0YUNvbm5lY3Rpb25GYWlsZWRSZWFzb24gPSByZWFzb247CiAgICAgICAgICAgICBmaW5hbCBpbnQgTiA9IG1SZWNvcmRzLnNpemUoKTsKQEAgLTM5Myw3ICs0MjEsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgICovCi0gICAgICAgIGJyb2FkY2FzdERhdGFDb25uZWN0aW9uRmFpbGVkKHJlYXNvbik7CisgICAgICAgIGJyb2FkY2FzdERhdGFDb25uZWN0aW9uRmFpbGVkKHJlYXNvbiwgYXBuVHlwZSk7CiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgbm90aWZ5Q2VsbExvY2F0aW9uKEJ1bmRsZSBjZWxsTG9jYXRpb24pIHsKQEAgLTQwMiw4ICs0MzAsNyBAQAogICAgICAgICB9CiAgICAgICAgIHN5bmNocm9uaXplZCAobVJlY29yZHMpIHsKICAgICAgICAgICAgIG1DZWxsTG9jYXRpb24gPSBjZWxsTG9jYXRpb247Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gbVJlY29yZHMuc2l6ZSgpIC0gMTsgaSA+PSAwOyBpLS0pIHsKLSAgICAgICAgICAgICAgICBSZWNvcmQgciA9IG1SZWNvcmRzLmdldChpKTsKKyAgICAgICAgICAgIGZvciAoUmVjb3JkIHIgOiBtUmVjb3JkcykgewogICAgICAgICAgICAgICAgIGlmICgoci5ldmVudHMgJiBQaG9uZVN0YXRlTGlzdGVuZXIuTElTVEVOX0NFTExfTE9DQVRJT04pICE9IDApIHsKICAgICAgICAgICAgICAgICAgICAgc2Vu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wogICAgICAgICAgICAgaWYgKGRpciA9PSBUaHJvdHRsZU1hbmFnZXIuRElSRUNUSU9OX1JYKSByZXR1cm4gbVJlY29yZGVyLmdldFBlcmlvZFJ4KGFnbyk7CiAgICAgICAgIH0KQEAgLTI3OSwxMCArMjg2LDEwIEBACiAKICAgICAvLyBUT0RPIC0gYSBiZXR0ZXIgbmFtZSAtIGdldEN1cnJlbnRUaHJvdHRsZVJhdGU/CiAgICAgLy8gVE9ETyAtIGZldGNoIGZvciB0aGUgaWZhY2UKLSAgICBwdWJsaWMgc3luY2hyb25pemVkIGludCBnZXRUaHJvdHRsZShTdHJpbmcgaWZhY2UpIHsKKyAgICBwdWJsaWMgaW50IGdldFRocm90dGxlKFN0cmluZyBpZmFjZSkgewogICAgICAgICBlbmZvcmNlQWNjZXNzUGVybWlzc2lvbigpOwotICAgICAgICBpZiAobVRocm90dGxlSW5kZXggPT0gMSkgewotICAgICAgICAgICAgcmV0dXJuIG1Qb2xpY3lUaHJvdHRsZVZhbHVlOworICAgICAgICBpZiAobVRocm90dGxlSW5kZXguZ2V0KCkgPT0gMSkgeworICAgICAgICAgICAgcmV0dXJuIG1Qb2xpY3lUaHJvdHRsZVZhbHVlLmdldCgpOwogICAgICAgICB9CiAgICAgICAgIHJldHVybiAwOwogICAgIH0KQEAgLTMwNSwyMiArMzEyLDYgQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9LCBuZXcgSW50ZW50RmlsdGVyKEFDVElPTl9SRVNFVCkpOwogCi0gICAgICAgIC8vIHVzZSBhIG5ldyB0aHJlYWQgYXMgd2UgZG9uJ3Qgd2FudCB0byBzdGFsbCB0aGUgc3lzdGVtIGZvciBmaWxlIHdyaXRlcwotICAgICAgICBtVGhyZWFkID0gbmV3IEhhbmRsZXJUaHJlYWQoVEFHKTsKLSAgICAgICAgbVRocmVhZC5zdGFydCgpOwotICAgICAgICBtSGFuZGxlciA9IG5ldyBNeUhhbmRsZXIobVRocmVhZC5nZXRMb29wZX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ICAgICAgICAgIG1SZWNvcmRlciA9IG5ldyBEYXRhUmVjb3JkZXIobUNvbnRleHQsIFRocm90dGxlU2VydmljZS50aGlzKTsKIApAQCAtNDAzLDE1ICs0MTAsMTYgQEAKICAgICAgICAgICAgICAgICAgICAgUi5pbnRlZ2VyLmNvbmZpZ19kYXRhdXNlX3RocmVzaG9sZF9ieXRlcyk7CiAgICAgICAgICAgICBpbnQgZGVmYXVsdFZhbHVlID0gbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0SW50ZWdlcigKICAgICAgICAgICAgICAgICAgICAgUi5pbnRlZ2VyLmNvbmZpZ19kYXRhdXNlX3Rocm90dGxlX2tiaXRzcHMpOwotICAgICAgICAgICAgc3luY2hyb25pemVkIChUaHJvdHRsZVNlcnZpY2UudGhpcykgewotICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJlc2hvbGQgPSBTZXR0aW5ncy5TZWN1cmUuZ2V0TG9uZyhtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5USFJPVFRMRV9USFJFU0hPTERfQllURVMsIGRlZmF1bHRUaHJlc2hvbGQpOwotICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJvdHRsZVZhbHVlID0gU2V0dGluZ3MuU2VjdXJlLmdldEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5USFJPVFRMRV9WQUxVRV9LQklUU1BTLCBkZWZhdWx0VmFsdWUpOwotICAgICAgICAgICAgICAgIGlmICh0ZXN0aW5nKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb2xpY3lQb2xsUGVyaW9kU2VjID0gVEVTVElOR19QT0xMSU5HX1BFUklPRF9TRUM7Ci0gICAgICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJlc2hvbGQgPSBURVNUSU5HX1RIUkVTSE9MRDsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBsb25nIHRocmVzaG9sZCA9IFNldHRpbmdzLlNlY3VyZS5nZXRMb25nKG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAorICAgICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuVEhST1RUTEVfVEhSRVNIT0xEX0JZVEVTLCBkZWZhdWx0VGhyZXNob2xkKTsKKyAgICAgICAgICAgIGludCB2YWx1ZSA9IFNldHRpbmdzLlNlY3VyZS5nZXRJbnQobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCisgICAgICAgICAgICAgICAgICAgIFNldHRpbmdzLlNlY3VyZS5USFJPVFRMRV9WQUxVRV9LQklUU1BTLCBkZWZhdWx0VmFsdWUpOworCisgICAgICAgICAgICBtUG9saWN5VGhyZXNob2xkLnNldCh0aHJlc2hvbGQpOworICAgICAgICAgICAgbVBvbGljeVRocm90dGxlVmFsdWUuc2V0KHZhbHVlKTsKKyAgICAgICAgICAgIGlmICh0ZXN0aW5nKSB7CisgICAgICAgICAgICAgICAgbVBvbGljeVBvbGxQZXJpb2RTZWMgPSBURVNUSU5HX1BPTExJTkdfUEVSSU9EX1NFQzsKKyAgICAgICAgICAgICAgICBtUG9saWN5VGhyZXNob2xkLnNldChURVNUSU5HX1RIUkVTSE9MRCk7CiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIG1Qb2xpY3lSZXNldERheSA9IFNldHRpbmdzLlNlY3VyZS5nZXRJbnQobUNvbnRleHQuZ2V0Q29udGVudFJlc29sdmVyKCksCkBAIC00MjMsMTAgKzQzMSw4IEBACiAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLnB1dEludChtQ29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKSwKICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuVEhST1RUTEVfUkVTRVRfREFZLCBtUG9saWN5UmVzZXREYXkpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgc3luY2hyb25pemVkIChUaHJvdHRsZVNlcnZpY2UudGhpcykgewotICAgICAgICAgICAgICAgIGlmIChtSWZhY2UgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBtUG9saWN5VGhyZXNob2xkID0gMDsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobUlmYWNlID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtUG9saWN5VGhyZXNob2xkLnNldCgwKTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgaW50IGRlZmF1bHROb3RpZmljYXRpb25UeXBlID0gbUNvbnRleHQuZ2V0UmVzb3VyY2VzKCkuZ2V0SW50ZWdlcigKQEAgLTQzNywxNSArNDQzLDE2IEBACiAgICAgICAgICAgICBtTWF4TnRwQ2FjaGVBZ2VTZWMgPSBTZXR0aW5ncy5TZWN1cmUuZ2V0SW50KG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAogICAgICAgICAgICAgICAgICAgICBTZXR0aW5ncy5TZWN1cmUuVEhST1RUTEVfTUFYX05UUF9DQUNIRV9BR0VfU0VDLCBNQVhfTlRQX0NBQ0hFX0FHRV9TRUMpOwogCi0gICAgICAgICAgICBpZiAoVkRCRyB8fCAobVBvbGljeVRocmVzaG9sZCAhPSAwKSkgeworICAgICAgICAgICAgaWYgKFZEQkcgfHwgKG1Qb2xpY3lUaHJlc2hvbGQuZ2V0KCkgIT0gMCkpIHsKICAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAib25Qb2xpY3lDaGFuZ2VkIHRlc3Rpbmc9IiArIHRlc3RpbmcgKyIsIHBlcmlvZD0iICsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Qb2xpY3lQb2xsUGVyaW9kU2VjICsgIiwgdGhyZXNob2xkPSIgKyBtUG9saWN5VGhyZXNob2xkICsgIiwgdmFsdWU9IiArCi0gICAgICAgICAgICAgICAgICAgICAgICBtUG9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ICAgICAgICAgICBsb25nIHRvdGFsID0gcGVyaW9kUnggKyBwZXJpb2RUeDsKLSAgICAgICAgICAgIGlmIChWREJHIHx8IChtUG9saWN5VGhyZXNob2xkICE9IDApKSB7CisgICAgICAgICAgICBpZiAoVkRCRyB8fCAobVBvbGljeVRocmVzaG9sZC5nZXQoKSAhPSAwKSkgewogICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJvblBvbGxBbGFybSAtIHJvYW1pbmcgPSIgKyByb2FtaW5nICsKICAgICAgICAgICAgICAgICAgICAgICAgICIsIHJlYWQgPSIgKyBpbmNSZWFkICsgIiwgd3JpdHRlbiA9IiArIGluY1dyaXRlICsgIiwgbmV3IHRvdGFsID0iICsgdG90YWwpOwogICAgICAgICAgICAgfQpAQCAtNTEwLDExICs1MTcsMTEgQEAKICAgICAgICAgcHJpdmF0ZSB2b2lkIG9uSWZhY2VVcCgpIHsKICAgICAgICAgICAgIC8vIGlmIHdlIHdlcmUgdGhyb3R0bGVkIGJlZm9yZSwgYmUgc3VyZSBhbmQgc2V0IGl0IGFnYWluIC0gdGhlIGlmYWNlIHdlbnQgZG93bgogICAgICAgICAgICAgLy8gKGFuZCBtYXkgaGF2ZSBkaXNhcHBlYXJlZCBhbGwgdG9nZXRoZXIpIGFuZCB0aGVzZSBzZXR0aW5ncyB3ZXJlIGxvc3QKLSAgICAgICAgICAgIGlmIChtVGhyb3R0bGVJbmRleCA9PSAxKSB7CisgICAgICAgICAgICBpZiAobVRocm90dGxlSW5kZXguZ2V0KCkgPT0gMSkgewogICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgIG1OTVNlcnZpY2Uuc2V0SW50ZXJmYWNlVGhyb3R0bGUobUlmYWNlLCAtMSwgLTEpOwogICAgICAgICAgICAgICAgICAgICBtTk1TZXJ2aWNlLnNldEludGVyZmFjZVRocm90dGxlKG1JZmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUG9saWN5VGhyb3R0bGVWYWx1ZSwgbVBvbGljeVRocm90dGxlVmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJvdHRsZVZhbHVlLmdldCgpLCBtUG9saWN5VGhyb3R0bGVWYWx1ZS5nZXQoKSk7CiAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgImVycm9yIHNldHRpbmcgVGhyb3R0bGU6ICIgKyBlKTsKICAgICAgICAgICAgICAgICB9CkBAIC01MjMsNyArNTMwLDggQEAKIAogICAgICAgICBwcml2YXRlIHZvaWQgY2hlY2tUaHJvdHRsZUFuZFBvc3ROb3RpZmljYXRpb24obG9uZyBjdXJyZW50VG90YWwpIHsKICAgICAgICAgICAgIC8vIGlzIHRocm90dGxpbmcgZW5hYmxlZD8KLSAgICAgICAgICAgIGlmIChtUG9saWN5VGhyZXNob2xkID09IDApIHsKKyAgICAgICAgICAgIGxvbmcgdGhyZXNob2xkID0gbVBvbGljeVRocmVzaG9sZC5nZXQoKTsKKyAgICAgICAgICAgIGlmICh0aHJlc2hvbGQgPT0gMCkgewogICAgICAgICAgICAgICAgIGNsZWFyVGhyb3R0bGVBbmROb3RpZmljYXRpb24oKTsKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9CkBAIC01MzUsMTUgKzU0MywxMyBAQAogICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAvLyBjaGVjayBpZiB3ZSBuZWVkIHRvIHRocm90dGxlCi0gICAgICAgICAgICBpZiAoY3VycmVudFRvdGFsID4gbVBvbGljeVRocmVzaG9sZCkgewotICAgICAgICAgICAgICAgIGlmIChtVGhyb3R0bGVJbmRleCAhPSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAoVGhyb3R0bGVTZXJ2aWNlLnRoaXMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1UaHJvdHRsZUluZGV4ID0gMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBTbG9nLmQoVEFHLCAiVGhyZXNob2xkICIgKyBtUG9saWN5VGhyZXNob2xkICsgIiBleGNlZWRlZCEiKTsKKyAgICAgICAgICAgIGlmIChjdXJyZW50VG90YWwgPiB0aHJlc2hvbGQpIHsKKyAgICAgICAgICAgICAgICBpZiAobVRocm90dGxlSW5kZXguZ2V0KCkgIT0gMSkgeworICAgICAgICAgICAgICAgICAgICBtVGhyb3R0bGVJbmRleC5zZXQoMSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIFNsb2cuZChUQUcsICJUaHJlc2hvbGQgIiArIHRocmVzaG9sZCArICIgZXhjZWVkZWQhIik7CiAgICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBtTk1TZXJ2aWNlLnNldEludGVyZmFjZVRocm90dGxlKG1JZmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBvbGljeVRocm90dGxlVmFsdWUsIG1Qb2xpY3lUaHJvdHRsZVZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBvbGljeVRocm90dGxlVmFsdWUuZ2V0KCksIG1Qb2xpY3lUaHJvdHRsZVZhbHVlLmdldCgpKTsKICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJlcnJvciBzZXR0aW5nIFRocm90dGxlOiAiICsgZSk7CiAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTU1Niw3ICs1NjIsOCBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5vdGlmaWNhdGlvbi5GTEFHX09OR09JTkdfRVZFTlQpOwogCiAgICAgICAgICAgICAgICAgICAgIEludGVudCBicm9hZGNhc3QgPSBuZXcgSW50ZW50KFRocm90dGxlTWFuYWdlci5USFJPVFRMRV9BQ1RJT04pOwotICAgICAgICAgICAgICAgICAgICBicm9hZGNhc3QucHV0RXh0cmEoVGhyb3R0bGVNYW5hZ2VyLkVYVFJBX1RIUk9UVExFX0xFVkVMLCBtUG9saWN5VGhyb3R0bGVWYWx1ZSk7CisgICAgICAgICAgICAgICAgICAgIGJyb2FkY2FzdC5wdXRFeHRyYShUaHJvdHRsZU1hbmFnZXIuRVhUUkFfVEhST1RUTEVfTEVWRUwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBvbGljeVRocm90dGxlVmFsdWUuZ2V0KCkpOwogICAgICAgICAgICAgICAgICAgICBtQ29udGV4dC5zZW5kU3RpY2t5QnJvYWRjYXN0KGJyb2FkY2FzdCk7CiAKICAgICAgICAgICAgICAgICB9IC8vIGVsc2UgYWxyZWFkeSB1cCEKQEAgLTU3OSw4ICs1ODYsOCBAQAogICAgICAgICAgICAgICAgICAgICBsb25nIHBlcmlvZExlbmd0aCA9IGVuZCAtIHN0YXJ0OwogICAgICAgICAgICAgICAgICAgICBsb25nIG5vdyA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwogICAgICAgICAgICAgICAgICAgICBsb25nIHRpbWVVc2VkID0gbm93IC0gc3RhcnQ7Ci0gICAgICAgICAgICAgICAgICAgIGxvbmcgd2FybmluZ1RocmVzaG9sZCA9IDIqbVBvbGljeVRocmVzaG9sZCp0aW1lVXNlZC8odGltZVVzZWQrcGVyaW9kTGVuZ3RoKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKChjdXJyZW50VG90YWwgPiB3YXJuaW5nVGhyZXNob2xkKSAmJiAoY3VycmVudFRvdGFsID4gbVBvbGljeVRocmVzaG9sZC80KSkgeworICAgICAgICAgICAgICAgICAgICBsb25nIHdhcm5pbmdUaHJlc2hvbGQgPSAyKnRocmVzaG9sZCp0aW1lVXNlZC8odGltZVVzZWQrcGVyaW9kTGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKChjdXJyZW50VG90YWwgPiB3YXJuaW5nVGhyZXNob2xkKSAmJiAoY3VycmVudFRvdGFsID4gdGhyZXNob2xkLzQpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobVdhcm5pbmdOb3RpZmljYXRpb25TZW50ID09IGZhbHNlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdhcm5pbmdOb3RpZmljYXRpb25TZW50ID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uTWFuYWdlci5jYW5jZWwoUi5kcmF3YWJsZS5zdGF0X3N5c190aHJvdHRsZWQpOwpAQCAtNjI1LDExICs2MzIsOSBAQAogICAgICAgICB9CiAKIAotICAgICAgICBwcml2YXRlIHN5bmNocm9uaXplZCB2b2lkIGNsZWFyVGhyb3R0bGVBbmROb3RpZmljYXRpb24oKSB7Ci0gICAgICAgICAgICBpZiAobVRocm90dGxlSW5kZXggIT0gVEhST1RUTEVfSU5ERVhfVU5USFJPVFRMRUQpIHsKLSAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKFRocm90dGxlU2VydmljZS50aGlzKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1UaHJvdHRsZUluZGV4ID0gVEhST1RUTEVfSU5ERVhfVU5USFJPVFRMRUQ7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICBwcml2YXRlIHZvaWQgY2xlYXJUaHJvdHRsZUFuZE5vdGlmaWNhdGlvbigpIHsKKyAgICAgICAgICAgIGlmIChtVGhyb3R0bGVJbmRleC5nZXQoKSAhPSBUSFJPVFRMRV9JTkRFWF9VTlRIUk9UVExFRCkgeworICAgICAgICAgICAgICAgIG1UaHJvdHRsZUluZGV4LnNldChUSFJPVFRMRV9JTkRFWF9VTlRIUk9UVExFRCk7CiAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgbU5NU2VydmljZS5zZXRJbnRlcmZhY2VUaHJv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VBZ2VTZWMgKiAxMDAwKSB7CisgICAgICAgICAgICAgICAgaWYgKG50cEFnZSA8IG1NYXhOdHBDYWNoZUFnZVNlYyAqIDEwMDAgfHwgZmFzdCkgewogICAgICAgICAgICAgICAgICAgICBpZiAoVkRCRykgU2xvZy52KFRBRywgInVzaW5nIGNhY2hlZCB0aW1lIik7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWNoZWROdHAgKyBudHBBZ2U7CiAgICAgICAgICAgICAgICAgfQpAQCAtMTAyNSwzOSArMTAzMyw1NyBAQAogICAgICAgICAgICAgICAgIGlmIChEQkcpIFNsb2cuZChUQUcsICJkYXRhIGZpbGUgZW1wdHkiKTsKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1QYXJlbnQpIHsKLSAgICAgICAgICAgICAgICBTdHJpbmdbXSBwYXJzZWQgPSBkYXRhLnNwbGl0KCI6Iik7Ci0gICAgICAgICAgICAgICAgaW50IHBhcnNlZFVzZWQgPSAwOwotICAgICAgICAgICAgICAgIGlmIChwYXJzZWQubGVuZ3RoIDwgNikgewotICAgICAgICAgICAgICAgICAgICBTbG9nLmUoVEFHLCAicmVhZGluZyBkYXRhIGZpbGUgd2l0aCBpbnN1ZmZpY2llbnQgbGVuZ3RoIC0gaWdub3JpbmciKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIFN0cmluZ1tdIHBhcnNlZCA9IGRhdGEuc3BsaXQoIjoiKTsKKyAgICAgICAgICAgIGludCBwYXJzZWRVc2VkID0gMDsKKyAgICAgICAgICAgIGlmIChwYXJzZWQubGVuZ3RoIDwgNikgeworICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJyZWFkaW5nIGRhdGEgZmlsZSB3aXRoIGluc3VmZmljaWVudCBsZW5ndGggLSBpZ25vcmluZyIpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KIAorICAgICAgICAgICAgaW50IHBlcmlvZENvdW50OworICAgICAgICAgICAgbG9uZ1tdIHBlcmlvZFJ4RGF0YTsKKyAgICAgICAgICAgIGxvbmdbXSBwZXJpb2RUeERhdGE7CisgICAgICAgICAgICBpbnQgY3VycmVudFBlcmlvZDsKKyAgICAgICAgICAgIENhbGVuZGFyIHBlcmlvZFN0YXJ0OworICAgICAgICAgICAgQ2FsZW5kYXIgcGVyaW9kRW5kOworICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICBpZiAoSW50ZWdlci5wYXJzZUludChwYXJzZWRbcGFyc2VkVXNlZCsrXSkgIT0gREFUQV9GSUxFX1ZFUlNJT04pIHsKICAgICAgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgInJlYWRpbmcgZGF0YSBmaWxlIHdpdGggYmFkIHZlcnNpb24gLSBpZ25vcmluZyIpOwogICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgbVBlcmlvZENvdW50ID0gSW50ZWdlci5wYXJzZUludChwYXJzZWRbcGFyc2VkVXNlZCsrXSk7Ci0gICAgICAgICAgICAgICAgaWYgKHBhcnNlZC5sZW5ndGggIT0gNSArICgyICogbVBlcmlvZENvdW50KSkgeworICAgICAgICAgICAgICAgIHBlcmlvZENvdW50ID0gSW50ZWdlci5wYXJzZUludChwYXJzZWRbcGFyc2VkVXNlZCsrXSk7CisgICAgICAgICAgICAgICAgaWYgKHBhcnNlZC5sZW5ndGggIT0gNSArICgyICogcGVyaW9kQ291bnQpKSB7CiAgICAgICAgICAgICAgICAgICAgIFNsb2cuZShUQUcsICJyZWFkaW5nIGRhdGEgZmlsZSB3aXRoIGJhZCBsZW5ndGggKCIgKyBwYXJzZWQubGVuZ3RoICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiICE9ICIgKyAoNSsoMiptUGVyaW9kQ291bnQpKSArICIpIC0gaWdub3JpbmciKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAiICE9ICIgKyAoNSArICgyICogcGVyaW9kQ291bnQpKSArICIpIC0gaWdub3JpbmciKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBwZXJpb2RSeERhdGEgPSBuZXcgbG9uZ1twZXJpb2RDb3VudF07CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBwZXJpb2RDb3VudDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIHBlcmlvZFJ4RGF0YVtpXSA9IExvbmcucGFyc2VMb25nKHBhcnNlZFtwYXJzZWRVc2VkKytdKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcGVyaW9kVHhEYXRhID0gbmV3IGxvbmdbcGVyaW9kQ291bnRdOworICAgICAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgcGVyaW9kQ291bnQ7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBwZXJpb2RUeERhdGFbaV0gPSBMb25nLnBhcnNlTG9uZyhwYXJzZWRbcGFyc2VkVXNlZCsrXSk7CisgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgbVBlcmlvZFJ4RGF0YSA9IG5ldyBsb25nW21QZXJpb2RDb3VudF07Ci0gICAgICAgICAgICAgICAgZm9yKGludCBpID0gMDsgaSA8IG1QZXJpb2RDb3VudDsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1QZXJpb2RSeERhdGFbaV0gPSBMb25nLnBhcnNlTG9uZyhwYXJzZWRbcGFyc2VkVXNlZCsrXSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1QZXJpb2RUeERhdGEgPSBuZXcgbG9uZ1ttUGVyaW9kQ291bnRdOwotICAgICAgICAgICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCBtUGVyaW9kQ291bnQ7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBtUGVyaW9kVHhEYXRhW2ldID0gTG9uZy5wYXJzZUxvbmcocGFyc2VkW3BhcnNlZFVzZWQrK10pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtQ3VycmVudFBlcmlvZCA9IEludGVnZXIucGFyc2VJbnQocGFyc2VkW3BhcnNlZFVzZWQrK10pOwotICAgICAgICAgICAgICAgIG1QZXJpb2RTdGFydCA9IG5ldyBHcmVnb3JpYW5DYWxlbmRhcigpOwotICAgICAgICAgICAgICAgIG1QZXJpb2RTdGFydC5zZXRUaW1lSW5NaWxsaXMoTG9uZy5wYXJzZUxvbmcocGFyc2VkW3BhcnNlZFVzZWQrK10pKTsKLSAgICAgICAgICAgICAgICBtUGVyaW9kRW5kID0gbmV3IEdyZWdvcmlhbkNhbGVuZGFyKCk7Ci0gICAgICAgICAgICAgICAgbVBlcmlvZEVuZC5zZXRUaW1lSW5NaWxsaXMoTG9uZy5wYXJzZUxvbmcocGFyc2VkW3BhcnNlZFVzZWQrK10pKTsKKyAgICAgICAgICAgICAgICBjdXJyZW50UGVyaW9kID0gSW50ZWdlci5wYXJzZUludChwYXJzZWRbcGFyc2VkVXNlZCsrXSk7CisKKyAgICAgICAgICAgICAgICBwZXJpb2RTdGFydCA9IG5ldyBHcmVnb3JpYW5DYWxlbmRhcigpOworICAgICAgICAgICAgICAgIHBlcmlvZFN0YXJ0LnNldFRpbWVJbk1pbGxpcyhMb25nLnBhcnNlTG9uZyhwYXJzZWRbcGFyc2VkVXNlZCsrXSkpOworICAgICAgICAgICAgICAgIHBlcmlvZEVuZCA9IG5ldyBHcmVnb3JpYW5DYWxlbmRhcigpOworICAgICAgICAgICAgICAgIHBlcmlvZEVuZC5zZXRUaW1lSW5NaWxsaXMoTG9uZy5wYXJzZUxvbmcocGFyc2VkW3BhcnNlZFVzZWQrK10pKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgIkVycm9yIHBhcnNpbmcgZGF0YSBmaWxlIC0gaWdub3JpbmciKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1QYXJlbnQpIHsKKyAgICAgICAgICAgICAgICBtUGVyaW9kQ291bnQgPSBwZXJpb2RDb3VudDsKKyAgICAgICAgICAgICAgICBtUGVyaW9kUnhEYXRhID0gcGVyaW9kUnhEYXRhOworICAgICAgICAgICAgICAgIG1QZXJpb2RUeERhdGEgPSBwZXJpb2RUeERhdGE7CisgICAgICAgICAgICAgICAgbUN1cnJlbnRQZXJpb2QgPSBjdXJyZW50UGVyaW9kOworICAgICAgICAgICAgICAgIG1QZXJpb2RTdGFydCA9IHBlcmlvZFN0YXJ0OworICAgICAgICAgICAgICAgIG1QZXJpb2RFbmQgPSBwZXJpb2RFbmQ7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIApAQCAtMTA5MSwxNSArMTExNywxNSBAQAogICAgICAgICB9CiAgICAgICAgIHB3LnByaW50bG4oKTsKIAotICAgICAgICBwdy5wcmludGxuKCJUaGUgdGhyZXNob2xkIGlzICIgKyBtUG9saWN5VGhyZXNob2xkICsKKyAgICAgICAgcHcucHJpbnRsbigiVGhlIHRocmVzaG9sZCBpcyAiICsgbVBvbGljeVRocmVzaG9sZC5nZXQoKSArCiAgICAgICAgICAgICAgICAgIiwgYWZ0ZXIgd2hpY2ggeW91IGV4cGVyaW5jZSB0aHJvdHRsaW5nIHRvICIgKwotICAgICAgICAgICAgICAgIG1Qb2xpY3lUaHJvdHRsZVZhbHVlICsgImticHMiKTsKKyAgICAgICAgICAgICAgICBtUG9saWN5VGhyb3R0bGVWYWx1ZS5nZXQoKSArICJrYnBzIik7CiAgICAgICAgIHB3LnByaW50bG4oIkN1cnJlbnQgcGVyaW9kIGlzICIgKwogICAgICAgICAgICAgICAgIChtUmVj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ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLmdldEludCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2V0dGluZ3MuU2VjdXJlLldJRklfTU9CSUxFX0RBVEFfVFJBTlNJVElPTl9XQUtFTE9DS19USU1FT1VUX01TLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREVGQVVMVF9XQUtFTE9DS19USU1FT1VUKTsKLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogV2UgYXJlIGFzc3VtaW5nIHRoYXQgQ29ubmVjdGl2aXR5U2VydmljZSBjYW4gbWFrZQotICAgICAgICAgICAgICAgICAgICAgKiBhIHRyYW5zaXRpb24gdG8gY2VsbHVsYXIgZGF0YSB3aXRoaW4gd2FrZUxvY2tUaW1lb3V0IHRpbWUuCi0gICAgICAgICAgICAgICAgICAgICAqIFRoZSB3YWtlbG9jayBpcyByZWxlYXNlZCBieSB0aGUgZGVsYXllZCBtZXNzYWdlLgotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgc0RyaXZlclN0b3BXYWtlTG9jay5hY3F1aXJlKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQ20gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbUNtID0gKENvbm5lY3Rpdml0eU1hbmFnZXIpbUNvbnRleHQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldFN5c3RlbVNlcnZpY2UoQ29udGV4dC5DT05ORUNUSVZJVFlfU0VSVklDRSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbUNtLnJlcXVlc3ROZXR3b3JrVHJhbnNpdGlvbldha2Vsb2NrKFRBRyk7CiAgICAgICAgICAgICAgICAgICAgIG1XaWZpSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlKE1FU1NBR0VfU1RPUF9XSUZJKTsKLSAgICAgICAgICAgICAgICAgICAgbVdpZmlIYW5kbGVyLnNlbmRFbXB0eU1lc3NhZ2VEZWxheWVkKE1FU1NBR0VfUkVMRUFTRV9XQUtFTE9DSywgd2FrZUxvY2tUaW1lb3V0KTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgIHNXYWtlTG9jay5hY3F1aXJlKCk7CkBAIC0xOTI3LDEwICsxOTA4LDYgQEAKICAgICAgICAgICAgICAgICAgICAgLy8gZG9uJ3QgcmVsZWFzZSB3YWtlbG9jawogICAgICAgICAgICAgICAgICAgICBicmVhazsKIAotICAgICAgICAgICAgICAgIGNhc2UgTUVTU0FHRV9SRUxFQVNFX1dBS0VMT0NLOgotICAgICAgICAgICAgICAgICAgICBzRHJpdmVyU3RvcFdha2VMb2NrLnJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KICAgICAgICAgICAgICAgICBjYXNlIE1FU1NBR0VfU1RBUlRfQUNDRVNTX1BPSU5UOgogICAgICAgICAgICAgICAgICAgICBzZXRXaWZpQXBFbmFibGVkQmxvY2tpbmcodHJ1ZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZy5hcmcxLApkaWZmIC0tZ2l0IGEvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvV2luZG93TWFuYWdlclNlcnZpY2UuamF2YSBiL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL1dpbmRvd01hbmFnZXJTZXJ2aWNlLmphdmEKaW5kZXggNDgzZjllYi4uZDA4Y2IwZCAxMDA2NDQKLS0tIGEvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvV2luZG93TWFuYWdlclN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gICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CkBAIC01NzQ0LDE5ICs1NzQyLDI0IEBACiAgICAgICAgICAgICAgICAgICAgIFdpbmRvd1N0YXRlIG91dCA9IG1LZXlXYWl0ZXIubU91dHNpZGVUb3VjaFRhcmdldHM7CiAgICAgICAgICAgICAgICAgICAgIGlmIChvdXQgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgTW90aW9uRXZlbnQgb2V2ID0gTW90aW9uRXZlbnQub2J0YWluKGV2KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG9ldi5zZXRBY3Rpb24oTW90aW9uRXZlbnQuQUNUSU9OX09VVFNJREUpOwotICAgICAgICAgICAgICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFJlY3QgZnJhbWUgPSBvdXQubUZyYW1lOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ldi5vZmZzZXRMb2NhdGlvbigtKGZsb2F0KWZyYW1lLmxlZnQsIC0oZmxvYXQpZnJhbWUudG9wKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXQubUNsaWVudC5kaXNwYXRjaFBvaW50ZXIob2V2LCBldmVudFRpbWUsIGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChhbmRyb2lkLm9zLlJlbW90ZUV4Y2VwdGlvbiBlKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuaShUQUcsICJXSU5ET1cgRElFRCBkdXJpbmcgb3V0c2lkZSBtb3Rpb24gZGlzcGF0Y2g6ICIgKyBvdXQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZXYub2Zmc2V0TG9jYXRpb24oKGZsb2F0KWZyYW1lLmxlZnQsIChmbG9hdClmcmFtZS50b3ApOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dCA9IG91dC5tTmV4dE91dHNpZGVUb3VjaDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKG91dCAhPSBudWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1LZXlXYWl0ZXIubU91dHNpZGVUb3VjaFRhcmdldHMgPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZXYuc2V0QWN0aW9uKE1vdGlvbkV2ZW50LkFDVElPTl9PVVRTSURFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFJlY3QgZnJhbWUgPSBvdXQubUZyYW1lOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZXYub2Zmc2V0TG9jYXRpb24oLShmbG9hdClmcmFtZS5sZWZ0LCAtKGZsb2F0KWZyYW1lLnRvcCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXQubUNsaWVudC5kaXNwYXRjaFBvaW50ZXIob2V2LCBldmVudFRpbWUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoYW5kcm9pZC5vcy5SZW1vdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy5pKFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIldJTkRPVyBESUVEIGR1cmluZyBvdXRzaWRlIG1vdGlvbiBkaXNwYXRjaDogIiArIG91dCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2V2Lm9mZnNldExvY2F0aW9uKChmbG9hdClmcmFtZS5sZWZ0LCAoZmxvYXQpZnJhbWUudG9wKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0ID0gb3V0Lm1OZXh0T3V0c2lkZVRvdWNoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKG91dCAhPSBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtS2V5V2FpdGVyLm1PdXRzaWRlVG91Y2hUYXJnZXRzID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2V2LnJlY3ljbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KIApAQCAtODU2OCw3ICs4NTcxLDcgQEAKICAgICAgICAgICAgIGZpbmFsIEFwcFdpbmRvd1Rva2VuIGF0b2tlbiA9IG1BcHBUb2tlbjsKICAgICAgICAgICAgIHJldHVybiBtU3VyZmFjZSAhPSBudWxsICYmICFtQXR0YWNoZWRIaWRkZW4KICAgICAgICAgICAgICAgICAgICAgJiYgKGF0b2tlbiA9PSBudWxsID8gbVBvbGljeVZpc2liaWxpdHkgOiAhYXRva2VuLmhpZGRlblJlcXVlc3RlZCkKLSAgICAgICAgICAgICAgICAgICAgJiYgKG1PcmllbnRhdGlvbkNoYW5naW5nIHx8ICghbURyYXdQZW5kaW5nICYmICFtQ29tbWl0RHJhd1BlbmRpbmcpKQorICAgICAgICAgICAgICAgICAgICAmJiAhbURyYXdQZW5kaW5nICYmICFtQ29tbWl0RHJhd1BlbmRpbmcKICAgICAgICAgICAgICAgICAgICAgJiYgIW1FeGl0aW5nICYmICFtRGVzdHJveWluZzsKICAgICAgICAgfQogCkBAIC04NjcyLDE0ICs4Njc1LDEyIEBACiAKICAgICAgICAgLyoqCiAgICAgICAgICAqIFJldHVybnMgdHJ1ZSBpZiB0aGUgd2luZG93IGhhcyBhIHN1cmZhY2UgdGhhdCBpdCBoYXMgZHJhd24gYQotICAgICAgICAgKiBjb21wbGV0ZSBVSSBpbiB0by4gIE5vdGUgdGhhdCB0aGlzIHJldHVybnMgdHJ1ZSBpZiB0aGUgb3JpZW50YXRpb24KLSAgICAgICAgICogaXMgY2hhbmdpbmcgZXZlbiBpZiB0aGUgd2luZG93IGhhc24ndCByZWRyYXduIGJlY2F1c2Ugd2UgZG9uJ3Qgd2FudAotICAgICAgICAgKiB0byBzdG9wIHRoaW5ncyBmcm9tIGV4ZWN1dGluZyBkdXJpbmcgdGhhdCB0aW1lLgorICAgICAgICAgKiBjb21wbGV0ZSBVSSBpbiB0by4KICAgICAgICAgICovCiAgICAgICAgIHB1YmxpYyBib29sZWFuIGlzRHJhd25MdygpIHsKICAgICAgICAgICAgIGZpbmFsIEFwcFdpbmRvd1Rva2VuIGF0b2tlbiA9IG1BcHBUb2tlbjsKICAgICAgICAgICAgIHJldHVybiBtU3VyZmFjZSAhPSBudWxsICYmICFtRGVzdHJveWluZwotICAgICAgICAgICAgICAgICYmIChtT3JpZW50YXRpb25DaGFuZ2luZyB8fCAoIW1EcmF3UGVuZGluZyAmJiAhbUNvbW1pdERyYXdQZW5kaW5nKSk7CisgICAgICAgICAgICAgICAgJiYgIW1EcmF3UGVuZGluZyAmJiAhbUNvbW1pdERyYXdQZW5kaW5nOwogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIGJvb2xlYW4gZmlsbHNTY3JlZW5MdyhpbnQgc2NyZWVuV2lkdGgsIGludCBzY3JlZW5IZWlnaHQsCkBAIC0xMDk2MCwxMiArMTA5NjEsNiBAQAogICAgICAgICAgICAgICAgICAgICBpZiAody5tQXR0YWNoZWRIaWRkZW4gfHwgIXcuaXNSZWFkeUZvckRpc3BsYXkoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF3Lm1MYXN0SGlkZGVuKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9kdW1wKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHX0NPTkZJR1VSQVRJT04pIFNsb2cudihUQUcsICJXaW5kb3cgaGlkaW5nOiB3YWl0aW5nVG9TaG93PSIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdy5tUm9vdFRva2VuLndhaXRpbmdUb1Nob3cgKyAiIHBvbHZpcz0iCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHcubVBvbGljeVZpc2liaWxpdHkgKyAiIGF0dGhpZD0iCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHcubUF0dGFjaGVkSGlkZGVuICsgIiB0b2toaWQ9IgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB3Lm1Sb290VG9rZW4uaGlkZGVuICsgIiB2aXM9IgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB3Lm1WaWV3VmlzaWJpbGl0eSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdy5tTGFzdEhpZGRlbiA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNIT1dfVFJBTlNBQ1RJT05TKSBsb2dTdXJmYWNlKHcsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSElERSAocGVyZm9ybUxheW91dCkiLCBudWxsKTsKQEAgLTExMzY1LDI4ICsxMTM2MCwyMyBAQAogICAgICAgICB9IGVsc2UgaWYgKGFuaW1hdGluZykgewogICAgICAgICAgICAgcmVxdWVzdEFuaW1hdGlvbkxvY2tlZChjdXJyZW50VGltZSsoMTAwMC82MCktU3lzdGVtQ2xvY2sudXB0aW1lTWlsbGlzKCkpOwogICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICBpZiAoREVCVUdfRlJFRVpFKSBTbG9nLnYoVEFHLCAiTGF5b3V0OiBtRGlzcGxheUZyb3plbj0iICsgbURpc3BsYXlGcm96ZW4KLSAgICAgICAgICAgICAgICArICIgaG9sZFNjcmVlbj0iICsgaG9sZFNjcmVlbik7Ci0gICAgICAgIGlmICghbURpc3BsYXlGcm96ZW4pIHsKLSAgICAgICAgICAgIHNldEhvbGRTY3JlZW5Mb2NrZWQoaG9sZFNjcmVlbiAhPSBudWxsKTsKLSAgICAgICAgICAgIGlmIChzY3JlZW5CcmlnaHRuZXNzIDwgMCB8fCBzY3JlZW5CcmlnaHRuZXNzID4gMS4wZikgewotICAgICAgICAgICAgICAgIG1Qb3dlck1hbmFnZXIuc2V0U2NyZWVuQnJpZ2h0bmVzc092ZXJyaWRlKC0xKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbVBvd2VyTWFuYWdlci5zZXRTY3JlZW5CcmlnaHRuZXNzT3ZlcnJpZGUoKGludCkKLSAgICAgICAgICAgICAgICAgICAgICAgIChzY3JlZW5CcmlnaHRuZXNzICogUG93ZXIuQlJJR0hUTkVTU19PTikpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGJ1dHRvbkJyaWdodG5lc3MgPCAwIHx8IGJ1dHRvbkJyaWdodG5lc3MgPiAxLjBmKSB7Ci0gICAgICAgICAgICAgICAgbVBvd2VyTWFuYWdlci5zZXRCdXR0b25CcmlnaHRuZXNzT3ZlcnJpZGUoLTEpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtUG93ZXJNYW5hZ2VyLnNldEJ1dHRvbkJyaWdodG5lc3NPdmVycmlkZSgoaW50KQotICAgICAgICAgICAgICAgICAgICAgICAgKGJ1dHRvbkJyaWdodG5lc3MgKiBQb3dlci5CUklHSFRORVNTX09OKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoaG9sZFNjcmVlbiAhPSBtSG9sZGluZ1NjcmVlbk9uKSB7Ci0gICAgICAgICAgICAgICAgbUhvbGRpbmdTY3JlZW5PbiA9IGhvbGRTY3JlZW47Ci0gICAgICAgICAgICAgICAgTWVzc2FnZSBtID0gbUgub2J0YWluTWVzc2FnZShILkhPTERfU0NSRUVOX0NIQU5HRUQsIGhvbGRTY3JlZW4pOwotICAgICAgICAgICAgICAgIG1ILnNlbmRNZXNzYWdlKG0pOwotICAgICAgICAgICAgfQorICAgICAgICBzZXRIb2xkU2NyZWVuTG9ja2VkKGhvbGRTY3JlZW4gIT0gbnVsbCk7CisgICAgICAgIGlmIChzY3JlZW5CcmlnaHRuZXNzIDwgMCB8fCBzY3JlZW5CcmlnaHRuZXNzID4gMS4wZikgeworICAgICAgICAgICAgbVBvd2VyTWFuYWdlci5zZXRTY3JlZW5CcmlnaHRuZXNzT3ZlcnJpZGUoLTEpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbVBvd2VyTWFuYWdlci5zZXRTY3JlZW5CcmlnaHRuZXNzT3ZlcnJpZGUoKGludCkKKyAgICAgICAgICAgICAgICAgICAgKHNjcmVlbkJyaWdodG5lc3MgKiBQb3dlci5CUklHSFRORVNTX09OKSk7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGJ1dHRvbkJyaWdodG5lc3MgPCAwIHx8IGJ1dHRvbkJyaWdodG5lc3MgPiAxLjBmKSB7CisgICAgICAgICAgICBtUG93ZXJNYW5hZ2VyLnNldEJ1dHRvbkJyaWdodG5lc3NPdmVycmlkZSgtMSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtUG93ZXJNYW5hZ2VyLnNldEJ1dHRvbkJyaWdodG5lc3NPdmVycmlkZSgoaW50KQorICAgICAgICAgICAgICAgICAgICAoYnV0dG9uQnJpZ2h0bmVzcyAqIFBvd2VyLkJSSUdIVE5FU1NfT04pKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoaG9sZFNjcmVlbiAhPSBtSG9sZGluZ1NjcmVlbk9uKSB7CisgICAgICAgICAgICBtSG9sZGluZ1NjcmVlbk9uID0gaG9sZFNjcmVlbjsKKyAg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PSBmYWxzZTsKICAgICAgICAgYm9vbGVhbiB1c2IgPSBmYWxzZTsKICAgICAgICAgaWYgKGlzV2lmaShpZmFjZSkpIHsKQEAgLTIyOSwyOCArMjMwLDMwIEBACiAgICAgICAgICAgICB1c2IgPSB0cnVlOwogICAgICAgICB9CiAgICAgICAgIGlmIChmb3VuZCA9PSBmYWxzZSkgewotICAgICAgICAgICAgTG9nLmQoVEFHLCBpZmFjZSArICIgaXMgbm90IGEgdGV0aGVyYWJsZSBpZmFjZSwgaWdub3JpbmciKTsKKyAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCBpZmFjZSArICIgaXMgbm90IGEgdGV0aGVyYWJsZSBpZmFjZSwgaWdub3JpbmciKTsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCiAgICAgICAgIHN5bmNocm9uaXplZCAobUlmYWNlcykgewogICAgICAgICAgICAgVGV0aGVySW50ZXJmYWNlU00gc20gPSBtSWZhY2VzLmdldChpZmFjZSk7CiAgICAgICAgICAgICBpZiAoc20gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImFjdGl2ZSBpZmFjZSAoIiArIGlmYWNlICsgIikgcmVwb3J0ZWQgYXMgYWRkZWQsIGlnbm9yaW5nIik7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJhY3RpdmUgaWZhY2UgKCIgKyBpZmFjZSArICIpIHJlcG9ydGVkIGFzIGFkZGVkLCBpZ25vcmluZyIpOwogICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHNtID0gbmV3IFRldGhlckludGVyZmFjZVNNKGlmYWNlLCBtTG9vcGVyLCB1c2IpOwogICAgICAgICAgICAgbUlmYWNlcy5wdXQoaWZhY2UsIHNtKTsKICAgICAgICAgICAgIHNtLnN0YXJ0KCk7CiAgICAgICAgIH0KLSAgICAgICAgTG9nLmQoVEFHLCAiaW50ZXJmYWNlQWRkZWQgOiIgKyBpZmFjZSk7CisgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAiaW50ZXJmYWNlQWRkZWQgOiIgKyBpZmFjZSk7CiAgICAgfQogCiAgICAgcHVibGljIHZvaWQgaW50ZXJmYWNlUmVtb3ZlZChTdHJpbmcgaWZhY2UpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtSWZhY2VzKSB7CiAgICAgICAgICAgICBUZXRoZXJJbnRlcmZhY2VTTSBzbSA9IG1JZmFjZXMuZ2V0KGlmYWNlKTsKICAgICAgICAgICAgIGlmIChzbSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiYXR0ZW1wdGluZyB0byByZW1vdmUgdW5rbm93biBpZmFjZSAoIiArIGlmYWNlICsgIiksIGlnbm9yaW5nIik7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgImF0dGVtcHRpbmcgdG8gcmVtb3ZlIHVua25vd24gaWZhY2UgKCIgKyBpZmFjZSArICIpLCBpZ25vcmluZyIpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBzbS5zZW5kTWVzc2FnZShUZXRoZXJJbnRlcmZhY2VTTS5DTURfSU5URVJGQUNFX0RPV04pOwpAQCAtMzUwLDggKzM1MywxMCBAQAogICAgICAgICBicm9hZGNhc3QucHV0U3RyaW5nQXJyYXlMaXN0RXh0cmEoQ29ubmVjdGl2aXR5TWFuYWdlci5FWFRSQV9FUlJPUkVEX1RFVEhFUiwKICAgICAgICAgICAgICAgICBlcnJvcmVkTGlzdCk7CiAgICAgICAgIG1Db250ZXh0LnNlbmRTdGlja3lCcm9hZGNhc3QoYnJvYWRjYXN0KTsKLSAgICAgICAgTG9nLmQoVEFHLCAic2VuZFRldGhlclN0YXRlQ2hhbmdlZEJyb2FkY2FzdCAiICsgYXZhaWxhYmxlTGlzdC5zaXplKCkgKyAiLCAiICsKLSAgICAgICAgICAgICAgICBhY3RpdmVMaXN0LnNpemUoKSArICIsICIgKyBlcnJvcmVkTGlzdC5zaXplKCkpOworICAgICAgICBpZiAoREVCVUcpIHsKKyAgICAgICAgICAgIExvZy5kKFRBRywgInNlbmRUZXRoZXJTdGF0ZUNoYW5nZWRCcm9hZGNhc3QgIiArIGF2YWlsYWJsZUxpc3Quc2l6ZSgpICsgIiwgIiArCisgICAgICAgICAgICAgICAgICAgIGFjdGl2ZUxpc3Quc2l6ZSgpICsgIiwgIiArIGVycm9yZWRMaXN0LnNpemUoKSk7CisgICAgICAgIH0KIAogICAgICAgICBpZiAodXNiVGV0aGVyZWQpIHsKICAgICAgICAgICAgIGlmICh3aWZpVGV0aGVyZWQpIHsKQEAgLTQzNiw3ICs0NDEsNyBAQAogICAgICAgICAgICAgICAgIG1Vc2JNYXNzU3RvcmFnZU9mZiA9IHRydWU7CiAgICAgICAgICAgICAgICAgdXBkYXRlVXNiU3RhdHVzKCk7CiAgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoQ29ubmVjdGl2aXR5TWFuYWdlci5DT05ORUNUSVZJVFlfQUNUSU9OKSkgewotICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIlRldGhlcmluZyBnb3QgQ09OTkVDVElWSVRZX0FDVElPTiIpOworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAiVGV0aGVyaW5nIGdvdCBDT05ORUNUSVZJVFlfQUNUSU9OIik7CiAgICAgICAgICAgICAgICAgbVRldGhlck1hc3RlclNNLnNlbmRNZXNzYWdlKFRldGhlck1hc3RlclNNLkNNRF9VUFNUUkVBTV9DSEFOR0VEKTsKICAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLmVxdWFscyhJbnRlbnQuQUNUSU9OX0JPT1RfQ09NUExFVEVEKSkgewogICAgICAgICAgICAgICAgIG1Cb290ZWQgPSB0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ogICAgICAgICAgICAgICAgIHN3aXRjaCAobWVzc2FnZS53aGF0KSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIG1heWJlIGEgcGFyZW50IGNsYXNzPwpAQCAtODM0LDcgKzgzOSw3IEBACiAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKG1Vc2IpIFRldGhlcmluZy50aGlzLmVuYWJsZVVzYlJuZGlzKHRydWUpOwotICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIlRldGhlcmVkICIgKyBtSWZhY2VOYW1lKTsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy5kKFRBRywgIlRldGhlcmVkICIgKyBtSWZhY2VOYW1lKTsKICAgICAgICAgICAgICAgICBzZXRBdmFpbGFibGUoZmFsc2UpOwogICAgICAgICAgICAgICAgIHNldFRldGhlcmVkKHRydWUpOwogICAgICAgICAgICAgICAgIHNlbmRUZXRoZXJTdGF0ZUNoYW5nZWRCcm9hZGNhc3QoKTsKQEAgLTg0NSw3ICs4NTAsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJUZXRoZXJlZFN0YXRlLnByb2Nlc3NNZXNzYWdlIHdoYXQ9IiArIG1lc3NhZ2Uud2hhdCk7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJUZXRoZXJlZFN0YXRlLnByb2Nlc3NNZXNzYWdlIHdoYXQ9IiArIG1lc3NhZ2Uud2hhdCk7CiAgICAgICAgICAgICAgICAgYm9vbGVhbiByZXRWYWx1ZSA9IHRydWU7CiAgICAgICAgICAgICAgICAgYm9vbGVhbiBlcnJvciA9IGZhbHNlOwogICAgICAgICAgICAgICAgIHN3aXRjaCAobWVzc2FnZS53aGF0KSB7CkBAIC04ODgsNyArODkzLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS53aGF0ID09IENNRF9JTlRFUkZBQ0VfRE9XTikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtVW5hdmFpbGFibGVTdGF0ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJVbnRldGhlcmVkICIgKyBtSWZhY2VOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAiVW50ZXRoZXJlZCAiICsgbUlmYWNlTmFtZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgY2FzZSBDTURfVEVUSEVSX0NPTk5FQ1RJT05fQ0hBTkdFRDoKICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBuZXdVcHN0cmVhbUlmYWNlTmFtZSA9IChTdHJpbmcpKG1lc3NhZ2Uub2JqKTsKQEAgLTk2MSw3ICs5NjYsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29ubmVjdGl2aXR5TWFuYWdlci5URVRIRVJfRVJST1JfTUFTVEVSX0VSUk9SKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIlRldGhlciBsb3N0IHVwc3RyZWFtIGNvbm5lY3Rpb24gIiArIG1JZmFjZU5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJUZXRoZXIgbG9zdCB1cHN0cmVhbSBjb25uZWN0aW9uICIgKyBtSWZhY2VOYW1lKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHNlbmRUZXRoZXJTdGF0ZUNoYW5nZWRCcm9hZGNhc3QoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtVXNiKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFUZXRoZXJpbmcudGhpcy5jb25maWd1cmVVc2JJZmFjZShmYWxzZSkpIHsKQEAgLTExOTksOCArMTIwNCwxMCBAQAogICAgICAgICAgICAgICAgIElCaW5kZXIgYiA9IFNlcnZpY2VNYW5hZ2VyLmdldFNlcnZpY2UoQ29udGV4dC5DT05ORUNUSVZJVFlfU0VSVklDRSk7CiAgICAgICAgICAgICAgICAgSUNvbm5lY3Rpdml0eU1hbmFnZXIgY20gPSBJQ29ubmVjdGl2aXR5TWFuYWdlci5TdHViLmFzSW50ZXJmYWNlKGIpOwogICAgICAgICAgICAgICAgIG1Db25uZWN0aW9uUmVxdWVzdGVkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgTG9nLmQoVEFHLCAiY2hvb3NlVXBzdHJlYW1UeXBlKCIgKyB0cnlDZWxsICsgIiksICBkdW5SZXF1aXJlZCA9IgotICAgICAgICAgICAgICAgICAgICAgICAgKyBtRHVuUmVxdWlyZWQgKyAiLCBpZmFjZT0iICsgaWZhY2UpOworICAgICAgICAgICAgICAgIGlmIChERUJVRykgeworICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJjaG9vc2VVcHN0cmVhbVR5cGUoIiArIHRyeUNlbGwgKyAiKSwgIGR1blJlcXVpcmVkID0iCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBtRHVuUmVxdWlyZWQgKyAiLCBpZmFjZT0iICsgaWZhY2UpOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBpZiAoaWZhY2UgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1EdW5SZXF1aXJlZCkgewpAQCAtMTIwOCw3ICsxMjE1LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOZXR3b3JrSW5mbyBpbmZvID0gY20uZ2V0TmV0d29ya0luZm8oCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb25uZWN0aXZpdHlNYW5hZ2VyLlRZUEVfTU9CSUxFX0RVTik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZm8uaXNDb25uZWN0ZWQoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJzZXR0aW5nIGR1biBpZmFjZW5hbWUgPSIgKyBpZmFjZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAic2V0dGluZyBkdW4gaWZhY2VuYW1lID0iICsgaWZhY2UpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBldmVuIGlmIHdlJ3JlIGFscmVhZHkgY29ubmVjdGVkIC0gaXQgbWF5IGJlIHNvbWVib2R5IGVsc2UncwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZWZjb3VudCwgc28gYWRkIG91ciBvd24KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHVybk9uTW9iaWxlQ29ubmVjdGlvbigpOwpAQCAtMTIyMCwxMSArMTIyNywxMSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJjaGVja2luZyBpZiBoaXByaSBicm91Z2h0IHVzIHRoaXMgY29ubmVjdGlvbiIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAiY2hlY2tpbmcgaWYgaGlwcmkgYnJvdWdodCB1cyB0aGlzIGNvbm5lY3Rpb24iKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOZXR3b3JrSW5mbyBpbmZvID0gY20uZ2V0TmV0d29ya0luZm8oCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb25uZWN0aXZpdHlNYW5hZ2VyLlRZUEVfTU9CSUxFX0hJUFJJKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5mby5pc0Nvbm5lY3RlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgInllcyAtIGhpcHJpIGluIHVzZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy5kKFRBRywgInllcyAtIGhpcHJpIGluIHVzZSIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBldmVuIGlmIHdlJ3JlIGFscmVhZHkgY29ubmVjdGVkIC0gaXQgbWF5IGJlIHNvbWJvZHkgZWxzZSdzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlZmNvdW50LCBzbyBhZGQgb3VyIG93bgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dXJuT25Nb2JpbGVDb25uZWN0aW9uKCk7CkBAIC0xMjQ2LDcgKzEyNTMsNyBAQAogICAgICAgICAgICAgICAgIG5vdGlmeVRldGhlcmVkT2ZOZXdVcHN0cmVhbUlmYWNlKGlmYWNlKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHByb3RlY3RlZCB2b2lkIG5vdGlmeVRldGhlcmVkT2ZOZXdVcHN0cmVhbUlmYWNlKFN0cmluZyBpZmFjZU5hbWUpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJub3RpZnlpbmcgdGV0aGVyZWQgd2l0aCBpZmFjZSA9IiArIGlmYWNlTmFtZSk7CisgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJub3RpZnlpbmcgdGV0aGVyZWQgd2l0aCBpZmFjZSA9IiArIGlmYWNlTmFtZSk7CiAgICAgICAgICAgICAgICAgbVVwc3RyZWFtSWZhY2VOYW1lID0gaWZhY2VOYW1lOwogICAgICAgICAgICAgICAgIGZvciAoT2JqZWN0IG8gOiBtTm90aWZ5TGlzdCkgewogICAgICAgICAgICAgICAgICAgICBUZXRoZXJJbnRlcmZhY2VTTSBzbSA9IChUZXRoZXJJbnRlcmZhY2VTTSlvOwpAQCAtMTI2MywxOSArMTI3MCwxOSBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJNYXN0ZXJJbml0aWFsU3RhdGUucHJvY2Vzc01lc3NhZ2Ugd2hhdD0iICsgbWVzc2FnZS53aGF0KTsKKyAgICAgICAgICAgICAgICBpZiAoREVCVUcpIExvZy5kKFRBRywgIk1hc3RlckluaXRpYWxTdGF0ZS5wcm9jZXNzTWVzc2FnZSB3aGF0PSIgKyBtZXNzYWdlLndoYXQpOwogICAgICAgICAgICAgICAgIGJvb2xlYW4gcmV0VmFsdWUgPSB0cnVlOwogICAgICAgICAgICAgICAgIHN3aXRjaCAobWVzc2FnZS53aGF0KSB7CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgQ01EX1RFVEhFUl9NT0RFX1JFUVVFU1RFRDoKICAgICAgICAgICAgICAgICAgICAgICAgIG1EdW5SZXF1aXJlZCA9IGlzRHVuUmVxdWlyZWQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIFRldGhlckludGVyZmFjZVNNIHdobyA9IChUZXRoZXJJbnRlcmZhY2VTTSltZXNzYWdlLm9iajsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKFRBRywgIlRldGhlciBNb2RlIHJlcXVlc3RlZCBieSAiICsgd2hvLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJUZXRoZXIgTW9kZSByZXF1ZXN0ZWQgYnkgIiArIHdoby50b1N0cmluZygpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIG1Ob3RpZnlMaXN0LmFkZCh3aG8pOwogICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRvKG1UZXRoZXJNb2RlQWxpdmVTdGF0ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgY2FzZSBDTURfVEVUSEVSX01PREVfVU5SRVFVRVNURUQ6CiAgICAgICAgICAgICAgICAgICAgICAgICB3aG8gPSAoVGV0aGVySW50ZXJmYWNlU00pbWVzc2FnZS5vYmo7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJUZXRoZXIgTW9kZSB1bnJlcXVlc3RlZCBieSAiICsgd2hvLnRvU3RyaW5nKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBMb2cuZChUQUcsICJUZXRoZXIgTW9kZSB1bnJlcXVlc3RlZCBieSAiICsgd2hvLnRvU3RyaW5nKCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgaW50IGluZGV4ID0gbU5vdGlmeUxpc3QuaW5kZXhPZih3aG8pOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ICE9IC0xKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU5vdGlmeUxpc3QucmVtb3ZlKHdobyk7CkBAIC0xMzA1LDcgKzEzMTIsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgICBwdWJsaWMgYm9vbGVhbiBwcm9jZXNzTWVzc2FnZShNZXNzYWdlIG1lc3NhZ2UpIHsKLSAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJUZXRoZXJNb2RlQWxpdmVTdGF0ZS5wcm9jZXNzTWVzc2FnZSB3aGF0PSIgKyBtZXNzYWdlLndoYXQpOworICAgICAgICAgICAgICAgIGlmIChERUJVRykgTG9nLmQoVEFHLCAiVGV0aGVyTW9kZUFsaXZlU3RhdGUucHJvY2Vzc01lc3NhZ2Ugd2hhdD0iICsgbWVzc2FnZS53aGF0KTsKICAgICAgICAgICAgICAgICBib29sZWFuIHJldFZhbHVlID0gdHJ1ZTsKICAgICAgICAgICAgICAgICBzd2l0Y2ggKG1lc3NhZ2Uud2hhdCkgewogICAgICAgICAgICAgICAgICAgICBjYXNlIENNRF9URVRIRVJfTU9ERV9SRVFVRVNURUQ6CkBAIC0xMzMzLDggKzEzNDAsMTAgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1ha2Ugc3VyZSB3ZSdyZSBzdGlsbCB1c2luZyBhIHJlcXVlc3RlZCBjb25uZWN0aW9uIC0gbWF5IGhhdmUgZm91bmQKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdpZmkgb3Igc29tZXRoaW5nIHNpbmNlIHRoZW4uCiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUNvbm5lY3Rpb25SZXF1ZXN0ZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJyZW5ld2luZyBtb2JpbGUgY29ubmVjdGlvbiAtIHJlcXVldWluZyBmb3IgYW5vdGhlciAiICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENFTExfQ09OTkVDVElPTl9SRU5FV19NUyArICJtcyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVRykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cuZChUQUcsICJyZW5ld2luZyBtb2JpbGUgY29ubmVjdGlvbiAtIHJlcXVldWluZyBmb3IgYW5vdGhlciAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDRUxMX0NPTk5FQ1RJT05fUkVORVdfTVMgKyAibXMiK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RpZmllZCBvbmx5IHVwb24gYQorICAgICAqIG5vdGlmaWNhdGlvbiB0aW1lb3V0LgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGxvbmcgVElNRU9VVF9URVNUX05PVElGSUNBVElPTl9USU1FT1VUID0gMzAwOworCisgICAgLyoqCisgICAgICogVGhlIHBhY2thZ2UgbmFtZS4KKyAgICAgKi8KKyAgICBwcml2YXRlIHN0YXRpYyBTdHJpbmcgc1BhY2thZ2VOYW1lOworCisgICAgLyoqCisgICAgICogVGhlIGludGVyZmFjZSB1c2VkIHRvIHRhbGsgdG8gdGhlIHRlc3RlZCBzZXJ2aWNlLgorICAgICAqLworICAgIHByaXZhdGUgSUFjY2Vzc2liaWxpdHlNYW5hZ2VyIG1NYW5hZ2VyU2VydmljZTsKKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldENvbnRleHQoQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIHN1cGVyLnNldENvbnRleHQoY29udGV4dCk7CisgICAgICAgIGlmIChzUGFja2FnZU5hbWUgPT0gbnVsbCkgeworICAgICAgICAgICAgc1BhY2thZ2VOYW1lID0gY29udGV4dC5nZXRQYWNrYWdlTmFtZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogQ3JlYXRlcyBhIG5ldyBpbnN0YW5jZS4KKyAgICAgKi8KKyAgICBwdWJsaWMgQWNjZXNzaWJpbGl0eU1hbmFnZXJTZXJ2aWNlVGVzdCgpIHsKKyAgICAgICAgSUJpbmRlciBpQmluZGVyID0gU2VydmljZU1hbmFnZXIuZ2V0U2VydmljZShDb250ZXh0LkFDQ0VTU0lCSUxJVFlfU0VSVklDRSk7CisgICAgICAgIG1NYW5hZ2VyU2VydmljZSA9IElBY2Nlc3NpYmlsaXR5TWFuYWdlci5TdHViLmFzSW50ZXJmYWNlKGlCaW5kZXIpOworICAgIH0KKworICAgIEBMYXJnZVRlc3QKKyAgICBwdWJsaWMgdm9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ICAgIGFzc2VydE1vY2tTZXJ2aWNlVmVyaWZpZWRXaXRoaW5UaW1lb3V0KHNlY29uZFNlcnZpY2UpOworICAgIH0KKworICAgIC8qKgorICAgICAqIEZ1bGx5IHBvcHVsYXRlcyB0aGUge0BsaW5rIEFjY2Vzc2liaWxpdHlFdmVudH0gdG8gbWFyc2hhbC4KKyAgICAgKgorICAgICAqIEBwYXJhbSBzZW50RXZlbnQgVGhlIGV2ZW50IHRvIHBvcHVsYXRlLgorICAgICAqLworICAgIHByaXZhdGUgdm9pZCBmdWxseVBvcHVsYXRlRGVmYXVsdEFjY2Vzc2liaWxpdHlFdmVudChBY2Nlc3NpYmlsaXR5RXZlbnQgc2VudEV2ZW50KSB7CisgICAgICAgIHNlbnRFdmVudC5zZXRBZGRlZENvdW50KDEpOworICAgICAgICBzZW50RXZlbnQuc2V0QmVmb3JlVGV4dCgiQmVmb3JlVGV4dCIpOworICAgICAgICBzZW50RXZlbnQuc2V0Q2hlY2tlZCh0cnVlKTsKKyAgICAgICAgc2VudEV2ZW50LnNldENsYXNzTmFtZSgiZm9vLmJhci5iYXouQ2xhc3MiKTsKKyAgICAgICAgc2VudEV2ZW50LnNldENvbnRlbnREZXNjcmlwdGlvbigiQ29udGVudERlc2NyaXB0aW9uIik7CisgICAgICAgIHNlbnRFdmVudC5zZXRDdXJyZW50SXRlbUluZGV4KDEpOworICAgICAgICBzZW50RXZlbnQuc2V0RW5hYmxlZCh0cnVlKTsKKyAgICAgICAgc2VudEV2ZW50LnNldEV2ZW50VHlwZShBY2Nlc3NpYmlsaXR5RXZlbnQuVFlQRV9WSUVXX0NMSUNLRUQpOworICAgICAgICBzZW50RXZlbnQuc2V0RXZlbnRUaW1lKDEwMDApOworICAgICAgICBzZW50RXZlbnQuc2V0RnJvbUluZGV4KDEpOworICAgICAgICBzZW50RXZlbnQuc2V0RnVsbFNjcmVlbih0cnVlKTsKKyAgICAgICAgc2VudEV2ZW50LnNldEl0ZW1Db3VudCgxKTsKKyAgICA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G1lb3V0KTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGllKSB7CisgICAgICAgICAgICAgICAgLyogaWdub3JlICovCisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBwb2xsIGZvciB2ZXJpZmljYXRpb24gYW5kIGlmIHRoaXMgZmFpbHMgc2F2ZSB0aGUgZXhjZXB0aW9uIGFuZAorICAgICAgICAgICAgLy8ga2VlcCBwb2xsaW5nCisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIHNlcnZpY2UudmVyaWZ5KCk7CisgICAgICAgICAgICAgICAgLy8gcmVzZXQgc28gaXQgZG9lcyBub3QgYWNjZXB0IG1vcmUgZXZlbnRzCisgICAgICAgICAgICAgICAgc2VydmljZS5yZXNldCgpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgbGFzdFZlcmlmeUV4Y2VwdGlvbiA9IGU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyByZXNldCwgd2UgaGF2ZSBhbHJlYWR5IGZhaWxlZAorICAgICAgICBzZXJ2aWNlLnJlc2V0KCk7CisKKyAgICAgICAgLy8gYWx3YXlzIG5vdCBudWxsCisgICAgICAgIHRocm93IGxhc3RWZXJpZnlFeGNlcHRpb247CisgICAgfQorCisgICAgLyoqCisgICAgICogVGhpcyBjbGFzcyBpcyB0aGUgZmlyc3QgbW9jayB7QGxpbmsgQWNjZXNzaWJpbGl0eVNlcnZpY2V9LgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgY2xhc3MgTXlGaXJzdE1vY2tBY2Nlc3NpYmlsaXR5U2VydmljZSBleHRlbmRzIE1vY2tBY2Nlc3NpYmlsaXR5U2VydmljZSB7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBzZXJ2aWNlIHtAbGluayBDb21wb25lbnROYW1lfSBmbGF0dGVuZWQgYXMgYSBzdHJpbmcuCisgICAgICAgICAqLworICAgICAgICBzdGF0aWMgZmluYWwgU3RyaW5nIHNDb21wb25lbnROYW1lID0gbmV3IENvbXBvbmVudE5hbWUoCisgICAgICAgICAgICAgICAgc1BhY2thZ2VOYW1lLAorICAgICAgICAgICAgICAgIE15Rmlyc3RNb2NrQWNjZXNzaWJpbGl0eVNlcnZpY2UuY2xhc3MuZ2V0TmFtZSgpCisgICAgICAgICAgICAgICAgKS5mbGF0dGVuVG9TaG9ydFN0cmluZygpOworCisgICAgICAgIC8qKgorICAgICAgICAgKiBIYW5kbGUgdG8gdGhlIHNlcnZpY2UgaW5zdGFuY2UuCisgICAgICAgICAqLworICAgICAgICBzdGF0aWMgTXlGaXJzdE1vY2tBY2Nlc3NpYmlsaXR5U2VydmljZSBzSW5zdGFuY2U7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIENyZWF0ZXMgYSBuZXcgaW5zdGFuY2UuCisgICAgICAgICAqLworICAgICAgICBwdWJsaWMgTXlGaXJzdE1vY2tBY2Nlc3NpYmlsaXR5U2VydmljZSgpIHsKKyAgICAgICAgICAgIHNJbnN0YW5jZSA9IHRoaXM7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBUaGlzIGNsYXNzIGlzIHRoZSBmaXJzdCBtb2NrIHtAbGluayBBY2Nlc3NpYmlsaXR5U2VydmljZX0uCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBjbGFzcyBNeVNlY29uZE1vY2tBY2Nlc3NpYmlsaXR5U2VydmljZSBleHRlbmRzIE1vY2tBY2Nlc3NpYmlsaXR5U2VydmljZSB7CisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSBzZXJ2aWNlIHtAbGluayBDb21wb25lbnROYW1lfSBmbGF0dGVuZWQgYXMgYSBzdHJpbmcuCisgICAgICAgICAqLworICAgICAgICBzdGF0aWMgZmluYWwgU3RyaW5nIHNDb21wb25lbnROYW1l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0Y2hlciBmb3Ige0BsaW5rIEFjY2Vzc2liaWxpdHlFdmVudH1zLgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGNsYXNzIEFjY2Vzc2liaWxpdHlFdmVudE1hdGhlciBpbXBsZW1lbnRzIElBcmd1bWVudE1hdGNoZXIgeworICAgICAgICBwcml2YXRlIEFjY2Vzc2liaWxpdHlFdmVudCBtRXhwZWN0ZWRFdmVudDsKKworICAgICAgICBwdWJsaWMgQWNjZXNzaWJpbGl0eUV2ZW50TWF0aGVyKEFjY2Vzc2liaWxpdHlFdmVudCBleHBlY3RlZEV2ZW50KSB7CisgICAgICAgICAgICBtRXhwZWN0ZWRFdmVudCA9IGV4cGVjdGVkRXZlbnQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgYm9vbGVhbiBtYXRjaGVzKE9iamVjdCBtYXRjaGVkKSB7CisgICAgICAgICAgICBpZiAoIShtYXRjaGVkIGluc3RhbmNlb2YgQWNjZXNzaWJpbGl0eUV2ZW50KSkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEFjY2Vzc2liaWxpdHlFdmVudCByZWNlaXZlZEV2ZW50ID0gKEFjY2Vzc2liaWxpdHlFdmVudCkgbWF0Y2hlZDsKKyAgICAgICAgICAgIHJldHVybiBtRXhwZWN0ZWRFdmVudC5nZXRFdmVudFR5cGUoKSA9PSByZWNlaXZlZEV2ZW50LmdldEV2ZW50VHlwZSgpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIHZvaWQgYXBwZW5kVG8oU3RyaW5nQnVmZmVyIGJ1ZmZlcikgeworICAgICAgICAgICAgYnVmZmVyLmFwcGVuZCgic2VuZEFjY2Vzc2liaWxpdHlFdmVudCgpIik7CisgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCIgd2l0aCBldmVudCB0eXBlIFwiIik7CisgICAgICAgICAgICBidWZmZXIuYXBwZW5kKG1FeHBlY3RlZEV2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YXIuYmF6IgorICAgICAgICB9OworCisgICAgICAgIHJldHVybiBkZWZhdWx0SW5mbzsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTdGFydHMgcmVwbGF5aW5nIHRoZSBtb2NrLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHJlcGxheSgpIHsKKyAgICAgICAgbVJlcGxheWluZyA9IHRydWU7CisgICAgfQorCisgICAgLyoqCisgICAgICogVmVyaWZpZXMgaWYgYWxsIGV4cGVjdGVkIHNlcnZpY2UgbWV0aG9kcyBoYXZlIGJlZW4gY2FsbGVkLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHZlcmlmeSgpIHsKKyAgICAgICAgaWYgKCFtUmVwbGF5aW5nKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJEaWQgeW91IGZvcmdldCB0byBjYWxsIHJlcGxheSgpIik7CisgICAgICAgIH0KKworICAgICAgICBpZiAobUV4cGVjdGVkSW50ZXJydXB0KSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbFN0YXRlRXhjZXB0aW9uKCJFeHBlY3RlZCBjYWxsIHRvICNpbnRlcnJ1cHQoKSBub3QgcmVjZWl2ZWQiKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoIW1FeHBlY3RlZEV2ZW50cy5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsU3RhdGVFeGNlcHRpb24oIkV4cGVjdGVkIGEgY2FsbCB0byBvbkFjY2Vzc2liaWxpdHlFdmVudCgpIGZvciAiCisgICAgICAgICAgICAgICAgICAgICsgImV2ZW50cyBcIiIgKyBtRXhwZWN0ZWRFdmVudHMgKyAiXCIgbm90IHJlY2VpdmVkIik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXNldHMgdGhpcyBpbnN0YW5jZSBzbyBpdCBjYW4gYmUgcmV1c2VkLgorICAgICAq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dXQgYSBzZWxlY3Rpb24KLSAgICAgICAgICAgIGZpbmFsIGludCBzZWxTdGFydCA9IFNlbGVjdGlvbi5nZXRTZWxlY3Rpb25TdGFydChzKTsKLSAgICAgICAgICAgIGZpbmFsIGludCBzZWxFbmQgPSBTZWxlY3Rpb24uZ2V0U2VsZWN0aW9uRW5kKHMpOwotICAgICAgICAgICAgaWYgKHMubGVuZ3RoKCkgPiAxIC8vIENhbiBkZWxldGUgYW5vdGhlciBjaGFyYWN0ZXIKLSAgICAgICAgICAgICAgICAgICAgJiYgY291bnQgPT0gMSAvLyBEZWxldGluZyBvbmx5IG9uZSBjaGFyYWN0ZXIKLSAgICAgICAgICAgICAgICAgICAgJiYgYWZ0ZXIgPT0gMCAvLyBEZWxldGluZwotICAgICAgICAgICAgICAgICAgICAmJiBzLmNoYXJBdChzdGFydCkgPT0gJy0nIC8vIGEgaHlwaGVuCi0gICAgICAgICAgICAgICAgICAgICYmIHNlbFN0YXJ0ID09IHNlbEVuZCkgeyAvLyBubyBzZWxlY3Rpb24KLSAgICAgICAgICAgICAgICBtRGVsZXRpbmdIeXBoZW4gPSB0cnVlOwotICAgICAgICAgICAgICAgIG1IeXBoZW5TdGFydCA9IHN0YXJ0OwotICAgICAgICAgICAgICAgIC8vIENoZWNrIGlmIHRoZSB1c2VyIGlzIGRlbGV0aW5nIGZvcndhcmQgb3IgYmFja3dhcmQKLSAgICAgICAgICAgICAgICBpZiAoc2VsU3RhcnQgPT0gc3RhcnQgKyAxKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1EZWxldGluZ0JhY2t3YXJkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBtRGVsZXRpbmdCYWNrd2FyZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbURlbGV0aW5nSHlwaGVuID0gZmFsc2U7Ci0gICAgICAgICAgIC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A9IHMuY2hhckF0KGkpOworICAgICAgICAgICAgaWYgKFBob25lTnVtYmVyVXRpbHMuaXNOb25TZXBhcmF0b3IoYykpIHsKKyAgICAgICAgICAgICAgICBpZiAobGFzdE5vblNlcGFyYXRvciAhPSAwKSB7CisgICAgICAgICAgICAgICAgICAgIGZvcm1hdHRlZCA9IGdldEZvcm1hdHRlZE51bWJlcihsYXN0Tm9uU2VwYXJhdG9yLCBoYXNDdXJzb3IpOworICAgICAgICAgICAgICAgICAgICBoYXNDdXJzb3IgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbGFzdE5vblNlcGFyYXRvciA9IGM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoaSA9PSBjdXJJbmRleCkgeworICAgICAgICAgICAgICAgIGhhc0N1cnNvciA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKGxhc3ROb25TZXBhcmF0b3IgIT0gMCkgeworICAgICAgICAgICAgZm9ybWF0dGVkID0gZ2V0Rm9ybWF0dGVkTnVtYmVyKGxhc3ROb25TZXBhcmF0b3IsIGhhc0N1cnNvcik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZvcm1hdHRlZDsKKyAgICB9CisKKyAgICBwcml2YXRlIFN0cmluZyBnZXRGb3JtYXR0ZWROdW1iZXIoY2hhciBsYXN0Tm9uU2VwYXJhdG9yLCBib29sZWFuIGhhc0N1cnNvcikgeworICAgICAgICByZXR1cm4gaGFzQ3Vyc29yID8gbUZvcm1hdHRlci5pbnB1dERpZ2l0QW5kUmVtZW1iZXJQb3NpdGlvbihsYXN0Tm9uU2VwYXJhdG9yKQorICAgICAgICAgICAgICAgIDogbUZvcm1hdHRlci5pbnB1dERpZ2l0KGxhc3ROb25TZXBhcmF0b3IpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzdG9wRm9ybWF0dGluZygpIHsKKyAgICAgICAgbVN0b3BGb3JtYXR0aW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luZywgb3IgaGVsZENhbGwgY2FuJ3QgYmUgYWN0aXZlLgorICAgICAqIEluIHRoZXNlIGNhc2VzLCB0aGlzIG9wZXJhdGlvbiBtYXkgbm90IGJlIHBlcmZvcm1lZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzd2l0Y2hIb2xkaW5nQW5kQWN0aXZlKENhbGwgaGVsZENhbGwpIHRocm93cyBDYWxsU3RhdGVFeGNlcHRpb24geworICAgICAgICBQaG9uZSBhY3RpdmVQaG9uZSA9IG51bGw7CisgICAgICAgIFBob25lIGhlbGRQaG9uZSA9IG51bGw7CisKKyAgICAgICAgaWYgKGhhc0FjdGl2ZUZnQ2FsbCgpKSB7CisgICAgICAgICAgICBhY3RpdmVQaG9uZSA9IGdldEFjdGl2ZUZnQ2FsbCgpLmdldFBob25lKCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoaGVsZENhbGwgIT0gbnVsbCkgeworICAgICAgICAgICAgaGVsZFBob25lID0gaGVsZENhbGwuZ2V0UGhvbmUoKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChhY3RpdmVQaG9uZSAhPSBoZWxkUGhvbmUpIHsKKyAgICAgICAgICAgIGFjdGl2ZVBob25lLnN3aXRjaEhvbGRpbmdBbmRBY3RpdmUoKTsKKyAgICAgICAgfQorCisgICAgICAgIGhlbGRQaG9uZS5zd2l0Y2hIb2xkaW5nQW5kQWN0aXZlKCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogV2hldGhlciBvciBub3QgdGhlIHBob25lIGNhbiBjb25mZXJlbmNlIGluIHRoZSBjdXJyZW50IHBob25lCisgICAgICogc3RhdGUtLXRoYXQgaXMsIG9uZSBjYWxsIGhvbGRpbmcgYW5kIG9uZSBjYWxsIGFjdGl2ZS4KKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgdGhlIHBob25lIGNhbiBjb25mZXJlbmNlOyBmYWxzZSBvdGhlcndpc2UuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4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hvbmVzKSB7CisgICAgICAgICAgICBwaG9uZS5jbGVhckRpc2Nvbm5lY3RlZCgpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogV2hldGhlciBvciBub3QgdGhlIHBob25lIGNhbiBkbyBleHBsaWNpdCBjYWxsIHRyYW5zZmVyIGluIHRoZSBjdXJyZW50CisgICAgICogcGhvbmUgc3RhdGUtLXRoYXQgaXMsIG9uZSBjYWxsIGhvbGRpbmcgYW5kIG9uZSBjYWxsIGFjdGl2ZS4KKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgdGhlIHBob25lIGNhbiBkbyBleHBsaWNpdCBjYWxsIHRyYW5zZmVyOyBmYWxzZSBvdGhlcndpc2UuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gY2FuVHJhbnNmZXIoQ2FsbCBoZWxkQ2FsbCkgeworICAgICAgICBQaG9uZSBhY3RpdmVQaG9uZSA9IG51bGw7CisgICAgICAgIFBob25lIGhlbGRQaG9uZSA9IG51bGw7CisKKyAgICAgICAgaWYgKGhhc0FjdGl2ZUZnQ2FsbCgpKSB7CisgICAgICAgICAgICBhY3RpdmVQaG9uZSA9IGdldEFjdGl2ZUZnQ2FsbCgpLmdldFBob25lKCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoaGVsZENhbGwgIT0gbnVsbCkgeworICAgICAgICAgICAgaGVsZFBob25lID0gaGVsZENhbGwuZ2V0UGhvbmUoKTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiAoaGVsZFBob25lID09IGFjdGl2ZVBob25lICYmIGFjdGl2ZVBob25lLmNhblRyYW5zZmVyKCkpOworICAgIH0KKworICAgIC8qKgorICAgICAqIENvbm5lY3RzIHRoZSBoZWxkIGNhbGwgYW5kIGFjdGl2ZSBjYWxsCisgICAgICogRGlzY29ubmVjdHMgdGhlIHN1YnNjcmliZXIgZnJvbSBib3RoIGNhbGxzCisgICAgICoKKyAgICAgKiBFeHBsaWNpdCBDYWxsIFRyYW5zZmV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3JlZC4KKyAgICAgKiBAcmV0dXJuIGZhbHNlIGlmIG5vIGFjdGl2ZSBjYWxsIG9yIHRoZSBhY3RpdmUgY2FsbCBkb2Vzbid0IHN1cHBvcnQKKyAgICAgKiAgICAgICAgIGR0bWYgdG9uZQorICAgICAqLworICAgIHB1YmxpYyBib29sZWFuIHNlbmREdG1mKGNoYXIgYykgeworICAgICAgICBpZiAoaGFzQWN0aXZlRmdDYWxsKCkpIHsKKyAgICAgICAgICAgIGdldEFjdGl2ZUZnQ2FsbCgpLmdldFBob25lKCkuc2VuZER0bWYoYyk7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgLyoqCisgICAgICogU3RhcnQgdG8gcGFseSBhIERUTUYgdG9uZSBvbiB0aGUgYWN0aXZlIGNhbGwuCisgICAgICogb3IgdGhlcmUgaXMgYSBwbGF5aW5nIERUTUYgdG9uZS4KKyAgICAgKiBAcGFyYW0gYyBzaG91bGQgYmUgb25lIG9mIDAtOSwgJyonIG9yICcjJy4gT3RoZXIgdmFsdWVzIHdpbGwgYmUKKyAgICAgKiBzaWxlbnRseSBpZ25vcmVkLgorICAgICAqCisgICAgICogQHJldHVybiBmYWxzZSBpZiBubyBhY3RpdmUgY2FsbCBvciB0aGUgYWN0aXZlIGNhbGwgZG9lc24ndCBzdXBwb3J0CisgICAgICogICAgICAgICBkdG1mIHRvbmUKKyAgICAgKi8KKyAgICBwdWJsaWMgYm9vbGVhbiBzdGFydER0bWYoY2hhciBjKSB7CisgICAgICAgIGlmIChoYXNBY3RpdmVGZ0NhbGwoKSkgeworICAgICAgICAgICAgZ2V0QWN0aXZlRmdDYWxsKCkuZ2V0UGhvbmUoKS5zZW5kRHRtZihjKTsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTdG9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2UoSGFuZGxlciBoKXt9CisKKyAgICAvKioKKyAgICAgKiBSZWdpc3RyYXRpb24gcG9pbnQgZm9yIHN1YnNjcmlwdGlvbiBpbmZvIHJlYWR5CisgICAgICogQHBhcmFtIGggaGFuZGxlciB0byBub3RpZnkKKyAgICAgKiBAcGFyYW0gd2hhdCB3aGF0IGNvZGUgb2YgbWVzc2FnZSB3aGVuIGRlbGl2ZXJlZAorICAgICAqIEBwYXJhbSBvYmogcGxhY2VkIGluIE1lc3NhZ2Uub2JqCisgICAgICovCisgICAgcHVibGljIHZvaWQgcmVnaXN0ZXJGb3JTdWJzY3JpcHRpb25JbmZvUmVhZHkoSGFuZGxlciBoLCBpbnQgd2hhdCwgT2JqZWN0IG9iail7fQorCisgICAgLyoqCisgICAgICogVW5yZWdpc3RlciBmb3Igbm90aWZpY2F0aW9ucyBmb3Igc3Vic2NyaXB0aW9uIGluZm8KKyAgICAgKiBAcGFyYW0gaCBIYW5kbGVyIHRvIGJlIHJlbW92ZWQgZnJvbSB0aGUgcmVnaXN0cmFudCBsaXN0LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHVucmVnaXN0ZXJGb3JTdWJzY3JpcHRpb25JbmZvUmVhZHkoSGFuZGxlciBoKXt9CisKKyAgICBwcml2YXRlIEhhbmRsZXIgbUhhbmRsZXIgPSBuZXcgSGFuZGxlcigpIHsKKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgaGFuZGxlTWVzc2FnZShNZXNzYWdlIG1zZykgeworICAgICAgICAgICAgc3dpdGNoIChtc2cud2hhdCkgeworICAgICAgICAgICAgICAgIGNhc2UgRVZFTlRfRElTQ09OTkVDVDoKKyAgICAgICAgICAgICAgICAgICAgbURpc2Nvbm5lY3RSZWdpc3RyYW50cy5ub3RpZnlSZWdpc3RyYW50cygoQXN5bmNSZXN1bHQpIG1zZy5vYmopOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlI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yAgICBwdWJsaWMgYm9vbGVhbiBpc0FwblR5cGVFbmFibGVkKFN0cmluZyBhcG5UeXBlKSB7CisgICAgICAgIHJldHVybiBpc0FwbklkRW5hYmxlZChhcG5UeXBlVG9JZChhcG5UeXBlKSk7CisgICAgfQorCisgICAgcHJvdGVjdGVkIHN5bmNocm9uaXplZCBib29sZWFuIGlzQXBuSWRFbmFibGVkKGludCBpZCkgewogICAgICAgICBpZiAoaWQgIT0gQVBOX0lOVkFMSURfSUQpIHsKICAgICAgICAgICAgIHJldHVybiBkYXRhRW5hYmxlZFtpZF07CiAgICAgICAgIH0KQEAgLTQ0NCwyMiArNTI0LDIxIEBACiAgICAgICAgICAgICByZXR1cm4gUGhvbmUuQVBOX1JFUVVFU1RfRkFJTEVEOwogICAgICAgICB9CiAKLSAgICAgICAgaWYgKERCRykgTG9nLmQoTE9HX1RBRywgImVuYWJsZUFwblR5cGUoIit0eXBlKyIpLCBpc0FwblR5cGVBY3RpdmUgPSAiCi0gICAgICAgICAgICAgICAgKyBpc0FwblR5cGVBY3RpdmUodHlwZSkgKyAiIGFuZCBzdGF0ZSA9ICIgKyBzdGF0ZSk7CisgICAgICAgIGlmIChEQkcpIHsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJlbmFibGVBcG5UeXBlKCIgKyB0eXBlICsgIiksIGlzQXBuVHlwZUFjdGl2ZSA9ICIKKyAgICAgICAgICAgICAgICAgICAgKyBpc0FwblR5cGVBY3RpdmUodHlwZSkgKyAiLCBpc0FwbklkRW5hYmxlZCA9IiArIGlzQXBuSWRFbmFibGVkKGlkKSArCisgICAgICAgICAgICAgICAgICAgICIgYW5kIHN0YXRlID0gIiArIHN0YXRlKTsKKyAgICAgICAgfQogCiAgICAgICAgIGlmICghaXNBcG5UeXBlQXZhaWxhYmxlKHR5cGUpKSB7CiAgICAgICAgICAgICBpZiAoREJHKSBMb2cuZChMT0dfVEFHLCAidHlwZSBub3QgYXZhaWxhYmxlIik7CiAgICAgICAgICAgICBy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ICAgICAgIGlmIChpc0VuYWJsZWQoaWQpKSB7CisgICAgICAgIGlmIChpc0FwbklkRW5hYmxlZChpZCkpIHsKICAgICAgICAgICAgIHNldEVuYWJsZWQoaWQsIGZhbHNlKTsKICAgICAgICAgICAgIGlmIChpc0FwblR5cGVBY3RpdmUoUGhvbmUuQVBOX1RZUEVfREVGQVVMVCkpIHsKICAgICAgICAgICAgICAgICBpZiAoZGF0YUVuYWJsZWRbQVBOX0RFRkFVTFRfSURdKSB7CkBAIC00OTUsOSArNTc0LDEwIEBACiAgICAgfQogCiAgICAgcHJpdmF0ZSB2b2lkIHNldEVuYWJsZWQoaW50IGlkLCBib29sZWFuIGVuYWJsZSkgewotICAgICAgICBpZiAoREJHKSBMb2cuZChMT0dfVEFHLCAic2V0RW5hYmxlZCgiICsgaWQgKyAiLCAiICsgZW5hYmxlICsgIikgd2l0aCBvbGQgc3RhdGUgPSAiICsKLSAgICAgICAgICAgICAgICBkYXRhRW5hYmxlZFtpZF0gKyAiIGFuZCBlbmFibGVkQ291bnQgPSAiICsgZW5hYmxlZENvdW50KTsKLQorICAgICAgICBpZiAoREJHKSB7CisgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAic2V0RW5hYmxlZCgiICsgaWQgKyAiLCAiICsgZW5hYmxlICsgIikgd2l0aCBvbGQgc3RhdGUgPSAiCisgICAgICAgICAgICAgICAgICAgICsgZGF0YUVuYWJsZWRbaWRdICsgIiBhbmQgZW5hYmxlZENvdW50ID0gIiArIGVuYWJsZWRDb3VudCk7CisgICAgICAgIH0KICAgICAgICAgTWVzc2FnZSBtc2cgPSBvYnRhaW5NZXNzYWdlKEVWRU5UX0VOQUJMRV9ORVdfQVBOKTsKICAgICAgICAgbXNnLmFyZzEgPSBpZDsKICAgICAgICAgbXNnLmFyZzIgPSAoZW5hYmxlID8gRU5BQkxFRCA6IERJU0FCTEVEKTsKQEAgLTUwNyw5ICs1ODcsOCBAQAogICAgIHByb3RlY3RlZCBzeW5jaHJvbml6ZWQgdm9pZCBvbkVuYWJsZUFwbihpbnQgYXBuSWQsIGludCBlbmFibGVkKSB7CiAgICAgICAgIGlmIChEQkcpIHsKICAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJFVkVOVF9BUE5fRU5BQkxFX1JFUVVFU1QgIiArIGFwbklkICsgIiwgIiArIGVuYWJsZWQpOwotICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgIiBkYXRhRW5hYmxlZCA9ICIgKyBkYXRhRW5hYmxlZFthcG5JZF0gKwotICAgICAgICAgICAgICAgICAgICAiLCBlbmFibGVkQ291bnQgPSAiICsgZW5hYmxlZENvdW50ICsKLSAgICAgICAgICAgICAgICAgICAgIiwgaXNBcG5UeXBlQWN0aXZlID0gIiArIGlzQXBuVHlwZUFjdGl2ZShhcG5JZFRvVHlwZShhcG5JZCkpKTsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICIgZGF0YUVuYWJsZWQgPSAiICsgZGF0YUVuYWJsZWRbYXBuSWRdICsgIiwgZW5hYmxlZENvdW50ID0gIgorICAgICAgICAgICAgICAgICAgICArIGVuYWJsZWRDb3VudCArICIsIGlzQXBuVHlwZUFjdGl2ZSA9ICIgKyBpc0FwblR5cGVBY3RpdmUoYXBuSWRUb1R5cGUoYXBuSWQpKSk7CiAgICAgICAgIH0KICAgICAgICAgaWYgKGVuYWJsZWQgPT0gRU5BQkxFRCkgewogICAgICAgICAgICAgaWYgKCFkYXRhRW5hYmxlZFthcG5JZF0pIHsKQEAgLTUyMCw2ICs1OTksOCBAQAogICAgICAgICAgICAgaWYgKCFpc0FwblR5cGVBY3RpdmUodHlwZSkpIHsKICAgICAgICAgICAgICAgICBtUmVxdWVzdGVkQXBuVHlwZSA9IHR5cGU7CiAgICAgICAgICAgICAgICAgb25FbmFibGVOZXdBcG4oKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbm90aWZ5QXBuSWRVcFRvQ3VycmVudChQaG9uZS5SRUFTT05fQVBOX1NXSVRDSEVELCBhcG5JZCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAvLyBkaXNhYmxlCkBAIC01MjgsOCArNjA5LDE3IEBACiAgICAgICAgICAgICAgICAgZW5hYmxlZENvdW50LS07CiAgICAgICAgICAgICAgICAgaWYgKGVuYWJsZWRDb3VudCA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgIG9uQ2xlYW5VcENvbm5lY3Rpb24odHJ1ZSwgUGhvbmUuUkVBU09OX0RBVEFfRElTQUJMRUQpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZGF0YUVuYWJsZWRbQVBOX0RFRkFVTFRfSURdID09IHRydWUgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICFpc0FwblR5cGVBY3RpdmUoUGhvbmUuQVBOX1RZUEVfREVGQVVMVCkpIHsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBzZW5kIHRoZSBkaXNjb25uZWN0IG1zZyBtYW51YWxseSwgc2luY2UgdGhlIG5vcm1hbCByb3V0ZSB3b250IHNlbmQKKyAgICAgICAgICAgICAgICAvLyBpdCAoaXQncyBub3QgZW5hYmxlZCkKKyAgICAgICAgICAgICAgICBub3RpZnlBcG5JZERpc2Nvbm5lY3RlZChQaG9uZS5SRUFTT05fREFUQV9ESVNBQkxFRCwgYXBuSWQpOworICAgICAgICAgICAgICAgIGlmIChkYXRhRW5hYmxlZFtBUE5fREVGQVVMVF9JRF0gPT0gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgJiYgIWlzQXBuVHlwZUFjdGl2ZShQaG9uZS5BUE5fVFlQRV9ERUZBVUxUKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIC0gdGhpcyBpcyBhbiB1Z2x5IHdheSB0byByZXN0b3JlIHRoZSBkZWZhdWx0IGNvbm4gLSBzaG91bGQgYmUgZG9uZQorICAgICAgICAgICAgICAgICAgICAvLyBieSBhIHJlYWwgY29udGVudGlvbiBtYW5hZ2VyIGFuZCBwb2xpY3kgdGhhdCBkaXNjb25uZWN0cyB0aGUgbG93ZXIgcHJpCisgICAgICAgICAgICAgICAgICAgIC8vIHN0dWZmIGFzIGVuYWJsZSByZXF1ZXN0cyBjb21lIGluIGFuZCBwb3BzIHRoZW0gYmFjayBvbiBhcyB3ZSBkaXNhYmxlIGJhY2sKKyAgICAgICAgICAgICAgICAgICAgLy8gZG93biB0byB0aGUgbG93ZXIgcHJpIHN0dWZmCiAgICAgICAgICAgICAgICAgICAgIG1SZXF1ZXN0ZWRBcG5UeXBlID0gUGhvbmUuQVBOX1RZUEVfREVGQVVMVDsKICAgICAgICAgICAgICAgICAgICAgb25FbmFibGVOZXdBcG4oKTsKICAgICAgICAgICAgICAgICB9CkBAIC01NzQsNyArNjY0LDcgQEAKICAgICAgICAgICAgICAgICBvblRyeVNldHVwRGF0YShQaG9uZS5SRUFTT05fREFUQV9FTkFCTEVEKTsKICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgb25DbGVhblVwQ29ubmVjdGlvbih0cnVlLCBQaG9uZS5SRUFTT05fREFUQV9ESVNBQkxFRCk7Ci0gICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KIApkaWZmIC0tZ2l0IGEvdGVsZXBob255L2phdmEvY29tL2FuZHJvaWQvaW50ZXJuYWwvdGVsZXBob255L0RlZmF1bHRQaG9uZU5vdGlmaWVyLmphdmEgYi90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvRGVmYXVsdFBob25lTm90aWZpZXIuamF2YQppbmRleCA0ZGE0YjZhLi4wNjQ2MTAxIDEwMDY0NAotLS0gYS90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvRGVmYXVsdFBob25lTm90aWZpZXIuamF2YQorKysgYi90ZWxlcGhvbn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IgZm9yIHRoaXMgb25lLgogICAgICAgICBUZWxlcGhvbnlNYW5hZ2VyIHRlbGVwaG9ueSA9IFRlbGVwaG9ueU1hbmFnZXIuZ2V0RGVmYXVsdCgpOwogICAgICAgICB0cnkgewogICAgICAgICAgICAgbVJlZ2lzdHJ5Lm5vdGlmeURhdGFDb25uZWN0aW9uKAotICAgICAgICAgICAgICAgICAgICBjb252ZXJ0RGF0YVN0YXRlKHNlbmRlci5nZXREYXRhQ29ubmVjdGlvblN0YXRlKCkpLAorICAgICAgICAgICAgICAgICAgICBjb252ZXJ0RGF0YVN0YXRlKHN0YXRlKSwKICAgICAgICAgICAgICAgICAgICAgc2VuZGVyLmlzRGF0YUNvbm5lY3Rpdml0eVBvc3NpYmxlKCksIHJlYXNvbiwKICAgICAgICAgICAgICAgICAgICAgc2VuZGVyLmdldEFjdGl2ZUFwbigpLAotICAgICAgICAgICAgICAgICAgICBzZW5kZXIuZ2V0QWN0aXZlQXBuVHlwZXMoKSwKKyAgICAgICAgICAgICAgICAgICAgYXBuVHlwZSwKICAgICAgICAgICAgICAgICAgICAgc2VuZGVyLmdldEludGVyZmFjZU5hbWUobnVsbCksCiAgICAgICAgICAgICAgICAgICAgICgodGVsZXBob255IT1udWxsKSA/IHRlbGVwaG9ueS5nZXROZXR3b3JrVHlwZSgpIDoKICAgICAgICAgICAgICAgICAgICAgVGVsZXBob255TWFuYWdlci5ORVRXT1JLX1RZUEVfVU5LTk9XTikpOwpAQCAtMTA4LDkgKzEyMSw5IEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwdWJsaWMgdm9pZCBub3RpZnlEYXRhQ29ubmVjdGlvbkZhaWxlZChQaG9uZSBzZW5kZXIsIFN0cmluZyByZWFzb24pIHsKKyAgICBwdWJsaWMgdm9pZCBub3RpZnlEYXRhQ29ubmVjdGlvbkZhaWxlZChQaG9uZSBzZW5kZXIsIFN0cmluZyByZWFzb24sIFN0cmluZyBhcG5UeXBlKSB7CiAgICAgICAgIHRyeSB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sICJmYWlsZWQgdG8gc2VuZCBiYWNrIFJFU1VMVF9FUlJPUl9MSU1JVF9FWENFRURFRCIpOwpAQCAtMzU4LDcgKzM1OSw3IEBACiAKICAgICAgICAgY2FzZSBFVkVOVF9TRU5EX0NPTkZJUk1FRF9TTVM6CiAgICAgICAgICAgICBpZiAobVNUcmFja2Vycy5pc0VtcHR5KCkgPT0gZmFsc2UpIHsKLSAgICAgICAgICAgICAgICBTbXNUcmFja2VyIHNUcmFja2VyID0gKFNtc1RyYWNrZXIpbVNUcmFja2Vycy5yZW1vdmUobVNUcmFja2Vycy5zaXplKCkgLSAxKTsKKyAgICAgICAgICAgICAgICBTbXNUcmFja2VyIHNUcmFja2VyID0gbVNUcmFja2Vycy5yZW1vdmUobVNUcmFja2Vycy5zaXplKCkgLSAxKTsKICAgICAgICAgICAgICAgICBpZiAoaXNNdWx0aXBhcnRUcmFja2VyKHNUcmFja2VyKSkgewogICAgICAgICAgICAgICAgICAgICBzZW5kTXVsdGlwYXJ0U21zKHNUcmFja2VyKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewpAQCAtMzcyLDcgKzM3Myw3IEBACiAgICAgICAgICAgICBpZiAobVNUcmFja2Vycy5pc0VtcHR5KCkgPT0gZmFsc2UpIHsKICAgICAgICAgICAgICAgICAvLyBSZW1vdmUgdGhlIGxhdGVzdCBvbmUuCiAgICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgU21zVHJhY2tlciBzVHJhY2tlciA9IChTbXNUcmFja2VyKW1TVHJhY2tlcnMucmVtb3ZlKG1TVHJhY2tlcnMuc2l6ZSgpIC0gMSk7CisgICAgICAgICAgICAgICAgICAgIFNtc1RyYWNrZXIgc1RyYWNrZXIgPSBtU1RyYWNrZXJzLnJlbW92ZShtU1RyYWNrZXJzLnNpemUoKSAtIDEpOwogICAgICAgICAgICAgICAgICAgICBzVHJhY2tlci5tU2VudEludGVudC5zZW5kKFJFU1VMVF9FUlJPUl9MSU1JVF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mV0dXJuIG5lZWRzUHJvdmlzaW9uaW5nOwotICAgIH0KLQogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyB2b2lkIGV4aXRFbWVyZ2VuY3lDYWxsYmFja01vZGUoKSB7CiAgICAgICAgIGlmIChtV2FrZUxvY2suaXNIZWxkKCkpIHsKQEAgLTExODAsNiArMTE1NCwyNiBAQAogICAgICAgICBtU01TLnNldENlbGxCcm9hZGNhc3RDb25maWcoY29uZmlnVmFsdWVzQXJyYXksIHJlc3BvbnNlKTsKICAgICB9CiAKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRydWUgaWYgT1RBIFNlcnZpY2UgUHJvdmlzaW9uaW5nIG5lZWRzIHRvIGJlIHBlcmZvcm1lZC4KKyAgICAgKi8KKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBuZWVkc090YVNlcnZpY2VQcm92aXNpb25pbmcoKSB7CisgICAgICAgIFN0cmluZyBjZG1hTWluID0gZ2V0Q2RtYU1pbigpOworICAgICAgICBib29sZWFuIG5lZWRzUHJvdmlzaW9uaW5nOworICAgICAgICBpZiAoY2RtYU1pbiA9PSBudWxsIHx8IChjZG1hTWluLmxlbmd0aCgpIDwgNikpIHsKKyAgICAgICAgICAgIGlmIChEQkcpIExvZy5kKExPR19UQUcsICJuZWVkc090YVNlcnZpY2VQcm92aXNpb25pbmc6IGlsbGVnYWwgY2RtYU1pbj0nIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBjZG1hTWluICsgIicgYXNzdW1lIHByb3Zpc2lvbmluZyBuZWVkZWQuIik7CisgICAgICAgICAgICBuZWVkc1Byb3Zpc2lvbmluZyA9IHRydWU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBuZWVkc1Byb3Zpc2lvbmluZyA9IChjZG1hTWluLmVxdWFscyhVTkFDVElWQVRFRF9NSU5fVkFMVUUpCisgICAgICAgICAgICAgICAgICAgIHx8IGNkbWFNaW4uc3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gICAgIChtQ2RtYVBob25lLm1TU1QuaXNDb25jdXJyZW50Vm9pY2VBbmREYXRhKCkgfHwKKyAgICAgICAgICAgICAgICAgcGhvbmUuZ2V0U3RhdGUoKSA9PSBQaG9uZS5TdGF0ZS5JRExFKSAmJgorICAgICAgICAgICAgICAgICFyb2FtaW5nICYmCisgICAgICAgICAgICAgICAgbU1hc3RlckRhdGFFbmFibGVkICYmCisgICAgICAgICAgICAgICAgZGVzaXJlZFBvd2VyU3RhdGUgJiYKKyAgICAgICAgICAgICAgICAhbVBlbmRpbmdSZXN0YXJ0UmFkaW8gJiYKKyAgICAgICAgICAgICAgICAhbUNkbWFQaG9uZS5uZWVkc090YVNlcnZpY2VQcm92aXNpb25pbmcoKSk7CisgICAgICAgIGlmICghYWxsb3dlZCAmJiBEQkcpIHsKKyAgICAgICAgICAgIFN0cmluZyByZWFzb24gPSAiIjsKKyAgICAgICAgICAgIGlmIChwc1N0YXRlICE9IFNlcnZpY2VTdGF0ZS5TVEFURV9JTl9TRVJWSUNFKSByZWFzb24gKz0gIiAtIHBzU3RhdGU9ICIgKyBwc1N0YXRlOworICAgICAgICAgICAgaWYgKHBob25lLm1DTS5nZXRSYWRpb1N0YXRlKCkgIT0gQ29tbWFuZHNJbnRlcmZhY2UuUmFkaW9TdGF0ZS5OVl9SRUFEWSAmJgorICAgICAgICAgICAgICAgICAgICAhbUNkbWFQaG9uZS5tUnVpbVJlY29yZHMuZ2V0UmVjb3Jkc0xvYWRlZCgpKSB7CisgICAgICAgICAgICAgICAgcmVhc29uICs9ICIgLSByYWRpb1N0YXRlPSAiICsgcGhvbmUubUNNLmdldFJhZGlvU3RhdGUoKSArICIgLSBSVUlNIG5vdCBsb2FkZWQiOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHBob25lLmdldFN0YXRlKCkgIT0gUGhvbmUuU3RhdGUuSURMRSAmJgorICAgICAgICAgICAgICAgICAgICBtQ2RtYVBob25lLm1TU1QuaXNDb25jdXJyZW50Vm9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HBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CisgICAgICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOworICAgICAgICAgICAgbm90aWZ5T2ZmQXBuc09mQXZhaWxhYmlsaXR5KHJlYXNvbiwgdHJ1ZSk7CiAKICAgICAgICAgICAgIExvZy5pKExPR19UQUcsICIoZml4PykgV2UncmUgb24gdGhlIHNpbXVsYXRvcjsgYXNzdW1pbmcgZGF0YSBpcyBjb25uZWN0ZWQiKTsKICAgICAgICAgICAgIHJldHVybiB0cnVlOwpAQCAtMzI3LDM2ICszNTksMTMgQEAKICAgICAgICAgYm9vbGVhbiByb2FtaW5nID0gcGhvbmUuZ2V0U2VydmljZVN0YXRlKCkuZ2V0Um9hbWluZygpOwogICAgICAgICBib29sZWFuIGRlc2lyZWRQb3dlclN0YXRlID0gbUNkbWFQaG9uZS5tU1NULmdldERlc2lyZWRQb3dlclN0YXRlKCk7CiAKLSAgICAgICAgaWYgKChzdGF0ZSA9PSBTdGF0ZS5JRExFIHx8IHN0YXRlID09IFN0YXRlLlNDQU5OSU5HKQotICAgICAgICAgICAgICAgICYmIChwc1N0YXRlID09IFNlcnZpY2VTdGF0ZS5TVEFURV9JTl9TRVJWSUNFKQotICAgICAgICAgICAgICAgICYmICgocGhvbmUubUNNLmdldFJhZGlvU3RhdGUoKSA9PSBDb21tYW5kc0ludGVyZmFjZS5SYWRpb1N0YXRlLk5WX1JFQURZKSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgbUNkbWFQaG9uZS5tUnVpbVJlY29yZHMuZ2V0UmVjb3Jkc0xvYWRlZCgpKQotICAgICAgICAgICAgICAgICYmIChtQ2RtYVBob25lLm1TU1QuaXNDb25jdXJyZW50Vm9pY2VBbmREYXRhKCkgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBob25lLmdldFN0YXRlKCkgPT0gUGhvbmUuU3RhdGUuSURMRSApCi0gICAgICAgICAgICAgICAgJiYgaXNEYXRhQWxsb3dlZCgpCi0gICAgICAgICAgICAgICAgJiYgZGVzaXJlZFBvd2VyU3RhdGUKLSAgICAgICAgICAgICAgICAmJiAhbVBlbmRpbmdSZXN0YXJ0UmFkaW8KLSAgICAgICAgICAgICAgICAmJiAhbUNkbWFQaG9uZS5uZWVkc090YVNlcnZpY2VQcm92aXNpb25pbmcoKSkgewotCi0gICAgICAgICAgICByZXR1cm4gc2V0dXBEYXRhKHJlYXNvbik7Ci0KKyAgICAgICAgaWYgKChzdGF0ZSA9PSBTdGF0ZS5JRExFIHx8IHN0YXRlID09IFN0YXRlLlNDQU5OSU5HKSAmJgorICAgICAgICAgICAgICAgIGlzRGF0YUFsbG93ZWQoKSAmJiBnZXRBbnlEYXRhRW5hYmxlZCgpKSB7CisgICAgICAgICAgICBib29sZWFuIHJldFZhbHVlID0gc2V0dXBEYXRhKHJlYXNvbik7CisgICAgICAgICAgICBub3RpZnlPZmZBcG5zT2ZBdmFpbGFiaWxpdHkocmVhc29uLCByZXRWYWx1ZSk7CisgICAgICAgICAgICByZXR1cm4gcmV0VmFsdWU7CiAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoREJHKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxvZygidHJ5U2V0dXBEYXRhOiBOb3QgcmVhZHkgZm9yIGRhdGE6ICIgKwotICAgICAgICAgICAgICAgICAgICAiIGRhdGFTdGF0ZT0iICsgc3RhdGUgKwotICAgICAgICAgICAgICAgICAgICAiIFBTIHN0YXRlPSIgKyBwc1N0YXRlICsKLSAgICAgICAgICAgICAgICAgICAgIiByYWRpbyBzdGF0ZT0iICsgcGhvbmUubUNNLmdldFJhZGlvU3RhdGUoKSArCi0gICAgICAgICAgICAgICAgICAgICIgcnVpbT0iICsgbUNkbWFQaG9uZS5tUnVpbVJlY29yZHMuZ2V0UmVjb3Jkc0xvYWRlZCgpICsKLSAgICAgICAgICAgICAgICAgICAgIiBjb25jdXJyZW50Vm9pY2UmRGF0YT0iICsgbUNkbWFQaG9uZS5tU1NULmlzQ29uY3VycmVudFZvaWNlQW5kRGF0YSgpICsKLSAgICAgICAgICAgICAgICAgICAgIiBwaG9uZVN0YXRlPSIgKyBwaG9uZS5nZXRTdGF0ZSgpICsKLSAgICAgICAgICAgICAgICAgICAgIiBkYXRhRW5hYmxlZD0iICsgZ2V0QW55RGF0YUVuYWJsZWQoKSArCi0gICAgICAgICAgICAgICAgICAgICIgcm9hbWluZz0iICsgcm9hbWluZyArCi0gICAgICAgICAgICAgICAgICAgICIgZGF0YU9uUm9hbWluZ0VuYWJsZT0iICsgZ2V0RGF0YU9uUm9hbWluZ0VuYWJsZWQoKSArCi0gICAgICAgICAgICAgICAgICAgICIgZGVzaXJlZFBvd2VyU3RhdGU9IiArIGRlc2lyZWRQb3dlclN0YXRlICsKLSAgICAgICAgICAgICAgICAgICAgIiBQZW5kaW5nUmVzdGFydFJhZGlvPSIgKyBtUGVuZGluZ1Jlc3RhcnRSYWRpbyArCi0gICAgICAgICAgICAgICAgICAgICIgTWFzdGVyRGF0YUVuYWJsZWQ9IiArIG1NYXN0ZXJEYXRhRW5hYmxlZCArCi0gICAgICAgICAgICAgICAgICAgICIgbmVlZHNPdGFTZXJ2aWNlUHJvdmlzaW9uaW5nPSIgKyBtQ2RtYVBob25lLm5lZWRzT3RhU2VydmljZVByb3Zpc2lvbmluZygpKTsKLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG5vdGlmeU9mZkFwbnNPZkF2YWlsYWJpbGl0eShyZWFzb24sIGZhbHNlKTsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogICAgIH0KQEAgLTM4Miw2ICszOTEsNyBAQAogICAgICAgICB9CiAKICAgICAgICAgc2V0U3RhdGUoU3RhdGUuRElTQ09OTkVDVElORyk7CisgICAgICAgIG5vdGlmeURhdGFBdmFpbGFiaWxpdHkocmVhc29uKTsKIAogICAgICAgICBib29sZWFuIG5vdGlmaWNhdGlvbkRlZmVycmVkID0gZmFsc2U7CiAgICAgICAgIGZvciAoRGF0YUNvbm5lY3Rpb24gY29ubiA6IGRhdGFDb25uZWN0aW9uTGlzdCkgewpAQCAtNDQwLDEzICs0NTAsMTMgQEAKICAgICAgICAgY29ubi5jb25uZWN0KG1zZywgbUFjdGl2ZUFwbik7CiAKICAgICAgICAgc2V0U3RhdGUoU3RhdGUuSU5JVElORyk7Ci0gICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CisgICAgICAgIG5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CiAgICAgICAgIHJldHVybiB0cnVlOwogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCBub3RpZnlEZWZhdWx0RGF0YShTdHJpbmcgcmVhc29uKSB7CiAgICAgICAgIHNldFN0YXRlKFN0YXRlLkNPTk5FQ1RFRCk7Ci0gICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CisgICAgICAgIG5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CiAgICAgICAgIHN0YXJ0TmV0U3RhdFBvbGwoKTsKICAgICAgICAgbVJldHJ5TWdyLnJlc2V0UmV0cnlDb3VudCgpOwogICAgIH0KQEAgLTYyMiwxMiArNjMyLDEzIEBACiAKICAgICBwcml2YXRlIHZvaWQgbm90aWZ5Tm9EYXRhKEZhaWxDYXVzZSBsYXN0RmFpbENhdXNlQ29kZSkgewogICAgICAgICBzZXRTdGF0ZShTdGF0ZS5GQUlMRUQpOworICAgICAgICBub3RpZnlEYXRhQXZhaWxhYmlsaXR5KG51bGwpOwogICAgIH0KIAogICAgIHByaXZhdGUgdm9pZCBnb3RvSWRsZUFuZE5vdGlmeURhdGFDb25uZWN0aW9uKFN0cmluZyByZWFzb24pIHsKICAgICAgICAgaWYgKERCRykgbG9nKCJnb3RvSWRsZUFuZE5vdGlmeURhdGFDb25uZWN0aW9uOiByZWFzb249IiArIHJlYXNvbik7CiAgICAgICAgIHNldFN0YXRlKFN0YXRlLklETEUpOwotICAgICAgICBwaG9uZS5ub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOworICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOwogICAgICAgICBtQWN0aXZlQXBuID0gbnVsbDsKICAgICB9CiAKQEAgLTY4NywxMSArNjk4LDEzIEBACiAgICAgICAgICAgICAvLyBBc3N1bWUgZGF0YSBpcyBjb25uZWN0ZWQgb24gdGhlIHNpbXVsYXRvcgogICAgICAgICAgICAgLy8gRklYTUUgIHRoaXMgY2FuIGJlIGltcHJvdmVkCiAgICAgICAgICAgICBzZXRTdGF0ZShTdGF0ZS5DT05ORUNURUQpOwotICAgICAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24obnVsbCk7CisgICAgICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihudWxsKTsKIAogICAgICAgICAgICAgTG9nLmkoTE9HX1RBRywgIldlJ3JlIG9uIHRoZSBzaW11bGF0b3I7IGFzc3VtaW5nIGRhdGEgaXMgY29ubmVjdGVkIik7CiAgICAgICAgIH0KIAorICAgICAgICBub3RpZnlEYXRhQXZhaWxhYmlsaXR5KG51bGwpOworCiAgICAgICAgIGlmIChzdGF0ZSAhPSBTdGF0ZS5JRExFKSB7CiAgICAgICAgICAgICBjbGVhblVwQ29ubmVjdGlvbih0cnVlLCBudWxsKTsKICAgICAgICAgfQpAQCAtNzYyLDcgKzc3NSw3IEBACiAgICAgICAgICAgICBvblJlc3RhcnRSYWRpbygpOwogICAgICAgICB9CiAKLSAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uKTsKKyAgICAgICAgbm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uKTsKICAgICAgICAgbUFjdGl2ZUFwbiA9IG51bGw7CiAgICAgICAgIGlmIChyZXRyeUFmdGVyRGlzY29ubmVjdGVkKHJlYXNvbikpIHsKICAgICA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pbVNtc0ludGVyZmFjZU1hbmFnZXIuamF2YQorKysgYi90ZWxlcGhvbnkvamF2YS9jb20vYW5kcm9pZC9pbnRlcm5hbC90ZWxlcGhvbnkvY2RtYS9SdWltU21zSW50ZXJmYWNlTWFuYWdlci5qYXZhCkBAIC02Nyw4ICs2Nyw3IEBACiAgICAgICAgICAgICAgICAgICAgIGFyID0gKEFzeW5jUmVzdWx0KW1zZy5vYmo7CiAgICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUxvY2spIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhci5leGNlcHRpb24gPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TbXMgID0gKExpc3Q8U21zUmF3RGF0YT4pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWlsZFZhbGlkUmF3RGF0YSgoQXJyYXlMaXN0PGJ5dGVbXT4pIGFyLnJlc3VsdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNtcyA9IGJ1aWxkVmFsaWRSYXdEYXRhKChBcnJheUxpc3Q8Ynl0ZVtdPikgYXIucmVzdWx0KTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoREJHKSBsb2coIkNhbm5vdCBsb2FkIFNtcyByZWNvcmRzIik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1TbXMgIT0gbnVsbCkKZGlmZiAtLWdpdCBhL3RlbGVwaG9ueS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3RlbGVwaG9ueS9jZG1hL1Ntc01lc3NhZ2UuamF2YSBiL3RlbGVwaG9ueS9qYXZhL2NvbS9hbmRyb2lkL2ludGVybmFsL3RlbGVwaG9ueS9jZG1hL1Ntc01lc3NhZ2UuamF2YQppbmRleCBiNTA1MDJjLi42NWQ4N2Y1IDEwMDc1NQotLS0gYS90ZWxlcGhvbnkv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T2ZBdmFpbGFiaWxpdHkocmVhc29uLCBmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBsb2cgKCJDcmVhdGUgZnJvbSBhbGxBcG5zIDogIiArIGFwbkxpc3RUb1N0cmluZyhhbGxBcG5zKSk7CkBAIC00NjEsMjIgKzQ4MCwxMSBAQAogICAgICAgICAgICAgaWYgKERCRykgewogICAgICAgICAgICAgICAgIGxvZyAoIlNldHVwIHdhaXRuZ0FwbnMgOiAiICsgYXBuTGlzdFRvU3RyaW5nKHdhaXRpbmdBcG5zKSk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gc2V0dXBEYXRhKHJlYXNvbik7CisgICAgICAgICAgICBib29sZWFuIHJldFZhbHVlID0gc2V0dXBEYXRhKHJlYXNvbik7CisgICAgICAgICAgICBub3RpZnlPZmZBcG5zT2ZBdmFpbGFiaWxpdHkocmVhc29uLCByZXRWYWx1ZSk7CisgICAgICAgICAgICByZXR1cm4gcmV0VmFsdWU7CiAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoREJHKQotICAgICAgICAgICAgICAgIGxvZygidHJ5U2V0dXBEYXRhOiBOb3QgcmVhZHkgZm9yIGRhdGE6ICIgKwotICAgICAgICAgICAgICAgICAgICAiIGRhdGFTdGF0ZT0iICsgc3RhdGUgKwotICAgICAgICAgICAgICAgICAgICAiIGdwcnNTdGF0ZT0iICsgZ3Byc1N0YXRlICsKLSAgICAgICAgICAgICAgICAgICAgIiBzaW09IiArIG1Hc21QaG9uZS5tU0lNUmVjb3Jkcy5nZXRSZWNvcmRzTG9hZGVkKCkgKwotICAgICAgICAgICAgICAgICAgICAiIFVNVFM9IiArIG1Hc21QaG9uZS5tU1NULmlzQ29uY3VycmVudFZvaWNlQW5kRGF0YSgpICsKLSAgICAgICAgICAgICAgICAgICAgIiBwaG9uZVN0YXRlPSIgKyBwaG9uZS5nZXRTdGF0ZSgpICsKLSAgICAgICAgICAgICAgICAgICAgIiBpc0RhdGFBbGxvd2VkPSIgKyBpc0RhdGFBbGxvd2VkKCkgKwotICAgICAgICAgICAgICAgICAgICAiIGRhdGFFbmFibGVkPSIgKyBnZXRBbnlEYXRhRW5hYmxlZCgpICsKLSAgICAgICAgICAgICAgICAgICAgIiByb2FtaW5nPSIgKyBwaG9uZS5nZXRTZXJ2aWNlU3RhdGUoKS5nZXRSb2FtaW5nKCkgKwotICAgICAgICAgICAgICAgICAgICAiIGRhdGFPblJvYW1pbmdFbmFibGU9IiArIGdldERhdGFPblJvYW1pbmdFbmFibGVkKCkgKwotICAgICAgICAgICAgICAgICAgICAiIHBzIHJlc3RyaWN0ZWQ9IiArIG1Jc1BzUmVzdHJpY3RlZCArCi0gICAgICAgICAgICAgICAgICAgICIgZGVzaXJlZFBvd2VyU3RhdGU9IiArIGRlc2lyZWRQb3dlclN0YXRlICsKLSAgICAgICAgICAgICAgICAgICAgIiBNYXN0ZXJEYXRhRW5hYmxlZD0iICsgbU1hc3RlckRhdGFFbmFibGVkKTsKKyAgICAgICAgICAgIG5vdGlmeU9mZkFwbnNPZkF2YWlsYWJpbGl0eShyZWFzb24sIGZhbHNlKTsKICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgfQogICAgIH0KQEAgLTU5NSw3ICs2MDMsNyBAQAogICAgICAgICBwZHAuY29ubmVjdChtc2csIGFwbik7CiAKICAgICAgICAgc2V0U3RhdGUoU3RhdGUuSU5JVElORyk7Ci0gICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CisgICAgICAgIG5vdGlmeURhdGFDb25uZWN0aW9uKHJlYXNvbik7CiAgICAgICAgIHJldHVybiB0cnVlOwogICAgIH0KIApAQCAtNzQ2LDcgKzc1NCw3IEBACiAKICAgICBwcml2YXRlIHZvaWQgbm90aWZ5RGVmYXVsdERhdGEoU3RyaW5nIHJlYXNvbikgewogICAgICAgICBzZXRTdGF0ZShTdGF0ZS5DT05ORUNURUQpOwotICAgICAgICBwaG9uZS5ub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOworICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihyZWFzb24pOwogICAgICAgICBzdGFydE5ldFN0YXRQb2xsKCk7CiAgICAgICAgIC8vIHJlc2V0IHJlY29ubmVjdCB0aW1lcgogICAgICAgICBtUmV0cnlNZ3IucmVzZXRSZXRyeUNvdW50KCk7CkBAIC03NTYsNyArNzY0LDcgQEAKICAgICBwcml2YXRlIHZvaWQgZ290b0lkbGVBbmROb3RpZnlEYXRhQ29ubmVjdGlvbihTdHJpbmcgcmVhc29uKSB7CiAgICAgICAgIGlmIChEQkcpIGxvZygiZ290b0lkbGVBbmROb3RpZnlEYXRhQ29ubmVjdGlvbjogcmVhc29uPSIgKyByZWFzb24pOwogICAgICAgICBzZXRTdGF0ZShTdGF0ZS5JRExFKTsKLSAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uKTsKKyAgICAgICAgbm90aWZ5RGF0YUNvbm5lY3Rpb24ocmVhc29uKTsKICAgICAgICAgbUFjdGl2ZUFwbiA9IG51bGw7CiAgICAgfQogCkBAIC05OTgsNyArMTAwNiw3IEBACiAgICAgICAgICAgICBpZiAoIW1SZXRyeU1nci5pc1JldHJ5TmVlZGVkKCkpIHsKICAgICAgICAgICAgICAgICBpZiAoIW1SZXF1ZXN0ZWRBcG5UeXBlLmVxdWFscyhQaG9uZS5BUE5fVFlQRV9ERUZBVUxUKSkgewogICAgICAgICAgICAgICAgICAgICAvLyBpZiBubyBtb3JlIHJldHJpZXMgb24gYSBzZWNvbmRhcnkgQVBOIGF0dGVtcHQsIHRlbGwgdGhlIHdvcmxkIGFuZCByZXZlcnQuCi0gICAgICAgICAgICAgICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKFBob25lLlJFQVNPTl9BUE5fRkFJTEVEKTsKKyAgICAgICAgICAgICAgICAgICAgbm90aWZ5RGF0YUNvbm5lY3Rpb24oUGhvbmUuUkVBU09OX0FQTl9GQUlMRUQpOwogICAgICAgICAgICAgICAgICAgICBvbkVuYWJsZUFwbihhcG5UeXBlVG9JZChtUmVxdWVzdGVkQXBuVHlwZSksIERJU0FCTEVEKTsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KQEAgLTEwOTEsNyArMTA5OSw3IEBACiAgICAgICAgICAgICAvLyBBc3N1bWUgZGF0YSBpcyBjb25uZWN0ZWQgb24gdGhlIHNpbXVsYXRvcgogICAgICAgICAgICAgLy8gRklYTUUgIHRoaXMgY2FuIGJlIGltcHJvdmVkCiAgICAgICAgICAgICBzZXRTdGF0ZShTdGF0ZS5DT05ORUNURUQpOwotICAgICAgICAgICAgcGhvbmUubm90aWZ5RGF0YUNvbm5lY3Rpb24obnVsbCk7CisgICAgICAgICAgICBub3RpZnlEYXRhQ29ubmVjdGlvbihudWxsKTsKIAogICAgICAgICAgICAgTG9nLmkoTE9HX1RBRywgIldlJ3JlIG9uIHRoZSBzaW11bGF0b3I7IGFzc3VtaW5nIGRhdGEgaXMgY29ubmVjdGVkIik7CiAgICAgICAgIH0KQEAgLTExNTgsNyArMTE2Niw3IEBACiAgICAgICAgICAgICBpZiAoY2F1c2UuaXNQZXJtYW5lbnRGYWlsKCkpIHsKICAgICAgICAgICAgICAgICBub3RpZnlOb0RhdGEoY2F1c2UpOwogICAgICAgICAgICAgICAgIGlmICghbVJlcXVlc3RlZEFwblR5cGUuZXF1YWxzKFBob25lLkFQTl9UWVBFX0RFRkFVTFQpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBob25lLm5vdGlmeURhdGFDb25uZWN0aW9uKFBob25lLlJFQVNPTl9BUE5fRkFJTEVEKTsKKyAgICAgICAgICAgICAgICAgICAgbm90aWZ5RGF0YUNvbm5lY3Rpb24oUGhvbmUuUkVBU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ICAgICAgYnl0ZSBwZHVbXTsKICAgICAgICAgaW50IGN1cjsKICAgICAgICAgU21zSGVhZGVyIHVzZXJEYXRhSGVhZGVyOwpAQCAtNDkwLDEwICs0ODksNiBAQAogICAgICAgICBpbnQgbVVzZXJEYXRhU2VwdGV0UGFkZGluZzsKICAgICAgICAgaW50IG1Vc2VyRGF0YVNpemU7CiAKLSAgICAgICAgUGR1UGFyc2VyKFN0cmluZyBzKSB7Ci0gICAgICAgICAgICB0aGlzKEljY1V0aWxzLmhleFN0cmluZ1RvQnl0ZXMocykpOwotICAgICAgICB9Ci0KICAgICAgICAgUGR1UGFyc2VyKGJ5dGVbXSBwZHUpIHsKICAgICAgICAgICAgIHRoaXMucGR1ID0gcGR1OwogICAgICAgICAgICAgY3VyID0gMDsKQEAgLTU0NSw3ICs1NDAsNyBAQAogICAgICAgICAgICAgR3NtU21zQWRkcmVzcyByZXQ7CiAKICAgICAgICAgICAgIC8vICJUaGUgQWRkcmVzcy1MZW5ndGggZmllbGQgaXMgYW4gaW50ZWdlciByZXByZXNlbnRhdGlvbiBvZgotICAgICAgICAgICAgLy8gdGhlIG51bWJlciBmaWVsZCwgaS5lLiBleGNsdWRlcyBhbnkgc2VtaSBvY3RldCBjb250YWluaW5nIG9ubHkKKyAgICAgICAgICAgIC8vIHRoZSBudW1iZXIgZmllbGQsIGkuZS4gZXhjbHVkZXMgYW55IHNlbWktb2N0ZXQgY29udGFpbmluZyBvbmx5CiAgICAgICAgICAgICAvLyBmaWxsIGJpdHMuIgogICAgICAgICAgICAgLy8gVGhlIFRPQSBmaWVsZCBpcyBub3QgaW5jbHVkZWQgYXMgcGFydCBvZiB0aGlzCiAgICAgICAgICAgICBpbnQgYWRkcmVzc0xlbmd0aCA9IHBkdVtjdXJdICYgMHhmZjsKQEAgLTU3Myw3ICs1NjgsNyBAQAogICAgICAgICAgICAgaW50IHNlY29uZCA9IEljY1V0aWxzLmdzbUJjZEJ5dGVUb0ludChwZHVbY3VyKytdKTsKIAogIC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gICAgICAgICAqIFJldHVybnMgdGhlIG51bWJlciBvZiBwYWRkaW5nIGJpdHMgYXQgdGhlIGJlZ2lubmluZyBvZiB0aGUgdXNlciBkYXRhCiAgICAgICAgICAqIGFycmF5IGJlZm9yZSB0aGUgc3RhcnQgb2YgdGhlIHNlcHRldHMuCiAgICAgICAgICAqCi0gICAgICAgICAqIEByZXR1cm4gdGhlIG51bWJlciBvZiBwYWRkaW5nIGJpdHMgYXQgdGhlIGJlZ2luaW5nIG9mIHRoZSB1c2VyIGRhdGEKKyAgICAgICAgICogQHJldHVybiB0aGUgbnVtYmVyIG9mIHBhZGRpbmcgYml0cyBhdCB0aGUgYmVnaW5uaW5nIG9mIHRoZSB1c2VyIGRhdGEKICAgICAgICAgICogYXJyYXkgYmVmb3JlIHRoZSBzdGFydCBvZiB0aGUgc2VwdGV0cwogICAgICAgICAgKi8KICAgICAgICAgaW50IGdldFVzZXJEYXRhU2VwdGV0UGFkZGluZygpIHsKQEAgLTY5NCw3ICs2ODksNyBAQAogICAgICAgICBYWFggTm90IHN1cmUgd2hhdCB0aGlzIG9uZSBpcyBzdXBwb3NlZCB0byBiZSBkb2luZywgYW5kIG5vIG9uZSBpcyB1c2luZwogICAgICAgICBpdC4KICAgICAgICAgU3RyaW5nIGdldFVzZXJEYXRhR1NNOGJpdCgpIHsKLSAgICAgICAgICAgIC8vIFN5c3RlbS5vdXQucHJpbnRsbigicmVtYWluZGVyIG9mIHB1ZDoiICsKKyAgICAgICAgICAgIC8vIFN5c3RlbS5vdXQucHJpbnRsbigicmVtYWluZGVyIG9mIHBkdToiICsKICAgICAgICAgICAgIC8vIEhleER1bXAuZHVtcEhleFN0cmluZyhwZHUsIGN1ciwgcGR1Lmxlbmd0aCAtIGN1cikpOwogICAgICAgICAgICAgaW50IGNvdW50ID0gcGR1W2N1cisrXSAmIDB4ZmY7CiAgICAgICAgICAgICBpbnQgc2l6ZSA9IHBkdVtjdXIrK107CkBAIC04MjUsMTEgKzgyMCwxMyBAQA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ogICAgICAqICBhci5leGNlcHRpb24gY2FycmllcyBleGNlcHRpb24gb24gZmFpbHVyZQotICAgICAqICBhci51c2VyT2JqZWN0IGNvbnRhaW5zIHRoZSBvcmlnbmFsIHZhbHVlIG9mIHJlc3VsdC5vYmoKKyAgICAgKiAgYXIudXNlck9iamVjdCBjb250YWlucyB0aGUgb3JpZ2luYWwgdmFsdWUgb2YgcmVzdWx0Lm9iagogICAgICAqICBhci5yZXN1bHQgaXMgbnVsbCBvbiBzdWNjZXNzIGFuZCBmYWlsdXJlCiAgICAgICoKICAgICAgKiBDTElSX0RFRkFVTFQgICAgID09IG9uICJ1c2Ugc3Vic2NyaXB0aW9uIGRlZmF1bHQgdmFsdWUiCkBAIC01MTMsNyArNTExLDcgQEAKICAgICAgKiAgcmV0dXJuZWQgbWVzc2FnZQogICAgICAqICByZXRNc2cub2JqID0gQXN5bmNSZXN1bHQgYXIKICAgICAgKiAgYXIuZXhjZXB0aW9uIGNhcnJpZXMgZXhjZXB0aW9uIG9uIGZhaWx1cmUKLSAgICAgKiAgYXIudXNlck9iamVjdCBjb250YWlucyB0aGUgb3JpZ25hbCB2YWx1ZSBvZiByZXN1bHQub2JqCisgICAgICogIGFyLnVzZXJPYmplY3QgY29udGFpbnMgdGhlIG9yaWdpbmFsIHZhbHVlIG9mIHJlc3VsdC5vYmoKICAgICAgKiAgYXIucmVzdWx0IGlzIFN0cmluZyBjb250YWluaW5nIElNU0kgb24gc3VjY2VzcwogICAgICAqLwogICAgIHB1YmxpYyB2b2lkIGdldElNU0koTWVzc2FnZSByZXN1bHQpIHsKQEAgLTUyNCw3ICs1MjIsNyBAQAogICAgICAqICByZXR1cm5lZCBtZXNzYWdlCiAgICAgICogIHJldE1zZy5vYmogPSBBc3luY1Jlc3VsdCBhcgogICAgICAqICBhci5leGNlcHRpb24gY2FycmllcyBleGNlcHRpb24gb24gZmFpbHVyZQotICAgICAqICBhci51c2VyT2JqZWN0IGNvbnRhaW5zIHRoZSBvcmlnbmFsIH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5zIHRoZSBvcmlnbmFsIHZhbHVlIG9mIHJlc3VsdC5vYmoKKyAgICAgKiAgYXIudXNlck9iamVjdCBjb250YWlucyB0aGUgb3JpZ2luYWwgdmFsdWUgb2YgcmVzdWx0Lm9iagogICAgICAqICBhci5yZXN1bHQgaXMgbnVsbCBvbiBzdWNjZXNzIGFuZCBmYWlsdXJlCiAgICAgICovCiAgICAgcHVibGljIHZvaWQgcmVqZWN0Q2FsbCAoTWVzc2FnZSByZXN1bHQpIHsKQEAgLTc4NSw3ICs3ODMsNyBAQAogICAgICAqCiAgICAgICogQHBhcmFtIHJlc3VsdCBpcyBjYWxsYmFjayBtZXNzYWdlCiAgICAgICogICAgICAgICgoQXN5bmNSZXN1bHQpcmVzcG9uc2Uub2JqKS5yZXN1bHQgIGlzIGFuIGludFtdIHdpdGggZXZlcnkKLSAgICAgKiAgICAgICAgZWxlbWVudCByZXByZXNlbnRpbmcgb25lIGF2aWFsYWJsZSBCTV8qX0JBTkQKKyAgICAgKiAgICAgICAgZWxlbWVudCByZXByZXNlbnRpbmcgb25lIGF2YWlsYWJsZSBCTV8qX0JBTkQKICAgICAgKi8KICAgICBwdWJsaWMgdm9pZCBxdWVyeUF2YWlsYWJsZUJhbmRNb2RlIChNZXNzYWdlIHJlc3VsdCkgewogICAgICAgICBpbnQgcmV0W10gPSBuZXcgaW50IFs0XTsKQEAgLTg0NCw3ICs4NDIsNiBAQAogICAgICAgICByZXRbMTFdID0gbnVsbDsKICAgICAgICAgcmV0WzEyXSA9IG51bGw7CiAgICAgICAgIHJldFsxM10gPSBudWxsOwotICAgICAgICByZXRbMTRdID0gbnVsbDsKIAogICAgICAgICByZXN1bHRTdWNjZXNzKHJlc3VsdCwgcmV0KTsKICAgICB9CkBAIC04OTUsNyArODkyLDcgQEAKIAogICAgIC8qKgogICAgICAqICBhci5leGNlcHRpb24gY2FycmllcyBleGNlcHRpb24gb24gZmFpbHVyZQotICAgICAqICBhci51c2VyT2JqZWN0IGNvbnRhaW5zI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VGV4dFdhdGNoZXIgPSBuZXcgVGV4dFdhdGNoZXIoKSB7CisgICAgICAgICAgICBwdWJsaWMgdm9pZCBhZnRlclRleHRDaGFuZ2VkKEVkaXRhYmxlIHMpIHsKKyAgICAgICAgICAgICAgICBzLmNsZWFyKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIGJlZm9yZVRleHRDaGFuZ2VkKENoYXJTZXF1ZW5jZSBzLCBpbnQgc3RhcnQsIGludCBjb3VudCwKKyAgICAgICAgICAgICAgICAgICAgaW50IGFmdGVyKSB7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uVGV4dENoYW5nZWQoQ2hhclNlcXVlbmNlIHMsIGludCBzdGFydCwgaW50IGJlZm9yZSwKKyAgICAgICAgICAgICAgICAgICAgaW50IGNvdW50KSB7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIGZpbmFsIFN0cmluZyBpbml0ID0gIig2NTApIDEyMyI7CisgICAgICAgIGZpbmFsIFN0cmluZyBleHBlY3RlZDEgPSAiIjsKKyAgICAgICAgVGV4dFdhdGNoZXIgdGV4dFdhdGNoZXIgPSBnZXRUZXh0V2F0Y2hlcigpOworCisgICAgICAgIFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIgbnVtYmVyID0gbmV3IFNwYW5uYWJsZVN0cmluZ0J1aWxkZXIoaW5pdCk7CisgICAgICAgIHRleHRXYXRjaGVyLmJlZm9yZVRleHRDaGFuZ2VkKG51bWJlciwgNSwgMCwgMSk7CisgICAgICAgIG51bWJlci5pbnNlcnQoNSwgIjQiKTsgLy8gKDY1MDQpIDEyMworICAgICAgICBTZWxlY3Rpb24uc2V0U2VsZWN0aW9uKG51bWJlciwgNSk7IC8vIG1ha2UgdGhlIGN1cnNvciBhdCByaWdodCBvZiA0CisgICAgICAgIHRleHRXYXRjaGVyLm9uVGV4dENoYW5nZWQobnVtYmVyLCA1LCAwLCAxKTsK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dGFydFNlcnZpY2UoSW50ZW50KX0gd2l0aAorICAgICAqIGFuIHtAbGluayBhbmRyb2lkLmNvbnRlbnQuSW50ZW50fSB0aGF0IGlkZW50aWZpZXMgYSBzZXJ2aWNlLgorICAgICAqIElmIHlvdSB1c2UgdGhpcyBtZXRob2QgdG8gc3RhcnQgdGhlIHNlcnZpY2UsIGl0IGlzIGF1dG9tYXRpY2FsbHkgc3RvcHBlZCBieQorICAgICAqIHtAbGluayAjdGVhckRvd259LgorICAgICAqCisgICAgICogQHBhcmFtIGludGVudCBBbiBJbnRlbnQgdGhhdCBpZGVudGlmaWVzIGEgc2VydmljZSwgb2YgdGhlIHNhbWUgZm9ybSBhcyB0aGUgSW50ZW50IHBhc3NlZCB0bworICAgICAqIHtAbGluayBhbmRyb2lkLmNvbnRlbnQuQ29udGV4dCNzdGFydFNlcnZpY2UoSW50ZW50KSBDb250ZXh0LnN0YXJ0U2VydmljZShJbnRlbnQpfS4KICAgICAgKi8KICAgICBwcm90ZWN0ZWQgdm9pZCBzdGFydFNlcnZpY2UoSW50ZW50IGludGVudCkgewogICAgICAgICBpZiAoIW1TZXJ2aWNlQXR0YWNoZWQpIHsKICAgICAgICAgICAgIHNldHVwU2VydmljZSgpOwogICAgICAgICB9CiAgICAgICAgIGFzc2VydE5vdE51bGwobVNlcnZpY2UpOwotICAgICAgICAKKwogICAgICAgICBpZiAoIW1TZXJ2aWNlQ3JlYXRlZCkgewogICAgICAgICAgICAgbVNlcnZpY2Uub25DcmVhdGUoKTsKICAgICAgICAgICAgIG1TZXJ2aWNlQ3JlYXRlZCA9IHRydWU7CiAgICAgICAgIH0KICAgICAgICAgbVNlcnZpY2Uub25TdGFydENvbW1hbmQoaW50ZW50LCAwLCBtU2VydmljZUlkKTsKLSAgICAgICAgCisKICAgICAgICAgbVNlcnZpY2VTdGFydGVkID0gdHJ1ZTsKICAgICB9Ci0gICAgCi0gICAgLyoqCi0gICAgICogU3RhcnQgdGhlIHNlcnZpY2UgdW5kZXI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ZGRQcm92aWRlcihTdHJpbmcgbmFtZSwgQ29udGVudFByb3ZpZGVyIHByb3ZpZGVyKSB7CisKKyAgICAgICAgLyoKKyAgICAgICAgICogTWFwcyB0aGUgYXV0aG9yaXR5IHRvIHRoZSBwcm92aWRlciBsb2NhbGx5LgorICAgICAgICAgKi8KICAgICAgICAgbVByb3ZpZGVycy5wdXQobmFtZSwgcHJvdmlkZXIpOwogICAgIH0KIAogICAgIC8qKiBAaGlkZSAqLwogICAgIEBPdmVycmlkZQogICAgIHByb3RlY3RlZCBJQ29udGVudFByb3ZpZGVyIGFjcXVpcmVQcm92aWRlcihDb250ZXh0IGNvbnRleHQsIFN0cmluZyBuYW1lKSB7CisKKyAgICAgICAgLyoKKyAgICAgICAgICogR2V0cyB0aGUgY29udGVudCBwcm92aWRlciBmcm9tIHRoZSBsb2NhbCBtYXAKKyAgICAgICAgICovCiAgICAgICAgIGZpbmFsIENvbnRlbnRQcm92aWRlciBwcm92aWRlciA9IG1Qcm92aWRlcnMuZ2V0KG5hbWUpOworCiAgICAgICAgIGlmIChwcm92aWRlciAhPSBudWxsKSB7CiAgICAgICAgICAgICByZXR1cm4gcHJvdmlkZXIuZ2V0SUNvbnRlbnRQcm92aWRlcigpOwogICAgICAgICB9IGVsc2UgewpAQCAtNjQsNyArOTQsMTggQEAKICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgfQogCisgICAgLyoqCisgICAgICogT3ZlcnJpZGVzIHtAbGluayBhbmRyb2lkLmNvbnRlbnQuQ29udGVudFJlc29sdmVyI25vdGlmeUNoYW5nZShVcmksIENvbnRlbnRPYnNlcnZlciwgYm9vbGVhbikKKyAgICAgKiBDb250ZW50UmVzb2x2ZXIubm90aWZDaGFuZ2UoVXJpLCBDb250ZW50T2JzZXJ2ZXIsIGJvb2xlYW4pfS4gQWxsIHBhcmFtZXRlcnMgYXJlIGlnbm9yZWQuCisgICAgICogVGhlIG1ldGhvZCBoaWRlcyBwcm92aWRlcnMgbGlua2VkIHRvI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Gxvbmcgb2xkVGltZSA9IDA7Ci0gICAgICAgIGxvbmcgbmV3VGltZSA9IDA7Ci0gICAgICAgIAotICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IElURVJBVElPTlM7IGorKykgewotICAgICAgICAgICAgbG9uZyB0MCA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwotICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCA0OyBpKyspIHsKLSAgICAgICAgICAgICAgICBvbGREaWdlc3QudXBkYXRlKGRhdGEsIDAsIGRhdGEubGVuZ3RoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGludCBvbGRMZW5ndGggPSBvbGREaWdlc3QuZG9GaW5hbChvbGRIYXNoLCAwKTsKLSAgICAgICAgICAgIGxvbmcgdDEgPSBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKTsKLSAgICAKLSAgICAgICAgICAgIG9sZFRpbWUgPSBvbGRUaW1lICsgKHQxIC0gdDApOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBsb25nIHQyID0gU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCk7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDQ7IGkrKykgewotICAgICAgICAgICAgICAgIG5ld0RpZ2VzdC51cGRhdGUoZGF0YSwgMCwgZGF0YS5sZW5ndGgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaW50IG5ld0xlbmd0aCA9IG5ld0RpZ2VzdC5kb0ZpbmFsKG5ld0hhc2gsIDApOwotICAgICAgICAgICAgbG9uZyB0MyA9IFN5c3RlbS5jdXJyZW50VGltZU1pbGxpcygpOwotCi0gICAgICAgICAgICBuZXdUaW1lID0gbmV3VGltZSArICh0MyAtIHQyKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgQXNzZXJ0LmFzc2VydEVxdWFscygiSGFzaCBzaXplcyBtdXN0IGJlIGVxdWFsIiwgb2xkTGVuZ3RoLCBuZXdMZW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pYyBmaW5hbCBpbnQgU0VUX1hTU19BVURJVE9SX0VOQUJMRUQgPSA0NjsKICAgICAKICAgICBDYWxsYmFja1Byb3h5KEV2ZW50U2VuZGVyIGV2ZW50U2VuZGVyLCAKICAgICAgICAgICAgIExheW91dFRlc3RDb250cm9sbGVyIGxheW91dFRlc3RDb250cm9sbGVyKSB7CkBAIC0xNzgsNiArMTgwLDEwIEBACiAgICAgICAgICAgICBtTGF5b3V0VGVzdENvbnRyb2xsZXIuZHVtcEFzVGV4dCgpOwogICAgICAgICAgICAgYnJlYWs7CiAKKyAgICAgICAgY2FzZSBMQVlPVVRfRFVNUF9DSElMRF9GUkFNRVNfVEVYVDoKKyAgICAgICAgICAgIG1MYXlvdXRUZXN0Q29udHJvbGxlci5kdW1wQ2hpbGRGcmFtZXNBc1RleHQoKTsKKyAgICAgICAgICAgIGJyZWFrOworCiAgICAgICAgIGNhc2UgTEFZT1VUX0RVTVBfSElTVE9SWToKICAgICAgICAgICAgIG1MYXlvdXRUZXN0Q29udHJvbGxlci5kdW1wQmFja0ZvcndhcmRMaXN0KCk7CiAgICAgICAgICAgICBicmVhazsKQEAgLTI3Myw2ICsyNzksMTAgQEAKICAgICAgICAgICAgIGJvb2xlYW4gdmFsdWUgPSBtc2cuZ2V0RGF0YSgpLmdldEJvb2xlYW4oInZhbHVlIik7CiAgICAgICAgICAgICBtTGF5b3V0VGVzdENvbnRyb2xsZXIub3ZlcnJpZGVQcmVmZXJlbmNlKGtleSwgdmFsdWUpOwogICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBTRVRfWFNTX0FVRElUT1JfRU5BQkxFRDoKKyAgICAgICAgICAgIG1MYXlvdXRUZXN0Q29udHJvbGxlci5zZXRYU1NBdWRpdG9yRW5hYmxlZChtc2cuYXJnMSA9PSAxKTsKKyAgICAgICAgICAgIGJyZWFrOwogICAgICAgICB9CiAgICAgfQogCkBAIC0zODAsNiArMzkwLDEwIEBACiAgICAgICAgIG9idGFpbk1l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iU2VhcmNoaW5nIHRlc3RzIHVuZGVyICIgKyBkaXIpOwogCiAgICAgICAgIEZpbGUgZCA9IG5ldyBGaWxlKGRpcik7CkBAIC02MSw3ICs2Niw3IEBACiAgICAgICAgICAgICAgICAgLy8gSWYgdGhpcyBpcyBub3QgYSB0ZXN0IGRpcmVjdG9yeSwgd2UgZG9uJ3QgcmVjdXJzZSBpbnRvIGl0LgogICAgICAgICAgICAgICAgIGlmICghRmlsZUZpbHRlci5pc05vblRlc3REaXIocykpIHsKICAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiUmVjdXJzaW5nIG9uICIgKyBzKTsKLSAgICAgICAgICAgICAgICAgICAgZmluZExheW91dFRlc3RzUmVjdXJzaXZlbHkoYm9zLCBzLCBpZ25vcmVSZXN1bHRzSW5EaXIpOworICAgICAgICAgICAgICAgICAgICB0ZXN0Q291bnQgKz0gd3JpdGVMYXlvdXRUZXN0TGlzdFJlY3Vyc2l2ZWx5KGJvcywgcywgaWdub3JlUmVzdWx0c0luRGlyKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICB9CkBAIC04MSw4ICs4NiwxMCBAQAogICAgICAgICAgICAgICAgICAgICBib3Mud3JpdGUoKCIgSUdOT1JFX1JFU1VMVCIpLmdldEJ5dGVzKCkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBib3Mud3JpdGUoJ1xuJyk7CisgICAgICAgICAgICAgICAgdGVzdENvdW50Kys7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRlc3RDb3VudDsKICAgICB9CiAKICAgICBwdWJsaWMgc3RhdGljIHZvaWQgdXBkYXRlVGVzdFN0YXR1cyhTdHJpbmcgc3RhdHVzRmlsZSwgU3RyaW5nIHMpIHsKZGlmZiAtLWdpdCBhL3Rlc3RzL0R1bXBSZW5kZXJUcmVlL3NyYy9jb20vYW5kcm9pZC9k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5naW5lLgotICAgICAgICBtSnNFbmdpbmUgPSBydW5uZXIubUpzRW5naW5lID09IG51bGwgPyAianNjIiA6IHJ1bm5lci5tSnNFbmdpbmU7CisgICAgICAgIC8vIFY4IGlzIHRoZSBkZWZhdWx0IEphdmFTY3JpcHQgZW5naW5lLgorICAgICAgICBtSnNFbmdpbmUgPSBydW5uZXIubUpzRW5naW5lID09IG51bGwgPyAidjgiIDogcnVubmVyLm1Kc0VuZ2luZTsKIAogICAgICAgICBpbnQgdGltZW91dCA9IHJ1bm5lci5tVGltZW91dEluTWlsbGlzOwogICAgICAgICBpZiAodGltZW91dCA8PSAwKSB7CkBAIC0zOTEsNyArMzg1LDcgQEAKICAgICAgICAgICAgIHJlc3VtZVRlc3RMaXN0KCk7CiAKICAgICAgICAgVGVzdFNoZWxsQWN0aXZpdHkgYWN0aXZpdHkgPSBnZXRBY3Rpdml0eSgpOwotICAgICAgICBhY3Rpdml0eS5zZXREZWZhdWx0RHVtcERhdGFUeXBlKER1bXBEYXRhVHlwZS5EVU1QX0FTX1RFWFQpOworICAgICAgICBhY3Rpdml0eS5zZXREZWZhdWx0RHVtcERhdGFUeXBlKER1bXBEYXRhVHlwZS5FWFRfUkVQUik7CiAKICAgICAgICAgLy8gUnVuIHRlc3RzLgogICAgICAgICBpbnQgYWRkciA9IC0xOwpAQCAtNDA4LDcgKzQwMiw5IEBACiAgICAgICAgICAgICBib29sZWFuIGlnbm9yZVJlc3VsdCA9IG1UZXN0TGlzdElnbm9yZVJlc3VsdC5lbGVtZW50QXQoaSk7CiAgICAgICAgICAgICBGc1V0aWxzLnVwZGF0ZVRlc3RTdGF0dXMoVEVTVF9TVEFUVVNfRklMRSwgcyk7CiAgICAgICAgICAgICAvLyBSdW4gdGVzdHMKLSAgICAgICAgICAgIHJ1blRlc3RBbmRXYWl0VW50aWxEb25lKGFjdGl2aXR5LCBzLCBydW5uZXIubVRpbWVvdXRJbk1pbGxpcywgaWdub3JlUmVzdWx0KTsKKyAgICAgICAg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F0YVR5cGUuRFVNUF9BU19URVhUOworICAgICAgICBtRHVtcFRvcEZyYW1lQXNUZXh0ID0gdHJ1ZTsKICAgICAgICAgaWYgKG1XZWJWaWV3ICE9IG51bGwpIHsKICAgICAgICAgICAgIFN0cmluZyB1cmwgPSBtV2ViVmlldy5nZXRVcmwoKTsKICAgICAgICAgICAgIExvZy52KExPR1RBRywgImR1bXBBc1RleHQgY2FsbGVkOiAiK3VybCk7CiAgICAgICAgIH0KICAgICB9CiAKKyAgICBwdWJsaWMgdm9pZCBkdW1wQ2hpbGRGcmFtZXNBc1RleHQoKSB7CisgICAgICAgIG1EdW1wRGF0YVR5cGUgPSBEdW1wRGF0YVR5cGUuRFVNUF9BU19URVhUOworICAgICAgICBtRHVtcENoaWxkRnJhbWVzQXNUZXh0ID0gdHJ1ZTsKKyAgICAgICAgaWYgKG1XZWJWaWV3ICE9IG51bGwpIHsKKyAgICAgICAgICAgIFN0cmluZyB1cmwgPSBtV2ViVmlldy5nZXRVcmwoKTsKKyAgICAgICAgICAgIExvZy52KExPR1RBRywgImR1bXBDaGlsZEZyYW1lc0FzVGV4dCBjYWxsZWQ6ICIrdXJsKTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIHB1YmxpYyB2b2lkIHdhaXRVbnRpbERvbmUoKSB7CiAgICAgICAgIG1XYWl0VW50aWxEb25lID0gdHJ1ZTsKICAgICAgICAgU3RyaW5nIHVybCA9IG1XZWJWaWV3LmdldFVybCgpOwpAQCAtMzQ3LDcgKzM3MCw5IEBACiAgICAgICAgIExvZy52KExPR1RBRywgIm5vdGlmeURvbmUgY2FsbGVkOiAiICsgdXJsKTsKICAgICAgICAgaWYgKG1XYWl0VW50aWxEb25lKSB7CiAgICAgICAgICAgICBtV2FpdFVudGlsRG9uZSA9IGZhbHNlOwotICAgICAgICAgICAgbUNocm9tZUNsaWVudC5vblByb2dyZXNzQ2hhbmdlZChtV2ViVmlldywgMTAxKTsKKyAgICAgICAgICAgIGlmICghbVJlcXVlc3R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gICAgICAgICAgLy8gZHVtcCB0aGUgcGFnZS4KICAgICAgICAgICAgIGlmIChmaW5pc2hlZCgpKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIW1XYWl0VW50aWxEb25lICYmICFtUmVxdWVzdGVkV2ViS2l0RGF0YSAmJiAhbVRpbWVkT3V0KSB7CisgICAgICAgICAgICAgICAgcmVxdWVzdFdlYktpdERhdGEoKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKG1XYWl0VW50aWxEb25lKSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgInBhZ2UgZmluaXNoZWQgbG9hZGluZyBidXQgd2FpdGluZyBmb3Igbm90aWZ5RG9uZSB0byBiZSBjYWxsZWQ6ICIgKyB1cmwpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChtUmVxdWVzdGVkV2ViS2l0RGF0YSkgeworICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJwYWdlIGZpbmlzaGVkIGxvYWRpbmcgYnV0IHdlYmtpdCBkYXRhIGhhcyBhbHJlYWR5IGJlZW4gcmVxdWVzdGVkOiAiICsgdXJsKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAobVRpbWVkT3V0KSB7CisgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgInBhZ2UgZmluaXNoZWQgbG9hZGluZyBidXQgYWxyZWFkeSB0aW1lZCBvdXQ6ICIgKyB1cmwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgc3VwZXIub25QYWdlRmluaXNoZWQodmlldywgdXJsKTsKICAgICAgICAgfQogCkBAIC01MzUsNDQgKzU4Myw4IEBACiAKICAgICBwcml2YXRlIGZpbmFsIFdlYkNocm9tZUNsaWVudCBtQ2hyb21lQ2xpZW50ID0gbm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gIFN0cmluZyB1cmwgPSBtV2ViVmlldy5nZXRVcmwoKTsKLSAgICAgICAgICAgICAgICAgICAgTG9nLnYoTE9HVEFHLCAiRmluaXNoZWQ6ICIrIHVybCk7Ci0gICAgICAgICAgICAgICAgICAgIHJlcXVlc3RXZWJLaXREYXRhKCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHVybCA9IG1XZWJWaWV3LmdldFVybCgpOwotICAgICAgICAgICAgICAgICAgICBpZiAobVRpbWVkT3V0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJUaW1lZCBvdXQgYmVmb3JlIGZpbmlzaGluZzogIiArIHVybCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVdhaXRVbnRpbERvbmUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KExPR1RBRywgIldhaXRpbmcgZm9yIG5vdGlmeURvbmU6ICIgKyB1cmwpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1SZXF1ZXN0ZWRXZWJLaXREYXRhKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJSZXF1ZXN0ZWQgd2Via2l0IGRhdGEgcmVhZHk6ICIgKyB1cmwpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZWRUaXRsZShXZWJWaWV3IHZpZXcsIFN0cmluZyB0aXRsZSkgewotICAgICAgICAgICAgaWYgKHRpdGxlLmxlbmd0aCgpID4gMzApCi0gICAgICAgICAgICAgICAgdGl0bGUgPSAiLi4uIit0aXRsZS5zdWJzdHJpbmcodGl0bGUubGVuZ3RoKCktMzApOwotICAgICAgICAgICAgc2V0VGl0bGUodGl0bGUpOworICAgICAgICAgICAgc2V0VGl0bGUoIlRlc3QgIiArIG1DdXJyZW50VGVzdE51bWJlciArICIgb2YgIiArIG1Ub3RhbFRlc3RDb3VudCArICI6ICIrIHRpdGxlKTsKICAgICAgICAgICAgIGlmIChtRHVtcFRpdGxlQ2hhbmdlcykgewogICAgICAgICAgICAgICAgIG1UaXRsZUNoYW5nZXMuYXBwZW5kKCJUSVRMRSBDSEFOR0VEOiAiKTsKICAgICAgICAgICAgICAgICBtVGl0bGVDaGFuZ2VzLmFwcGVuZCh0aXRsZSk7CkBAIC02NzUsMTUgKzY4NywyOCBAQAogICAgICAgICB9CiAKICAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgIHB1YmxpYyB2b2lkIG9uQ29uc29sZU1lc3NhZ2UoU3RyaW5nIG1lc3NhZ2UsIGludCBsaW5lTnVtYmVyLAotICAgICAgICAgICAgICAgIFN0cmluZyBzb3VyY2VJRCkgeworICAgICAgICBwdWJsaWMgYm9vbGVhbiBvbkNvbnNvbGVNZXNzYWdlKENvbnNvbGVNZXNzYWdlIGNvbnNvbGVNZXNzYWdlKSB7CisgICAgICAgICAgICBTdHJpbmcgbXNnID0gIkNPTlNPTEUgTUVTU0FHRTogbGluZSAiICsgY29uc29sZU1lc3NhZ2UubGluZU51bWJlcigpICsgIjogIgorICAgICAgICAgICAgICAgICAgICArIGNvbnNvbGVNZXNzYWdlLm1lc3NhZ2UoKSArICJcbiI7CiAgICAgICAgICAgICBpZiAobUNvbnNvbGVNZXNzYWdlcyA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgbUNvbnNvbGVNZXNzYWdlcyA9IG5ldyBTdHJpbmdCdWZmZXIoKTsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIFN0cmluZyBjb25zb2xlTWVzc2FnZSA9ICJDT05TT0xFIE1FU1NBR0U6IGxpbmUgIgotICAgICAgICAgICAgICAgICAgICArIGxpbmVOdW1iZXIgKyI6ICIrIG1lc3NhZ2UgKyJcbi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WVkKG5ldyBSdW5uYWJsZSgpIHsKKyAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbm90aWZ5RG9uZSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwgNTAwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9CiAKICAgICAgICAgQE92ZXJyaWRlCkBAIC03MjksNiArNzU0LDggQEAKICAgICBwcml2YXRlIHZvaWQgcmVzZXRUZXN0U3RhdHVzKCkgewogICAgICAgICBtV2FpdFVudGlsRG9uZSA9IGZhbHNlOwogICAgICAgICBtRHVtcERhdGFUeXBlID0gbURlZmF1bHREdW1wRGF0YVR5cGU7CisgICAgICAgIG1EdW1wVG9wRnJhbWVBc1RleHQgPSBmYWxzZTsKKyAgICAgICAgbUR1bXBDaGlsZEZyYW1lc0FzVGV4dCA9IGZhbHNlOwogICAgICAgICBtVGltZWRPdXQgPSBmYWxzZTsKICAgICAgICAgbUR1bXBUaXRsZUNoYW5nZXMgPSBmYWxzZTsKICAgICAgICAgbVJlcXVlc3RlZFdlYktpdERhdGEgPSBmYWxzZTsKQEAgLTczOCwxMCArNzY1LDEwIEBACiAgICAgICAgIG1FdmVudFNlbmRlci5jbGVhclRvdWNoUG9pbnRzKCk7CiAgICAgICAgIG1FdmVudFNlbmRlci5jbGVhclRvdWNoTWV0YVN0YXRlKCk7CiAgICAgICAgIG1QYWdlRmluaXNoZWQgPSBmYWxzZTsKLSAgICAgICAgbU9uZUh1bmRyZWRQZXJjZW50Q29tcGxldGUgPSBmYWxzZTsKICAgICAgICAgbUR1bXBXZWJLaXREYXRhID0gZmFsc2U7CiAgICAgICAgIG1HZXREcmF3dGltZSA9IGZhbHNlOwogICAgICAgICBtU2F2ZUltYWdlUGF0aCA9IG51bGw7CisgICAgICAgIHNldERlZmF1bHRXZWJTZXR0aW5ncyhtV2ViVmlld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jZWxlcmF0ZWQ9InRydWUiPgorCisgICAgICAgIDxhY3Rpdml0eQorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bmFtZT0iQWxwaGFMYXllcnNBY3Rpdml0eSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxhYmVsPSJfzrFMYXllcnMiPgorICAgICAgICAgICAgPGludGVudC1maWx0ZXI+CisgICAgICAgICAgICAgICAgPGFjdGlvbiBhbmRyb2lkOm5hbWU9ImFuZHJvaWQuaW50ZW50LmFjdGlvbi5NQUlOIiAvPgorICAgICAgICAgICAgICAgIDxjYXRlZ29yeSBhbmRyb2lkOm5hbWU9ImFuZHJvaWQuaW50ZW50LmNhdGVnb3J5LkxBVU5DSEVSIiAvPgorICAgICAgICAgICAgPC9pbnRlbnQtZmlsdGVyPgorICAgICAgICA8L2FjdGl2aXR5PgorICAgICAgICAKKyAgICAgICAgPGFjdGl2aXR5CisgICAgICAgICAgICAgICAgYW5kcm9pZDpuYW1lPSJMYXllcnNBY3Rpdml0eSIKKyAgICAgICAgICAgICAgICBhbmRyb2lkOmxhYmVsPSJfTGF5ZXJzIgorICAgICAgICAgICAgICAgIGFuZHJvaWQ6dGhlbWU9IkBhbmRyb2lkOnN0eWxlL1RoZW1lLlRyYW5zbHVjZW50Lk5vVGl0bGVCYXIiPgorICAgICAgICAgICAgPGludGVudC1maWx0ZXI+CisgICAgICAgICAgICAgICAgPGFjdGlvbiBhbmRyb2lkOm5hbWU9ImFuZHJvaWQuaW50ZW50LmFjdGlvbi5NQUlOIiAvPgorICAgICAgICAgICAgICAgIDxjYXRlZ29yeSBhbmRyb2lkOm5hbWU9ImFuZHJvaWQuaW50ZW50LmNhdGVnb3J5LkxBVU5DSEVSIiAvPgorICAgICAgICAgICAgPC9pbnRlbnQtZmlsdGVyPgorICAgICAgICA8L2FjdGl2aXR5PgorCisgICAgICAgIDxhY3Rpdml0eQorICAgICAgICAgICAgICAgIGFuZHJvaWQ6bmFtZT0iWGZlcm1vZGVBY3R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IChjLmdldFJlc291cmNlcygpLmdldERpc3BsYXlNZXRyaWNzKCkuZGVuc2l0eSAqIGRpcCArIDAuNWYpOworICAgIH0KKworICAgIHN0YXRpYyBjbGFzcyBDb2xvclZpZXcgZXh0ZW5kcyBWaWV3IHsKKyAgICAgICAgQ29sb3JWaWV3KENvbnRleHQgYykgeworICAgICAgICAgICAgc3VwZXIoYyk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgb25EcmF3KENhbnZhcyBjYW52YXMpIHsKKyAgICAgICAgICAgIHN1cGVyLm9uRHJhdyhjYW52YXMpOworICAgICAgICAgICAgY2FudmFzLmRyYXdSR0IoMCwgMjU1LCAwKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHN0YXRpYyBjbGFzcyBEaXJ0eUJpdG1hcFZpZXcgZXh0ZW5kcyBGcmFtZUxheW91dCB7CisgICAgICAgIHByaXZhdGUgZmluYWwgUGFpbnQgbVBhaW50OworCisgICAgICAgIERpcnR5Qml0bWFwVmlldyhDb250ZXh0IGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGMpOworICAgICAgICAgICAgbVBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIHZvaWQgZGlzcGF0Y2hEcmF3KENhbnZhcyBjYW52YXMpIHsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UkdCKDI1NSwgMjU1LCAyNTUpOworCisgICAgICAgICAgICBtUGFpbnQuc2V0Q29sb3IoMHhmZmZmMDAwMCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMjAwLjBmLCAwLjBmLCAyMjAuMGYsIDIwLjBmLCBtUGFpbnQpOworCisgICAgICAgICAgICBjYW52YXMuc2F2ZSgpOworICAgICAgICAgICAgY2FudmFzLmNsaXBSZWN0KDIwLjBmLCAwLjBmLCA0MC4wZiwgMjAuMGYpOworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgImNsaXBSZWN0ID0gIiArIGNhbnZhcy5nZXRDbGlwQm91bmRzKCkpOworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgInJlamVjdGVkID0gIiArIGNhbnZhcy5xdWlja1JlamVjdCgxMDAuMGYsIDEwMC4wZiwgMTEwLjBmLCAxMTAuMGYsCisgICAgICAgICAgICAgICAgICAgIENhbnZhcy5FZGdlVHlwZS5CVykpOworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgInJlamVjdGVkID0gIiArIGNhbnZhcy5xdWlja1JlamVjdCgyNS4wZiwgNS4wZiwgMzAuMGYsIDEwLjBmLAorICAgICAgICAgICAgICAgICAgICBDYW52YXMuRWRnZVR5cGUuQlcpKTsKKyAgICAgICAgICAgIGNhbnZhcy5yZXN0b3JlKCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGNhbnZhcy5zYXZlKCk7CisgICAgICAgICAgICBjYW52YXMuc2NhbGUoMi4wZiwgMi4wZik7CisgICAgICAgICAgICBjYW52YXMuY2xpcFJlY3QoMjAuMGYsIDAuMGYsIDQwLjBmLCAyMC4wZik7CisgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAiY2xpcFJlY3QgPSAiICsgY2FudmFzLmdldENsaXBCb3VuZHMoKSk7CisgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAicmVqZWN0ZWQgPSAiICsgY2FudmFzLnF1aWNrUmVqZWN0KDUwLjBmLCA1MC4wZiwgNjAuMGYsIDYwLjBmLAorICAgICAgICAgICAgICAgICAgICBDYW52YXMuRWRnZVR5cGUuQlcpKTsKKyAgICAgICAgICAgIExvZy5kKExPR19UQUcsICJyZWplY3RlZCA9ICIgKyBjYW52YXMucXVpY2tSZWplY3QoMjUuMGYsIDUuMGYsIDMwLjBmLCAxMC4wZiwKKyAgICAgICAgICAgICAgICAgICAgQ2FudmFzLkVkZ2VUeXBlLkJXKSk7CisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworCisgICAgICAgICAgICBjYW52YXMuc2F2ZSgpOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgyMC4wZiwgMjAuMGYpOworICAgICAgICAgICAgY2FudmFzLmNsaXBSZWN0KDIwLjBmLCAwLjBmLCA0MC4wZiwgMjAuMGYpOworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgImNsaXBSZWN0ID0gIiArIGNhbnZhcy5nZXRDbGlwQm91bmRzKCkpOworICAgICAgICAgICAgTG9nLmQoTE9HX1RBRywgInJlamVjdGVkID0gIiArIGNhbnZhcy5xdWlja1JlamVjdCg4MC4wZiwgODAuMGYsIDkwLjBmLCA5MC4wZiwKKyAgICAgICAgICAgICAgICAgICAgQ2FudmFzLkVkZ2VUeXBlLkJXKSk7CisgICAgICAgICAgICBMb2cuZChMT0dfVEFHLCAicmVqZWN0ZWQgPSAiICsgY2FudmFzLnF1aWNrUmVqZWN0KDI1LjBmLCA1LjBmLCAzMC4wZiwgMTAuMGYsCisgICAgICAgICAgICAgICAgICAgIENhbnZhcy5FZGdlVHlwZS5CVykpOworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmUoKTsKKworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKyAgICAgICAgICAgIGNhbnZhcy5zY2FsZSgyLjBmLCAyLjBmKTsgICAgICAgICAgICAKKyAgICAgICAgICAgIGNhbnZhcy5jbGlwUmVjdCgyMC4wZiwgMC4wZiwgNDAuMGYsIDIwLjBmKTsKKworICAgICAgICAgICAgbVBhaW50LnNldENvbG9yKDB4ZmYwMGZmMDApOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDAuMGYsIDAuMGYsIDIwLjBmLCAyMC4wZiwgbVBhaW50KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbVBhaW50LnNldENvbG9yKDB4ZmYwMDAwZmYpOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDIwLjBmLCAwLjBmLCA0MC4wZiw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udGVudFZpZXcodmlldyk7CisgICAgICAgIAorICAgICAgICBTY2FsZUFuaW1hdGlvbiBhID0gbmV3IFNjYWxlQW5pbWF0aW9uKDEuMGYsIDIuMGYsIDEuMGYsIDIuMGYsCisgICAgICAgICAgICAgICAgU2NhbGVBbmltYXRpb24uUkVMQVRJVkVfVE9fU0VMRiwgMC41ZiwKKyAgICAgICAgICAgICAgICBTY2FsZUFuaW1hdGlvbi5SRUxBVElWRV9UT19TRUxGLDAuNWYpOworICAgICAgICBhLnNldER1cmF0aW9uKDIwMDApOworICAgICAgICBhLnNldFJlcGVhdENvdW50KEFuaW1hdGlvbi5JTkZJTklURSk7CisgICAgICAgIGEuc2V0UmVwZWF0TW9kZShBbmltYXRpb24uUkVWRVJTRSk7CisgICAgICAgIHZpZXcuc3RhcnRBbmltYXRpb24oYSk7CisgICAgfQorCisgICAgc3RhdGljIGNsYXNzIEJpdG1hcHNWaWV3IGV4dGVuZHMgVmlldyB7CisgICAgICAgIHByaXZhdGUgUGFpbnQgbUJpdG1hcFBhaW50OworICAgICAgICBwcml2YXRlIGZpbmFsIEJpdG1hcCBtQml0bWFwMTsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBCaXRtYXAgbUJpdG1hcDI7CisKKyAgICAgICAgQml0bWFwc1ZpZXcoQ29udGV4dCBjKSB7CisgICAgICAgICAgICBzdXBlcihjKTsKKworICAgICAgICAgICAgbUJpdG1hcDEgPSBCaXRtYXBGYWN0b3J5LmRlY29kZVJlc291cmNlKGMuZ2V0UmVzb3VyY2VzKCksIFIuZHJhd2FibGUuc3Vuc2V0MSk7CisgICAgICAgICAgICBtQml0bWFwMiA9IEJpdG1hcEZhY3RvcnkuZGVjb2RlUmVzb3VyY2UoYy5nZXRSZXNvdXJjZXMoKSwgUi5kcmF3YWJsZS5zdW5zZXQyKTsKKworICAgICAgICAgICAgbUJpdG1hcFBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgb25EcmF3KENhbnZhcyBjYW52YXMpIHsKKyAgICAgICAgICAgIHN1cGVyLm9uRHJhdyhjYW52YXMpOworCisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDEyMC4wZiwgNTAuMGYpOworICAgICAgICAgICAgY2FudmFzLmRyYXdCaXRtYXAobUJpdG1hcDEsIDAuMGYsIDAuMGYsIG1CaXRtYXBQYWludCk7CisKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgbUJpdG1hcDEuZ2V0SGVpZ2h0KCkpOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCAyNS4wZik7CisgICAgICAgICAgICBjYW52YXMuZHJhd0JpdG1hcChtQml0bWFwMiwgMC4wZiwgMC4wZiwgbnVsbCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIG1CaXRtYXBQYWludC5zZXRBbHBoYSgxMjcpOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCBtQml0bWFwMi5nZXRIZWlnaHQoKSk7CisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAuMGYsIDI1LjBmKTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3Qml0bWFwKG1CaXRtYXAxLCAwLjBmLCAwLjBmLCBtQml0bWFwUGFpbnQpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtQml0bWFwUGFpbnQuc2V0QWxwaGEoMjU1KTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgbUJpdG1hcDEuZ2V0SGVpZ2h0KCkpOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCAyNS4wZik7CisgICAgICAgICAgICBtQml0bWFwUGFpbnQuc2V0Q29sb3IoMHhmZmZmMDAwMCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgbUJpdG1hcDIuZ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worICAgICAgICAgICAgbUJpdG1hcFBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICBtQml0bWFwUGFpbnQuc2V0RmlsdGVyQml0bWFwKHRydWUpOworCisgICAgICAgICAgICBmaW5hbCBmbG9hdCBmb3VydGggPSBtQml0bWFwMS5nZXRXaWR0aCgpIC8gNC4wZjsKKyAgICAgICAgICAgIGZpbmFsIGZsb2F0IGhhbGYgPSBtQml0bWFwMS5nZXRIZWlnaHQoKSAvIDIuMGY7CisgICAgICAgICAgICBtU3JjUmVjdCA9IG5ldyBSZWN0KChpbnQpIGZvdXJ0aCwgKGludCkgKGhhbGYgLSBoYWxmIC8gMi4wZiksCisgICAgICAgICAgICAgICAgICAgIChpbnQpIChmb3VydGggKyBmb3VydGgpLCAoaW50KSAoaGFsZiArIGhhbGYgLyAyLjBmKSk7CisgICAgICAgICAgICBtRHN0UmVjdCA9IG5ldyBSZWN0Rihmb3VydGgsIGhhbGYgLSBoYWxmIC8gMi4wZiwgZm91cnRoICsgZm91cnRoLCBoYWxmICsgaGFsZiAvIDIuMGYpOworICAgICAgICAgICAgbURzdFJlY3QyID0gbmV3IFJlY3RGKGZvdXJ0aCwgaGFsZiAtIGhhbGYgLyAyLjBmLAorICAgICAgICAgICAgICAgICAgICAoZm91cnRoICsgZm91cnRoKSAqIDMuMGYsIChoYWxmICsgaGFsZiAvIDIuMGYpICogMy4wZik7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgb25EcmF3KENhbnZhcyBjYW52YXMpIHsKKyAgICAgICAgICAgIHN1cGVyLm9uRHJhdyhjYW52YXMpOworCisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDEyMC4wZiwgNTAuMGYpOworICAgICAgICAgICAgY2FudmFzLmRyYXdCaXRtYXAobUJpdG1hcDEsIG1TcmNSZWN0LCBtRHN0UmVjdCwgbUJpdG1hcFBhaW50KTsKKworICAgICAgICAgICAgY2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WQgdm9pZCBvbkNyZWF0ZShCdW5kbGUgc2F2ZWRJbnN0YW5jZVN0YXRlKSB7CisgICAgICAgIHN1cGVyLm9uQ3JlYXRlKHNhdmVkSW5zdGFuY2VTdGF0ZSk7CisgICAgICAgIHNldENvbnRlbnRWaWV3KG5ldyBMYXllcnNWaWV3KHRoaXMpKTsKKyAgICB9CisKKyAgICBzdGF0aWMgY2xhc3MgTGF5ZXJzVmlldyBleHRlbmRzIFZpZXcgeworICAgICAgICBwcml2YXRlIFBhaW50IG1MYXllclBhaW50OworICAgICAgICBwcml2YXRlIGZpbmFsIFBhaW50IG1SZWN0UGFpbnQ7CisKKyAgICAgICAgTGF5ZXJzVmlldyhDb250ZXh0IGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGMpOworCisgICAgICAgICAgICBtTGF5ZXJQYWludCA9IG5ldyBQYWludCgpOworICAgICAgICAgICAgbVJlY3RQYWludCA9IG5ldyBQYWludCgpOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHByb3RlY3RlZCB2b2lkIG9uRHJhdyhDYW52YXMgY2FudmFzKSB7CisgICAgICAgICAgICBzdXBlci5vbkRyYXcoY2FudmFzKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgxNDAuMGYsIDEwMC4wZik7CisKKyAgICAgICAgICAgIC8vY2FudmFzLmRyYXdSR0IoMjU1LCAyNTUsIDI1NSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGludCBjb3VudCA9IGNhbnZhcy5zYXZlTGF5ZXIoMC4wZiwgMC4wZiwgMjAwLjBmLCAxMDAuMGYsIG1MYXllclBhaW50LAorICAgICAgICAgICAgICAgICAgICBDYW52YXMuQUxMX1NBVkVfRkxBRyk7CisKKyAgICAgICAgICAgIG1SZWN0UGFpbnQuc2V0Q29sb3IoMHhmZmZmMDAwMCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgMjAwLjBmLCAxMDAuMGYsIG1SZWN0UGFpbnQpOworCisgICAgICAgICAgICBjYW52YXMucmVzdG9yZVRvQ291bnQoY291bnQpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAuMGYsIDEyNS4wZik7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGNvdW50ID0gY2FudmFzLnNhdmVMYXllcigwLjBmLCAwLjBmLCAyMDAuMGYsIDEwMC4wZiwgbUxheWVyUGFpbnQsCisgICAgICAgICAgICAgICAgICAgIENhbnZhcy5BTExfU0FWRV9GTEFHKTsKKworICAgICAgICAgICAgbVJlY3RQYWludC5zZXRDb2xvcigweGZmMDBmZjAwKTsKKyAgICAgICAgICAgIG1SZWN0UGFpbnQuc2V0QWxwaGEoNTApOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDAuMGYsIDAuMGYsIDIwMC4wZiwgMTAwLjBmLCBtUmVjdFBhaW50KTsKKworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmVUb0NvdW50KGNvdW50KTsKKworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgyNS4wZiwgMTI1LjBmKTsKKworICAgICAgICAgICAgbVJlY3RQYWludC5zZXRDb2xvcigweGZmMDAwMGZmKTsKKyAgICAgICAgICAgIG1SZWN0UGFpbnQuc2V0QWxwaGEoMjU1KTsKKyAgICAgICAgICAgIGNhbnZhcy5kcmF3UmVjdCgwLjBmLCAwLjBmLCAxMDAuMGYsIDUwLjBmLCBtUmVjdFBhaW50KTsgICAgICAgICAgICAKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbUxheWVyUGFpbnQuc2V0QWxwaGEoMTI3KTsKKyAgICAgICAgICAgIG1MYXllclBhaW50LnNldFhmZXJtb2RlKG5ldyBQb3J0ZXJEdWZmWGZlcm1vZGUoUG9ydGVyRHVmZi5Nb2RlLlNSQ19PVVQpKTsKKyAgICAgICAgICAgIGNvdW50ID0gY2FudmFzLnNhdmVMYXllcig1MC4wZiwgMjUuMGYsIDE1MC4wZiwgNzUuMGYsIG1MYXllclBhaW50LAorICAgICAgICAgICAgICAgICAgICBDYW52YXMuQUxMX1NBVkVfRkxBRyk7CisKKyAgICAgICAgICAgIG1SZWN0UGFpbnQuc2V0Q29sb3IoMHhmZmZmMDAwMCk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoNTAuMGYsIDI1LjBmLCAxNTAuMGYsIDc1LjBmLCBtUmVjdFBhaW50KTsKKworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmVUb0NvdW50KGNvdW50KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCAxMjUuMGYpOworCisgICAgICAgICAgICBtUmVjdFBhaW50LnNldENvbG9yKDB4ZmYwMDAwZmYpOworICAgICAgICAgICAgbVJlY3RQYWludC5zZXRBbHBoYSgyNTUpOworICAgICAgICAgICAgY2FudmFzLmRyYXdSZWN0KDAuMGYsIDAuMGYsIDEwMC4wZiwgNTAuMGYsIG1SZWN0UGFpbnQpOyAgICAgICAgICAgIAorICAgICAgICAgICAgCisgICAgICAgICAgICBtTGF5ZXJQYWludC5zZXRDb2xvcigweGZmZmYwMDAwKTsKKyAgICAgICAgICAgIG1MYXllclBhaW50LnNldEFscGhhKDEyNyk7CisgICAgICAgICAgICBtTGF5ZXJQYWludC5zZXRYZmVybW9kZShuZXcgUG9ydGVyRHVmZlhmZXJtb2RlKFBvcnRlckR1ZmYuTW9kZS5EU1RfQVRPUCkpOworICAgICAgICAgICAgY291bnQgPSBjYW52YXMuc2F2ZUxheWVyKDUwLjBmLCAyNS4wZiwgMTUwLjBmLCA3NS4wZiwgbUxheWVyUGFpbnQsCisgICAgICAgICAgICAgICAgICAgIENhbnZhcy5BTExfU0FWRV9GTEFHKTsKKworICAgICAgICAgICAgbVJlY3RQYWludC5zZXRDb2xvcigweGZmZmYwMDAwKTsKKyAgICAgICAgICAgIGNhbnZhcy5k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VkIHZvaWQgb25DcmVhdGUoQnVuZGxlIHNhdmVkSW5zdGFuY2VTdGF0ZSkgeworICAgICAgICBzdXBlci5vbkNyZWF0ZShzYXZlZEluc3RhbmNlU3RhdGUpOworICAgICAgICAKKyAgICAgICAgc2V0Q29udGVudFZpZXcobmV3IFhmZXJtb2Rlc1ZpZXcodGhpcykpOworICAgIH0KKworICAgIHN0YXRpYyBjbGFzcyBYZmVybW9kZXNWaWV3IGV4dGVuZHMgVmlldyB7CisgICAgICAgIHByaXZhdGUgZmluYWwgUGFpbnQgbUJsdWVQYWludDsKKyAgICAgICAgcHJpdmF0ZSBmaW5hbCBQYWludCBtUmVkUGFpbnQ7CisKKyAgICAgICAgWGZlcm1vZGVzVmlldyhDb250ZXh0IGMpIHsKKyAgICAgICAgICAgIHN1cGVyKGMpOworCisgICAgICAgICAgICBtQmx1ZVBhaW50ID0gbmV3IFBhaW50KCk7CisgICAgICAgICAgICBtQmx1ZVBhaW50LnNldENvbG9yKDB4ZmYwMDAwZmYpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtUmVkUGFpbnQgPSBuZXcgUGFpbnQoKTsKKyAgICAgICAgICAgIG1SZWRQYWludC5zZXRDb2xvcigweDdmZmYwMDAwKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvbkRyYXcoQ2FudmFzIGNhbnZhcykgeworICAgICAgICAgICAgc3VwZXIub25EcmF3KGNhbnZhcyk7CisgICAgICAgICAgICAvL2NhbnZhcy5kcmF3UkdCKDI1NSwgMjU1LCAyNTUpOworCisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDEwMC4wZiwgMTAwLjBmKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gU1JDIG1vZGVzCisgICAgICAgICAgICBjYW52YXMuc2F2ZSgpOworCisgICAgICAgICAgICBkcmF3UmVjdHMoY2FudmFzLCBNb2RlLlNSQ19PVkVSKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgMTAwLjBmKTsKKworICAgICAgICAgICAgZHJhd1JlY3RzKGNhbnZhcywgTW9kZS5TUkNfSU4pOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCAxMDAuMGYpOyAgICAgICAgICAgIAorCisgICAgICAgICAgICBkcmF3UmVjdHMoY2FudmFzLCBNb2RlLlNSQ19PVVQpOworICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCAxMDAuMGYpOworCisgICAgICAgICAgICBkcmF3UmVjdHMoY2FudmFzLCBNb2RlLlNSQ19BVE9QKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgMTAwLjBmKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgZHJhd1JlY3RzKGNhbnZhcywgTW9kZS5TUkMpOworCisgICAgICAgICAgICBjYW52YXMucmVzdG9yZSgpOworICAgICAgICAgICAgCisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDEwMC4wZiwgMC4wZik7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vIERTVCBtb2RlcworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKworICAgICAgICAgICAgZHJhd1JlY3RzKGNhbnZhcywgTW9kZS5EU1RfT1ZFUik7CisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAuMGYsIDEwMC4wZik7CisKKyAgICAgICAgICAgIGRyYXdSZWN0cyhjYW52YXMsIE1vZGUuRFNUX0lOKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgMTAwLjBmKTsgICAgICAgICAgICAKKworICAgICAgICAgICAgZHJhd1JlY3RzKGNhbnZhcywgTW9kZS5EU1RfT1VUKTsKKyAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUoMC4wZiwgMTAwLjBmKTsKKworICAgICAgICAgICAgZHJhd1JlY3RzKGNhbnZhcywgTW9kZS5EU1RfQVRPUCk7CisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAuMGYsIDEwMC4wZik7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGRyYXdSZWN0cyhjYW52YXMsIE1vZGUuRFNUKTsKKworICAgICAgICAgICAgY2FudmFzLnJlc3RvcmUoKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgxMDAuMGYsIDAuMGYpOworICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBPdGhlciBtb2RlcworICAgICAgICAgICAgY2FudmFzLnNhdmUoKTsKKworICAgICAgICAgICAgZHJhd1JlY3RzKGNhbnZhcywgTW9kZS5DTEVBUik7CisgICAgICAgICAgICBjYW52YXMudHJhbnNsYXRlKDAuMGYsIDEwMC4wZik7CisKKyAgICAgICAgICAgIGRyYXdSZWN0cyhjYW52YXMsIE1vZGUuWE9SKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCAxMDAuMGYpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtQmx1ZVBhaW50LnNldEFscGhhKDEyNyk7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgNTAuMGYsIDUwLjBmLCBtQmx1ZVBhaW50KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZSgwLjBmLCAxMDAuMGYpOworICAgICAgICAgICAgCisgICAgICAgICAgICBtQmx1ZVBhaW50LnNldEFscGhhKDEwKTsKKyAgICAgICAgICAgIG1CbHVlUGFpbnQuc2V0Q29sb3IoMHg3ZjAwMDBmZik7CisgICAgICAgICAgICBjYW52YXMuZHJhd1JlY3QoMC4wZiwgMC4wZiwgNTAuMGYsIDUwLjBmLCBtQmx1ZVBhaW50KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbUJsdWVQYWludC5zZXRDb2xvcigweGZmMDAwMG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XB0L1Jlc291cmNlLmNwcCBiL3Rvb2xzL2FhcHQvUmVzb3VyY2UuY3BwCmluZGV4IGNhZmQ2MzUuLjU4NTViNTYgMTAwNjQ0Ci0tLSBhL3Rvb2xzL2FhcHQvUmVzb3VyY2UuY3BwCisrKyBiL3Rvb2xzL2FhcHQvUmVzb3VyY2UuY3BwCkBAIC01NDIsMTEgKzU0MiwxMSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgRGVmYXVsdEtleWVkVmVjdG9yPEFhcHRHcm91cEVudHJ5LCBzcDxBYXB0RmlsZT4gPiBiYXNlRmlsZXMgPQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYXNlR3JvdXAtPmdldEZpbGVzKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpPTA7IGkgPCBiYXNlRmlsZXMuc2l6ZSgpOyBpKyspIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoImJhc2VGaWxlICVsZCBoYXMgZmxhdm9yICVzXG4iLCBpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiYmFzZUZpbGUgJWQgaGFzIGZsYXZvciAlc1xuIiwgaSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2VGaWxlcy5rZXlBdChpKS50b1N0cmluZygpLnN0cmluZygpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGk9MDsgaSA8IG92ZXJsYXlGaWxlcy5zaXplKCk7IGkrKykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50Zigib3ZlcmxheUZpbGUgJWxkIGhhcyBmbGF2b3IgJXNcbiIsIGksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJvdmVybGF5RmlsZSAlZCBoYXMgZmxhdm9yICVzXG4iLCBpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmxheUZpbGVzLmtleUF0KGkpLnRvU3RyaW5nKCkuc3RyaW5nKCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CkBAIC01NjAsNyArNTYwLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5QXQob3ZlcmxheUdyb3VwSW5kZXgpKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGJhc2VGaWxlSW5kZXggPCBVTktOT1dOX0VSUk9SKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJ1bmRsZS0+Z2V0VmVyYm9zZSgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiZm91bmQgYSBtYXRjaCAoJWxkKSBmb3Igb3ZlcmxheSBmaWxlICVzLCBmb3IgZmxhdm9yICVzXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoImZvdW5kIGEgbWF0Y2ggKCVkKSBmb3Igb3ZlcmxheSBmaWxlICVzLCBmb3IgZmxhdm9yICVzXG4iLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2VGaWxlSW5kZXgsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmxheUdyb3VwLT5nZXRMZWFmKCkuc3RyaW5nKCksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmxheUZpbGVzLmtleUF0KG92ZXJsYXlHcm91cEluZGV4KS50b1N0cmluZygpLnN0cmluZygpKTsKZGlmZiAtLWdpdCBhL3Rvb2xzL2FhcHQvUmVzb3VyY2VUYWJsZS5jcHAgYi90b29scy9hYXB0L1Jlc291cmNlVGFibGUuY3BwCmluZGV4IDc1NWI5M2IuLmY0MGE4NzcgMTAwNjQ0Ci0tLSBhL3Rvb2xzL2FhcHQvUmVzb3VyY2VUYWJsZS5jcHAKKysrI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isgICAgfQorCisgICAgcHVibGljIGludCBnZXREZWZhdWx0R2F0ZXdheUFkZHIoKSB7CisgICAgICAgIHJldHVybiBtRGVmYXVsdEdhdGV3YXlBZGRyOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzRGVmYXVsdFJvdXRlU2V0KCkgeworICAgICAgICByZXR1cm4gbURlZmF1bHRSb3V0ZVNldDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBkZWZhdWx0Um91dGVTZXQoYm9vbGVhbiBlbmFibGVkKSB7CisgICAgICAgIG1EZWZhdWx0Um91dGVTZXQgPSBlbmFibGVkOworICAgIH0KKwogICAgIC8qKgogICAgICAqIFJldHVybiB0aGUgc3lzdGVtIHByb3BlcnRpZXMgbmFtZSBhc3NvY2lhdGVkIHdpdGggdGhlIHRjcCBidWZmZXIgc2l6ZXMKICAgICAgKiBmb3IgdGhpcyBuZXR3b3JrLgpAQCAtNjczLDIyICs3NjQsNiBAQAogICAgIH0KIAogICAgIC8qKgotICAgICAqIFdlIHJlbGVhc2UgdGhlIHdha2Vsb2NrIGluIFdpZmlTZXJ2aWNlCi0gICAgICogdXNpbmcgYSB0aW1lci4KLSAgICAgKgotICAgICAqIFRPRE86Ci0gICAgICogUmVsZWFzaW5nIHdha2Vsb2NrIHVzaW5nIGJvdGggdGltZXIgYW5kCi0gICAgICogYSBjYWxsIGZyb20gQ29ubmVjdGl2aXR5U2VydmljZSByZXF1aXJlcwotICAgICAqIGEgcmV0aGluay4gV2UgaGFkIHByb2JsZW1zIHdoZXJlIFdpZmlTZXJ2aWNlCi0gICAgICogY291bGQga2VlcCBhIHdha2Vsb2NrIGZvcmV2ZXIgaWYgd2UgZGVsZXRlCi0gICAgICogbWVzc2FnZXMgaW4gdGhlIGFzeW5jaHJvbm91cyBjYWxsCi0gICAgICogZnJvbSBDb25uZWN0aXZpdHlTZXJ2aWNlCi0gICAgICovCi0gICAgQE92ZXJyaWRlCi0gICAgcHVibGljIHZvaWQgcmVsZWFz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