본문 바로가기
프로그래밍/Flutter

[Flutter] 난독화

by YuminK 2022. 4. 28.

# Flutter 난독화 

How to obfuscate Flutter apps?
https://stackoverflow.com/questions/50542764/how-to-obfuscate-flutter-apps

Flutter’s code obfuscation, when supported, works only on a release build.
https://docs.flutter.dev/deployment/obfuscate

Android/iOS/macOS — Supported.
Linux/Windows — Not yet supported.
Web — Obfuscation is not supported for web apps, but a web app can be minified, which is similar. When you build a release version of a Flutter web app, it is automatically minified.

jadx로 디버그, 릴리즈 다 뜯어봤는데 릴리즈 apk에서만 적용

디버그 apk파일에서는 assets/flutter_assets 경로에 kernel_blob.bin 파일이 있어서 
Linux 기반 OS에서 strings kernel_blob.bin > ~.dart 

터미널 커맨드를 사용하여 dart코드를 뜯어서 볼 수 있다.
릴리즈 apk파일에서는 kernel_blob.bin 파일이 생성되지 않음

Flutter/flutter_assets/kernel_blob.bin
file is a Dart kernel bytecode representation of your app's code generated by a compiler in Flutter's toolchain.

since the code is compiled into isolate_snapshot_instr file, which is not a raw arm assembly, and is only deserialized using the Flutter engine in run-time. You can read more about it here
https://github.com/flutter/flutter/wiki/Flutter-engine-operation-in-AOT-Mode

기본적으로 난독화가 적용이 되어 뜯어보려면, 리버싱을 해야 하는 수준으로 보인다.
릴리즈 모드의 동작에 따르면 중간 단어의 언어로 컴파일 되므로 작정하고 뜯지 않는 이상 난독화에서 크게 이슈는 없을 것으로 파악된다.

댓글