New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cordovax-edit-ats

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordovax-edit-ats - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

16

index.js

@@ -17,8 +17,14 @@ // npm install cordova-common 2.2.3

var ConfigFile = require(cordovaCommonPath).ConfigFile;
var plistHelper = require(path.resolve(cordovaCommonPath, 'src', 'util', 'plist-helpers'));
var configFile = new ConfigFile(iosPlatformPath, 'ios', '*-Info.plist');
if (command === 'create') {
logger.log("creating NSAppTransportSecurity");
configFile.graft_child('NSAppTransportSecurity',
{xml:'<dict><key>NSAllowsArbitraryLoads</key><true/></dict>'}
);
if (['create', 'create_true', 'create_false'].includes(command)) {
var value = ['create', 'create_true'].includes(command) ? 'true' : 'false';
logger.log('creating NSAppTransportSecurity NSAllowsArbitraryLoads ' + value);
if (configFile.data['NSAppTransportSecurity']) { // alread exists
configFile.data['NSAppTransportSecurity']['NSAllowsArbitraryLoads'] = value == 'true';
} else {
configFile.graft_child('NSAppTransportSecurity',
{xml:'<dict><key>NSAllowsArbitraryLoads</key><'+value+'/></dict>'}
);
}
} else {

@@ -25,0 +31,0 @@ logger.log("removing NSAppTransportSecurity");

{
"name": "cordovax-edit-ats",
"version": "1.0.0",
"version": "1.1.0",
"description": "",

@@ -5,0 +5,0 @@ "repository" : {

@@ -26,3 +26,22 @@ # Introduction

the following ATS is created
```
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
```
Create ATS with NSAllowsArbitraryLoads true
```
$ npx xordovax-edit-ats create true
```
Create ATS with NSAllowsArbitraryLoads false
```
$ npx xordovax-edit-ats create false
```
# With Cordova hook.

@@ -35,6 +54,6 @@

```
<hook src="scripts/removeATS.js" type="after_platform_add" />
<hook src="scripts/editPlist.js" type="after_platform_add" />
```
scripts/removeATS.js
scripts/editPlist.js
```

@@ -45,5 +64,5 @@ var editATS = require('cordovax-edit-ats');

if (context.opts.cordova.platforms.includes('ios')) {
editATS('remove', context.opts.projectRoot);
editATS('create_false', context.opts.projectRoot);
}
};
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc