如何查看Flutter App的混淆结果? [英] How to check obfuscation results of flutter app?
问题描述
在本机android开发中,我可以检查我的minifyEnabled是否已生效.
In native android development I could check whether my minifyEnabled had taken effect.
我使用了这个脚本(在Linux中),该脚本允许我提取apk并查看java文件,以查看我的代码是否可读或已被混淆:
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
如果我在Flutter APK上使用此脚本,则看不到任何文件包含与原始代码相关的任何文件.
If I use this script on a flutter apk, I don't see any files containing anything related to my original code.
推荐答案
Flutter的dart代码被编译为本机并嵌入到flutter.so运行时中,因此反编译flutter并不像java/kotlin的字节码那样容易 但是,可以反编译.so文件.您可以使用android ndk中的工具链来执行所需的拆卸类型
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
但这只是给你一个objdump.
but this is just give you an objdump.
这篇关于如何查看Flutter App的混淆结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!