1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
package cgeo.geocaching.connector.oc;
import cgeo.geocaching.R;
import cgeo.geocaching.Settings;
import cgeo.geocaching.cgeoapplication;
import cgeo.geocaching.network.OAuthAuthorizationActivity;
import org.apache.commons.lang3.tuple.ImmutablePair;
public class OCAuthorizationActivity extends OAuthAuthorizationActivity {
private final int siteResId = R.string.auth_ocde;
public OCAuthorizationActivity() {
super("www.opencaching.de",
"/okapi/services/oauth/request_token",
"/okapi/services/oauth/authorize",
"/okapi/services/oauth/access_token",
false,
cgeoapplication.getInstance().getResources().getString(R.string.oc_de_okapi_consumer_key),
cgeoapplication.getInstance().getResources().getString(R.string.oc_de_okapi_consumer_secret));
}
@Override
protected ImmutablePair<String, String> getTempToken() {
return Settings.getTempOCDEToken();
}
@Override
protected void setTempTokens(String tokenPublic, String tokenSecret) {
Settings.setOCDETempTokens(tokenPublic, tokenSecret);
}
@Override
protected void setTokens(String tokenPublic, String tokenSecret, boolean enable) {
Settings.setOCDETokens(tokenPublic, tokenSecret, enable);
}
@Override
protected String getAuthTitle() {
return res.getString(siteResId);
}
@Override
protected String getAuthAgain() {
return res.getString(R.string.auth_again_oc);
}
@Override
protected String getErrAuthInitialize() {
return res.getString(R.string.err_auth_initialize);
}
@Override
protected String getAuthStart() {
return res.getString(R.string.auth_start_oc);
}
@Override
protected String getAuthDialogCompleted() {
return res.getString(R.string.auth_dialog_completed_oc, getAuthTitle());
}
@Override
protected String getErrAuthProcess() {
return res.getString(R.string.err_auth_process);
}
@Override
protected String getAuthDialogWait() {
return res.getString(R.string.auth_dialog_wait_oc, getAuthTitle());
}
@Override
protected String getAuthDialogPinTitle() {
return res.getString(R.string.auth_dialog_pin_title_oc);
}
@Override
protected String getAuthDialogPinMessage() {
return res.getString(R.string.auth_dialog_pin_message_oc, getAuthTitle());
}
@Override
protected String getAboutAuth1() {
return res.getString(R.string.about_auth_1_oc, getAuthTitle());
}
@Override
protected String getAboutAuth2() {
return res.getString(R.string.about_auth_2_oc, getAuthTitle(), getAuthTitle());
}
@Override
protected String getAuthAuthorize() {
return res.getString(R.string.auth_authorize_oc);
}
@Override
protected String getAuthPinHint() {
return res.getString(R.string.auth_pin_hint_oc, getAuthTitle());
}
@Override
protected String getAuthFinish() {
return res.getString(R.string.auth_finish_oc);
}
}
|