少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "il2cpp-config.h"
 
#if IL2CPP_TARGET_LUMIN
 
#include "Lifecycle.h"
 
#include "ml_lifecycle.h"
/*!
    \brief Path to the writable dir of the application. This path is valid when the
    user is logged in and using the device, i.e the device is unlocked. This path
    is not available when device is locked.
   */
std::string s_WritableDirPath = "";
/*! Path to the application package dir. */
std::string s_PackageDirPath = "";
/*! Package name of the application. */
std::string s_PackageName = "";
/*! Component name of the application. */
std::string s_ComponentName = "";
/*! Path to the application tmp dir. */
std::string s_TmpDirPath = "";
/*! \brief Visible name of the application */
std::string s_VisibleName = "";
 
 
namespace il2cpp
{
namespace os
{
namespace lumin
{
    std::string GetPackageName() { return s_PackageName; }
 
    std::string GetPackageTempPath() { return s_TmpDirPath; }
 
    void LifecycleInit()
    {
        MLLifecycleSelfInfo* info = NULL;
        if (MLLifecycleGetSelfInfo(&info) == MLResult_Ok)
        {
            s_PackageName = info->package_name;
            s_TmpDirPath = info->tmp_dir_path;
            s_WritableDirPath = info->writable_dir_path;
 
            MLLifecycleFreeSelfInfo(&info);
        }
    }
}
}
}
#endif