If you’re a mobile engineer, during both development and testing you probably use some of the most common tools out there to debug, intercept or rewrite your network calls, like Charles Proxy or Fiddler.

如果您是移动工程师,则在开发和测试期间,您可能会使用一些最常用的工具来调试,拦截或重写您的网络呼叫,例如Charles Proxy或Fiddler 。

You will also probably find the process of setting up the proxy in your devices quite annoying: go to Settings > Network Settings > Select your WiFi network > Modify Network > Add proxy. Every. Single. Time. Phew!

您也可能会发现在设备中设置代理的过程非常烦人:转到“设置”>“网络设置”>“选择WiFi网络”>“修改网络”>“添加代理”。 每一个 单。 时间。

If you’re working with a set of different devices, you probably also noticed small differences between Android versions, manufacturers, etc., that might add or modify the steps you take for setting up the proxy.

如果您使用一组不同的设备,则可能还会注意到Android版本,制造商等之间的细微差别,这可能会增加或修改您设置代理的步骤。

There’s a small adb command you can run from your Terminal to enable a global proxy on your connected device:

您可以从终端运行一个小的adb命令,以在连接的设备上启用全局代理:

adb shell settings put global http_proxy YOUR_IP:YOUR_PORT

But this won’t give you any visual indicator to know whether the device is using a proxy or not. It also requires the device to be connected to a computer with adb installed every single time you want to enable or disable the proxy… which probably makes using this workaround not the most ideal solution.

但这不会给您任何视觉指示器,以了解设备是否正在使用代理。 它还要求您每次要启用或禁用代理时都将设备连接到安装了adb的计算机……这可能使得使用此替代方法不是最理想的解决方案。

Well, I have good news for you.

好吧,我有个好消息要给你。

代理切换简介 (Introducing Proxy Toggle)

Proxy Toggle is a small utility application compatible with Android 5.0 and above that will allow you to quickly enable and disable your proxy settings, as well as unifying and simplifying the process across platform versions, devices, manufacturers, etc.

Proxy Toggle是与Android 5.0及更高版本兼容的小型实用程序,可让您快速启用和禁用代理设置,以及统一和简化跨平台版本,设备,制造商等的过程。

Easy setup: just add your desired IP and port, enable the proxy and voilà! all done, your whole device will be proxied.

设置简单:只需添加所需的IP和端口,即可启用代理和功能 完成所有操作后,整个设备都会被代理。

使它变得更加容易 (Making it even easier)

I know this is all exciting news. But I also feel that having to open the app every time you want to enable the proxy might be also a long process… right?

我知道这都是令人振奋的消息。 但是我也觉得每次要启用代理都必须打开应用程序也可能是一个漫长的过程……对吗?

That’s why I also added two optional shortcuts for you to use: a home screen widget and a quick settings tile.

因此,我还添加了两个可选的快捷方式供您使用:主屏幕小部件和快速设置图块。

主屏幕小部件 (Home Screen Widget)

This shortcut’s very helpful for enabling and disabling your last used proxy quickly from your home screen.

此快捷方式对于从主屏幕快速启用和禁用最后使用的代理非常有用。

To add the widget, you’d normally long-press your home screen (depending on your launcher), select Add Widget and scroll down on your app list until you see the Proxy Toggle widget.

要添加小部件,通常需要长按主屏幕(取决于启动器),选择“添加小部件”并在应用列表上向下滚动,直到看到“代理切换”小部件。

The home screen widget will configure the last used proxy automatically
主屏幕小部件将自动配置上次使用的代理

That’s it! Toggle your proxy on and off with a single tap!

而已! 轻按一下即可开启和关闭代理!

快速设置图块 (Quick Settings Tile)

If your device is running Android 7.0 or higher, you’ll have access to another amazing shortcut: a Quick Settings Tile. This shortcut will live inside your Notification Drawer, next to some other handy shortcuts like WiFi, Location, Bluetooth, Airplane Mode, etc.

