Unity3d android Dynamic Update dll

Source: Internet
Author: User

The basic reference is this article: Http://blog.sina.com.cn/s/blog_9e5d42ee0102vvtg.html, a wave of additions and deletions.

Roughly say the basic steps: 1. Download mono source code, modify the source code, compile to get libmono.so, replace the Packer (the development machine is not necessary) Unity installation directory under the libmono.so;

2. In your project check version control where, if the DLL updated, the path "/data/data/packname/files" under the Assembly-csharp.dll deleted,

Under the latest DLL thrown to the path, after the next set up the local version for the latest version;

3. Call the SDK interface to restart the game.

The following is an elaborate:

1.

1) go to GitHub under mono Source (note here, be sure to correspond to your unity version of Mono)

Query your Unity for the mono version of the method: Enter the directory ... \unity\editor\data\mono\bin, executes monop2- Runtime-version Mono. EXE, it'll print out.

Next Mono Address: Https://github.com/Unity-Technologies/mono, corresponding to the mono version.

2) Modify mono source code:

In the load Assembly-csharp.dll place to judge if the loaded byte stream name is Assembly-csharp.dll load the DLL that you saved,
Replace the byte stream of the DLL with the incoming Assembly-csharp.dll byte stream (remember to free the memory) with the following code:

Monoimage *Mono_image_open_from_data_with_name (Char*data, Guint32 Data_len, Gboolean need_copy,
Monoimageopenstatus *status, Gboolean refonly,Const Char*name) { //Modify start 1 intDataSize =0; if(Strstr (Name,"Assembly-csharp.dll")){ //Recalculate Paths Const Char* _pack = STRSTR (name,"com."); Const Char* _pfie = STRSTR (name,"-"); Char_name[ +]; memset (_name,0, +); int_len0 = (int) (_pfie-_pack); memcpy (_name,"/data/data/", One); memcpy (_name+ One, _pack,_len0); memcpy (_name+ One+ _len0,"/files/assembly-csharp.dll", -); G_message ("Momo:path =%s\n", _name); Char* bytes = Readstringfromfile (_name,&datasize);//This own implementation, do not post code, the article began that article hasif(DataSize >0) {Data=bytes; Data_len=datasize; //Data[0]-= (char) GetKey (); //g_message ("Momo:key =%d\n", GetKey ()); } } //Modified End 1 ... //Modify Start 2 if(DataSize >0&& Data! =0) {g_free (data); } //Modified End 2}

3) Compile to get libmono.so,

Compile can be referenced (if the link below fails, go directly to http://www.luzexi.com/unity3d here to see the directory to find):

http://www.luzexi.com/unity3d/%E6%B8%B8%E6%88%8F%E6%9E%B6%E6%9E%84/%E5%89%8D%E7%AB%AF%E6%8A%80%E6%9C%AF/2015/ 04/11/unity3d-%e9%87%8d%e6%96%b0%e7%bc%96%e8%af%91mono%e5%8a%a0%e5%af%86dll.html

After the successful compilation to get libmono.so, replace the Unity installation directory libmono.so, to ensure that the replacement can use Ah, can not use the basic is the mono version of the wrong, search solution.

2. This is the project, but also only version control a small point, more simple than the resource version control, you can see the version of your project control code is good, basically is to put your DLL into the/data/data/packname/files/under the modified mono source code to use.

3. It's needless to say.

Unity3d android Dynamic Update dll

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.