Android In App Billing: защита открытого ключа приложения

Из Android In App Billing версия 3 (TrivialDrive) пример приложения, поставляемого с SDK

MainActivity.java
/* base64EncodedPublicKey should be YOUR APPLICATION'S PUBLIC KEY
 * (that you got from the Google Play developer console). This is not your
 * developer public key, it's the *app-specific* public key.
 *
 * Instead of just storing the entire literal string here embedded in the
 * program,  construct the key at runtime from pieces or
 * use bit manipulation (for example, XOR with some other string) to hide
 * the actual key.  The key itself is not secret information, but we don't
 * want to make it easy for an attacker to replace the public key with one
 * of their own and then fake messages from the server.
 */
String base64EncodedPublicKey = "CONSTRUCT_YOUR_KEY_AND_PLACE_IT_HERE";

Ну, я не уверен, что понимаю эту меру безопасности. Я знаю, как получить открытый ключ приложения (который уже закодирован в формате base64) из Google Play Developer Console.

То, что я не понимаю, это часть

 /* Instead of just storing the entire literal string here embedded in the
 * program,  construct the key at runtime from pieces or
 * use bit manipulation (for example, XOR with some other string) to hide
 * the actual key
 */

Насколько я знаю, этот открытый ключ является константной строкой, которую выдает Google в процессе загрузки приложения.

Как мы можем создать один и тот же ключ программно, используя любой процесс манипуляции с битами? Кто-то делал это раньше? Есть ли пример кода о том, как это сделать?

Ответы на вопрос(6)

Ваш ответ на вопрос