如果您的设备运行的是Android 7.0或更高版本,则可以访问另一个惊人的快捷方式:“快速设置”图块。 该快捷方式将位于通知抽屉中,紧随其他一些方便的快捷方式,如WiFi,位置,蓝牙,飞行模式等。

To enable it, simply expand your Navigation Drawer, click on the Edit icon and drag the Proxy Toggle icon wherever you want to place it.

要启用它,只需展开导航抽屉,单击“编辑”图标,然后将“代理切换”图标拖到要放置的任何位置。

Once enabled, the quick settings tile is a great shortcut for toggling your proxy
启用后,快速设置图块是切换代理的绝佳捷径

Done! You can toggle on and off your proxy without even leaving the current app!

做完了! 您甚至可以在不离开当前应用的情况下打开和关闭代理!

Note: if you have any ongoing network calls, they might take a few seconds to complete and update with the new setting.

注意:如果您正在进行任何网络通话,则它们可能需要几秒钟才能完成并使用新设置进行更新。

所有闪光的不都是金子 (All that glitters is not gold)

Although the app perfectly accomplishes its goal and makes our life easier, there’s a couple of caveats that I want to highlight about this shiny app.

尽管该应用程序可以完美实现其目标并使我们的生活更轻松,但我还是要强调一些有关此闪亮应用程序的警告。

使用系统限制的权限 (Using system restricted permissions)

The app will make use of Settings.Global. Since this is a system setting, it’s normally a read-only setting. This small inconvenience is bypassed by granting the app WRITE_SECURE_SETTINGS restricted permission.

该应用程序将使用Settings.Global 。 由于这是系统设置,因此通常是只读设置。 通过为应用程序WRITE_SECURE_SETTINGS授予受限权限,可以绕过这一小麻烦。

Note: this is a protected permission that only System apps should be granted. Be extra careful when you grant this permission for apps from unknown sources.

注意:这是受保护的权限,仅应授予系统应用程序。 当您为来自未知来源的应用授予此权限时,请格外小心。

I know this might raise some concerns, and I understand them. That’s why I decided to open-source the project: to prove that it’s completely safe to grant this permission, as you will have complete control and knowledge of what’s going on behind the scenes.

我知道这可能会引起一些担忧,并且我理解它们。 这就是为什么我决定开源该项目:证明授予此权限是完全安全的,因为您将完全控制和了解幕后发生的事情。

授予系统受限权限 (Granting system restricted permissions)

Since this is a restricted permission, we can’t request it on runtime as we would normally do, so you’ll need to manually grant it from our computer.

由于这是受限制的权限,因此我们无法像通常那样在运行时请求它,因此您需要从计算机上手动授予它。

If you just want to install the app without building it from Android Studio, there’s a small script that will be bundled with the app. Just download the zip file and execute the installAndGrantPermission.sh script.Alternatively, you can manually install the app by running adb install -g App.apk on your Terminal.

如果您只想安装应用程序而不从Android Studio进行构建,则该应用程序将捆绑有一个小脚本。 只需下载zip文件并执行installAndGrantPermission.sh即可。或者,您可以通过在终端上运行adb install -g App.apk来手动安装该应用程序。

To grant this permission once the app is already installed, connect the device to your computer and execute the following command on your Terminal:

要在安装了应用程序后授予此权限,请将设备连接到计算机,然后在终端上执行以下命令:

adb shell pm grant com.kinandcarta.create.proxytoggle android.permission.WRITE_SECURE_SETTINGS

卸载应用程序时请小心 (Be careful when uninstalling the app)

Sadly, as developers, we can’t run any code when the app is being uninstalled. Therefore, uninstalling the app with the proxy enabled will permanently leave your device with this setup (as it’s a Settings.Global configuration!).

