java.lang.Object | |
↳ | com.samsung.android.knox.sdp.SdpFileSystem |
Deprecated in API level 33
SdpFileSystem provides convenient APIs for manipulating file(s) as sensitive.
API level 19 |
KNOX 2.6 |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Deprecated
in API level 33
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
| |||||||||||
Deprecated
in API level 33
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Deprecated in API level 33
Construct a new SdpFileSystem object with the given context and alias. This can be used to manipulate the Sdp filesystem.
Usage:
        An application developer can use this constructor to create an instance of the object.
try { String alias = "sdpDemo"; // In case of default engine, alias will be null. SdpFileSystem sdpFileSystem = new SdpFileSystem(mContext, alias); File file = new File(sdpFileSystem.getFilesDir(), "file_path"); } catch (SdpException e) { e.printStackTrace(); }
c | Android Context. Interface to global information about an application environment. |
---|---|
alias | SdpEngine alias. null for default engine. |
SdpException | thrown when SDP engine doesn't exist, license activation is required or internal error has occured. |
---|
API level 19 |
KNOX 2.6 |
User Scope |
Deprecated in API level 33
API returns application specific cache directory in the encrypted filesystem. Application specific temporary files can be stored at this location. This is the encrypted storage equivalent of Android API getCacheDir().
Usage:
        An Application Developer can use this API to get the handle of encrypted data cache directory related to the engine information passed to SdpFileSystem.
try { String alias = "alias"; SdpFileSystem sFS = new SdpFileSystem(this, alias); File cacheDir = sFS.getCacheDir(); } catch (SdpException e ) { e.printStackTrace(); }
API level 19 |
KNOX 2.6 |
User Scope |
Deprecated in API level 33
API returns the absolute path of the database on the encrypted filesystem,
created with openOrCreateDatabase(String, int, CursorFactory)
or openOrCreateDatabase(String, int, CursorFactory, DatabaseErrorHandler)
.
Usage:
        Deleting a database by checking the existance of the DatabasePath.
File database = mContext.getDatabasePath(mDbFileName); if (database.exists()) { database.delete(); } openDatabase();
name | Database name. |
---|
API level 19 |
KNOX 2.6 |
User Scope |
Deprecated in API level 33
API returns the external storage directory root in the encrypted filesystem. The external storage is shared between all the applications and can hold relatively large data. This is the encrypted storage equivalent of Android API getExternalStorageDirectory().
Usage:
        An Application Developer can use this API to get the handle of encrypted external storage related to the engine information passed to SdpFileSystem.
try { String alias = "alias"; SdpFileSystem sFS = new SdpFileSystem(this, alias); File encDir = sFS.getExternalStorageDirectory(); } catch (SdpException e ) { e.printStackTrace(); }
API level 19 |
KNOX 2.6 |
User Scope |
Deprecated in API level 33
API returns the external storage directory root in the encrypted filesystem. The external storage is shared between all the applications and can hold relatively large data. This is the encrypted storage equivalent of Android API getExternalStorageDirectory().
Usage:
        An Application Developer can use this API to get the handle of encrypted external storage path with the specific user id.
int userId = 0; File encDir = SdpFileSystem.getExternalStorageDirectory(userId);
userId | Android user id. |
---|
API level 19 |
KNOX 2.6 |
User Scope |
Deprecated in API level 33
API returns application specific files directory in the encrypted filesystem. Application specific private files can be stored at this location. This is the encrypted storage equivalent of Android API getFilesDir().
Usage:
        This test starts to determine the files directory by returning the directory location to the variable "file".
try { String alias = "sdpDemo"; // In case of default engine, alias will be null. SdpFileSystem sdpFileSystem = new SdpFileSystem(mContext, alias); File file = new File(sdpFileSystem.getFilesDir(), "file_path"); boolean result = false; if(!sdpFileSystem.isSensitive(file)) { result = sdpFileSystem.setSensitive(file) } } catch (SdpException e) { e.printStackTrace(); }
API level 19 |
KNOX 2.6 |
User Scope |
Deprecated in API level 33
API returns the file object of the protected directory in the device's external storage. This is provided only for a managed profile.
API level 19 |
KNOX 2.6 |
User Scope |
Deprecated in API level 33
API returns the applications specific data directory root in the encrypted filesystem. This is the encrypted storage equivalent of Android API getDataDirectory().
Usage:
        An application developer can use this API to get the handle of encrypted data directory path related to the engine information passed to SdpFileSystem.
try { String alias = "alias"; SdpFileSystem sFS = new SdpFileSystem(this, alias); File encDir = sFS.getUserDataDir(); } catch (SdpException e) { e.printStackTrace(); }
API level 19 |
KNOX 2.6 |
User Scope |
Deprecated in API level 33
API returns the applications specific data directory root in the encrypted filesystem. This is the encrypted storage equivalent of Android API getDataDirectory().
Usage:
        An application developer can use this API to get the handle of encrypted package directory path.
int userId = 0; File encDir = SdpFileSystem.getUserDataDir(userId, "com.example.packagename");
userId | Android user id. |
---|---|
packageName | Application package name. |
API level 19 |
KNOX 2.6 |
User Scope |
Deprecated in API level 33
API checks if the file is sensitive.
Usage:
        An application developer can use this API to check whether target file is sensitive or not.
try { String alias = "alias"; File file = new File(filename); SdpFileSystem sFS = new SdpFileSystem(this, alias); if(sFS.isSensitive(file)) { Log.d(TAG, "Sensitive file!"); } } catch (SdpException e) { e.printStackTrace(); }
f | File object representing the file to test for sensitive attribute. |
---|
true
if file is sensitive, otherwise false
.API level 19 |
KNOX 2.6 |
User Scope |
Deprecated in API level 33
API returns a handle to an application specific SQLiteDatabase and creates the database file if it doesn't exist. This is the encrypted storage equivalent of Android API openOrCreateDatabase().
name | The database name. |
---|---|
mode | Operating mode: MODE_PRIVATE for the default operation, MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE to control permissions. |
factory | An optional factory class that is called to instantiate a cursor when sqlite query is called on the database object. |
errorHandler | DatabaseErrorHandler to be used when sqlite reports database corruption.
If null , DefaultDatabaseErrorHandler is assumed. |
API level 19 |
KNOX 2.6 |
User Scope |
Deprecated in API level 33
API returns a handle to an application specific SQLiteDatabase and creates the database file if it doesn't exist. This is the encrypted storage equivalent of Android API openOrCreateDatabase().
name | The database name. |
---|---|
mode | Operating mode: MODE_PRIVATE for the default operation, MODE_WORLD_READABLE and MODE_WORLD_WRITEABLE to control permissions. |
factory | An optional factory class that is called to instantiate a cursor when sqlite query is called on the database object. |
API level 19 |
KNOX 2.6 |
User Scope |
Deprecated in API level 33
API sets the file(s) as sensitive.
A sensitive file can be decrypted only when the SdpEngine
is unlocked.
This method will fail, if the file is not located in SdpFileSystem
or the SdpEngine
is removed/tampered with.
NOTE: To determine the file path, do not use the Android API getExternalStorageDirectory(). Use one of the following SDP APIs instead:
getExternalStorageDirectory()
,
getFilesDir()
Usage:
        An application developer can use this API to set target file as sensitive.
try { String alias = "alias"; File file = new File(filename); SdpFileSystem sFS = new SdpFileSystem(this, alias); sFS.setSensitive(file); } catch (SdpException e) { e.printStackTrace(); }
f | File object representing the file to be set as sensitive. |
---|
true
on success, otherwise false
.API level 19 |
KNOX 2.6 |
User Scope |