Skip to content

Commit

Permalink
Merge pull request #1 from WanderaOrg/customise
Browse files Browse the repository at this point in the history
Wandera customistaions
  • Loading branch information
coufalja authored Feb 18, 2019
2 parents cdb607a + 88a0857 commit 7a49db4
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 33 deletions.
27 changes: 3 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,18 @@
<img src="res/common/logo/exports/STF-128.png?raw=true" style="width:100px;height:100px;" alt="STF">

[![Build Status](https://travis-ci.org/openstf/stf.svg?branch=master)](https://travis-ci.org/openstf/stf)
[![Docker Pulls](https://img.shields.io/docker/pulls/openstf/stf.svg)](https://hub.docker.com/r/openstf/stf/)
[![Build Status](https://travis-ci.org/WanderaOrg/stf.svg?branch=master)](https://travis-ci.org/WanderaOrg/stf)
[![Docker Pulls](https://img.shields.io/docker/pulls/wanderadock/stf.svg)](https://hub.docker.com/r/wanderadock/stf/)
[![NPM version](https://img.shields.io/npm/v/stf.svg)](https://www.npmjs.com/package/stf)
[![Backers on Open Collective](https://opencollective.com/openstf/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/openstf/sponsors/badge.svg)](#sponsors)

**STF** (or Smartphone Test Farm) is a web application for debugging smartphones, smartwatches and other gadgets remotely, from the comfort of your browser.

This is a fork of a original repository located at [https://github.com/openstf/stf](https://github.com/openstf/stf) adding Wandera specific features,
STF was originally developed at [CyberAgent](https://www.cyberagent.co.jp/en/) to control a growing collection of more than 160 devices. As of July 2016 development is mainly sponsored by [HeadSpin](https://performance.headspin.io/) and [other individual contributors](https://opencollective.com/openstf).

We welcome financial contributions in full transparency on our [open collective](https://opencollective.com/openstf).

![Close-up of device shelf](doc/shelf_closeup_790x.jpg?raw=true)

![Super short screencast showing usage](doc/7s_usage.gif?raw=true)

## Credits

### Sponsors

Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/openstf#sponsor))

#### Gold Sponsor

[<img src="doc/sponsors/headspin-wordmark-orange.png?raw=true" alt="HeadSpin" width="400">](https://headspin.io/)

> [HeadSpin](https://headspin.io/) enables developers launch high quality and high performing apps Worldwide. Using HeadSpin’s global distributed device cloud infrastructure, developers can test and monitor their apps instantly on 1,500 global cell networks and local devices. HeadSpin seamlessly plugs into your development workflow with no code changes to your apps.
HeadSpin offers a generous monthly contribution towards STF development.

### Contributors
Thank you to all the people who have already contributed to STF!
<a href="../../graphs/contributors"><img src="https://opencollective.com/openstf/contributors.svg?width=890" /></a>
Expand All @@ -38,11 +22,6 @@ Thank you to all our backers! [[Become a backer](https://opencollective.com/open

<a href="https://opencollective.com/openstf#backers" target="_blank"><img src="https://opencollective.com/openstf/backers.svg?width=890"></a>


### How to become a sponsor

Please use our [open collective](https://opencollective.com/openstf#sponsor) or [contact us][contact-link] directly for sponsor arrangements. Both recurring and one-time contributions are most welcome. Contributions towards a specific issue or feature are also possible, and can be attributed to your company in our release notes and other related materials. Hardware-only contributions, whether new or used, are also extremely helpful and well received, especially if you find a device that doesn't work. Please see our [donation transparency report](DONATION-TRANSPARENCY.md) for past hardware contributions.

## Features

* OS support
Expand Down
71 changes: 71 additions & 0 deletions res/app/control-panes/dashboard/shell/shell-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,77 @@ module.exports = function ShellCtrl($scope) {
})
}

// WANDERA CUSTOM - START
$scope.runIntent = function(string) {
$scope.run('am start -d \"' + string + '\"')
}

$scope.runPmListPackages = function(grep) {
$scope.run('pm list packages | grep ' + grep)
}

$scope.clearDevice = function() {
$scope.data = 'Resetting Wandera Dev...'
$scope.control.shell('am start -W -a android.intent.action.VIEW -d ' +
"'wandera://?action=reset' com.wandera.android.dev")
$scope.data = 'Deauthing Wandera Dev...'
$scope.control.shell('am start -W -a android.intent.action.VIEW -d ' +
"'wandera://?action=deauthorize' com.wandera.android.dev")
$scope.data = 'Uninstalling Wandera Dev...'
$scope.control.shell('pm uninstall com.wandera.android.dev')
$scope.data = 'Cleaning Wandera Debug...'
$scope.control.shell('am start -W -a android.intent.action.VIEW -d ' +
"'wandera://?action=reset' com.wandera.android.debug")
$scope.control.shell('am start -W -a android.intent.action.VIEW -d ' +
"'wandera://?action=deauthorize' com.wandera.android.debug")
$scope.control.shell('pm uninstall com.wandera.android.debug')
$scope.data = 'Cleaning Wandera Prod...'
$scope.control.shell('am start -W -a android.intent.action.VIEW -d' +
" 'wandera://?action=reset' com.wandera.android")
$scope.control.shell('am start -W -a android.intent.action.VIEW -d' +
" 'wandera://?action=deauthorize' com.wandera.android")
$scope.control.shell('pm uninstall com.wandera.android')
$scope.data = 'Cleaned'
$scope.$digest()
}

$scope.disableAnimations = function() {
$scope.control.shell('settings put global window_animation_scale 0').then(function(result) {
$scope.result = result
$scope.data = result.data.join('')
$scope.$digest()
return $scope.control.shell('settings put global transition_animation_scale 0')
}).then(function(result) {
$scope.result = result
$scope.data = result.data.join('')
$scope.$digest()
return $scope.control.shell('settings put global animator_duration_scale 0')
}).then(function(result) {
$scope.result = result
$scope.data = 'Animations disabled'
$scope.$digest()
})
}

$scope.enableAnimations = function() {
$scope.control.shell('settings put global window_animation_scale 1').then(function(result) {
$scope.result = result
$scope.data = result.data.join('')
$scope.$digest()
return $scope.control.shell('settings put global transition_animation_scale 1')
}).then(function(result) {
$scope.result = result
$scope.data = result.data.join('')
$scope.$digest()
return $scope.control.shell('settings put global animator_duration_scale 1')
}).then(function(result) {
$scope.result = result
$scope.data = 'Animations enabled'
$scope.$digest()
})
}
// WANDERA CUSTOM - END

$scope.clear = function() {
$scope.command = ''
$scope.data = ''
Expand Down
64 changes: 55 additions & 9 deletions res/app/control-panes/dashboard/shell/shell.pug
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,62 @@
clear-button(ng-click='clear()', ng-disabled='!command && !data').btn-xs
help-icon(topic='Remote-Shell', uib-tooltip='{{"Executes remote shell commands" | translate}}')

// WANDERA CUSTOM - START
.widget-content.padded
button.btn.btn-xs.btn-info-outline(ng-click='run("pm uninstall com.wandera.android")',
uib-tooltip='{{ "pm uninstall com.wandera.android" | translate }}')
i.fa.fa-trash
span(translate) Wandera
button.btn.btn-xs.btn-info-outline(ng-click='run("pm uninstall com.wandera.android.dev")',
uib-tooltip='{{ "pm uninstall com.wandera.android.dev" | translate }}')
i.fa.fa-trash
span(translate) Wandera Dev
button.btn.btn-xs.btn-info-outline(ng-click='run("pm uninstall com.wandera.android.debug")',
uib-tooltip='{{ "pm uninstall com.wandera.android.debug" | translate }}')
i.fa.fa-trash
span(translate) Wandera Debug

.clearfix

button.btn.btn-xs.btn-info-outline(ng-click='runIntent("wandera://?action=reset")',
uib-tooltip='{{ "am start -d wandera://?action=reset" | translate }}')
i.fa.fa-recycle
span(translate) Reset Wandera
button.btn.btn-xs.btn-info-outline(ng-click='runIntent("wandera://?action=deauthorize")',
uib-tooltip='{{ "am start -d wandera://?action=deauthorize" | translate }}')
i.fa.fa-magic
span(translate) Deauth Wandera
button.btn.btn-xs.btn-info-outline(ng-click='runPmListPackages("com.wandera.android")',
uib-tooltip='{{ "Show all packages that begins with com.wandera.android" | translate }}')
i.fa.fa-list
span(translate) Show installed Wandera apps

.clearfix

button.btn.btn-xs.btn-info-outline(ng-click='run("input keyevent 82")',
uib-tooltip='{{ "input keyevent 82" | translate }}')
i.fa.fa-unlock
span(translate) Unlock device

button.btn.btn-xs.btn-info-outline(ng-click='disableAnimations()',
uib-tooltip='{{ "window_animation_scale 0, transition_animation_scale 0, animator_duration_scale 0" | translate }}')
i.fa.fa-ban
span(translate) Disable Animations
button.btn.btn-xs.btn-info-outline(ng-click='enableAnimations()',
uib-tooltip='{{ "window_animation_scale 1, transition_animation_scale 1, animator_duration_scale 1" | translate }}')
i.fa.fa-play
span(translate) Enable Animations
// NOTE: autofill doesn't work here
form(method='post', enable-autofill, ng-submit='run(command)')
.input-group.form-inline
input(type=text, ng-model='command', Xtext-focus-select,
autocapitalize='off', spellcheck='false',
tabindex='30', accesskey='S', autocomplete='on').form-control.shell-input
span.input-group-btn
button.btn.btn-primary-outline(ng-click='run(command)', ng-disabled='!command')
i.fa.fa-play
pre.shell-results.selectable(ng-show='data') {{data}}
pre.shell-results.selectable.shell-results-empty(ng-show='result.settled && !data') No output

.widget-content.padded
.input-group.form-inline
input(type=text, ng-model='command', Xtext-focus-select,
autocapitalize='off', spellcheck='false',
tabindex='30', accesskey='S', autocomplete='on').form-control.shell-input
span.input-group-btn
button.btn.btn-primary-outline(ng-click='run(command)', ng-disabled='!command')
i.fa.fa-play
pre.shell-results.selectable(ng-show='data') {{data}}
pre.shell-results.selectable.shell-results-empty(ng-show='result.settled && !data') No output
// WANDERA CUSTOM - END

0 comments on commit 7a49db4

Please sign in to comment.