Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Automatic splash screen generation and resizing for Mobile Apps. Supports Native, React Native, Cordova, Xamarin and more. The little brother of 'app-icon'.
Automatic splash screen generation and resizing for Mobile Apps. Supports Native, React Native, Cordova, Xamarin and more. The little brother of app-icon
.
This simple tool allows you to create a single icon in your app project, then create icons of all required sizes from it. It currently works for iOS and Android. You can also add labels to your app icons.
Install with:
npm install -g app-icon
You will need imagemagick installed:
brew install imagemagick # OSX
sudo apt-get install imagemagick # Debian/Ubuntu/etc
sudo yum install imagemagick # CentOS/etc
The commandline tool can be used to generate icons or label icons.
Add an icon (ideally at least 192x192 pixels) named icon.png
to your project root. To automatically generate icons of all sizes for all app projects in the same folder, run:
app-icon generate
If an iOS project is present, then the icon will be copied at all required sizes to:
./ios/<ProjectName>/Images.xcassets/AppIcon.appiconset
If an Android project is present, then the icon will be copied at all required sizes to:
./android/app/src/main/res
You can limit the platforms which icons are generated for with the --platforms
flag, specifying:
app-icon generate --platforms=ios
app-icon generate --platforms=android,ios
By default the tool will generate icons for both platforms.
You can specify the path to the source icon, as well as the folder to search for app projects, just run app-icon generate -h
to see the options.
Add labels to an icon with the command below:
app-icon label -i icon.png -o output.png --top UAT --bottom 0.12.3
This would produce output like the below image:
This is a useful trick when you are creating things like internal QA versions of your app, where you might want to show a version number or other label in the icon itself.
The only dependencies are Node 6 (or above) and Yarn.
Useful commands for development are:
Command | Usage |
---|---|
npm test | Runs the unit tests. |
npm run test:debug | Runs the tests in a debugger. Combine with .only and debugger for ease of debugging. |
npm run cov | Runs the tests, writing coverage reports to ./artifacts/coverage . |
Currently the linting style is based on airbnb. Run npm run lint
to lint the code.
Install the dependencies (I recommend Node Version Manager):
nvm install 6
nvm use 6
npm install -g yarn
git clone git@github.com:dwmkerr/app-icon.git
cd app-icon
yarn
Run the tests with:
npm test
Tests are executed with Mocha and coverage is handled by Istanbul. Coverage reports are written to an ./artifacts
folder.
To create a release.
npm version
to bump, e.g. npm version patch
git push --tags && git push && npm publish
This project includes some sample apps in the test
folder, which are used for the tests. You can also run these apps to see the icons produced in action.
To run:
cd ./test/ReactNativeIconTest/
npm install
react-native run-ios
# OR react-native run-android
To run:
cd ./test/CordovaApp/
npm install
cordova run ios
# OR cordova run android
To run the native apps, open the ./test/NativeApp
directory, then open the iOS/Android projects in XCode/AndroidStudio as needed.
Images labelled with app-icon label
have the text slightly vertically offset
This seems to be an issue with Imagemagick 6 - try upgrading to 7.
MIT
FAQs
Automatic splash screen generation and resizing for Mobile Apps. Supports Native, React Native, Cordova, Xamarin and more. The little brother of 'app-icon'.
We found that app-splash 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
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.