Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
expo-tag-reader
Advanced tools
expo-tag-reader is an Android only Expo module that allows you to read audio file tags and metadata from your React Native Expo application. It provides simple functions to read tags from individual audio files or to scan directories for audio files and retrieve their metadata.
This was created for use in my project "Flora".
bunx expo install expo-tag-reader
First, import the functions you need from the package:
import { readTags, readAudioFiles, ... or other functions } from "expo-tag-reader";
const fileUri = "file:///path/to/your/audio/file.mp3";
try {
const tags = readTags(fileUri);
console.log(tags);
} catch (error) {
console.error("Error reading tags:", error);
}
try {
// REQUEST READ PERMISSIONS FIRST
const pageSize = 5;
let pageNumber = 1;
let currentPage;
do {
currentPage = await readAudioFiles(pageSize, pageNumber);
pageNumber++;
console.log(currentPage); // current page files
} while (currentPage.length === pageSize);
} catch (error) {
console.error("Error reading audio files:", error);
}
readTags()
Reads the tags from the audio file at the given URI.
fileUri
: The URI of the audio file to read tags from.disableTags
(optional): Add any of the AudioFile
properties to ignore.cacheImages
(optional): Whether to cache album art images. Defaults to true
. If caching is enabled, the artwork property of AudioTags
will be a URI, otherwise it will be Base64.AudioTags
.readAudioFiles()
Reads all audio files from the Music
and Downloads
directory.
pageSize
(optional): The number of audio files to return per page. Defaults to 10
.pageNumber
: The page number to return. Defaults to 1
.cacheImages
(optional): Whether to cache album art images. Defaults to true
.disableTags
(optional): Add any of the AudioFile
properties to ignore.Promise
that resolves with an array of objects of type AudioFile
.setCustomDirectories()
Sets the custom directories to read audio files from.
dirPaths
: An array of paths to directories that contain audio files.Promise
that resolves when the operation is complete.readNewAudioFiles()
Finds and returns new audio files by comparing IDs.
songIds
: The IDs of the songs to read new files from.pageSize
(optional): The number of audio files to return per page. Defaults to 10
.pageNumber
: The page number to return. Defaults to 1
.cacheImages
(optional): Whether to cache album art images. Defaults to true
.disableTags
(optional): Add any of the AudioFile
properties to ignore.Promise
that resolves with an array of objects of type AudioFile
.getRemovedAudioFiles()
Finds and returns the removed audio files by comparing IDs.
songIds
: The IDs of the songs to find removed files from.Promise
that resolves with an array of strings of removed file IDs.type AudioTags = {
title: string;
artist: string;
album: string;
year: string;
genre: string;
track: string;
comment: string;
albumArt: string; // URI or Base64 (default: URI)
sampleRate: string;
bitrate: string;
channels: string;
duration: string; // in ms
};
type AudioFile = {
extension: string;
uri: string;
fileName: string;
tags: AudioTags;
creationDate: string; // in "dd-MM-yyyy"
internalId: string; // unique identifier for the audio file
};
The module supports reading tags from the following audio file formats:
This module is currently implemented for Android only.
internalId
property in the AudioFile
type is essential for tracking new and removed files.FAQs
An Expo Modules that reads metadata from audio files
The npm package expo-tag-reader receives a total of 41 weekly downloads. As such, expo-tag-reader popularity was classified as not popular.
We found that expo-tag-reader demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.