遗憾的是,作为开发人员,在卸载应用程序时我们无法运行任何代码。 因此,在启用了代理的情况下卸载应用程序将使设备永久保留此设置(因为它是Settings.Global配置!)。

You should make sure the proxy is disabled before uninstalling the app. Since we can’t guarantee this is going to happen, there’s also the uninstallAndCleanUp.sh script for making sure everything is in a clean state after uninstalling the app.

您应先确保已禁用代理,然后再卸载应用。 由于我们不能保证会发生这种情况,因此还有一个uninstallAndCleanUp.sh脚本,用于确保在卸载应用程序后一切都处于干净状态。

Alternatively, you could run the following commands on your Terminal to clean up the proxy setting:

或者,您可以在终端上运行以下命令来清理代理设置:

adb shell settings delete global http_proxyadb shell settings delete global global_http_proxy_hostadb shell settings delete global global_http_proxy_port

触手可及的便利 (Convenience at your fingertips)

Proxy Toggle makes it easier to set up a global proxy on any Android phone, as well as providing different shortcuts for enabling and disabling the proxy with a single tap on the screen. I hope this tool will be as useful to your team as it’s been to our internal apps team, both developers and testers!

Proxy Toggle使您可以更轻松地在任何Android手机上设置全局代理,并提供不同的快捷方式,只需单击屏幕即可启用和禁用代理。 希望该工具对您的团队像对我们内部应用程序团队(包括开发人员和测试人员)一样有用!

You can download the latest version from here, or clone the project from Github.

您可以从此处下载最新版本,或从Github克隆项目。

Many thanks to the unique and amazing Flor Novello for her invaluable help with the app design!

非常感谢独特而惊人的弗洛尔·诺韦罗(Flor Novello)对应用程序设计的宝贵帮助!

翻译自: https://medium.com/kinandcartacreated/how-to-easily-proxy-your-android-device-e2ba907de4d9


http://www.taodudu.cc/news/show-4391875.html

相关文章:

  • 四六级写作模板
  • 2022-CS224n-Assignment1-exploring_word_vectors
  • Minecraft 1.12.2模组开发(四十三) 自定义盾牌(Shield)
  • 斯坦福cs224n-2021 assignment1-探索词向量—词共现矩阵—SVD(奇异值分解)
  • CS224n_2019_Assignment1: Exploring Word Vectors Coding Solution
  • 【2019-CS224n】Assignment1
  • 【cs224n学习作业】Assignment 1 - Exploring Word Vectors
  • 【cs224n学习作业】Assignment 1 - Exploring Word Vectors【附代码】
  • D3树状图改造
  • CS224N-HW1
  • 【NLP】5计数词向量底层代码编写和gensim word2vec库入门——斯坦福大学CS224n第一次课作业代码复现
  • 48. All that glitters is not gold. 闪光的不一定是金子
  • 大文件分块计算MD5值 C++实现
  • 个人博客开发之blog-api项目统一结果集api封装
  • Code Review 有感
  • Java基础项目实战--大学生求职招聘信息网站系统
  • 软件工程基础个人项目——数独(5)
  • 4月算法刷题总结
  • Java+MySQL基于SSM的二手玩具交换网站
  • Java项目:SSH房屋线下销售网站管理系统
  • 2019.3.27个人赛
  • 2019.4.3个人赛
  • Java项目:JSP中华传统美食网站平台管理系统
  • Java项目:JSP网上在线酒类商城系统网站
  • Java+mysql基于JSP的家教兼职网站
  • Gerrit的安装和配置个人经验总结
  • 基于SSM的个人博客
  • Java基于JSP个人博客网站设计与实现
  • 魅蓝note6的android怎么升级,魅蓝note6怎么把应用安装到sd卡
  • 红米note7找android,红米Note 7

