1、修改 $HOME/.zshrc文件

vim $HOME/.zshrc

2、添加以下内容

# Flutter路径
export PATH="$PATH:[Flutter路径]/flutter/bin"
# 国内镜像
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
# 代理
export HTTP_PROXY=http://127.0.0.1:1080
export HTTPS_PROXY=http://127.0.0.1:1080

3、刷新

source $HOME/.zshrc

4、检查Flutter信息

flutter doctor

今天重装完Android Studio,启动模拟器时出现了以下问题

Emulator: dsound: Could not initialize DirectSoundCapture 15:37 Emulator: dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID 15:37 Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object 15:37 Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object 15:37 Emulator: audio: Failed to create voice goldfish_audio_in‘ 15:37 Emulator: D:\buildSoft\android-studio\sdk\emulator\qemu\windows-x86_64\qemu-system-i386.exe: warning: opening audio input failed 15:37 Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object 15:37 Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object 15:37 Emulator: audio: Failed to create voice adc’

找了好久终于找到了解决方法:

https://jingyan.baidu.com/article/a65957f434890a24e67f9bfc.html

1、打开系统声音设置,打开声音控制面板

QQ截图20190322172307-768x435.png

2、将录制里的立体声混音打开

QQ图片20190322172353-238x300.png

3、重启模拟器,OK

Android7.0以上默认不再信任用户证书,我们就无法抓取HTTPS包。

我们需要下面两个工具来使我们能够简单免Root的抓取Https包:

VirtualXposed 是基于VirtualApp 和 epic 在非ROOT环境下运行Xposed模块的实现。

JustTrustMe 是一个Xposed模块,用来信任全部证书。

首先安装VirtualXposed,运行Xposed模块

下载地址:https://github.com/android-hacker/VirtualXposed

VirtualXposed安装完成后下载JustTrustMe

下载地址:https://github.com/Fuzion24/JustTrustMe

将JustTrustMe安装在VirtualXposed中,并启用JustTrustMe模块,再将需要抓包的APP添加到VirtualXposed中

接下来按常规抓包方式,安装证书、设置代理,在VirtualXposed中打开需要抓包的APP就可以正常抓包了

安卓7.0以后不在默认信任用户根证书,需要在network_security_config.xml中信任用户根证书。

1、首先需要使用apktool反编译APK

2、更改res/xml中的network_security_config.xml

<network-security-config>
<base-config>
<trust-anchors>
<!– Trust preinstalled CAs –>
<certificates src=”system” />
<!– Additionally trust user added CAs –>
<certificates src=”user” />
</trust-anchors>
</base-config>
</network-security-config>

3、重新打包APK安装,抓包即可

参考:

https://www.kalvin.cn/article/14

Android 7: Intercepting App Traffic

http://www.freebuf.com/articles/terminal/158492.html

https://www.jianshu.com/p/eb766d2bb837