Android Studio Frida 설치
nox와 wsl의 충돌로 시작하는 Android Studio에 frida 연결하기
Android Studio adb
안드로이드 스튜디오 설치 후
Setting - Languages & Frameworks - Andriod SDK
SDK Tools탭에서 Android SDK Command-lin Tools (latest) 체크하고 OK를 눌러주면 설치된다.
SDK 폴더 경로 안에 있는 platform-tools 에 adb.exe가 있다.
%SDK Location%\platform-tools 를 환경변수에 추가해준다.
환경변수가 잘 적용되었는지 확인한다.
adb version
rootAVD
https://github.com/newbit1/rootAVD
시스템 이미지에서 아래 조건을 만족하는 이미지 선택:
"Google APIs" 또는 "Google Play"가 없는 이미지 (예: x86 또는 x86_64)
API Level은 33 이하가 좋음 (예: Android 10, 11)
만약 루팅이 되지 않는다면 최신 버전 안드로이드가 아닌지 확인해보자
사용한 디바이스 환경:
git clone https://github.com/newbit1/rootAVD.git
cd rootAVD
.\rootAVD.bat
.\rootAVD.bat ListAllAVDs //ListAllAVDs 목록을 보고 안드로이드 버전에 맞게 설치해준다.
.\rootAVD.bat system-images\{android-version}\google_apis_playstore\x86_64\ramdisk.img
에뮬레이터를 다시 실행시키면 Magisk가 설치되어 있다.
실행시키면 자동으로 재부팅된다.
Zygisk를 활성화 시켜주고 재부팅한다.
다시 터미널에서 adb root로 루팅활성화를 하고 adb shell로 들어가면 루팅된 것을 확인할 수 있다.
Frida Connect
디바이스 환경과 frida 버전을 확인하고 frida-server-frida버전-android-에뮬레이터환경인 파일을 설치해야한다.
Frida github: https://github.com/frida/frida/releases
Releases · frida/frida
Clone this repo to build Frida. Contribute to frida/frida development by creating an account on GitHub.
github.com
Show all 을 눌러서 찾아야한다.
디바이스에 맞는 환경의 frida-server를 다운받는다.
압축을 풀어서 adb push로 디바이스로 전송한다.
adb push .\frida-server /data/local/tmp/frida-server
frida-server에 chmod로 755권한을 준다.
adb shell chmod 755 /data/local/tmp/frida-server
frida-server를 백그라운드에서 실행한다.
emu64xa:/data/local/tmp $ ./frida-server-16.7.14-android-x86_64 &
터미널에서 frida-ps -Ua 명령어로 확인해보면 연결되었다는 것을 확인할 수 있다.
Error
Unable to load SELinux policy from the kernel: Failed to open file ?/sys/fs/selinux/policy?: Permission denied
=> 루팅 전 frida-server 실행하려고 하면 나오는 오류. 루팅하면 해결됨