Advertisement
Guest User

Untitled

a guest
Jun 16th, 2024
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. The solution is to install the certificate Globally. For that I has to install only the emulator:
  2. [Android Emulator (32.1.13) Stable][1]
  3.  
  4.  
  5. Then you have to find the name of your AVD:
  6. ```
  7. ╭─░▒▓ ~/src/emulator 
  8. ╰─ ./emulator -list-avds
  9. P6
  10.  
  11. ```
  12. Then Run the AVD using this command:
  13.  
  14. ```
  15. ANDROID_SDK_ROOT=~/Android/Sdk/ /home/syst/src/emulator/./emulator -avd P6 -writable-system
  16. ```
  17.  
  18. You obviously have to change the path of your emulator and the AVD name to yours
  19.  
  20. Then you have to export your public Der certificate from BurpSuite:
  21. [![Export Burp Certificate][2]][2]
  22.  
  23. Name it `cacert.der`
  24.  
  25.  
  26. The execute these commands:
  27.  
  28. ```
  29. ╭─░▒▓ ~/Desktop  ✔  base Py  03:22:26 ▓▒░
  30. ╰─ openssl x509 -inform DER -in cacert.der -out cacert.pem
  31.  
  32. ╭─░▒▓ ~/Desktop  ✔  base Py  03:22:30 ▓▒░
  33. ╰─ openssl x509 -inform PEM -subject_hash_old -in cacert.pem | head -1
  34. 9a5ba575
  35.  
  36. ```
  37.  
  38. Then you will rename your certificate like this <PrevOutput>.0
  39.  
  40.  
  41. In my case
  42. ```
  43. mv cacert.pem 9a5ba575.0
  44. ```
  45. Then
  46. ```
  47. adb push 9a5ba575.0 /sdcard/
  48. ```
  49.  
  50.  
  51. Before installing the certificate we need to gain root over the AVD
  52.  
  53. ```
  54. ╭─░▒▓ ~   ✔  base Py  03:20:31 ▓▒░
  55. ╰─ adb root
  56. restarting adbd as root
  57.  
  58. ╭─░▒▓ ~   ✔  base Py  03:20:35 ▓▒░
  59. ╰─ adb remount
  60. Disabling verity for /system
  61. Using overlayfs for /system
  62. Using overlayfs for /vendor
  63. Using overlayfs for /product
  64. Using overlayfs for /system_ext
  65. Now reboot your device for settings to take effect
  66.  
  67. ╭─░▒▓ ~   ✔  base Py  03:20:39 ▓▒░
  68. ╰─ adb reboot
  69.  
  70.  
  71. ╭─░▒▓ ~   1 ✘  base Py  03:20:56 ▓▒░
  72. ╰─ adb root
  73. restarting adbd as root
  74.  
  75. ╭─░▒▓ ~   ✔  base Py  03:22:16 ▓▒░
  76. ╰─ adb remount
  77. remount succeeded
  78.  
  79. ```
  80. Once the Remount has succeeded, we will install the Certificate:
  81.  
  82. ```
  83. ╭─░▒▓ ~/Desktop   ✔  base Py  03:23:19 ▓▒░
  84. ╰─ adb shell
  85. emu64xa:/ # mv /sdcard/9a5ba575.0 /system/etc/security/cacerts/
  86. emu64xa:/ # chmod 664 /system/etc/security/cacerts/9a5ba575.0
  87. emu64xa:/ # exit
  88.  
  89. ╭─░▒▓ ~/Desktop   ✔  36s  base Py  03:24:17 ▓▒░
  90. ╰─ adb reboot
  91. ```
  92.  
  93. Now it should be working !
  94.  
  95.  
  96.  
  97.  
  98.  
  99. [1]: https://developer.android.com/studio/emulator_archive
  100. [2]: https://i.sstatic.net/odPekRA4.png
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement