Search Unity

I want to encrypt assets/bin/data in the apk file. But show error

Discussion in 'Android' started by yu11111222, May 13, 2021.

  1. yu11111222

    yu11111222

    Joined:
    May 13, 2021
    Posts:
    1
    I packaged bin/data into a encrypted zip file
    then
    In Application.attachBaseContext(), I release the resource to /data/data/xxxxx/file/res.zip
    then
    Add the resource to the AssetManager, but unity prompts that the resource cannot be found
    Then I noticed
    In unity, Application.dataPath =/data/APP/xxxxx/base. Apk/
    I think unity may directly read base.apk to load resources. As long as I can modify the value of base.apk, I can modify the load path.
    so
    I hook LoadedApk and modify Applicationinfo.sourceDir and Applicationinfo.publicSourceDir to/data/data/xxxxx/file/res.zip, but not find too
    How does unity read the path to base.apk?
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,918
    I don't think you can achieve this, Unity is directly accessing those files via native layer.