ryanking13 / android-SSL-unpinning

Bypass android application SSL-pinning
188 stars 28 forks source link

카카오톡 Repack 오류 #8

Open Taewan-P opened 11 months ago

Taewan-P commented 11 months ago

안녕하세요, KakaoTalk 앱을 repack 하는 과정에 오류가 발생하여 원인이 무엇인가 해서 로그를 남깁니다.

username@computername android-SSL-unpinning % python patch.py com.kakao.talk.apk 
[*] Unpacking com.kakao.talk.apk...
I: Using Apktool 2.6.1 on com.kakao.talk.apk
I: Loading resource table...
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.webview), pkgId: 112
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.webview), pkgId: 112
I: Decoding Shared Library (com.kakao.talk.pay_main), pkgId: 116
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.webview), pkgId: 112
I: Decoding Shared Library (com.kakao.talk.pay_main), pkgId: 116
I: Decoding Shared Library (com.kakao.talk.moim), pkgId: 117
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.webview), pkgId: 112
I: Decoding Shared Library (com.kakao.talk.pay_main), pkgId: 116
I: Decoding Shared Library (com.kakao.talk.moim), pkgId: 117
I: Decoding Shared Library (com.kakao.talk.contenttab), pkgId: 118
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.webview), pkgId: 112
I: Decoding Shared Library (com.kakao.talk.pay_main), pkgId: 116
I: Decoding Shared Library (com.kakao.talk.moim), pkgId: 117
I: Decoding Shared Library (com.kakao.talk.contenttab), pkgId: 118
I: Decoding Shared Library (com.kakao.talk.finder), pkgId: 119
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.webview), pkgId: 112
I: Decoding Shared Library (com.kakao.talk.pay_main), pkgId: 116
I: Decoding Shared Library (com.kakao.talk.moim), pkgId: 117
I: Decoding Shared Library (com.kakao.talk.contenttab), pkgId: 118
I: Decoding Shared Library (com.kakao.talk.finder), pkgId: 119
I: Decoding Shared Library (com.kakao.talk.calendar), pkgId: 120
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.webview), pkgId: 112
I: Decoding Shared Library (com.kakao.talk.pay_main), pkgId: 116
I: Decoding Shared Library (com.kakao.talk.moim), pkgId: 117
I: Decoding Shared Library (com.kakao.talk.contenttab), pkgId: 118
I: Decoding Shared Library (com.kakao.talk.finder), pkgId: 119
I: Decoding Shared Library (com.kakao.talk.calendar), pkgId: 120
I: Decoding Shared Library (com.kakao.talk.express), pkgId: 121
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.webview), pkgId: 112
I: Decoding Shared Library (com.kakao.talk.pay_main), pkgId: 116
I: Decoding Shared Library (com.kakao.talk.moim), pkgId: 117
I: Decoding Shared Library (com.kakao.talk.contenttab), pkgId: 118
I: Decoding Shared Library (com.kakao.talk.finder), pkgId: 119
I: Decoding Shared Library (com.kakao.talk.calendar), pkgId: 120
I: Decoding Shared Library (com.kakao.talk.express), pkgId: 121
I: Decoding Shared Library (com.kakao.talk.drawer), pkgId: 122
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.webview), pkgId: 112
I: Decoding Shared Library (com.kakao.talk.pay_main), pkgId: 116
I: Decoding Shared Library (com.kakao.talk.moim), pkgId: 117
I: Decoding Shared Library (com.kakao.talk.contenttab), pkgId: 118
I: Decoding Shared Library (com.kakao.talk.finder), pkgId: 119
I: Decoding Shared Library (com.kakao.talk.calendar), pkgId: 120
I: Decoding Shared Library (com.kakao.talk.express), pkgId: 121
I: Decoding Shared Library (com.kakao.talk.drawer), pkgId: 122
I: Decoding Shared Library (com.kakao.talk.openlink), pkgId: 123
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.webview), pkgId: 112
I: Decoding Shared Library (com.kakao.talk.pay_main), pkgId: 116
I: Decoding Shared Library (com.kakao.talk.moim), pkgId: 117
I: Decoding Shared Library (com.kakao.talk.contenttab), pkgId: 118
I: Decoding Shared Library (com.kakao.talk.finder), pkgId: 119
I: Decoding Shared Library (com.kakao.talk.calendar), pkgId: 120
I: Decoding Shared Library (com.kakao.talk.express), pkgId: 121
I: Decoding Shared Library (com.kakao.talk.drawer), pkgId: 122
I: Decoding Shared Library (com.kakao.talk.openlink), pkgId: 123
I: Decoding Shared Library (com.kakao.talk.zzng), pkgId: 124
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.webview), pkgId: 112
I: Decoding Shared Library (com.kakao.talk.pay_main), pkgId: 116
I: Decoding Shared Library (com.kakao.talk.moim), pkgId: 117
I: Decoding Shared Library (com.kakao.talk.contenttab), pkgId: 118
I: Decoding Shared Library (com.kakao.talk.finder), pkgId: 119
I: Decoding Shared Library (com.kakao.talk.calendar), pkgId: 120
I: Decoding Shared Library (com.kakao.talk.express), pkgId: 121
I: Decoding Shared Library (com.kakao.talk.drawer), pkgId: 122
I: Decoding Shared Library (com.kakao.talk.openlink), pkgId: 123
I: Decoding Shared Library (com.kakao.talk.zzng), pkgId: 124
I: Decoding Shared Library (com.kakao.talk.jordy), pkgId: 125
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.webview), pkgId: 112
I: Decoding Shared Library (com.kakao.talk.pay_main), pkgId: 116
I: Decoding Shared Library (com.kakao.talk.moim), pkgId: 117
I: Decoding Shared Library (com.kakao.talk.contenttab), pkgId: 118
I: Decoding Shared Library (com.kakao.talk.finder), pkgId: 119
I: Decoding Shared Library (com.kakao.talk.calendar), pkgId: 120
I: Decoding Shared Library (com.kakao.talk.express), pkgId: 121
I: Decoding Shared Library (com.kakao.talk.drawer), pkgId: 122
I: Decoding Shared Library (com.kakao.talk.openlink), pkgId: 123
I: Decoding Shared Library (com.kakao.talk.zzng), pkgId: 124
I: Decoding Shared Library (com.kakao.talk.jordy), pkgId: 125
I: Decoding Shared Library (com.kakao.talk.vox), pkgId: 126
I: Decoding Shared Library (com.kakao.talk.music), pkgId: 108
I: Decoding Shared Library (com.kakao.talk.emoticon), pkgId: 110
I: Decoding Shared Library (com.kakao.talk.webview), pkgId: 112
I: Decoding Shared Library (com.kakao.talk.pay_main), pkgId: 116
I: Decoding Shared Library (com.kakao.talk.moim), pkgId: 117
I: Decoding Shared Library (com.kakao.talk.contenttab), pkgId: 118
I: Decoding Shared Library (com.kakao.talk.finder), pkgId: 119
I: Decoding Shared Library (com.kakao.talk.calendar), pkgId: 120
I: Decoding Shared Library (com.kakao.talk.express), pkgId: 121
I: Decoding Shared Library (com.kakao.talk.drawer), pkgId: 122
I: Decoding Shared Library (com.kakao.talk.openlink), pkgId: 123
I: Decoding Shared Library (com.kakao.talk.zzng), pkgId: 124
I: Decoding Shared Library (com.kakao.talk.jordy), pkgId: 125
I: Decoding Shared Library (com.kakao.talk.vox), pkgId: 126
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /<User 경로>/Library/apktool/framework/1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x7c0800d1
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x7c08008b
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x7c080115
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x7c08010d
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x7c080081
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x7c080081
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0016
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0016
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0016
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0017
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0016
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0017
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0017
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0016
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0016
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0016
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0016
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0016
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0016
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x7b0c0017
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x76080093
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x760800b7
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x76080092
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x760800cb
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes10.dex...
I: Baksmaling classes11.dex...
I: Baksmaling classes12.dex...
I: Baksmaling classes13.dex...
I: Baksmaling classes14.dex...
I: Baksmaling classes15.dex...
I: Baksmaling classes16.dex...
I: Baksmaling classes17.dex...
I: Baksmaling classes18.dex...
I: Baksmaling classes19.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Baksmaling classes4.dex...
I: Baksmaling classes5.dex...
I: Baksmaling classes6.dex...
I: Baksmaling classes7.dex...
I: Baksmaling classes8.dex...
I: Baksmaling classes9.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
I: Copying META-INF/services directory
[*] Repacking com.kakao.talk to com.kakao.talk.repack.apk...
I: Using Apktool 2.6.1
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes18 folder into classes18.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes11 folder into classes11.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes16 folder into classes16.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes17 folder into classes17.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes10 folder into classes10.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes19 folder into classes19.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes9 folder into classes9.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes7 folder into classes7.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes6 folder into classes6.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes8 folder into classes8.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes15 folder into classes15.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes12 folder into classes12.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes13 folder into classes13.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes14 folder into classes14.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes3 folder into classes3.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes4 folder into classes4.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes5 folder into classes5.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether resources has changed...
I: Building resources...
W: invalid resource directory name: <레포경로>/android-SSL-unpinning/com.kakao.talk/res navigation
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/3_/rsqb2p1n0dqf7b4sf3hfm1kw0000gn/T/brut_util_Jar_65116220781328197606344923628117687172.tmp, p, --forced-package-id, 127, --min-sdk-version, 24, --target-sdk-version, 33, --version-code, 2410320, --version-name, 10.3.2, --no-version-vectors, -F, /var/folders/3_/rsqb2p1n0dqf7b4sf3hfm1kw0000gn/T/APKTOOL4477745139083657652.tmp, -e, /var/folders/3_/rsqb2p1n0dqf7b4sf3hfm1kw0000gn/T/APKTOOL2854136015768241296.tmp, -0, arsc, -I, /<User 경로>/Library/apktool/framework/1.apk, -S, <레포경로>/android-SSL-unpinning/com.kakao.talk/res, -M, <레포경로>/android-SSL-unpinning/com.kakao.talk/AndroidManifest.xml]
[*] Failed to repack com.kakao.talk. Retrying with --use-aapt2 flags
I: Using Apktool 2.6.1
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: <레포경로>/android-SSL-unpinning/com.kakao.talk/AndroidManifest.xml:1418: error: unexpected element <uses-native-library> found in <manifest><application>.
W: <레포경로>/android-SSL-unpinning/com.kakao.talk/AndroidManifest.xml:1419: error: unexpected element <uses-native-library> found in <manifest><application>.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/3_/rsqb2p1n0dqf7b4sf3hfm1kw0000gn/T/brut_util_Jar_86650716844760997651238126639013331862.tmp, link, -o, /var/folders/3_/rsqb2p1n0dqf7b4sf3hfm1kw0000gn/T/APKTOOL5928600068233026936.tmp, --package-id, 127, --min-sdk-version, 24, --target-sdk-version, 33, --version-code, 2410320, --version-name, 10.3.2, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, -e, /var/folders/3_/rsqb2p1n0dqf7b4sf3hfm1kw0000gn/T/APKTOOL16451477802969490783.tmp, -0, arsc, -I, /<User 경로>/Library/apktool/framework/1.apk, --manifest, <레포경로>/android-SSL-unpinning/com.kakao.talk/AndroidManifest.xml, <레포경로>/android-SSL-unpinning/com.kakao.talk/build/resources.zip]
[-] Failed to repack com.kakao.talk
ryanking13 commented 10 months ago