如何轻松代理您的Android设备相关推荐

  1. android 文件传输_使用“发送到”轻松将文件传输到您的Android设备

    android 文件传输 The "Send to" menu has been around since Windows 95; so long a lot of users m ...

  2. Android 设备网络信息的获取(网络类型、网络强度、网络速度、代理情况)

    1.Android 设备网络类型的判断 判断网络类型主要还是依赖系统服务(系统为我们提供了大量的服务,以便我们能够查看到设备的一些信息),这里通过 Context.CONNECTIVITY_SERVI ...

  3. Android设备设置代理的两种方法

    本文将介绍两种给给android设备设置网络代理的方法,一种是直接在网络设置中操作,另一种是通过adb指令操作 第一种最常用的通过设置页面操作(此处以夜神模拟器为例讲解,其他设备操作方式基本类似) 操 ...

  4. 轻松简单实现Android设备重启的两种方式

    " 须知少时凌云志,曾许人间第一流 " 在<风犬少年的天空>中刘闻钦下线时,嘴里念叨的就是这句,我们何尝不是这样的人呢,年轻时的凌云大志,曾决心要做人间第一流的人物,干 ...

  5. 是否有唯一的Android设备ID?

    Android设备是否具有唯一的ID,如果是,则使用Java访问它的简单方法是什么? #1楼 有许多不同的方法可以解决这些ANDROID_ID问题(有时可能为null或特定模型的设备总是返回相同的ID ...

  6. 是否有唯一的 Android 设备 ID?

    问: Android 设备是否有唯一 ID,如果有,使用 Java 访问它的简单方法是什么? 答1: 保持自己快人一步,享受全网独家提供的一站式外包任务.远程工作.创意产品订阅服务–huntsbot. ...

  7. android 设备占用_如何查看正在占用Android设备的空间

    android 设备占用 When you picked up your shiny new Android device, you probably thought "yeah, this ...

  8. [转载] 如何在Android设备之间共享Google Play应用,音乐等

    参考链接: 使用super访问Java祖父母的成员 We recently showed you how to configure your iOS devices for app and media ...

  9. Android 设备正在“绞杀”密码!

    当应用程序或浏览器不再使用用户名和密码的登录方式时,盗号.撞库的数据泄露现状是否会有所好转? 日前,于巴萨罗那召开的世界移动通信大会(Mobile World Congress,简称 MWC)上,Go ...

最新文章

  1. 2016 - 1- 21 - RunLoop使用(2016-1-24修改一次)(2016 - 1 - 24 再次修改)
  2. pandas使用replace函数和正则表达式移除dataframe字符串数据列中尾部指定模式字符串(Removing trailing substring in dataframe)
  3. CodeSmith输错license后的解决办法
  4. 伯努利数与自然数幂和
  5. Linux 启动流程即init程序分析--2
  6. linux 内存泄露 工具,Linux Kernel模块内存泄露分析
  7. java面试笔试试题http://www.jobui.com/mianshiti/it/java/6827/
  8. MyEclipse中的ant初识
  9. SocksCap代理
  10. 6个小白也能看得懂的华为交换机命令,你学会了吗?
  11. 整除光棍 — C语言【模拟手算除法(附过程图解)】
  12. 不确定性Uncertainty
  13. SecureCRT http代理设置
  14. FPGA学习笔记-1 FPGA原理与开发流程
  15. 常用算法的算法思想以及基本特征
  16. SQLite sqlite_master
  17. 一场虚拟现实密室逃脱冒险,让你见识科技新加坡
  18. ECharts2.0
  19. “岁月静好,现世安稳
  20. 701-简单易懂的进制转换方法

热门文章

  1. Web端程序实现文件下载
  2. Ubuntu20.04 配置网卡信息
  3. 人力资源管理案例-左右为难的经理
  4. SVN管理文件的步骤
  5. 开个魔兽1.22的maphack版
  6. unity,通俗解释什么是协程
  7. 【CC2640】CC2640架构及原理
  8. Python版本与Matlab版本的对应关系
  9. idea运行报路径不存在
  10. 以太坊·电影院场景区块链应用探索