How to check obfuscation results of flutter app?

放肆的年华 提交于 2019-12-11 16:51:38

问题


In native android development I could check whether my minifyEnabled had taken effect.

I used this script (in linux) which allows me to extract the apk and view the java files to see if my code is readable, or has been obfuscated :

#! /bin/bash
d2j=/work/installs/dex2jar-2.0
jdgui=/work/installs/jd-gui-1.4.0.jar
apk_loc=/work/projects/my_app/build/app/outputs/app-release.apk

mkdir -p /work/tmp/dex
rm -rf /work/tmp/dex/*
cd /work/tmp
cp $apk_loc ./app-release.zip
unzip app-release.zip -d dex
cd dex

chmod +x $d2j/*.sh
$d2j/d2j-dex2jar.sh classes.dex

java -jar $jdgui classes-dex2jar.jar

If I use this script on a flutter apk, I don't see any files containing anything related to my original code.


回答1:


Flutter's dart code is compiled to native and embedded to flutter.so runtime, so decompiling flutter is not as easy as byte code of java/kotlin However decompiling .so file is possible. You can use the toolchains inside the android ndk to perform the type of disassembling you want to

./android-ndk-r15b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-objdump -T "flutter.so | less

but this is just give you an objdump.



来源:https://stackoverflow.com/questions/51342391/how-to-check-obfuscation-results-of-flutter-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!