1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/base/sync/setup/Constants.java Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,110 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +package org.mozilla.gecko.sync.setup; 1.9 + 1.10 +import android.content.Intent; 1.11 + 1.12 +public class Constants { 1.13 + // Constants for Firefox Sync SyncAdapter Accounts. 1.14 + public static final String OPTION_SYNCKEY = "option.synckey"; 1.15 + public static final String OPTION_USERNAME = "option.username"; 1.16 + public static final String AUTHTOKEN_TYPE_PLAIN = "auth.plain"; 1.17 + public static final String OPTION_SERVER = "option.serverUrl"; 1.18 + public static final String DATA_ENABLE_ON_UPGRADE = "data.enableOnUpgrade"; 1.19 + 1.20 + public static final String DEFAULT_PROFILE = "default"; 1.21 + 1.22 + /** 1.23 + * Name of file to pickle current account preferences to each sync. 1.24 + * <p> 1.25 + * Must not contain path separators! 1.26 + */ 1.27 + public static final String ACCOUNT_PICKLE_FILENAME = "sync.account.json"; 1.28 + 1.29 + /** 1.30 + * Key in sync extras bundle specifying stages to sync this sync session. 1.31 + * <p> 1.32 + * Corresponding value should be a String JSON-encoding an object, the keys of 1.33 + * which are the stage names to sync. For example: 1.34 + * <code>"{ \"stageToSync\": 0 }"</code>. 1.35 + */ 1.36 + public static final String EXTRAS_KEY_STAGES_TO_SYNC = "sync"; 1.37 + 1.38 + /** 1.39 + * Key in sync extras bundle specifying stages to skip this sync session. 1.40 + * <p> 1.41 + * Corresponding value should be a String JSON-encoding an object, the keys of 1.42 + * which are the stage names to skip. For example: 1.43 + * <code>"{ \"stageToSkip\": 0 }"</code>. 1.44 + */ 1.45 + public static final String EXTRAS_KEY_STAGES_TO_SKIP = "skip"; 1.46 + 1.47 + // Constants for Activities. 1.48 + public static final String INTENT_EXTRA_IS_SETUP = "isSetup"; 1.49 + public static final String INTENT_EXTRA_IS_PAIR = "isPair"; 1.50 + public static final String INTENT_EXTRA_IS_ACCOUNTERROR = "isAccountError"; 1.51 + 1.52 + public static final int FLAG_ACTIVITY_REORDER_TO_FRONT_NO_ANIMATION = 1.53 + Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | 1.54 + Intent.FLAG_ACTIVITY_NO_ANIMATION; 1.55 + 1.56 + // Constants for Account Authentication. 1.57 + public static final String AUTH_SERVER_VERSION = "1.1/"; 1.58 + public static final String AUTH_SERVER_SUFFIX = "info/collections/"; 1.59 + 1.60 + // Account Authentication Errors. 1.61 + public static final String AUTH_ERROR_NOUSER = "auth.error.badcredentials"; 1.62 + 1.63 + // Links for J-PAKE setup help pages. 1.64 + public static final String LINK_FIND_CODE = "https://support.mozilla.org/kb/find-code-to-add-device-to-firefox-sync"; 1.65 + public static final String LINK_FIND_ADD_DEVICE = "https://support.mozilla.org/kb/add-a-device-to-firefox-sync"; 1.66 + 1.67 + // Constants for JSON payload. 1.68 + public static final String JSON_KEY_PAYLOAD = "payload"; 1.69 + public static final String JSON_KEY_CIPHERTEXT = "ciphertext"; 1.70 + public static final String JSON_KEY_HMAC = "hmac"; 1.71 + public static final String JSON_KEY_IV = "IV"; 1.72 + public static final String JSON_KEY_TYPE = "type"; 1.73 + public static final String JSON_KEY_VERSION = "version"; 1.74 + public static final String JSON_KEY_ETAG = "etag"; 1.75 + 1.76 + public static final String JSON_KEY_ACCOUNT = "account"; 1.77 + public static final String JSON_KEY_PASSWORD = "password"; 1.78 + public static final String JSON_KEY_SYNCKEY = "synckey"; 1.79 + public static final String JSON_KEY_SERVER = "serverURL"; 1.80 + public static final String JSON_KEY_CLUSTER = "clusterURL"; 1.81 + public static final String JSON_KEY_CLIENT_NAME = "clientName"; 1.82 + public static final String JSON_KEY_CLIENT_GUID = "clientGUID"; 1.83 + public static final String JSON_KEY_SYNC_AUTOMATICALLY = "syncAutomatically"; 1.84 + public static final String JSON_KEY_TIMESTAMP = "timestamp"; 1.85 + 1.86 + public static final String CRYPTO_KEY_GR1 = "gr1"; 1.87 + public static final String CRYPTO_KEY_GR2 = "gr2"; 1.88 + 1.89 + public static final String ZKP_KEY_GX1 = "gx1"; 1.90 + public static final String ZKP_KEY_GX2 = "gx2"; 1.91 + 1.92 + public static final String ZKP_KEY_ZKP_X1 = "zkp_x1"; 1.93 + public static final String ZKP_KEY_ZKP_X2 = "zkp_x2"; 1.94 + public static final String ZKP_KEY_B = "b"; 1.95 + public static final String ZKP_KEY_GR = "gr"; 1.96 + public static final String ZKP_KEY_ID = "id"; 1.97 + 1.98 + public static final String ZKP_KEY_A = "A"; 1.99 + public static final String ZKP_KEY_ZKP_A = "zkp_A"; 1.100 + 1.101 + // J-PAKE errors. 1.102 + public static final String JPAKE_ERROR_CHANNEL = "jpake.error.channel"; 1.103 + public static final String JPAKE_ERROR_NETWORK = "jpake.error.network"; 1.104 + public static final String JPAKE_ERROR_SERVER = "jpake.error.server"; 1.105 + public static final String JPAKE_ERROR_TIMEOUT = "jpake.error.timeout"; 1.106 + public static final String JPAKE_ERROR_INTERNAL = "jpake.error.internal"; 1.107 + public static final String JPAKE_ERROR_INVALID = "jpake.error.invalid"; 1.108 + public static final String JPAKE_ERROR_NODATA = "jpake.error.nodata"; 1.109 + public static final String JPAKE_ERROR_KEYMISMATCH = "jpake.error.keymismatch"; 1.110 + public static final String JPAKE_ERROR_WRONGMESSAGE = "jpake.error.wrongmessage"; 1.111 + public static final String JPAKE_ERROR_USERABORT = "jpake.error.userabort"; 1.112 + public static final String JPAKE_ERROR_DELAYUNSUPPORTED = "jpake.error.delayunsupported"; 1.113 +}