Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin 如何反编译appconfig.json_Xamarin_Apk_App Config_Reverse Engineering_Api Key - Fatal编程技术网

Xamarin 如何反编译appconfig.json

Xamarin 如何反编译appconfig.json,xamarin,apk,app-config,reverse-engineering,api-key,Xamarin,Apk,App Config,Reverse Engineering,Api Key,我使用的是Xamarin,我的所有API密钥都存储在PCL中一个名为appconfig.json的文件中 生成APK时,我的API密钥存储在哪里 有人能用这个APK和反编译来获取这个文件的内容吗 我知道这是可能的,但我在mac电脑上,因此无法访问windows工具 有人能带我完成这些步骤,在编译appconfig.json后阅读它的内容吗?只有这样我才能证明这是可以做到的——我知道这是可以做到的,只是我花了太长时间。谢谢 对于Android应用程序,您可以将任意文件作为 因此,假设我在应用程序的

我使用的是Xamarin,我的所有API密钥都存储在PCL中一个名为appconfig.json的文件中

生成APK时,我的API密钥存储在哪里

有人能用这个APK和反编译来获取这个文件的内容吗

我知道这是可能的,但我在mac电脑上,因此无法访问windows工具


有人能带我完成这些步骤,在编译appconfig.json后阅读它的内容吗?只有这样我才能证明这是可以做到的——我知道这是可以做到的,只是我花了太长时间。谢谢

对于Android应用程序,您可以将任意文件作为


因此,假设我在应用程序的一个程序集中(调用
SomeLibrary
)将此json文件标记为
EmbeddedResource

我存档并发布
.apk

提取apk含量 搜索所有嵌入式资源: 使用
ikdasm
搜索嵌入式资源:

find . -name "*.dll" -print0 | xargs -n 1 -0 -J % ikdasm % | grep .mresource

.mresource public charinfo.nlp
.mresource public collation.core.bin
.mresource public collation.tailoring.bin
.mresource public mscorlib.xml
.mresource public SomeLibrary.appconfig.json
找到了
appconfig.json
资源,因此我们可以再次使用
ikdasm
获取详细信息

SomeLibrary.appconfig.json详细信息: 结果:
string
获取详细信息的程序集:
我想这不是我要问的。我在问我的应用程序中是否有一个名为appconfig.json的文件,编译时内容保存到哪里?您是说此文件将保存在资产下?您是在询问如何在生成时在APK中包含任意文件。答案是使用Android AssetI我在问是否有人可以对APK进行反编译以查看包含在我的PCLIm中的JSON文件不太确定实际上,我们是MVVM iOC容器,并在OnCreate()期间在本机层初始化它,但appconfig.JSON来自PCL。当我打开APK的Zip时,我可以进入assemblies->dll.config,但我不认为这是我想要的我们只是在运行时读取JSON文件的内容啊,我看到这里我们将它嵌入为一个程序集资源,并像这样读取->'var resourceNames=assembly.GetManifestResourceNames();'建议在中询问有关反向工程的问题。哇,@SushiHangver,你是一个寿司忍者。这正是我想要的,这太棒了。谢谢@斯蒂芬:没问题。。。
{
    "Password": "SushiHangover",
    "Logging": {
        "Debug": {
            "LogLevel": {
                "Default": "Warning"
            }
        },
        "Console": {
            "LogLevel": {
                "Default": "Warning"
            }
        }
    }
}
unzip com.sushihangover.SomeApp.apk -d foobar
find . -name "*.dll" -print0 | xargs -n 1 -0 -J % ikdasm % | grep .mresource

.mresource public charinfo.nlp
.mresource public collation.core.bin
.mresource public collation.tailoring.bin
.mresource public mscorlib.xml
.mresource public SomeLibrary.appconfig.json
ikdasm assemblies/SomeLibrary.dll
~~~~
69 62 72 61 72 79 00 00 ) // ...SomeLibrary..
  .hash algorithm 0x00008004
  .ver 1:0:0:0
}
.mresource public SomeLibrary.appconfig.json
{
  // Offset: 0x00000000 Length: 0x00000116
  // WARNING: managed resource file SomeLibrary.appconfig.json created
}
.module SomeLibrary.dll
// MVID: {3100E9F8-3BB0-4E49-ADC7-33B284FCCFAE}
.imagebase 0x00400000
~~~~
cd foobar
find . -name "*.dll" -print0 | xargs -n 1 -0 -J % strings %

~~~
mscoree.dll
!This program cannot be run in DOS mode.
.text
`.rsrc
@.reloc
    "Password": "SushiHangover",
    "Logging": {
        "Debug": {
            "LogLevel": {
                "Default": "Warning"
            }
        },
        "Console": {
            "LogLevel": {
                "Default": "Warning"
            }
        }
    }
BSJB
v4.0.30319
~~~~