CFTTFileSystem_Android.cpp 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #include <sys/stat.h>
  2. #include <sys/sysconf.h>
  3. #include <unistd.h>
  4. #include <errno.h>
  5. #include <android/asset_manager.h>
  6. #include <android/asset_manager_jni.h>
  7. #include "CFTTFileSystem_Android.h"
  8. #include "CFTTFile_Android.h"
  9. #include "CFTTFileSystem_APKX.h"
  10. #include "CFTTFile_AndroidDocs.h"
  11. #include "str_conv.h"
  12. #include "memctrl.h"
  13. CFTTFile_AsyncQueue *CFTTFileSystem_Android::ms_pAsyncQueue = nullptr; //005CDFCC
  14. bool CFTTFileSystem_Android::s_bHaveExpansionFile = false;
  15. MYSTATIC char *ExpansionPath_5CE3D4 = nullptr;
  16. MYSTATIC AAssetManager *pAAssetManager_5CDFD0; //005CDFD0
  17. char dir_5CDFD4[1024];
  18. //-------------------------------------------------------------------------------------------------
  19. //0026C608 //^_-
  20. CFTTFileSystem_Android::CFTTFileSystem_Android(const char *a2, const char *ptype) {
  21. }
  22. //-------------------------------------------------------------------------------------------------
  23. //0026C694 0026C6B8 //^_^
  24. CFTTFileSystem_Android::~CFTTFileSystem_Android() {
  25. }
  26. //-------------------------------------------------------------------------------------------------
  27. //0026C6C6 //^_^
  28. bool CFTTFileSystem_Android::GetAbsoluteFilename(char const *filepath,
  29. char *pOutputName,
  30. uint outpue_len) {
  31. bool dret = false;
  32. return dret;
  33. }
  34. //-------------------------------------------------------------------------------------------------
  35. //0026C81E //^_^
  36. CFTTFile *CFTTFileSystem_Android::Open(char const *filepath,
  37. uint a3,
  38. EFTTMemHeapID eHeapId) {
  39. return 0;
  40. }
  41. //-------------------------------------------------------------------------------------------------
  42. //0026C852 //^_^
  43. EFTTError CFTTFileSystem_Android::Delete(char const *filepath) {
  44. EFTTError derror;
  45. return derror;
  46. }
  47. //-------------------------------------------------------------------------------------------------
  48. //0026C898 //其中的while循环被编译器优化掉了
  49. EFTTError CFTTFileSystem_Android::Rename(char const *oldpath,
  50. char const *newpath,
  51. CFTTFileSystem *pFileSystem_arg) {
  52. EFTTError errRet;
  53. return errRet;
  54. }
  55. //-------------------------------------------------------------------------------------------------
  56. //0026C90C //^_^ 唯有这个函数有栈保护
  57. EFTTError CFTTFileSystem_Android::Copy(char const *src, char const *dst, bool) {
  58. EFTTError eret;
  59. return eret;
  60. }
  61. //-------------------------------------------------------------------------------------------------
  62. //0026C9D0 //^_^
  63. EFTTError CFTTFileSystem_Android::OpenDir(char const *pDir,
  64. CFTTFileIterator **ppFileIt) {
  65. EFTTError eret;
  66. // loc_26CA7C
  67. return eret;
  68. }
  69. //-------------------------------------------------------------------------------------------------
  70. //0026CAAC //^_^
  71. bool CFTTFileSystem_Android::FileExistsFS(char const *filepath) {
  72. bool bret = false;
  73. return bret;
  74. }
  75. //-------------------------------------------------------------------------------------------------
  76. // AAsset* AAssetManager_open(AAssetManager* mgr, const char* filename, int mode);
  77. //0026CB00 //^_^
  78. EFTTError CFTTFileSystem_Android::GetAttributesFS(char const *filepath, TFTTFileAttributes *pAttr) {
  79. EFTTError err;
  80. return err;
  81. }
  82. //-------------------------------------------------------------------------------------------------
  83. //0026C548 //^_^
  84. char *CFTTFileSystem_Android::AndroidGetExpansionPath() {
  85. return ExpansionPath_5CE3D4;
  86. }
  87. //-------------------------------------------------------------------------------------------------
  88. //0026C520 //^_^ AAssetManager *arg_pAAssetManager
  89. void CFTTFileSystem_Android::AndroidSetAssetManager(void *arg_pAAssetManager) {
  90. LOGE("CFTTFileSystem_Android::AndroidSetAssetManager%p",arg_pAAssetManager);
  91. }
  92. //-------------------------------------------------------------------------------------------------
  93. //0026C554 //^_^
  94. void CFTTFileSystem_Android::AndroidSetExpansionPath(char const *filepath) {
  95. LOGE("AndroidSetExpansionPath%p%s",filepath,filepath);
  96. }
  97. //-------------------------------------------------------------------------------------------------
  98. //0026C52C //^_^
  99. int CFTTFileSystem_Android::AndroidSetExternalFilesDir(char const *dirpath) {
  100. // memset(dir_5CDFD4, 0, 1024);
  101. LOGE("AndroidSetExternalFilesDir%p%s",dirpath,dirpath);
  102. return 0;
  103. }
  104. //-------------------------------------------------------------------------------------------------
  105. //0026C818 //^_^
  106. void CFTTFileSystem_Android::CloseAsset(AAsset *a2) {
  107. }
  108. //-------------------------------------------------------------------------------------------------
  109. //0026C480 //^_-
  110. EFTTError CFTTFileSystem_Android::ErrorInternal(int errid, CFTTFile_Android *pFile, char const *name) {
  111. return EFTTError_0;
  112. }
  113. //-------------------------------------------------------------------------------------------------
  114. //0026C574 //^_^
  115. void CFTTFileSystem_Android::InitExpansionFilesystem() {
  116. }
  117. //-------------------------------------------------------------------------------------------------
  118. //0026C7E0 //^_^
  119. AAsset *CFTTFileSystem_Android::OpenAsset(char const *a2) {
  120. return 0;
  121. }
  122. //-------------------------------------------------------------------------------------------------
  123. //0026C708 //^_-
  124. CFTTFile *CFTTFileSystem_Android::Open_Common(char const *filepath,
  125. uint dMod,
  126. EFTTMemHeapID eHeapId) {
  127. // loc_26C7A2
  128. return nullptr;
  129. }
  130. //-------------------------------------------------------------------------------------------------
  131. //0026CB74 //^_^
  132. void CFTTFileSystem_Android::Shutdown() {
  133. }
  134. //-------------------------------------------------------------------------------------------------