how to have a file in the root of the android apk

2019-06-14 12:14发布

I have a file eula.zip which I want to be in root of the android apk when i build from unity3d.

in unity 4.0 I can do this by exporting as android project and pasting the zip file in
android project root and then building apk from eclipse

but I have to do it in unity3.5,
I have tried to place it in following locations-
Assets folder
plugins folder
Plugins/Android folder
none of these seam to work

what should do to have eula.zip in the root of the android apk from unity.

标签: unity3d
4条回答
啃猪蹄的小仙女
2楼-- · 2019-06-14 12:17

There is a solution, it is more a hack, rather than a good way to solve the issue. I have made it this way:

  1. Decompile the apk with apktool

  2. Add file to needed directory of decompiled project

  3. Make sure apktool.yml includes your file when compiling apk

  4. Compile project

  5. Sign obtained apk with jarsigner

查看更多
放我归山
3楼-- · 2019-06-14 12:18

try modify this directory:

C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer

or

C:\Program Files(x86)\Unity\Editor\Data\PlaybackEngines\AndroidPlayer

查看更多
▲ chillily
4楼-- · 2019-06-14 12:33

I know this post is quite old, but it still shows up in the Google search and I found an elegant solution:

Simply copy the files directly into your project's src directory (not into the com.whatever... package).

查看更多
不美不萌又怎样
5楼-- · 2019-06-14 12:35

it sounds like you're looking for the "file:///android_asset/" directory, in the eclipse project it would be in the /assets subdirectory.

in unity, use this:

Plugins/Android/assets

查看更多
登录 后发表回答