{"id":15018388,"url":"https://github.com/nativescript/nativescript-app-encryption","last_synced_at":"2025-10-19T16:30:46.567Z","repository":{"id":57308381,"uuid":"72532371","full_name":"NativeScript/nativescript-app-encryption","owner":"NativeScript","description":"This plugin encrypts all your app/**.js files during a release build. In experimental state.","archived":false,"fork":false,"pushed_at":"2019-01-07T16:35:23.000Z","size":215,"stargazers_count":35,"open_issues_count":8,"forks_count":6,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-10-29T15:51:50.841Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NativeScript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-01T12:05:10.000Z","updated_at":"2021-05-28T11:01:14.000Z","dependencies_parsed_at":"2022-09-07T03:10:28.811Z","dependency_job_id":null,"html_url":"https://github.com/NativeScript/nativescript-app-encryption","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fnativescript-app-encryption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fnativescript-app-encryption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fnativescript-app-encryption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NativeScript%2Fnativescript-app-encryption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NativeScript","download_url":"https://codeload.github.com/NativeScript/nativescript-app-encryption/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237163189,"owners_count":19265225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T19:51:54.453Z","updated_at":"2025-10-19T16:30:39.203Z","avatar_url":"https://github.com/NativeScript.png","language":"JavaScript","readme":"__ATTENTION: This repository is deprecated. Use [Webpack with uglify](https://docs.nativescript.org/tooling/bundling-with-webpack#uglifyjs) as an encryption alternative.__\n\n\nThis plugin encrypts all of your `app/**.js` files during a release build.\n\n# How it works\nThis plugins encrypts all `.js` files in the `app` folder, except those under `tns_modules` with a unique AES256 key that is generated on  each build.\nOn Android, the key is embedded in native code, on iOS - the key is kept in additional __DATA section in the app binary.\n\n*For the future we are thinking about enhancing the way the encryption key is used. We need your input here. For the moment the plugin is responsible for storing and retrieving the key, but we are open for other suggestions on how to improve this.* See [#1](https://github.com/NativeScript/nativescript-app-encryption/issues/1).\n\nEncryption is only applied for Release builds.\n\nDecryption is transparently performed the first time a file is `require`d and the result is only cached in-memory.\n\n### `generate-aes256-key.js`\nGenerates a 256-bit Base64-encoded AES key during a release build.\n\n### `encrypt-file.js`\nEncrypts a file with AES256 (you don't need to do this yourself).\nUsage: `encrypt-file.js \u003cbase64-encoded key\u003e \u003cinput file path\u003e \u003coutput file path\u003e`\n\n# Usage\nInstall the platforms you need for your app before installing this plugin: `tns platform add [ios|android]`\n\n## iOS\nNo additional steps required; just `tns build ios --release` and your `.js` files will be encrypted in the `.ipa` binary.\n\nYou can validate this on a Mac by right-clicking the `.ipa` and inspecting the package contents.\n\n## Android\nNo additional steps required; just `tns build android --release` and your `.js` files will be encrypted in the `.apk` binary.\n\nTo test the plugin in debug comment out the following line in `platforms/android/include.gradle`\n\n`appProtectionInclude.onlyIf { project.hasProperty('release') }`\n\n### Additional protection\n[Use Proguard or Dexguard](http://proguard.sourceforge.net/FAQ.html#encrypt) to obfuscate or encrypt strings in native files so the encryption key is hidden even more deeply. \n\n### Further reading\nEncryption does not guarantee 100% protection. Any sensitive/critical logic should be kept on the server. Please read this blog post for more details - [How secure is NativeScript?](https://www.nativescript.org/blog/how-secure-is-nativescript).\n\n### Next steps\nwith our 2.5 release we will also enable code obfuscation for the code as part of our integration with WebPack.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript%2Fnativescript-app-encryption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnativescript%2Fnativescript-app-encryption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript%2Fnativescript-app-encryption/lists"}