반응형

android webview로 작업된 프로젝트에서 간혹 ipin 인증이나 결제 모듈 팝업, sms 인증 팝업을 띄워야 할 때가 있다.

이 경우 webChromeClient의 onCreateWindow를  Override하여야 하며 webview setting을 다음과 같이 변경해야 한다.

 

1. Webview Setting 변경

WebSettings settings = webView.getSettings();

 

settings.setJavaScriptEnabled(true);

settings.setJavaScriptCanOpenWindowsAutomatically(true);

settings.setSupportMultipleWindows(true);

 

2. WebChromeClient에 onCreateWindow Override

@Override

public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {

    WebView newWebView = new WebView(MainActivity.this);

    WebSettings webSettings = newWebView.getSettings();

    webSettings.setJavaScriptEnabled(true);



    final Dialog dialog = new Dialog(MainActivity.this);

    dialog.setContentView(newWebView);

    dialog.show();



    newWebView.setWebChromeClient(new WebChromeClient() {

        @Override

        public void onCloseWindow(WebView window) {

            dialog.dismiss();

        }

    });



    ((WebView.WebViewTransport)resultMsg.obj).setWebView(newWebView);

    resultMsg.sendToTarget();

    return true;

}

 

2020/07/11 - [Android/Tips] - Could not find com.android.tools.build:aapt2:4.0.0-6051327.

2020/07/11 - [Android/Kotlin] - byte array to hex string

2020/07/11 - [Android/Tips] - Android API Level 및 명칭

2020/07/11 - [Android/Tips] - ERROR: Could not get unknown property 'com' for root project 'myApp' of type org.gradle.api.Project

2020/07/11 - [Android/Tips] - error: cannot find symbol this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);

