Skip to content

Commit

Permalink
Revert "Use Application rather than Context in CuriousHostKeyRepository"
Browse files Browse the repository at this point in the history
This reverts commit 6a90dcc, which seems
to do the opposite of what it's commit message states...
  • Loading branch information
rtyley committed Mar 15, 2012
1 parent dbb6a22 commit b05a533
Showing 1 changed file with 7 additions and 7 deletions.
Expand Up @@ -21,17 +21,17 @@
import java.util.Arrays;
import java.util.Map;

import android.content.Context;
import android.app.Application;

@Singleton
public class CuriousHostKeyRepository implements HostKeyRepository {
Map<String, byte[]> knownKeys = newHashMap();
private final Context context;
private final Application application;
private final Provider<BlockingPromptService> blockingPromptService;

@Inject
public CuriousHostKeyRepository(Context context, Provider<BlockingPromptService> blockingPromptService) {
this.context = context;
public CuriousHostKeyRepository(Application application, Provider<BlockingPromptService> blockingPromptService) {
this.application = application;
this.blockingPromptService = blockingPromptService;
}

Expand All @@ -45,8 +45,8 @@ public int check(String host, byte[] key) {

private int userCheckKey(String host, byte[] key) {
String keyFingerprint = "<small>"+code(encodeHex(md5(key)))+"</small><br />";
String ticker = context.getString(ask_host_key_ok_ticker, code(host));
String message = context.getString(ask_host_key_ok, code(host)+"<br />", keyFingerprint);
String ticker = application.getString(ask_host_key_ok_ticker, code(host));
String message = application.getString(ask_host_key_ok, code(host)+"<br />", keyFingerprint);
boolean userConfirmKeyGood = TRUE == blockingPromptService.get().request(promptYesOrNo(alert(fromHtml(ticker), "SSH", centered(message))));
if (userConfirmKeyGood) {
knownKeys.put(host,key);
Expand Down Expand Up @@ -75,6 +75,6 @@ public HostKey[] getHostKey() {
}

public HostKey[] getHostKey(String host, String type) {
return new HostKey[0]; //To change body of implemented methods use File | Settings | File Templates.
return new HostKey[0];
}
}

0 comments on commit b05a533

Please sign in to comment.