Package net_62v.external
Class MetaStorageManager
java.lang.Object
net_62v.external.MetaStorageManager
Mundo storage manager, you can use the storage related api by using this class.
- Version:
- 1.2
- Author:
- [email protected]
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic File
obtainAppDataDir
(String packageName, int splitRegion) Alias of the function obtainAppDataDirstatic File
obtainAppDataDir
(String packageName, String splitRegion) Get the application data dir
You must specific the package name and user name.static String
obtainAppExternalStorageDir
(String appPkg) Obtain an external relative (not absolutely path) path by package name
The path will mostly like to be /storage/emulated/0/Android/obb/[Your Package Name]/scopedStorage/[appPkg]static boolean
setExternalRootDirectory
(String newRoot) Deprecated.Please use the default configuration to evade the read and write issues above Android 11.
-
Constructor Details
-
MetaStorageManager
public MetaStorageManager()
-
-
Method Details
-
obtainAppDataDir
Get the application data dir
You must specific the package name and user name.- Parameters:
packageName
- package name of the appsplitRegion
- user name- Returns:
- data dir
- See Also:
-
obtainAppDataDir
Alias of the function obtainAppDataDir- Parameters:
packageName
- package namesplitRegion
- user name- Returns:
- data dir
- See Also:
-
obtainAppExternalStorageDir
Obtain an external relative (not absolutely path) path by package name
The path will mostly like to be /storage/emulated/0/Android/obb/[Your Package Name]/scopedStorage/[appPkg]- Parameters:
appPkg
- package name- Returns:
- A relative path, please do not hardcode the external path.
- Throws:
RemoteException
- See Also:
-
setExternalRootDirectory
Deprecated.Please use the default configuration to evade the read and write issues above Android 11.Set the external directory root, and the external file structures will be [Your new external storage root dir]/[appPkg]
If you change this path manually after an app upgrade, you must delete or move the origin dir manually.
You must call this function before you launch the app, the application that already launched will continue to use the old path.- Parameters:
newRoot
- New external storage root directory, which must be writeableFile.canWrite()
.- Returns:
- If the changes be applied successfully then true, otherwise false
- Throws:
RemoteException
- Since:
- 1.2
- See Also:
-