How to protect Google Play public key when doing InApp Billing

前端 未结 5 1359
没有蜡笔的小新
没有蜡笔的小新 2020-12-22 22:09

Actually this is a little bit silly about protecting public key (what is the definition of public key then?) but as per the documentation by Google:

T

5条回答
  •  误落风尘
    2020-12-22 22:39

    The public key is base64-encoded ([a-zA-Z0-9+/]) so you can easily avoid the need to escape the obfuscated string at all as is an annoying problem in @PointerNull's solution.

    Instead, you can perform the obfuscation by first converting the character in question to a 6-bit int. Then do the bit manipulation (e.g. XOR-ing) and then convert back to a base64-encoded char. Guaranteed no character escaping needed.

提交回复
热议问题