Skip to content

Commit 5902760

Browse files
fix:修改原生层代码,使stat接口的type属性与iOS保持一致 (#8)
1 parent 0afdfb8 commit 5902760

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

harmony/file_access.har

-24 Bytes
Binary file not shown.

harmony/file_access/BuildProfile.ets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Use these variables when you tailor your ArkTS code. They must be of the const type.
33
*/
4-
export const HAR_VERSION = '3.1.0-0.0.2';
4+
export const HAR_VERSION = '3.1.0-0.0.3';
55
export const BUILD_MODE_NAME = 'debug';
66
export const DEBUG = true;
77
export const TARGET_NAME = 'default';

harmony/file_access/obfuscation-rules.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@
1515

1616
# Keep options:
1717
# -keep-property-name: specifies property names that you want to keep
18-
# -keep-global-name: specifies names that you want to keep in the global scope
18+
# -keep-global-name: specifies names that you want to keep in the global scope
19+
-enable-property-obfuscation
20+
-enable-toplevel-obfuscation
21+
-enable-filename-obfuscation
22+
-enable-export-obfuscation

harmony/file_access/oh-package-lock.json5

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "@react-native-oh-tpl/react-native-file-access",
3-
"version": "3.1.0-0.0.2",
3+
"version": "3.1.0-0.0.3",
44
"description": "Keep the screen from going to sleep. iOS , Android and Harmony",
55
"main": "Index.ets",
66
"author": "",
77
"license": "Apache-2.0",
88
"dependencies": {
9-
"@rnoh/react-native-openharmony": 'file:../libs/react_native_openharmony-5.0.0.490.har'
9+
"@rnoh/react-native-openharmony": 'file:../react_native_openharmony'
1010
}
1111
}
1212

harmony/file_access/src/main/ets/RNFileAccessTurboModule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export class RNFileAccessTurboModule extends TurboModule implements TM.FileAcces
257257
statResult.path = path;
258258
statResult.size = stat.size;
259259
statResult.lastModified = stat.mtime;
260-
statResult.type = stat.isDirectory() ? '1' : '0';
260+
statResult.type = stat.isDirectory() ? 'directory' : 'file';
261261
resolve(statResult);
262262
}
263263
});
@@ -390,7 +390,7 @@ export class RNFileAccessTurboModule extends TurboModule implements TM.FileAcces
390390
return {
391391
filename: item,
392392
path: path + "/" + item,
393-
type: stat.isDirectory() ? '1' : '0',
393+
type: stat.isDirectory() ? 'directory' : 'file',
394394
size: stat.size,
395395
lastModified: stat.mtime,
396396
}

0 commit comments

Comments
 (0)