2020/07/11 - [Android/Rooting] - LG 펌웨어 추출 및 OS 다운그레이드 (kdz file)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 환경설정 (4/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 환경설정 (3/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 환경설정 (2/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 환경설정 (1/4)

반응형
블로그 이미지

SKY STORY

,
반응형
반응형
블로그 이미지

SKY STORY

,
반응형
private val hexArray = "0123456789ABCDEF".toCharArray()

fun bytesToHex(bytes: ByteArray): String {
    val hexChars = CharArray(bytes.size * 2)
    for (j in bytes.indices) {
        val v = (bytes[j] and 0xFF.toByte()).toInt()

        hexChars[j * 2] = hexArray[v ushr 4]
        hexChars[j * 2 + 1] = hexArray[v and 0x0F]
    }
    return String(hexChars)
}

fun main(args: Array<String>) {

    val bytes = byteArrayOf(10, 2, 15, 11)

    val s = bytesToHex(bytes)
    println(s)
}
반응형
블로그 이미지

SKY STORY

,
반응형

https://developer.android.com/guide/topics/manifest/uses-sdk-element.html

 

 |  Android 개발자  |  Android Developers

Lets you express an application's compatibility with one or more versions of the Android platform, by means of an API Level integer. The API Level expressed by an application will be compared to the API Level of a given Android system, which may vary…

developer.android.com

 

다음 표에는 각 Android 플랫폼 버전이 지원하는 API 레벨이 지정되어 있습니다. 각 버전을 실행 중인 기기의 관련 번호에 대한 자세한 내용은 플랫폼 버전 대시보드 페이지를 참조하세요.

플랫폼 버전API 레벨버전 코드참고

Android 10.0 29 Q 플랫폼 하이라이트
Android 9 28 P 플랫폼 하이라이트
Android 8.1 27 O_MR1 플랫폼 하이라이트
Android 8.0 26 O 플랫폼 하이라이트
Android 7.1.1
Android 7.1
25 N_MR1 플랫폼 하이라이트
Android 7.0 24 N 플랫폼 하이라이트
Android 6.0 23 M 플랫폼 하이라이트
Android 5.1 22 LOLLIPOP_MR1 플랫폼 하이라이트
Android 5.0 21 LOLLIPOP
Android 4.4W 20 KITKAT_WATCH 웨어러블 기기 전용 KitKat
Android 4.4 19 KITKAT 플랫폼 하이라이트
Android 4.3 18 JELLY_BEAN_MR2 플랫폼 하이라이트
Android 4.2, 4.2.2 17 JELLY_BEAN_MR1 플랫폼 하이라이트
Android 4.1, 4.1.1 16 JELLY_BEAN 플랫폼 하이라이트
Android 4.0.3, 4.0.4 15 ICE_CREAM_SANDWICH_MR1 플랫폼 하이라이트
Android 4.0, 4.0.1, 4.0.2 14 ICE_CREAM_SANDWICH
Android 3.2 13 HONEYCOMB_MR2
Android 3.1.x 12 HONEYCOMB_MR1 플랫폼 하이라이트
Android 3.0.x 11 HONEYCOMB 플랫폼 하이라이트
Android 2.3.4
Android 2.3.3
10 GINGERBREAD_MR1 플랫폼 하이라이트
Android 2.3.2
Android 2.3.1
Android 2.3
9 GINGERBREAD
Android 2.2.x 8 FROYO 플랫폼 하이라이트
Android 2.1.x 7 ECLAIR_MR1 플랫폼 하이라이트
Android 2.0.1 6 ECLAIR_0_1
Android 2.0 5 ECLAIR
Android 1.6 4 DONUT 플랫폼 하이라이트
Android 1.5 3 CUPCAKE 플랫폼 하이라이트
Android 1.1 2 BASE_1_1
Android 1.0 1 BASE

 

 

2020/07/11 - [Android/Tips] - ERROR: Could not get unknown property 'com' for root project 'myApp' of type org.gradle.api.Project

2020/07/11 - [Android/Tips] - error: cannot find symbol this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);

2020/07/11 - [Android/Rooting] - LG 펌웨어 추출 및 OS 다운그레이드 (kdz file)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 환경설정 (4/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 환경설정 (3/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 환경설정 (2/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 환경설정 (1/4)

2020/06/16 - [OS/Mac OS X] - duplicate symbol 에러 해결

2020/06/12 - [iOS/Jailbreak] - Fridump 사용법 (4/4) - 결과물 바이너리 검색

2020/06/03 - [iOS/Objective-C] - NSString <-> CBUUID

2020/06/03 - [iOS/Swift] - 위치서비스(location service) 활성화 여부 체크

2020/06/02 - [개발노트] - Luhn 알고리즘

2020/06/01 - [iOS/Swift] - The Ultimate Guide to WKWebView

2020/06/01 - [iOS/Tips] - WKWebView에서 로컬 웹 파일 및 리소스 로드

반응형
블로그 이미지

SKY STORY

,
반응형

다음과 같은 에러 발생시  다음과 같이 캐시 폴더를 삭제하도록 하자

~/.gradle/caches

 

또는 다음과 같이 gradle 의존성 업데이트 명령을 통해 해결할 수 있다.

gradle --refresh-dependencies

 

 

반응형
블로그 이미지

SKY STORY

,
반응형

아래와 같이 에러 발생시 

error: cannot find symbol

this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);

 

다음과 같이 수정

this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);

반응형
블로그 이미지

SKY STORY

,
반응형

기기에서 실행중인 프로세스 목록 출력 

frida-ps -U

-U : USB로 연결된 기기에 접속.

-D : Device ID로 기기에 접속.

-R : Remote Server(원격서버)에 접속

-H : Host의 Remote Server(원격서버)에 접속

 

 

pid후킹

frida -D 192.168.0.173:5555 -p 27402

frida -R 192.168.0.173:5555 -p 27402

sudo -H python fridump.py -U -s -r  apppos

 

 

Frida-server다운로드

https://github.com/frida/frida/releases

 

 

 

cd Downloads

cd frida-server-arm

unxz frida-server-12.9.8-android-x86_64.xz

 

이름변경

frida-server

 

# frida server 복사

#adb push frida-server data/local/tmp

 

연결된 디바이스 목록 출력

adb devices

 

TCP로 접속 설정 (포트는 5555)

adb tcpip 5555

 

포트는 5555가 기본이고 adb tcpip 명령어를 통해 port를 바꿀수있다.

 

접속

adb connect 192.168.0.173

 

 

 

cd /Applications/NoxAppPlayer.app/Contents/MacOS/

ls

 

 

adb shell "getprop dhcp.eth0.ipaddress"

adb shell "/data/local/tmp/frida-server -l 10.0.2.15:21502 &"

frida-ps -H 127.0.0.1:21502

frida -H 127.0.0.1:21502 -f it.app.mobile -l "D:\frida-android-repinning_sa-1.js" --no-pause1

 

root@hammerhead:/data/local/tmp # ps | grep server

drm       187   1     20952  1856  ffffffff b6eea384 S /system/bin/drmserver

media     188   1     127024 10652 ffffffff b6f83384 S /system/bin/mediaserver

system    747   199   1898228 159416 ffffffff b6f832b8 S system_server

radio     1439  199   1491828 37264 ffffffff b6f832b8 S com.android.server.telecom

root      31228 31158 56184  31260 ffffffff b5eb6d9c S ./frida-server-12.9.8-android-arm

 

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 사용하기 (1/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 사용하기 (2/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 사용하기 (3/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 사용하기 (4/4)

2020/05/19 - [iOS/Jailbreak] - Fridump 사용법 (1/4) - iOS디바이스 환경 구축

2020/05/19 - [iOS/Jailbreak] - Fridump 사용법 (2/4) - Mac OS X 환경 구축

2020/05/19 - [iOS/Jailbreak] - Fridump 사용법 (3/4) - 메모리 덤프

2020/06/12 - [iOS/Jailbreak] - Fridump 사용법 (4/4) - 결과물 바이너리 검색

반응형
블로그 이미지

SKY STORY

,
반응형

xz 압축 해제

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew install xz

 

$ xz -d easytag-2.4.3.tar.xz

// xz 해제

$ tar -xvf easytag-2.4.3.tar

// tar 해제

 

 

 

cd Downloads

cd frida-server-arm

unxz frida-server-11.0.13-android-arm.xz

 

연결된 디바이스 목록 출력

adb devices

 

TCP로 접속 설정 (포트는 5555)

adb tcpip 5555

 

포트는 5555가 기본이고 adb tcpip 명령어를 통해 port를 바꿀수있다.

 

접속

adb connect 192.168.0.173

 

 

shell실행

adb shell

 

 

다음과 같은 에러가 발생하면 

usb로도 연결되어있고 TCP/IP로도 연결되어있어 발생하는 에러이다.

둘중 하나만 선택해야한다. (이경우 TCP로 연결되어 있으므로 usb연결 케이블은 뽑도록 한다)

adb: error: failed to get feature set: more than one device/emulator

 

서버 파일 복사

adb push frida-server data/local/tmp

 

 

 

adb shell

su

chmod 777 /data/local/tmp/frida-server

/data/local/tmp/frida-server &

 

맨아래 frida-server가 정상 동작중임을 알수있다.

ps | grep server

 

exit로 종료하고 빠져나온다.

 

모든 연결 끊기

adb disconnect

 

usb모드로 재연결한다.

adb usb

 

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 사용하기 (1/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 사용하기 (2/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 사용하기 (3/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 사용하기 (4/4)

2020/05/19 - [iOS/Jailbreak] - Fridump 사용법 (1/4) - iOS디바이스 환경 구축

2020/05/19 - [iOS/Jailbreak] - Fridump 사용법 (2/4) - Mac OS X 환경 구축

2020/05/19 - [iOS/Jailbreak] - Fridump 사용법 (3/4) - 메모리 덤프

2020/06/12 - [iOS/Jailbreak] - Fridump 사용법 (4/4) - 결과물 바이너리 검색

반응형
블로그 이미지

SKY STORY

,