mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-23 17:22:16 -05:00
enabled proxy in CertifyKeyFragment
This commit is contained in:
parent
0499b1f056
commit
d95798dda2
@ -397,10 +397,12 @@ public class HkpKeyserver extends Keyserver {
|
||||
.post(body)
|
||||
.build();
|
||||
|
||||
Response response = new OkHttpClient().setProxy(proxy).newCall(request).execute();
|
||||
Response response = getClient(url, proxy).newCall(request).execute();
|
||||
|
||||
Log.d(Constants.TAG, "response code: " + response.code());
|
||||
Log.d(Constants.TAG, "answer: " + response.body().string());
|
||||
|
||||
tempIpTest(proxy);
|
||||
} catch (IOException e) {
|
||||
Log.e(Constants.TAG, "IOException", e);
|
||||
throw new AddKeyException();
|
||||
|
@ -61,6 +61,7 @@ import org.sufficientlysecure.keychain.ui.util.Notify;
|
||||
import org.sufficientlysecure.keychain.ui.widget.CertifyKeySpinner;
|
||||
import org.sufficientlysecure.keychain.util.Log;
|
||||
import org.sufficientlysecure.keychain.util.Preferences;
|
||||
import org.sufficientlysecure.keychain.util.orbot.OrbotHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ -90,11 +91,14 @@ public class CertifyKeyFragment
|
||||
private static final int INDEX_IS_REVOKED = 4;
|
||||
|
||||
private MultiUserIdsAdapter mUserIdsAdapter;
|
||||
private Preferences.ProxyPrefs mProxyPrefs;
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
mProxyPrefs = Preferences.getPreferences(getActivity()).getProxyPrefs();
|
||||
|
||||
mPubMasterKeyIds = getActivity().getIntent().getLongArrayExtra(CertifyKeyActivity.EXTRA_KEY_IDS);
|
||||
if (mPubMasterKeyIds == null) {
|
||||
Log.e(Constants.TAG, "List of key ids to certify missing!");
|
||||
@ -171,8 +175,26 @@ public class CertifyKeyFragment
|
||||
Notify.create(getActivity(), getString(R.string.select_key_to_certify),
|
||||
Notify.Style.ERROR).show();
|
||||
} else {
|
||||
|
||||
if (mUploadKeyCheckbox.isChecked() && mProxyPrefs.torEnabled) {
|
||||
Handler ignoreTorHandler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
mProxyPrefs = new Preferences.ProxyPrefs(false, false, null, -1, null);
|
||||
cryptoOperation();
|
||||
}
|
||||
};
|
||||
if (!OrbotHelper.isOrbotInstalled(getActivity())) {
|
||||
OrbotHelper.getInstallDialogFragmentWithThirdButton(new Messenger(ignoreTorHandler),
|
||||
R.string.orbot_install_dialog_ignore_tor).show(getActivity().getSupportFragmentManager(), "installOrbot");
|
||||
} else if (!OrbotHelper.isOrbotRunning()) {
|
||||
OrbotHelper.getOrbotStartDialogFragment(new Messenger(ignoreTorHandler),
|
||||
R.string.orbot_install_dialog_ignore_tor).show(getActivity().getSupportFragmentManager(), "startOrbot");
|
||||
} else {
|
||||
cryptoOperation();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user