首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在android系统中使用带有重装功能的网络密码?

如何在android系统中使用带有重装功能的网络密码?
EN

Stack Overflow用户
提问于 2015-01-15 14:37:18
回答 3查看 1.4K关注 0票数 4

Netcipher是一个Android库项目,它为提高移动应用程序中的网络安全性提供了多种方法。“洋葱”名称不仅指Tor使用的Onion路由概念(它提供匿名性和对流量监视的抵抗力),还指任何应用程序应该使用的多层安全概念。

更具体地说,这个图书馆提供:

代码语言:javascript
复制
1. Stronger Sockets: Through support for the right cipher suites, pinning and more, we ensure your encrypted connections are as strong as possible.
2. Proxied Connection Support: HTTP and SOCKS proxy connection support for HTTP and HTTP/S traffic through specific configuration of the Apache HTTPClient library

https://guardianproject.info/code/netcipher/

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2015-01-15 16:40:03

您需要实现您自己的Client,它将在Netcipher http客户端上执行重定向请求。

  1. Request转换为适当的网络密码请求(复制http方法、标头、正文)
  2. 在Netcipher http客户端上执行翻译的请求
  3. 获取响应并将其翻译为Response (复制http状态代码、响应、标头)
  4. 返回要反序列化为类型的响应。

把你的Client传给RestAdapter.Builder

好了。

代码语言:javascript
复制
public class NetcipherClient implements Client{
  private Context mContext;
  public NetcipherClient(Context context){
      mContext = context;
      //As far as I could see from the sample, Netcipher seems to be dependant on application `Context`.

  }
  @Override
    public retrofit.client.Response execute(retrofit.client.Request request) throws IOException {
        //Set up configuration for Netcipher (proxy, timeout etc)
        // Translate Request to Netcipher request 
        // Execute and obtain the response
        // Build Response from response
        return response;
    }


}
票数 4
EN

Stack Overflow用户

发布于 2016-11-01 17:14:05

我们最近在OkHTTP中实现了对NetCipher的支持,因此应该很容易通过OkHTTP将Tor支持添加到Retrofit中。下面是操作步骤:

代码语言:javascript
复制
compile 'info.guardianproject.netcipher:netcipher-okhttp3:2.0.0-alpha1'

它的核心是运行方法来设置:

代码语言:javascript
复制
  StrongOkHttpClientBuilder
    .forMaxSecurity(this)
    .withTorValidation()
    .build(this);

有关完整示例,请参阅包含的示例-okhttp3 3项目,它是git repo https://github.com/guardianproject/NetCipher的一部分。

票数 3
EN

Stack Overflow用户

发布于 2015-01-16 18:37:34

除了Tor类路由,OkHttp还具有证书钉扎能力&代理支持.而且它也适用于重新装修的盒子!所以,如果Tor类函数对您不那么重要,我建议您利用OkHttp的威望。否则,@NikolaDespotoski的回答是您的最佳选择。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27965821

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档