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

macaca-android

Package Overview
Dependencies
Maintainers
5
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

macaca-android - npm Package Compare versions

Comparing version 1.1.21 to 1.1.22

39

lib/controllers.js

@@ -8,3 +8,2 @@ 'use strict';

const _ = require('./helper');
const keyMap = require('./key-map');
const pkg = require('../package.json');

@@ -73,17 +72,33 @@

/**
see: https://github.com/macacajs/android-unicode#use-in-adb-shell
*/
controllers.keys = function *(value) {
if (Array.isArray(value)) {
value = value.join('').split('');
value = value.join('');
var content = '';
if (!!~value.indexOf('[ADB_INPUT_TEXT]')) {
value = value.replace('[ADB_INPUT_TEXT]', '');
content = `am broadcast -a ADB_INPUT_TEXT --es msg '${value}'`;
yield this.adb.shell(content);
} else if (!!~value.indexOf('[ADB_INPUT_CHARS]')) {
value = value.replace('[ADB_INPUT_CHARS]', '');
content = `am broadcast -a ADB_INPUT_CHARS --eia chars '${value}'`;
yield this.adb.shell(content);
} else if (!!~value.indexOf('[ADB_INPUT_CODE]')) {
value = value.replace('[ADB_INPUT_CODE]', '');
content = `am broadcast -a ADB_INPUT_CODE --ei code '${value}'`;
yield this.adb.shell(content);
} else if (!!~value.indexOf('[ADB_EDITOR_CODE]')) {
value = value.replace('[ADB_EDITOR_CODE]', '');
content = `am broadcast -a ADB_EDITOR_CODE --ei code '${value}'`;
yield this.adb.shell(content);
} else {
value = value.split('');
const keyActions = value.map(key => {
return () => this.adb.input(`text "${key}"`);
});
yield _.serialTasks.apply(null, keyActions);
}
const keyActions = value.map(key => {
const keyEvent = keyMap[key];
if (keyEvent) {
return () => this.adb.input(`keyevent ${keyEvent}`);
} else {
return () => this.adb.input(`text "${key}"`);
}
});
return yield _.serialTasks.apply(null, keyActions);
return null;
};

@@ -90,0 +105,0 @@

{
"name": "macaca-android",
"version": "1.1.21",
"version": "1.1.22",
"description": "Macaca Android driver",

@@ -5,0 +5,0 @@ "keywords": [

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