
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
cordova-plugin-simple-file
Advanced tools
SimpleFile is a Cordova plugin that lets you read and write files from the filesystem.
You can also create/remove directories, extract the URI from a file and download remote content to a file.
It currently features support for Android and iOS.
From the root of a cordova project run:
$ cordova plugin add https://github.com/uniclau/SimpleFile.git
The plugin exposes the window.plugins.simpleFile
object. It provides access to different file systems through their corresponding object:
plugins.simpleFile.internal
/var/mobile/Applications/<UUID>/Library/NoCloud
/data/data/<app-id>/files
plugins.simpleFile.internal
/var/mobile/Applications/<UUID>/Library
/data/data/<app-id>/files
plugins.simpleFile.external
/var/mobile/Applications/<UUID>/Library/NoCloud
internal
filesystem.<sdcard>/
plugins.simpleFile.bundle
www
)window.plugins.simpleFile.<fs>.read(fileName, successCallback, errorCallback)
Reads the contents of a file and provides them to the given successCallback.
window.plugins.simpleFile.<fs>.write(fileName, contents, successCallback, errorCallback)
Writes the contents in contents
to the path provided in fileName
. This function will create any folders in fileName
that do not exist yet.
Note: This will not work if you use it with the bundle
filesystem.
window.plugins.simpleFile.<fs>.remove(fileName, successCallback, errorCallback)
Removes the file or folder specified in fileName
. If fileName
is a folder, all of its contents are removed as well.
Note: This will not work if you use it with the bundle
filesystem.
window.plugins.simpleFile.<fs>.getURL(fileName, successCallback, errorCallback)
Provides the URL to reference a file from inside the browser.
window.plugins.simpleFile.<fs>.download(url, fileName, successCallback, errorCallback)
Downloads a file and saves the contents to the file specified in fileName
.
This function will create any folders in fileName
that do not exist yet.
Note: This will not work if you use it with the bundle
filesystem.
window.plugins.simpleFile.<fs>.createFolder(dirName, successCallback, errorCallback)
Creates a folder and all the parent directories that do not exist yet.
Note: This will not work if you use it with the bundle
filesystem.
window.plugins.simpleFile.<fs>.list(folderName, successCallback, errorCallback)
Provides the successCallback
function with an array of objects, containing the files and folders contained inside the folderName
directory.
Every object in the array has the following structure:
{
name: "file.txt",
isFolder: false
}
To list the root directory, just set folderName
to either ""
or "."
window.plugins.simpleFile.copy(originFilesystem, originFileOrFolder, destinationFilesystem, destinationFileOrFolder, successCallback, errorCallback)
Copies the file or folder (with all its contents) to the given destination.
As an example:
window.plugins.simpleFile.copy('bundle', 'logo.png', 'internal', 'logo.png', successCallback, errorCallback)
The next example copies the phonegap logo to the internal directory and sets that logo.png as the current page of the webView:
window.plugins.simpleFile.bundle.read("www/img/logo.png",function(data) {
window.plugins.simpleFile.internal.write("logo.png", data, function() {
window.plugins.simpleFile.internal.getUrl("logo.png", function(url) {
alert(url);
window.location.href = url;
},function(err) {
alert("ERROR in getUrl: "+err);
});
},function(err) {
alert("ERROR: write: "+err);
});
},function(err) {
alert("ERROR: read: "+err);
});
FAQs
SimpleFile ==========
The npm package cordova-plugin-simple-file receives a total of 6 weekly downloads. As such, cordova-plugin-simple-file popularity was classified as not popular.
We found that cordova-plugin-simple-file demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.