ProxymanApp / Proxyman

Modern. Native. Delightful Web Debugging Proxy for macOS, iOS, and Android ⚡️
https://proxyman.io
5.35k stars 177 forks source link

Android emulator setup script doesnt work for Medium phone android 14 (api 34) #1916

Closed StanislavMayorov closed 4 months ago

StanislavMayorov commented 5 months ago

Description

@NghiaTranUIT hello. SSL proxy doesn't works for android 14 emulator (Google API). It works fine for android 13. There's no error in the patch script.

Steps to Reproduce

  1. Install and run android emulator API 34 (Google API) Screenshot 2024-01-19 at 17 05 39
  2. Click override emulator
Screenshot 2024-01-19 at 15 27 51

Current Behavior

SSL proxy doesn't work.

Expected Behavior

SSL proxy works.

Environment

NghiaTranUIT commented 5 months ago

@StanislavMayorov can you verify the Proxyman Certificate is installed in Setting app -> Security -> Encryption & Credential -> Trusted Certificate -> User Tab?

May I ask: If you finish the step 5 in the Android docs: https://docs.proxyman.io/debug-devices/android-device

to your android app source code?

NghiaTranUIT commented 5 months ago

@StanislavMayorov I tested again and it works fine with Android API 34 Screenshot 2024-01-21 at 09 36 01

Screenshot 2024-01-21 at 09 36 18
StanislavMayorov commented 5 months ago

@NghiaTranUIT thank you for reply. I tested OKHTTP-Android-Sample and reproduced the same error like in my app.

OKHTTP-Android-Sample Error:

Request failed:
java.security.cert.CertPathValidatorException
Trust anchor for certification path not found
Screenshot 2024-01-21 at 18 17 54 Screenshot 2024-01-21 at 17 43 48 Screenshot 2024-01-21 at 18 18 52 Screenshot 2024-01-21 at 18 13 18

@StanislavMayorov can you verify the Proxyman Certificate is installed in Setting app -> Security -> Encryption & Credential -> Trusted Certificate -> User Tab?

May I ask: If you finish the step 5 in the Android docs: https://docs.proxyman.io/debug-devices/android-device

  • Add res/xml/network_security_config.xml
  • Add to AndroidManifest.xml

to your android app source code?

Yes. So my app works on android API 33. I tested using OKHTTP-Android-Sample to have the same env.

NghiaTranUIT commented 5 months ago

It's odd. Let me try again with your emulator (Created by Other Image Tab -> Upsidedown Cake, API 34, Google APIs).

Mime was created from the Recommended Tab.

NghiaTranUIT commented 5 months ago

@StanislavMayorov it just works fine again with the sample code, that I provide you.

There is something odd, the first request always fails. If you re-send the GET request again, it will work.

StanislavMayorov commented 5 months ago

@NghiaTranUIT I got it. I can reproduce it only on the new Medium phone template! It works fine on pixel 7 with the same API SDK. I have android studio 2023.1.1. Medium phone template is a new one.

Screenshot 2024-01-26 at 15 34 57 Screenshot 2024-01-26 at 15 35 30
NghiaTranUIT commented 5 months ago

@StanislavMayorov

Medium Phone doesn't work with Proxyman because it's a PlayStore version. Pixel phone works fine because it's not 👍

Screenshot 2024-01-27 at 10 21 56

StanislavMayorov commented 5 months ago

@NghiaTranUIT pixel 7 has the same play store icon, but it works fine with Google API image.

image

StanislavMayorov commented 4 months ago

@NghiaTranUIT Hello. Pixel 7 and Medium Phone have the same play store icon. Could you explain the difference please?

300149741-e31b9297-d2d2-4c30-9332-aa37414a6a30

NghiaTranUIT commented 4 months ago

Sorry, I don't know honestly. I guess it's how Medium Phone Emulator works, it doesn't allow the Mitm app to decrypt their data. You can try with other proxy apps, like Charles Proxy.

May I ask: Why do you need to use the Medium Phone? Can we try the Pixel phone with the same API? 🤔

StanislavMayorov commented 4 months ago

@NghiaTranUIT I can use pixel instead of Medium Phone. Pixel works fine with the same API. I hadn't just known about this compatibility issue. It had been confusing. Can you update this comment to describe that only pixel emulator is supported please?

Screenshot 2024-02-07 at 12 31 10
NghiaTranUIT commented 4 months ago

Sure, I will add this note. For now, I might update the online documentation first 👍

StanislavMayorov commented 4 months ago

thank you!