netpyoung / SqlCipher4Unity3D

💾 SqlCipher made easy for Unity3d
MIT License
163 stars 37 forks source link

what the file link.xml must contain and where to place it #3

Closed cabanel closed 6 years ago

cabanel commented 6 years ago

hi, in http://unitylist.com/r/9qg/sql-cipher-4-unity3d

is write : If You are on iOS, need to modify link.xml for prevent stripping by Unity.

what the file link.xml must contain and where to place it

can you help me?

thank you

netpyoung commented 6 years ago

at first you need to understand that. https://docs.unity3d.com/Manual/IL2CPP-BytecodeStripping.html

to prevent stripping.

for example.

Person.cs with [Preserve] attribute

namespace HelloWorld.Nice.To.Meet
{
    [Preserve]
    public class Person  {

    [PrimaryKey, AutoIncrement]
    public int Id { get; set; }
    public string Name { get; set; }
    }
}

link.xml under directory Assets/ or Assets/'s subdirectory

<linker>
    <assembly fullname="HelloWorld.Nice.To.Meet" preserve="all"/>
</linker>%
cabanel commented 6 years ago

I use SQLite4Unity3d for some time and I've never entered

using [Preserve] attribute or using link.xml

is it necessary to do it for encryption of SqlCipher4Unity3D?

thanks

netpyoung commented 6 years ago

unity's IL2CPP build not only stripping unused code. sometime stripping class name. for example

db.sqlite

Hello

id value
1 val

Hello.cs

class Hello
{
  int id { get; set;}
}

you can't find name by Hello so It will be failed without prevent stripping db.Get<Hello>(x => x.id == 1);

cabanel commented 6 years ago

but this also happens with SQLite4Unity3d?

netpyoung commented 6 years ago

I think also happen in SQLite4Unity3D if ios building with.

cabanel commented 6 years ago

I've been using SQLite4Unity3d for years to develop apps for ios and I've never used

[Preserve] attribute or link.xml

netpyoung commented 6 years ago

um.. I don't know exactly. but In my case It needed. If that's work what you said, It also good.

netpyoung commented 6 years ago

@cabanel Is it okay to close this issue?