|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 package org.mozilla.gecko.sync.setup; |
|
6 |
|
7 import android.content.Intent; |
|
8 |
|
9 public class Constants { |
|
10 // Constants for Firefox Sync SyncAdapter Accounts. |
|
11 public static final String OPTION_SYNCKEY = "option.synckey"; |
|
12 public static final String OPTION_USERNAME = "option.username"; |
|
13 public static final String AUTHTOKEN_TYPE_PLAIN = "auth.plain"; |
|
14 public static final String OPTION_SERVER = "option.serverUrl"; |
|
15 public static final String DATA_ENABLE_ON_UPGRADE = "data.enableOnUpgrade"; |
|
16 |
|
17 public static final String DEFAULT_PROFILE = "default"; |
|
18 |
|
19 /** |
|
20 * Name of file to pickle current account preferences to each sync. |
|
21 * <p> |
|
22 * Must not contain path separators! |
|
23 */ |
|
24 public static final String ACCOUNT_PICKLE_FILENAME = "sync.account.json"; |
|
25 |
|
26 /** |
|
27 * Key in sync extras bundle specifying stages to sync this sync session. |
|
28 * <p> |
|
29 * Corresponding value should be a String JSON-encoding an object, the keys of |
|
30 * which are the stage names to sync. For example: |
|
31 * <code>"{ \"stageToSync\": 0 }"</code>. |
|
32 */ |
|
33 public static final String EXTRAS_KEY_STAGES_TO_SYNC = "sync"; |
|
34 |
|
35 /** |
|
36 * Key in sync extras bundle specifying stages to skip this sync session. |
|
37 * <p> |
|
38 * Corresponding value should be a String JSON-encoding an object, the keys of |
|
39 * which are the stage names to skip. For example: |
|
40 * <code>"{ \"stageToSkip\": 0 }"</code>. |
|
41 */ |
|
42 public static final String EXTRAS_KEY_STAGES_TO_SKIP = "skip"; |
|
43 |
|
44 // Constants for Activities. |
|
45 public static final String INTENT_EXTRA_IS_SETUP = "isSetup"; |
|
46 public static final String INTENT_EXTRA_IS_PAIR = "isPair"; |
|
47 public static final String INTENT_EXTRA_IS_ACCOUNTERROR = "isAccountError"; |
|
48 |
|
49 public static final int FLAG_ACTIVITY_REORDER_TO_FRONT_NO_ANIMATION = |
|
50 Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | |
|
51 Intent.FLAG_ACTIVITY_NO_ANIMATION; |
|
52 |
|
53 // Constants for Account Authentication. |
|
54 public static final String AUTH_SERVER_VERSION = "1.1/"; |
|
55 public static final String AUTH_SERVER_SUFFIX = "info/collections/"; |
|
56 |
|
57 // Account Authentication Errors. |
|
58 public static final String AUTH_ERROR_NOUSER = "auth.error.badcredentials"; |
|
59 |
|
60 // Links for J-PAKE setup help pages. |
|
61 public static final String LINK_FIND_CODE = "https://support.mozilla.org/kb/find-code-to-add-device-to-firefox-sync"; |
|
62 public static final String LINK_FIND_ADD_DEVICE = "https://support.mozilla.org/kb/add-a-device-to-firefox-sync"; |
|
63 |
|
64 // Constants for JSON payload. |
|
65 public static final String JSON_KEY_PAYLOAD = "payload"; |
|
66 public static final String JSON_KEY_CIPHERTEXT = "ciphertext"; |
|
67 public static final String JSON_KEY_HMAC = "hmac"; |
|
68 public static final String JSON_KEY_IV = "IV"; |
|
69 public static final String JSON_KEY_TYPE = "type"; |
|
70 public static final String JSON_KEY_VERSION = "version"; |
|
71 public static final String JSON_KEY_ETAG = "etag"; |
|
72 |
|
73 public static final String JSON_KEY_ACCOUNT = "account"; |
|
74 public static final String JSON_KEY_PASSWORD = "password"; |
|
75 public static final String JSON_KEY_SYNCKEY = "synckey"; |
|
76 public static final String JSON_KEY_SERVER = "serverURL"; |
|
77 public static final String JSON_KEY_CLUSTER = "clusterURL"; |
|
78 public static final String JSON_KEY_CLIENT_NAME = "clientName"; |
|
79 public static final String JSON_KEY_CLIENT_GUID = "clientGUID"; |
|
80 public static final String JSON_KEY_SYNC_AUTOMATICALLY = "syncAutomatically"; |
|
81 public static final String JSON_KEY_TIMESTAMP = "timestamp"; |
|
82 |
|
83 public static final String CRYPTO_KEY_GR1 = "gr1"; |
|
84 public static final String CRYPTO_KEY_GR2 = "gr2"; |
|
85 |
|
86 public static final String ZKP_KEY_GX1 = "gx1"; |
|
87 public static final String ZKP_KEY_GX2 = "gx2"; |
|
88 |
|
89 public static final String ZKP_KEY_ZKP_X1 = "zkp_x1"; |
|
90 public static final String ZKP_KEY_ZKP_X2 = "zkp_x2"; |
|
91 public static final String ZKP_KEY_B = "b"; |
|
92 public static final String ZKP_KEY_GR = "gr"; |
|
93 public static final String ZKP_KEY_ID = "id"; |
|
94 |
|
95 public static final String ZKP_KEY_A = "A"; |
|
96 public static final String ZKP_KEY_ZKP_A = "zkp_A"; |
|
97 |
|
98 // J-PAKE errors. |
|
99 public static final String JPAKE_ERROR_CHANNEL = "jpake.error.channel"; |
|
100 public static final String JPAKE_ERROR_NETWORK = "jpake.error.network"; |
|
101 public static final String JPAKE_ERROR_SERVER = "jpake.error.server"; |
|
102 public static final String JPAKE_ERROR_TIMEOUT = "jpake.error.timeout"; |
|
103 public static final String JPAKE_ERROR_INTERNAL = "jpake.error.internal"; |
|
104 public static final String JPAKE_ERROR_INVALID = "jpake.error.invalid"; |
|
105 public static final String JPAKE_ERROR_NODATA = "jpake.error.nodata"; |
|
106 public static final String JPAKE_ERROR_KEYMISMATCH = "jpake.error.keymismatch"; |
|
107 public static final String JPAKE_ERROR_WRONGMESSAGE = "jpake.error.wrongmessage"; |
|
108 public static final String JPAKE_ERROR_USERABORT = "jpake.error.userabort"; |
|
109 public static final String JPAKE_ERROR_DELAYUNSUPPORTED = "jpake.error.delayunsupported"; |
|
110 } |