안녕하세요, https://github.com/iBotPeaches/Apktool/issues/2778 apktool 2.6.2에서 해결된 문제로 보이는데, 현재 레포지토리에번들되어있는 apktool 의 버전이 2.6.1이라 발생하는 문제인 것 같습니다. 최신 버전의 apktool을 다운로드 받아서 apktool.jar 파일을 바꾸신 뒤 시도해보시겠어요?

Taewan-P commented 10 months ago

안녕하세요, 방금 최신 버전인 2.8.1 로 시도한 결과, Invalid Resource Directory 오류는 동일하게 발생하고, aapt2 플레그로 넘어간 부분에서 오류가 다음과 같이 변경되었습니다.

W: invalid resource directory name: <Project 경로>/android-SSL-unpinning/com.kakao.talk/res navigation
brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/3_/rsqb2p1n0dqf7b4sf3hfm1kw0000gn/T/brut_util_Jar_25742701117600892811104488619202736772.tmp, p, --forced-package-id, 127, --min-sdk-version, 24, --target-sdk-version, 33, --version-code, 2410320, --version-name, 10.3.2, --no-version-vectors, -F, /var/folders/3_/rsqb2p1n0dqf7b4sf3hfm1kw0000gn/T/APKTOOL13536057283216145497.tmp, -e, /var/folders/3_/rsqb2p1n0dqf7b4sf3hfm1kw0000gn/T/APKTOOL8611481281889357915.tmp, -0, arsc, -I, <User 경로>/Library/apktool/framework/1.apk, -S, <Project 경로>/android-SSL-unpinning/com.kakao.talk/res, -M, <Project 경로>/android-SSL-unpinning/com.kakao.talk/AndroidManifest.xml]
[*] Failed to repack com.kakao.talk. Retrying with --use-aapt2 flags
I: Using Apktool 2.8.1
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: <Project 경로>/android-SSL-unpinning/com.kakao.talk/res/values-v31/colors.xml:55: error: resource android:color/Indigo_800 is private.
W: <Project 경로>/android-SSL-unpinning/com.kakao.talk/res/values-v31/colors.xml:56: error: resource android:color/Indigo_700 is private.
W: <Project 경로>/android-SSL-unpinning/com.kakao.talk/res/values-v31/colors.xml:58: error: resource android:color/GM2_grey_800 is private.
W: <Project 경로>/android-SSL-unpinning/com.kakao.talk/res/values-v31/colors.xml:59: error: resource android:color/Blue_800 is private.
W: <Project 경로>/android-SSL-unpinning/com.kakao.talk/res/values-v31/colors.xml:60: error: resource android:color/Blue_700 is private.
W: error: failed linking references.
brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/3_/rsqb2p1n0dqf7b4sf3hfm1kw0000gn/T/brut_util_Jar_2692349490601023949923368222495973472.tmp, link, -o, /var/folders/3_/rsqb2p1n0dqf7b4sf3hfm1kw0000gn/T/APKTOOL18117864369129074700.tmp, --package-id, 127, --min-sdk-version, 24, --target-sdk-version, 33, --version-code, 2410320, --version-name, 10.3.2, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, --enable-sparse-encoding, -e, /var/folders/3_/rsqb2p1n0dqf7b4sf3hfm1kw0000gn/T/APKTOOL17003444383201710203.tmp, -0, arsc, -I, <User 경로>/Library/apktool/framework/1.apk, --manifest, <Project 경로>/android-SSL-unpinning/com.kakao.talk/AndroidManifest.xml, <Project 경로>/android-SSL-unpinning/com.kakao.talk/build/resources.zip]
[-] Failed to repack com.kakao.talk

해당 부분은 apktool 쪽에 이슈를 제보해야 할까요?

ryanking13 commented 10 months ago

저도 같이 정보를 찾아볼 수 있기는 한데, 제가 apktool 전문가가 아닌 관계로 아무래도 apktool 에 직접 물어보시는 게 더 답변이 빠를 것 같네요 :)

Taewan-P commented 10 months ago

넵 알겠습니다 감사합니다! 확인되면 해당 정보 여기 공유하겠습니다.