0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Android TVでproxymanを使う

Last updated at Posted at 2025-01-29

ハマったのでメモとして残しておきます

ProxymanのAndroid用手順では使えませんでした
(Proxyman Version 5.9.0)
使えない理由としては、
実機は証明書をインストールするGUIが用意されていません
エミュレータはarm64で用意されているOSがproduction buildでrootがとれません
(とれないので、証明書が置けない)

手順

  1. Proxymanのpemを出力する
    Proxymanの以下設定から出力できます
    Certificate -> Export -> Root Certificate as PEM...
  2. pemをAndroid TVのプロジェクト配下におく
    app/src/debug/res/raw
    このpemは個人の環境によるので、gitにcommitしない方が良いです
  3. networkSecurityConfigを作る
    app/src/debug/res/xml/network_security_config.xml
    <?xml version="1.0" encoding="utf-8"?>
    <network-security-config>
        <debug-overrides>
            <trust-anchors>
                <certificates src="system" />
                <certificates src="@raw/${拡張子を除いたpemのファイル名}" />
                <certificates src="user" />
            </trust-anchors>
        </debug-overrides>
    </network-security-config>
    
  4. AndroidManifestにnetworkSecurityConfig設定を追加する
    app/src/debug/AndroidManifest.xml
    <application
        android:networkSecurityConfig="@xml/network_security_config">
    </application>
    
  5. エミュレータの場合
    Proxymanの以下設定から、No.2のスクリプトを実行する
    Certificate -> Install Certificate on Android -> Emulators...
    (エミュレータは対象の1つだけにして、実機はdisconnectしておいた方がいいです)
  6. 実機の場合
    Proxymanの以下設定から、No.2のプロキシ設定をする
    Certificate -> Install Certificate on Android -> Physical Devices...
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?