diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c70543c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,59 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. + +# Common formats +*.html text +*.xml text +*.css text +*.scss text +*.js text +*.properties text +*.rtf text +*.yaml text +*.yml text +*.md text + +LICENSE text + +# SQL scripts +*.sql text + +# Java sources +*.java text + +# Python sources +*.py text + +# Gradle build files +*.gradle text + +# Google protocol buffers +*.proto text + +# Miscellaneous +*.rb text + +# Declare files that will always have CRLF line endings on checkout. +*.bat text eol=crlf +mvnw.cmd eol=crlf + +# Declare files that will always have LF line endings on checkout. +*.sh text eol=lf +mvnw text eol=lf + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary +*.gif binary +*.swf binary +*.jar binary +*.desc binary + +*.scpt binary +*.scssc binary + +# Encoded files +*.enc binary diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..0c6937a --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,33 @@ +name: CI + +on: + push: + workflow_dispatch: + +jobs: + build: + name: Build on Java ${{ matrix.java }} and ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + java: [ 8, 11 ] + os: [ ubuntu-latest, windows-latest, macos-latest ] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build with Maven + run: mvn --batch-mode --update-snapshots verify diff --git a/.gitignore b/.gitignore index bd072fa..266d694 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,23 @@ ### JetBrains template # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 -.idea + +# IntelliJ IDEA modules and interim config files. +*.iml +.idea/*.xml +.idea/.name +.idea/artifacts +.idea/libraries +.idea/modules +.idea/shelf + +# Do not ignore the following IDEA settings +!.idea/misc.xml +!.idea/vcs.xml +!.idea/encodings.xml +!.idea/codeStyleSettings.xml +!.idea/codeStyles/ +!.idea/copyright/ ## File-based project format: *.iws @@ -145,4 +161,7 @@ dependency-reduced-pom.xml buildNumber.properties .mvn/timing.properties -!.mvn/wrapper/maven-wrapper.jar \ No newline at end of file +!.mvn/wrapper/maven-wrapper.jar + +# Do not ignore JNLP jars. +!docs/jnlp/*.jar diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/copyright/OpenSource.xml b/.idea/copyright/OpenSource.xml new file mode 100644 index 0000000..4fe00c7 --- /dev/null +++ b/.idea/copyright/OpenSource.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e683b6d --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..4361200 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java index fa4f7b4..b901097 100644 --- a/.mvn/wrapper/MavenWrapperDownloader.java +++ b/.mvn/wrapper/MavenWrapperDownloader.java @@ -1,22 +1,18 @@ /* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ - + * Copyright 2007-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import java.net.*; import java.io.*; import java.nio.channels.*; @@ -24,11 +20,12 @@ Licensed to the Apache Software Foundation (ASF) under one public class MavenWrapperDownloader { + private static final String WRAPPER_VERSION = "0.5.6"; /** * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. */ - private static final String DEFAULT_DOWNLOAD_URL = - "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"; + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; /** * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to @@ -76,13 +73,13 @@ public static void main(String args[]) { } } } - System.out.println("- Downloading from: : " + url); + System.out.println("- Downloading from: " + url); File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); if(!outputFile.getParentFile().exists()) { if(!outputFile.getParentFile().mkdirs()) { System.out.println( - "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); } } System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); @@ -98,6 +95,16 @@ public static void main(String args[]) { } private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } URL website = new URL(urlString); ReadableByteChannel rbc; rbc = Channels.newChannel(website.openStream()); diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar index 01e6799..2cc7d4a 100755 Binary files a/.mvn/wrapper/maven-wrapper.jar and b/.mvn/wrapper/maven-wrapper.jar differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index b6e6781..08f76d0 100755 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1 +1,19 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip \ No newline at end of file +# +# Copyright 2020 Yurii Serhiichuk +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/LICENSE b/LICENSE index cb0a745..27b6d43 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2014-2019 Yurii Serhiichuk + Copyright 2014-2020 Yurii Serhiichuk Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 09cc378..a5867e1 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,26 @@ AndroidScreencast ================= -[![Build Status Travis-CI][travis_badge]][travis]  +[![Build Status GitHub Actions][actions_badge]][actions]  [![Codacy Badge][codacy_badge]][codacy]  [![Join the chat at https://gitter.im/AndroidScreencast/Lobby][gitter_badge]][gitter]  [![Apache License][license_badge]][license] +[actions_badge]: https://github.com/xSAVIKx/AndroidScreencast/workflows/CI/badge.svg +[actions]: https://github.com/xSAVIKx/AndroidScreencast/actions + +[versioneye_badge]: https://www.versioneye.com/user/projects/58a746d8b4d2a20055fcb887/badge.svg?style=flat +[versioneye]: https://www.versioneye.com/user/projects/58a746d8b4d2a20055fcb887 + +[codacy_badge]: https://api.codacy.com/project/badge/Grade/064bbd2582b544bb9659a01a2872317c +[codacy]: https://www.codacy.com/app/xSAVIKx/AndroidScreencast?utm_source=github.com&utm_medium=referral&utm_content=xSAVIKx/AndroidScreencast&utm_campaign=badger + +[license_badge]: https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat +[license]: http://www.apache.org/licenses/LICENSE-2.0 + +[gitter_badge]: https://badges.gitter.im/AndroidScreencast/Lobby.svg?style=flat +[gitter]: https://gitter.im/AndroidScreencast/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge + # Description AndroidScreencast was developed to view and control your android device from a PC. @@ -28,29 +43,34 @@ This project gives the opportunity to use your phone even with a broken screen. ## Configuration There are 2 ways to run application: -1. Run ADB server on your own -2. Provide correct `app.properties` file + +1. Run ADB server on your own. +2. Provide a correct `app.properties` file. ### Run ADB server on your own -In order to run server on your own you have to run already installed (or one from our OS-specific bundle) `adb` -with following command: -``` +In order to run server on your own you have to run already installed (or one from our OS-specific bundle) `adb` with +following command: + +```bash adb start-server ``` **Note**: -If `app.properties` will have `adb.path` filled - AndroidScreencast will shutdown ADB server on application termination. +If `app.properties` will have `adb.path` filled, AndroidScreencast will shutdown the ADB server on application +termination. -Additionally, in order to use, for example, remote ADB server with ssh forwarding you should not use `app.properties` or `adb.path` -property should be commented. +Additionally, in order to use for example remote ADB server with ssh forwarding you should not use `app.properties` +or `adb.path` property should be commented. ### Provide correct `app.properties` file -Right now to successfully run application you **should** create `app.properties` file in the same folder as -AndroidScreencast's jar and provide at least one property - `adb.path` which should point to the `adb` executable file -within your OS, for example such location could be configured for Windows OS: +Right now to successfully run application you **should** create `app.properties` file in the same +folder as AndroidScreencast's jar and provide at least one property - `adb.path` which should point +to the `adb` executable file within your OS, for example such location could be configured +for Windows OS: + ```properties adb.path=adb/windows/adb.exe ``` @@ -59,17 +79,20 @@ Both absolute and relative paths are supported. Example of valid `app.properties` could be find [here](app.properties). -Also we have got some valid OS-specific examples: +Also, we have got some valid OS-specific examples: + * [OSX app.properties](adb/macosx/app.properties) * [Windows app.properties](adb/windows/app.properties) * [Linux app.properties](adb/linux/app.properties) -They are actually the same, just `adb.path` is OS-specific. Files listed above are automatically included into OS-specific bundles. +They are actually the same, just `adb.path` is OS-specific. Files listed above are automatically +included into OS-specific bundles. ### Additional properties Here is the full list of available properties for application configuration. -Properties should be places in the `app.properties` file in the same folder as AndroidScreencast's jar file. +Properties should be places in the `app.properties` file in the same folder as AndroidScreencast's +jar file. ```properties #relative or absolute path to ADB @@ -85,16 +108,17 @@ app.window.height=768 #Defines whether application should look 'natively' to OS. Possible values: true/false app.native.look=false ``` + ## JNLP Application is available using Java web start technology via [androidscreencast.jnlp][jnlp]. -[jnlp]: http://xsavikx.github.io/AndroidScreencast/jnlp/androidscreencast.jnlp +[jnlp]: https://xsavikx.github.io/AndroidScreencast/jnlp/androidscreencast.jnlp ### Java security configuration -Due to Java security restriction policy, that was updated in java 7 and is restricted even more in java 8, we're now not -able to run JNLP without some security "hacks". +Due to Java security restriction policy, that was updated in java 7 and is restricted even more +in java 8, we're now not able to run JNLP without some security "hacks". To use JNLP, please follow this article: [How can I configure the Exception Site List?][exception] @@ -108,12 +132,13 @@ After cloning the project, run `mvnw install`. The resulting artifacts will be created in the `target` subdirectory. -You can run the executable jar via `java -jar target/androidscreencast-VERSION-executable.jar`, replacing VERSION with -the current version. +You can run the executable jar via `java -jar target/androidscreencast-VERSION-executable.jar`, +replacing `VERSION` with the current version. For example, `java -jar target/androidscreencast-0.0.10s-executable.jar`. -Additionally OS-packages would be created with ADB executables bundled: +Additionally, OS-packages would be created with ADB executables bundled: + * `androidscreencast-VERSION-windows.zip` * `androidscreencast-VERSION-linux.tar.gz` * `androidscreencast-VERSION-macosx.tar.gz` @@ -124,39 +149,31 @@ In order to provide correct configuration see [configuration][configuration_sect # Requirements -Currently AndroidScreencast works directly with `adb input` program through `ddmlib` and abuse functionality of: +Currently, AndroidScreencast works directly with `adb input` program through `ddmlib` and uses +the functionality of: + * `adb input key` * `adb input tap` * `adb input swipe` -Regarding this point, to use AndroidScreencast you need Smartphone running on Android with specific `input` program version. `adb input tap` and `adb input swipe` were introduced in [Android 4.1.1][Android_4_1_1_Input]. +Regarding this point, to use AndroidScreencast you need Smartphone running on Android with +specific `input` program version. `adb input tap` and `adb input swipe` were introduced +in [Android 4.1.1][Android_4_1_1_Input]. So, right now AndroidScreencast support all Android versions equal or greater than Android 4.1.1. Also, to run AndroidScreencast you will need *adb* installed (or you can use bundled in OS bundles adb). +[Android_4_1_1_Input]: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.1.1_r1/com/android/commands/input/Input.java#Input + # Similar Projects * [Seven Square][seven_square] - QT implementation of Android Screencast (actively developed) -* [Droid@Screen][droid_at_screen] - implementation of Android Screencast in Java (fancy one, last release in 2013) -* [Android Screen Monitor][android_screen_monitor] - implementation of Android Screencast in Java (latest release in 2013) +* [Droid@Screen][droid_at_screen] - implementation of Android Screencast in Java + (fancy one, last release in 2013) +* [Android Screen Monitor][android_screen_monitor] - implementation of Android Screencast in Java + (latest release in 2013) -[Android_4_1_1_Input]: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.1.1_r1/com/android/commands/input/Input.java#Input [seven_square]: https://github.com/yangh/sevensquare [droid_at_screen]: http://droid-at-screen.org/droid-at-screen/ [android_screen_monitor]: https://github.com/adakoda/android-screen-monitor - -[travis_badge]: https://travis-ci.org/xSAVIKx/AndroidScreencast.svg?branch=master -[travis]: https://travis-ci.org/xSAVIKx/AndroidScreencast - -[versioneye_badge]: https://www.versioneye.com/user/projects/58a746d8b4d2a20055fcb887/badge.svg?style=flat -[versioneye]: https://www.versioneye.com/user/projects/58a746d8b4d2a20055fcb887 - -[codacy_badge]: https://api.codacy.com/project/badge/Grade/064bbd2582b544bb9659a01a2872317c -[codacy]: https://www.codacy.com/app/xSAVIKx/AndroidScreencast?utm_source=github.com&utm_medium=referral&utm_content=xSAVIKx/AndroidScreencast&utm_campaign=badger - -[license_badge]: https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat -[license]: http://www.apache.org/licenses/LICENSE-2.0 - -[gitter_badge]: https://badges.gitter.im/AndroidScreencast/Lobby.svg?style=flat -[gitter]: https://gitter.im/AndroidScreencast/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge diff --git a/adb/linux/adb b/adb/linux/adb index d3d9861..4bc65ec 100755 Binary files a/adb/linux/adb and b/adb/linux/adb differ diff --git a/adb/linux/app.properties b/adb/linux/app.properties index af5cee1..d5f3ea8 100644 --- a/adb/linux/app.properties +++ b/adb/linux/app.properties @@ -1,3 +1,20 @@ +# +# Copyright 2020 Yurii Serhiichuk +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + #relative or absolute path to ADB adb.path=./adb #maximum time to wait for device (in seconds) diff --git a/adb/linux/fastboot b/adb/linux/fastboot index 4ec5b33..4e3217e 100755 Binary files a/adb/linux/fastboot and b/adb/linux/fastboot differ diff --git a/adb/macosx/adb b/adb/macosx/adb index 9891dbf..1a11716 100755 Binary files a/adb/macosx/adb and b/adb/macosx/adb differ diff --git a/adb/macosx/app.properties b/adb/macosx/app.properties index af5cee1..d5f3ea8 100644 --- a/adb/macosx/app.properties +++ b/adb/macosx/app.properties @@ -1,3 +1,20 @@ +# +# Copyright 2020 Yurii Serhiichuk +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + #relative or absolute path to ADB adb.path=./adb #maximum time to wait for device (in seconds) diff --git a/adb/macosx/fastboot b/adb/macosx/fastboot index bb8b97b..e9ab83b 100755 Binary files a/adb/macosx/fastboot and b/adb/macosx/fastboot differ diff --git a/adb/windows/adb.exe b/adb/windows/adb.exe index 0f4389d..d1861fd 100755 Binary files a/adb/windows/adb.exe and b/adb/windows/adb.exe differ diff --git a/adb/windows/app.properties b/adb/windows/app.properties index 0ec58b6..19f3cbd 100644 --- a/adb/windows/app.properties +++ b/adb/windows/app.properties @@ -1,3 +1,20 @@ +# +# Copyright 2020 Yurii Serhiichuk +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + #relative or absolute path to ADB adb.path=./adb.exe #maximum time to wait for device (in seconds) diff --git a/adb/windows/fastboot.exe b/adb/windows/fastboot.exe index e93e3bb..d70dacd 100755 Binary files a/adb/windows/fastboot.exe and b/adb/windows/fastboot.exe differ diff --git a/app.properties b/app.properties index 729b7f1..c698190 100644 --- a/app.properties +++ b/app.properties @@ -1,3 +1,20 @@ +# +# Copyright 2020 Yurii Serhiichuk +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + adb.path=./adb/linux/adb app.window.width=1024 -app.window.height=768 \ No newline at end of file +app.window.height=768 diff --git a/docs/assets/androidscreencast.mov b/docs/assets/androidscreencast.mov new file mode 100644 index 0000000..9013abf Binary files /dev/null and b/docs/assets/androidscreencast.mov differ diff --git a/docs/assets/exec-command.png b/docs/assets/exec-command.png new file mode 100644 index 0000000..08d4029 Binary files /dev/null and b/docs/assets/exec-command.png differ diff --git a/docs/assets/main.png b/docs/assets/main.png new file mode 100644 index 0000000..005ca5d Binary files /dev/null and b/docs/assets/main.png differ diff --git a/docs/index.md b/docs/index.md index 46a9c54..ca29eee 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,6 +10,16 @@ AndroidScreencast was developed to view and control your android device from a P This project gives the opportunity to use your phone even with a broken screen. +The main screen: + +![AndroidScreencast - Main screen](./assets/main.png) + +Commands execution screen: + +![AndroidScreencast - Execute command](./assets/exec-command.png) + +Video recorded by the app available [here](./assets/androidscreencast.mov). + ## Features - No client needed @@ -40,15 +50,23 @@ To use JNLP, please follow this article: [How can I configure the Exception Site # Requirements -Currently AndroidScreencast works directly with `adb input` program through `ddmlib` and abuse functionality of: +Currently, AndroidScreencast works directly with `adb input` program through `ddmlib` and uses functionality of: + - `adb input key` - `adb input tap` - `adb input swipe` -Regarding this point, to use AndroidScreencast you need Smartphone running on Android with specific `input` program version. `adb input tap` and `adb input swipe` were introduced in [Android 4.1.1][Android_4_1_1_Input]. +Regarding this point, to use AndroidScreencast you need Smartphone running on Android with specific `input` +program version. `adb input tap` and `adb input swipe` were introduced in [Android 4.1.1][Android_4_1_1_Input]. So, right now AndroidScreencast support all Android versions equal or greater than Android 4.1.1. Also, to run AndroidScreencast you will need *adb* installed (or you can use bundled in OS bundles adb). [Android_4_1_1_Input]: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.1.1_r1/com/android/commands/input/Input.java#Input + +# More info + +Please refer to the project's [GitHub page][github] for more detailed overview and specific instructions. + +[github]: https://github.com/xSAVIKx/AndroidScreencast diff --git a/docs/jnlp/androidscreencast-0.1-executable.jar b/docs/jnlp/androidscreencast-0.1-executable.jar new file mode 100644 index 0000000..3bbcb89 Binary files /dev/null and b/docs/jnlp/androidscreencast-0.1-executable.jar differ diff --git a/docs/jnlp/androidscreencast.jnlp b/docs/jnlp/androidscreencast.jnlp index a6114d3..260d7c1 100644 --- a/docs/jnlp/androidscreencast.jnlp +++ b/docs/jnlp/androidscreencast.jnlp @@ -1,7 +1,25 @@ + + + + version="0.1"> Android Screencast Yurii Serhiichuk @@ -16,7 +34,7 @@ + href="https://xsavikx.github.io/AndroidScreencast/jnlp/androidscreencast-0.1-executable.jar"/> diff --git a/mvnw b/mvnw index 5551fde..41c0f0c 100755 --- a/mvnw +++ b/mvnw @@ -19,7 +19,7 @@ # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script +# Maven Start Up Batch script # # Required ENV vars: # ------------------ @@ -114,7 +114,6 @@ if $mingw ; then M2_HOME="`(cd "$M2_HOME"; pwd)`" [ -n "$JAVA_HOME" ] && JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" - # TODO classpath? fi if [ -z "$JAVA_HOME" ]; then @@ -212,7 +211,11 @@ else if [ "$MVNW_VERBOSE" = true ]; then echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." fi - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi while IFS="=" read key value; do case "$key" in (wrapperUrl) jarUrl="$value"; break ;; esac @@ -221,22 +224,38 @@ else echo "Downloading from: $jarUrl" fi wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi if command -v wget > /dev/null; then if [ "$MVNW_VERBOSE" = true ]; then echo "Found wget ... using wget" fi - wget "$jarUrl" -O "$wrapperJarPath" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi elif command -v curl > /dev/null; then if [ "$MVNW_VERBOSE" = true ]; then echo "Found curl ... using curl" fi - curl -o "$wrapperJarPath" "$jarUrl" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + else if [ "$MVNW_VERBOSE" = true ]; then echo "Falling back to using Java to download" fi javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi if [ -e "$javaClass" ]; then if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then if [ "$MVNW_VERBOSE" = true ]; then @@ -277,6 +296,11 @@ if $cygwin; then MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` fi +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain exec "$JAVACMD" \ diff --git a/mvnw.cmd b/mvnw.cmd index e5cfb0a..8611571 100755 --- a/mvnw.cmd +++ b/mvnw.cmd @@ -18,7 +18,7 @@ @REM ---------------------------------------------------------------------------- @REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script +@REM Maven Start Up Batch script @REM @REM Required ENV vars: @REM JAVA_HOME - location of a JDK home dir @@ -26,7 +26,7 @@ @REM Optional ENV vars @REM M2_HOME - location of maven2's installed home dir @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven @REM e.g. to debug Maven itself, use @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 @@ -37,7 +37,7 @@ @echo off @REM set title of command window title %0 -@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% @REM set %HOME% to equivalent of $HOME @@ -120,23 +120,44 @@ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" -FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B ) @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central @REM This allows using the maven wrapper in projects that prohibit checking in binary data. if exist %WRAPPER_JAR% ( - echo Found %WRAPPER_JAR% + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) ) else ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" - echo Finished downloading %WRAPPER_JAR% + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) ) @REM End of extension +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* if ERRORLEVEL 1 goto error goto end diff --git a/pom.xml b/pom.xml index 3e87d2e..e9f8504 100644 --- a/pom.xml +++ b/pom.xml @@ -1,27 +1,52 @@ + + + 4.0.0 com.github.xsavikx androidscreencast - 0.0.16s + 0.1 Android Screencast jar - 2.24 - 26.5.2 - 1.7.29 + 2.30.1 + 27.1.1 + 1.7.30 1.2.3 - 28.1-jre + 30.1-jre + com.github.xsavikx.androidscreencast.Main 1.8 UTF-8 UTF-8 + ${project.basedir}/adb ${adb.folder}/linux ${adb.folder}/windows ${adb.folder}/macosx + + javax.annotation + javax.annotation-api + 1.3.2 + com.android.tools.ddms ddmlib @@ -49,10 +74,8 @@ com.google.dagger - dagger-compiler + dagger-producers ${dagger2.version} - true - provided com.google.guava @@ -68,6 +91,13 @@ ${jdk.version} ${jdk.version} + + + com.google.dagger + dagger-compiler + ${dagger2.version} + + @@ -85,7 +115,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.1.2 + 3.2.0 @@ -97,7 +127,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.2.1 + 3.2.4 package @@ -112,6 +142,12 @@ implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> ${main.class} + + false + + diff --git a/src/assembly/linux.xml b/src/assembly/linux.xml index d5e64ea..f7e78e2 100644 --- a/src/assembly/linux.xml +++ b/src/assembly/linux.xml @@ -1,3 +1,22 @@ + + + + diff --git a/src/assembly/macosx.xml b/src/assembly/macosx.xml index 9fed631..a1e7d68 100644 --- a/src/assembly/macosx.xml +++ b/src/assembly/macosx.xml @@ -1,3 +1,22 @@ + + + + diff --git a/src/assembly/windows.xml b/src/assembly/windows.xml index 8890e82..ddd0a8d 100644 --- a/src/assembly/windows.xml +++ b/src/assembly/windows.xml @@ -1,3 +1,22 @@ + + + + diff --git a/src/main/java/com/github/xsavikx/androidscreencast/Main.java b/src/main/java/com/github/xsavikx/androidscreencast/Main.java index 994cfe1..a5d14f8 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/Main.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/Main.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast; import com.github.xsavikx.androidscreencast.app.Application; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/AndroidDevice.java b/src/main/java/com/github/xsavikx/androidscreencast/api/AndroidDevice.java index 4d0cc9d..c96cfdc 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/AndroidDevice.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/AndroidDevice.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api; import com.github.xsavikx.androidscreencast.api.file.FileInfo; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/AndroidDeviceImpl.java b/src/main/java/com/github/xsavikx/androidscreencast/api/AndroidDeviceImpl.java index 3de38b3..20bf4ae 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/AndroidDeviceImpl.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/AndroidDeviceImpl.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api; import com.android.ddmlib.IDevice; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/adb/AndroidDebugBridgeWrapper.java b/src/main/java/com/github/xsavikx/androidscreencast/api/adb/AndroidDebugBridgeWrapper.java index 10cd94d..859073b 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/adb/AndroidDebugBridgeWrapper.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/adb/AndroidDebugBridgeWrapper.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.adb; import com.android.ddmlib.AndroidDebugBridge; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/command/Command.java b/src/main/java/com/github/xsavikx/androidscreencast/api/command/Command.java index 5872754..5c129c0 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/command/Command.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/command/Command.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.command; public interface Command { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/command/InputCommand.java b/src/main/java/com/github/xsavikx/androidscreencast/api/command/InputCommand.java index d045d57..799f804 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/command/InputCommand.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/command/InputCommand.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.command; abstract class InputCommand implements Command { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/command/KeyCommand.java b/src/main/java/com/github/xsavikx/androidscreencast/api/command/KeyCommand.java index 3760a6a..e97c34b 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/command/KeyCommand.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/command/KeyCommand.java @@ -1,10 +1,27 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.command; import com.github.xsavikx.androidscreencast.api.injector.InputKeyEvent; public final class KeyCommand extends InputCommand { - private int code; + private final int code; private boolean longpress; public KeyCommand(int keyCode) { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/command/SwipeCommand.java b/src/main/java/com/github/xsavikx/androidscreencast/api/command/SwipeCommand.java index b67c21c..27d934a 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/command/SwipeCommand.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/command/SwipeCommand.java @@ -1,11 +1,28 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.command; public final class SwipeCommand extends InputCommand { - private int x1; - private int y1; - private int x2; - private int y2; + private final int x1; + private final int y1; + private final int x2; + private final int y2; private long duration; public SwipeCommand(int x1, int y1, int x2, int y2) { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/command/TapCommand.java b/src/main/java/com/github/xsavikx/androidscreencast/api/command/TapCommand.java index adab496..3805796 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/command/TapCommand.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/command/TapCommand.java @@ -1,9 +1,26 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.command; public final class TapCommand extends InputCommand { - private int x; - private int y; + private final int x; + private final int y; public TapCommand(int x, int y) { this.x = x; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/command/exception/AdbShellCommandExecutionException.java b/src/main/java/com/github/xsavikx/androidscreencast/api/command/exception/AdbShellCommandExecutionException.java index 3a4a760..8294eac 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/command/exception/AdbShellCommandExecutionException.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/command/exception/AdbShellCommandExecutionException.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.command.exception; import com.github.xsavikx.androidscreencast.api.command.Command; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/command/exception/CommandExecutionException.java b/src/main/java/com/github/xsavikx/androidscreencast/api/command/exception/CommandExecutionException.java index e7986c2..65d2827 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/command/exception/CommandExecutionException.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/command/exception/CommandExecutionException.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.command.exception; import com.github.xsavikx.androidscreencast.exception.AndroidScreenCastRuntimeException; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/command/executor/CommandExecutor.java b/src/main/java/com/github/xsavikx/androidscreencast/api/command/executor/CommandExecutor.java index 445da24..57db7ac 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/command/executor/CommandExecutor.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/command/executor/CommandExecutor.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.command.executor; import com.github.xsavikx.androidscreencast.api.command.Command; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/command/executor/ShellCommandExecutor.java b/src/main/java/com/github/xsavikx/androidscreencast/api/command/executor/ShellCommandExecutor.java index e592ee6..231df58 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/command/executor/ShellCommandExecutor.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/command/executor/ShellCommandExecutor.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.command.executor; import com.android.ddmlib.*; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/command/factory/AdbInputCommandFactory.java b/src/main/java/com/github/xsavikx/androidscreencast/api/command/factory/AdbInputCommandFactory.java index 9e1dc1d..e23ef0f 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/command/factory/AdbInputCommandFactory.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/command/factory/AdbInputCommandFactory.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.command.factory; import com.github.xsavikx.androidscreencast.api.command.KeyCommand; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/command/factory/InputCommandFactory.java b/src/main/java/com/github/xsavikx/androidscreencast/api/command/factory/InputCommandFactory.java index b7393a9..8fd6b8a 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/command/factory/InputCommandFactory.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/command/factory/InputCommandFactory.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.command.factory; import com.github.xsavikx.androidscreencast.api.command.KeyCommand; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/file/FileInfo.java b/src/main/java/com/github/xsavikx/androidscreencast/api/file/FileInfo.java index f0ecb07..157d2d4 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/file/FileInfo.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/file/FileInfo.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.file; import com.github.xsavikx.androidscreencast.api.AndroidDeviceImpl; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/image/AbstractRawImageColorModel.java b/src/main/java/com/github/xsavikx/androidscreencast/api/image/AbstractRawImageColorModel.java index fd3cefe..567c494 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/image/AbstractRawImageColorModel.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/image/AbstractRawImageColorModel.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.image; import java.awt.*; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/image/ImageUtils.java b/src/main/java/com/github/xsavikx/androidscreencast/api/image/ImageUtils.java index c3f8994..55d240b 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/image/ImageUtils.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/image/ImageUtils.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.image; import com.android.ddmlib.RawImage; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/image/SixteenBitColorModel.java b/src/main/java/com/github/xsavikx/androidscreencast/api/image/SixteenBitColorModel.java index 61dad44..b8d54a8 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/image/SixteenBitColorModel.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/image/SixteenBitColorModel.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.image; /** diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/image/ThirtyTwoBitColorModel.java b/src/main/java/com/github/xsavikx/androidscreencast/api/image/ThirtyTwoBitColorModel.java index ac92691..d4e6a17 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/image/ThirtyTwoBitColorModel.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/image/ThirtyTwoBitColorModel.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.image; import com.android.ddmlib.RawImage; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/injector/Injector.java b/src/main/java/com/github/xsavikx/androidscreencast/api/injector/Injector.java index 63cf835..d86db20 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/injector/Injector.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/injector/Injector.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.injector; import javax.inject.Inject; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/injector/InputKeyEvent.java b/src/main/java/com/github/xsavikx/androidscreencast/api/injector/InputKeyEvent.java index 32d3ec9..84fe2a8 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/injector/InputKeyEvent.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/injector/InputKeyEvent.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + //@formatter:off package com.github.xsavikx.androidscreencast.api.injector; @@ -79,7 +96,7 @@ public enum InputKeyEvent { KEYCODE_EQUALS(70, "Key code constant: '=' key. ", '='), KEYCODE_LEFT_BRACKET(71, "Key code constant: '[' key. ", '['), KEYCODE_RIGHT_BRACKET(72, "Key code constant: ']' key. ", ']'), - KEYCODE_BACKSLASH(73, "Key code constant: '\' key. ", '\\'), + KEYCODE_BACKSLASH(73, "Key code constant: '' key. ", '\\'), KEYCODE_SEMICOLON(74, "Key code constant: ';' key. ", ';'), KEYCODE_APOSTROPHE(75, "Key code constant: ''' (apostrophe) key. ", '\''), KEYCODE_SLASH(76, "Key code constant: '/' key. ", '/'), @@ -268,10 +285,10 @@ public enum InputKeyEvent { KEYCODE_HELP(259, "Key code constant: Help key. "); private static final Set eventsWithCharacters = fillEventsWithCharacters(); - private static Set eventsWithKeyCodes = fillEventsWithKeyCodes(); + private static final Set eventsWithKeyCodes = fillEventsWithKeyCodes(); private int keyCode; - private int code; - private String description; + private final int code; + private final String description; private char characterToReplace; InputKeyEvent(int code, String description) { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/injector/KeyCodeConverter.java b/src/main/java/com/github/xsavikx/androidscreencast/api/injector/KeyCodeConverter.java index 916387f..6f1c976 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/injector/KeyCodeConverter.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/injector/KeyCodeConverter.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.injector; import org.slf4j.Logger; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/injector/MultiLineReceiverPrinter.java b/src/main/java/com/github/xsavikx/androidscreencast/api/injector/MultiLineReceiverPrinter.java index 04a34e7..b0fac18 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/injector/MultiLineReceiverPrinter.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/injector/MultiLineReceiverPrinter.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.injector; import com.android.ddmlib.MultiLineReceiver; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/injector/OutputStreamShellOutputReceiver.java b/src/main/java/com/github/xsavikx/androidscreencast/api/injector/OutputStreamShellOutputReceiver.java index 184006b..e43c617 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/injector/OutputStreamShellOutputReceiver.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/injector/OutputStreamShellOutputReceiver.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.injector; import com.android.ddmlib.IShellOutputReceiver; @@ -8,7 +25,7 @@ public final class OutputStreamShellOutputReceiver implements IShellOutputReceiver { - private OutputStream os; + private final OutputStream os; public OutputStreamShellOutputReceiver(OutputStream os) { this.os = os; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/injector/ScreenCaptureRunnable.java b/src/main/java/com/github/xsavikx/androidscreencast/api/injector/ScreenCaptureRunnable.java index 1f452f2..57154d6 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/injector/ScreenCaptureRunnable.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/injector/ScreenCaptureRunnable.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.injector; import com.android.ddmlib.AdbCommandRejectedException; @@ -31,7 +48,7 @@ public final class ScreenCaptureRunnable implements Runnable { private static final int FRAME_DURATION = 10; private final IDevice device; private final long defaultAdbCommandTimeout; - private Dimension size; + private final Dimension size; private QuickTimeOutputStream qos = null; private boolean landscape = false; private ScreenCaptureListener listener = null; @@ -100,7 +117,8 @@ private void display(final RawImage rawImage) { if (qos != null) { SwingUtilities.invokeLater(() -> { try { - qos.writeFrame(image, FRAME_DURATION); + if (qos != null) + qos.writeFrame(image, FRAME_DURATION); } catch (IORuntimeException e) { log().error("IO exception happened during writing the video frame: {}.", image, e); } @@ -112,10 +130,9 @@ public void setListener(final ScreenCaptureListener listener) { this.listener = listener; } - public void startRecording(final File file) { try { - qos = new QuickTimeOutputStream(file, QuickTimeOutputStream.VideoFormat.JPG); + qos = new QuickTimeOutputStream(file, QuickTimeOutputStream.VideoFormat.PNG); qos.setVideoCompressionQuality(MOV_COMPRESSION_RATE); qos.setTimeScale(MOV_FPS); } catch (final IOException e) { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/DataAtomOutputStream.java b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/DataAtomOutputStream.java index 6481d5b..aa3b139 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/DataAtomOutputStream.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/DataAtomOutputStream.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.recording; import com.github.xsavikx.androidscreencast.api.recording.atom.AtomType; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/FilterImageOutputStream.java b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/FilterImageOutputStream.java index 3a0dd6f..d49279b 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/FilterImageOutputStream.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/FilterImageOutputStream.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.recording; import javax.imageio.stream.ImageOutputStream; @@ -6,7 +23,7 @@ public final class FilterImageOutputStream extends FilterOutputStream { - private ImageOutputStream imgOut; + private final ImageOutputStream imgOut; public FilterImageOutputStream(ImageOutputStream iOut) { super(null); diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/QuickTimeOutputStream.java b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/QuickTimeOutputStream.java index f685f3a..40d908f 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/QuickTimeOutputStream.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/QuickTimeOutputStream.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.recording; import com.github.xsavikx.androidscreencast.api.recording.atom.AtomType; @@ -71,7 +88,7 @@ public final class QuickTimeOutputStream { /** * List of video frames. */ - private LinkedList videoFrames; + private final LinkedList videoFrames; /** * This atom holds the movie frames. */ @@ -1531,15 +1548,15 @@ private static class Sample { /** * Offset of the sample relative to the start of the QuickTime file. */ - private long offset; + private final long offset; /** * Data length of the sample. */ - private long length; + private final long length; /** * The duration of the sample in time scale units. */ - private int duration; + private final int duration; /** * Creates a new sample. diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/Atom.java b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/Atom.java index 35c109d..28e9720 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/Atom.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/Atom.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.recording.atom; import com.github.xsavikx.androidscreencast.exception.IORuntimeException; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/AtomType.java b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/AtomType.java index aec8920..9fe2981 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/AtomType.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/AtomType.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.recording.atom; /** diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/CommonAtom.java b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/CommonAtom.java index 3f3ee60..784a45d 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/CommonAtom.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/CommonAtom.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.recording.atom; import com.github.xsavikx.androidscreencast.exception.IORuntimeException; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/CompositeAtom.java b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/CompositeAtom.java index 3d8407f..1889e51 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/CompositeAtom.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/CompositeAtom.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.recording.atom; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/DataAtom.java b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/DataAtom.java index 60eb26d..4222c85 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/DataAtom.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/DataAtom.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.recording.atom; import com.github.xsavikx.androidscreencast.api.recording.DataAtomOutputStream; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/WideDataAtom.java b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/WideDataAtom.java index cb74704..0d28d19 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/WideDataAtom.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/atom/WideDataAtom.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.recording.atom; import com.github.xsavikx.androidscreencast.api.recording.DataAtomOutputStream; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/exception/MaximumAtomSizeExeededException.java b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/exception/MaximumAtomSizeExeededException.java index 84a214c..e9b61aa 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/exception/MaximumAtomSizeExeededException.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/exception/MaximumAtomSizeExeededException.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.recording.exception; import com.github.xsavikx.androidscreencast.exception.AndroidScreenCastRuntimeException; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/exception/OutputStreamAlreadyClosedException.java b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/exception/OutputStreamAlreadyClosedException.java index 95d800b..4250c07 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/api/recording/exception/OutputStreamAlreadyClosedException.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/api/recording/exception/OutputStreamAlreadyClosedException.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.api.recording.exception; import com.github.xsavikx.androidscreencast.exception.AndroidScreenCastRuntimeException; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/app/AndroidScreencastApplication.java b/src/main/java/com/github/xsavikx/androidscreencast/app/AndroidScreencastApplication.java index 71b8171..1cd0aec 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/app/AndroidScreencastApplication.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/app/AndroidScreencastApplication.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.app; import com.android.ddmlib.IDevice; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/app/Application.java b/src/main/java/com/github/xsavikx/androidscreencast/app/Application.java index feb0248..a6dbe65 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/app/Application.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/app/Application.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.app; public interface Application { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/app/DeviceChooserApplication.java b/src/main/java/com/github/xsavikx/androidscreencast/app/DeviceChooserApplication.java index 5a28816..747ecb1 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/app/DeviceChooserApplication.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/app/DeviceChooserApplication.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.app; import com.android.ddmlib.IDevice; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/app/GUIApplication.java b/src/main/java/com/github/xsavikx/androidscreencast/app/GUIApplication.java index 74dec95..164b271 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/app/GUIApplication.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/app/GUIApplication.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.app; import org.slf4j.Logger; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/app/SwingApplication.java b/src/main/java/com/github/xsavikx/androidscreencast/app/SwingApplication.java index 8a2673b..1fe726c 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/app/SwingApplication.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/app/SwingApplication.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.app; import com.github.xsavikx.androidscreencast.configuration.ApplicationConfiguration; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/configuration/ApplicationConfiguration.java b/src/main/java/com/github/xsavikx/androidscreencast/configuration/ApplicationConfiguration.java index 5449143..345f02f 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/configuration/ApplicationConfiguration.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/configuration/ApplicationConfiguration.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.configuration; import com.github.xsavikx.androidscreencast.exception.AndroidScreenCastRuntimeException; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/configuration/ApplicationConfigurationProperty.java b/src/main/java/com/github/xsavikx/androidscreencast/configuration/ApplicationConfigurationProperty.java index fbf53ab..491b41e 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/configuration/ApplicationConfigurationProperty.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/configuration/ApplicationConfigurationProperty.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.configuration; import static com.github.xsavikx.androidscreencast.configuration.ApplicationConfigurationPropertyKeys.*; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/configuration/ApplicationConfigurationPropertyKeys.java b/src/main/java/com/github/xsavikx/androidscreencast/configuration/ApplicationConfigurationPropertyKeys.java index 18023f5..4424b99 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/configuration/ApplicationConfigurationPropertyKeys.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/configuration/ApplicationConfigurationPropertyKeys.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.configuration; public final class ApplicationConfigurationPropertyKeys { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/dagger/ApiModule.java b/src/main/java/com/github/xsavikx/androidscreencast/dagger/ApiModule.java index 2725c83..9522c21 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/dagger/ApiModule.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/dagger/ApiModule.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.dagger; import com.android.ddmlib.IShellOutputReceiver; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/dagger/AppModule.java b/src/main/java/com/github/xsavikx/androidscreencast/dagger/AppModule.java index 8af41b8..7395ac3 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/dagger/AppModule.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/dagger/AppModule.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.dagger; import com.android.ddmlib.IDevice; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/dagger/MainComponent.java b/src/main/java/com/github/xsavikx/androidscreencast/dagger/MainComponent.java index b5ad021..dfe3343 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/dagger/MainComponent.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/dagger/MainComponent.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.dagger; import com.github.xsavikx.androidscreencast.api.command.executor.CommandExecutor; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/dagger/MainComponentProvider.java b/src/main/java/com/github/xsavikx/androidscreencast/dagger/MainComponentProvider.java index 27f42f1..6fe3790 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/dagger/MainComponentProvider.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/dagger/MainComponentProvider.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.dagger; public final class MainComponentProvider { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/dagger/UiModule.java b/src/main/java/com/github/xsavikx/androidscreencast/dagger/UiModule.java index 94c0e77..778a7e5 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/dagger/UiModule.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/dagger/UiModule.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.dagger; import com.github.xsavikx.androidscreencast.api.injector.InputKeyEvent; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/exception/AndroidScreenCastRuntimeException.java b/src/main/java/com/github/xsavikx/androidscreencast/exception/AndroidScreenCastRuntimeException.java index 1031d3f..5e02399 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/exception/AndroidScreenCastRuntimeException.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/exception/AndroidScreenCastRuntimeException.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.exception; public class AndroidScreenCastRuntimeException extends RuntimeException { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/exception/ExecuteCommandException.java b/src/main/java/com/github/xsavikx/androidscreencast/exception/ExecuteCommandException.java index 8b82ffc..72e633c 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/exception/ExecuteCommandException.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/exception/ExecuteCommandException.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.exception; public final class ExecuteCommandException extends AndroidScreenCastRuntimeException { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/exception/IORuntimeException.java b/src/main/java/com/github/xsavikx/androidscreencast/exception/IORuntimeException.java index 093d046..bc20710 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/exception/IORuntimeException.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/exception/IORuntimeException.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.exception; import java.io.IOException; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/exception/IllegalAdbConfigurationException.java b/src/main/java/com/github/xsavikx/androidscreencast/exception/IllegalAdbConfigurationException.java index 94765d5..56fca6c 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/exception/IllegalAdbConfigurationException.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/exception/IllegalAdbConfigurationException.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.exception; public final class IllegalAdbConfigurationException extends AndroidScreenCastRuntimeException { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/exception/NoDeviceChosenException.java b/src/main/java/com/github/xsavikx/androidscreencast/exception/NoDeviceChosenException.java index 8b80170..f599463 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/exception/NoDeviceChosenException.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/exception/NoDeviceChosenException.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.exception; public final class NoDeviceChosenException extends AndroidScreenCastRuntimeException { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/exception/WaitDeviceListTimeoutException.java b/src/main/java/com/github/xsavikx/androidscreencast/exception/WaitDeviceListTimeoutException.java index b0261e9..b347978 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/exception/WaitDeviceListTimeoutException.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/exception/WaitDeviceListTimeoutException.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.exception; public final class WaitDeviceListTimeoutException extends AndroidScreenCastRuntimeException { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/JDialogDeviceList.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/JDialogDeviceList.java index 12b779e..2862488 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/JDialogDeviceList.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/JDialogDeviceList.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui; import com.android.ddmlib.IDevice; @@ -15,16 +32,16 @@ public final class JDialogDeviceList extends JDialog implements ActionListener { private static final String DEFAULT_HOST = "127.0.0.1"; private static final int DEFAULT_PORT = 1324; - private JTextField jtfHost = new JTextField(DEFAULT_HOST); - private JFormattedTextField jftfPort = new JFormattedTextField(DEFAULT_PORT); - private JList jlDevices = new JList<>(); - private JPanel jpAgent = new JPanel(); - private JPanel jpButtons = new JPanel(); - private JButton jbOk = new JButton("OK"); - private JButton jbQuit = new JButton("Quit"); + private final JTextField jtfHost = new JTextField(DEFAULT_HOST); + private final JFormattedTextField jftfPort = new JFormattedTextField(DEFAULT_PORT); + private final JList jlDevices = new JList<>(); + private final JPanel jpAgent = new JPanel(); + private final JPanel jpButtons = new JPanel(); + private final JButton jbOk = new JButton("OK"); + private final JButton jbQuit = new JButton("Quit"); private boolean cancelled = false; - private IDevice[] devices; + private final IDevice[] devices; public JDialogDeviceList(IDevice[] devices) { super(); diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/JDialogError.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/JDialogError.java index 23e418b..aa1d60b 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/JDialogError.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/JDialogError.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui; import com.github.xsavikx.androidscreencast.exception.AndroidScreenCastRuntimeException; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/JDialogExecuteKeyEvent.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/JDialogExecuteKeyEvent.java index ad776eb..b66f5d6 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/JDialogExecuteKeyEvent.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/JDialogExecuteKeyEvent.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui; import com.github.xsavikx.androidscreencast.api.command.KeyCommand; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/JFrameMain.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/JFrameMain.java index a48918c..e743fe0 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/JFrameMain.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/JFrameMain.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui; import com.github.xsavikx.androidscreencast.api.injector.Injector; @@ -37,18 +54,18 @@ public final class JFrameMain extends JFrame { private final JDialogExecuteKeyEvent dialogExecuteKeyEvent; private transient boolean isDisposed = false; - private JToolBar jtb = new JToolBar(); - private JToolBar jtbHardkeys = new JToolBar(); + private final JToolBar jtb = new JToolBar(); + private final JToolBar jtbHardkeys = new JToolBar(); private JScrollPane jsp; - private JButton jbExplorer = new JButton("Explore"); - private JButton jbExecuteKeyEvent = new JButton("Execute keycode"); - private JButton jbKbHome = new JButton("Home"); - private JButton jbKbMenu = new JButton("Menu"); - private JButton jbKbBack = new JButton("Back"); - private JButton jbKbSearch = new JButton("Search"); - private JButton jbKbPhoneOn = new JButton("Call"); - private JButton jbKbPhoneOff = new JButton("End call"); - private JButton jbRecord = new JButton("Start record"); + private final JButton jbExplorer = new JButton("Explore"); + private final JButton jbExecuteKeyEvent = new JButton("Execute keycode"); + private final JButton jbKbHome = new JButton("Home"); + private final JButton jbKbMenu = new JButton("Menu"); + private final JButton jbKbBack = new JButton("Back"); + private final JButton jbKbSearch = new JButton("Search"); + private final JButton jbKbPhoneOn = new JButton("Call"); + private final JButton jbKbPhoneOff = new JButton("End call"); + private final JButton jbRecord = new JButton("Start record"); private Dimension oldImageDimension; @Inject diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/JPanelScreen.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/JPanelScreen.java index 5b83393..9e90c13 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/JPanelScreen.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/JPanelScreen.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui; import javax.inject.Inject; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/explorer/JFrameExplorer.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/explorer/JFrameExplorer.java index b462dae..c229d33 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/explorer/JFrameExplorer.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/explorer/JFrameExplorer.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui.explorer; import com.github.xsavikx.androidscreencast.api.AndroidDevice; @@ -22,9 +39,9 @@ public final class JFrameExplorer extends JFrame { private static final long serialVersionUID = -5209265873286028854L; private final AndroidDevice androidDevice; - private JTree jt; + private final JTree jt; private JList jListFichiers; - private Map> cache = new LinkedHashMap<>(); + private final Map> cache = new LinkedHashMap<>(); @Inject JFrameExplorer(AndroidDevice androidDevice) { diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/explorer/LazyLoadingTreeNode.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/explorer/LazyLoadingTreeNode.java index 977391a..5b8037b 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/explorer/LazyLoadingTreeNode.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/explorer/LazyLoadingTreeNode.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui.explorer; import javax.swing.*; @@ -24,11 +41,11 @@ public abstract class LazyLoadingTreeNode extends DefaultMutableTreeNode impleme /** * The JTree containing this Node */ - private JTree tree; + private final JTree tree; /** * Can the worker be Canceled ? */ - private boolean cancelable; + private final boolean cancelable; /** * Default Constructor @@ -243,7 +260,7 @@ protected static class CancelWorkersAction extends AbstractAction { /** * the SwingWorkers */ - private List> workers = new ArrayList<>(); + private final List> workers = new ArrayList<>(); /** * Default constructor diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/explorer/LazyMutableTreeNode.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/explorer/LazyMutableTreeNode.java index 062c00f..74da016 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/explorer/LazyMutableTreeNode.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/explorer/LazyMutableTreeNode.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui.explorer; import javax.swing.tree.DefaultMutableTreeNode; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyEventDispatcherFactory.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyEventDispatcherFactory.java index d71c0ec..099ff26 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyEventDispatcherFactory.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyEventDispatcherFactory.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui.interaction; import java.awt.*; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyEventDispatcherImpl.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyEventDispatcherImpl.java index adc76fc..64ca216 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyEventDispatcherImpl.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyEventDispatcherImpl.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui.interaction; import com.github.xsavikx.androidscreencast.api.command.KeyCommand; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyboardActionListener.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyboardActionListener.java index ec078aa..efb844f 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyboardActionListener.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyboardActionListener.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui.interaction; import com.github.xsavikx.androidscreencast.api.command.KeyCommand; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyboardActionListenerFactory.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyboardActionListenerFactory.java index a290d06..ea09b94 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyboardActionListenerFactory.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/KeyboardActionListenerFactory.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui.interaction; import com.github.xsavikx.androidscreencast.api.injector.InputKeyEvent; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/MouseActionAdapter.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/MouseActionAdapter.java index b2c4110..68b2710 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/MouseActionAdapter.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/interaction/MouseActionAdapter.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui.interaction; import com.github.xsavikx.androidscreencast.api.command.SwipeCommand; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/model/InputKeyEventTable.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/model/InputKeyEventTable.java index 72f2f02..6d5c4a8 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/model/InputKeyEventTable.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/model/InputKeyEventTable.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui.model; import javax.inject.Inject; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/model/InputKeyEventTableModel.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/model/InputKeyEventTableModel.java index 20aca41..aea864e 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/model/InputKeyEventTableModel.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/model/InputKeyEventTableModel.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.ui.model; import com.github.xsavikx.androidscreencast.api.injector.InputKeyEvent; @@ -19,7 +36,7 @@ public final class InputKeyEventTableModel extends AbstractTableModel { INDEX_COLUMN_NAME, TITLE_COLUMN_NAME, DESCRIPTION_COLUMN_NAME }; - private List> data = new ArrayList<>(); + private final List> data = new ArrayList<>(); private int rowCount = 0; @Inject diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/worker/AccumulativeRunnable.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/worker/AccumulativeRunnable.java index e4126db..aeed8a9 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/worker/AccumulativeRunnable.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/worker/AccumulativeRunnable.java @@ -1,12 +1,22 @@ -package com.github.xsavikx.androidscreencast.ui.worker; - -/* - * $Id: AccumulativeRunnable.java,v 1.3 2008/07/25 19:32:29 idk Exp $ - * - * Copyright @ 2005 Sun Microsystems, Inc. All rights - * reserved. Use is subject to license terms. +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * */ +package com.github.xsavikx.androidscreencast.ui.worker; + import javax.swing.*; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/com/github/xsavikx/androidscreencast/ui/worker/SwingWorker.java b/src/main/java/com/github/xsavikx/androidscreencast/ui/worker/SwingWorker.java index f230fdf..f673615 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/ui/worker/SwingWorker.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/ui/worker/SwingWorker.java @@ -1,8 +1,18 @@ -/* - * $Id: SwingWorker.java,v 1.6 2008/07/25 19:32:29 idk Exp $ - * - * Copyright © 2005 Sun Microsystems, Inc. All rights - * reserved. Use is subject to license terms. +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * */ package com.github.xsavikx.androidscreencast.ui.worker; @@ -251,11 +261,11 @@ public Thread newThread(final Runnable r) { } }; - /* - * We want a to have no more than MAX_WORKER_THREADS running threads. - * - * We want a worker thread to wait no longer than 1 second for new tasks before terminating. - */ + /* + * We want a to have no more than MAX_WORKER_THREADS running threads. + * + * We want a worker thread to wait no longer than 1 second for new tasks before terminating. + */ executorService = new ThreadPoolExecutor(0, MAX_WORKER_THREADS, 5L, TimeUnit.SECONDS, new LinkedBlockingQueue(), threadFactory) { @@ -281,17 +291,17 @@ protected void afterExecute(Runnable r, Throwable t) { @Override public void execute(Runnable command) { - /* - * ThreadPoolExecutor first tries to run task in a corePool. If all threads are busy it tries to add task to the waiting queue. If it fails - * it run task in maximumPool. - * - * We want corePool to be 0 and maximumPool to be MAX_WORKER_THREADS We need to change the order of the execution. First try corePool then - * try maximumPool pool and only then store to the waiting queue. We can not do that because we would need access to the private methods. - * - * Instead we enlarge corePool to MAX_WORKER_THREADS before the execution and shrink it back to 0 after. It does pretty much what we need. - * - * While we changing the corePoolSize we need to stop running worker threads from accepting new tasks. - */ + /* + * ThreadPoolExecutor first tries to run task in a corePool. If all threads are busy it tries to add task to the waiting queue. If it fails + * it run task in maximumPool. + * + * We want corePool to be 0 and maximumPool to be MAX_WORKER_THREADS We need to change the order of the execution. First try corePool then + * try maximumPool pool and only then store to the waiting queue. We can not do that because we would need access to the private methods. + * + * Instead we enlarge corePool to MAX_WORKER_THREADS before the execution and shrink it back to 0 after. It does pretty much what we need. + * + * While we changing the corePoolSize we need to stop running worker threads from accepting new tasks. + */ // we need atomicity for the execute method. executeLock.lock(); @@ -557,9 +567,9 @@ public final PropertyChangeSupport getPropertyChangeSupport() { * @return the current state */ public final StateValue getState() { - /* - * DONE is a special case to keep getState and isDone is sync - */ + /* + * DONE is a special case to keep getState and isDone is sync + */ if (isDone()) { return StateValue.DONE; } else { @@ -718,7 +728,8 @@ public enum StateValue { /** * Initial {@code SwingWorker} state. */ - PENDING, /** + PENDING, + /** * {@code SwingWorker} is {@code STARTED} before invoking {@code doInBackground}. */ STARTED, @@ -747,10 +758,10 @@ protected void run(List args) { } } finally { if (i < args.size()) { - /* - * there was an exception schedule all the unhandled items for the next time - */ - Runnable argsTail[] = new Runnable[args.size() - i]; + /* + * there was an exception schedule all the unhandled items for the next time + */ + Runnable[] argsTail = new Runnable[args.size() - i]; for (int j = 0; j < argsTail.length; j++) { argsTail[j] = args.get(i + j); } diff --git a/src/main/java/com/github/xsavikx/androidscreencast/util/StringUtils.java b/src/main/java/com/github/xsavikx/androidscreencast/util/StringUtils.java index a44201b..9c1d15a 100644 --- a/src/main/java/com/github/xsavikx/androidscreencast/util/StringUtils.java +++ b/src/main/java/com/github/xsavikx/androidscreencast/util/StringUtils.java @@ -1,3 +1,20 @@ +/* + * Copyright 2020 Yurii Serhiichuk + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.github.xsavikx.androidscreencast.util; public final class StringUtils { diff --git a/src/main/resources/logback-test.xml b/src/main/resources/logback-test.xml index 633cd4c..500c2b2 100644 --- a/src/main/resources/logback-test.xml +++ b/src/main/resources/logback-test.xml @@ -1,4 +1,22 @@ + + + diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index 633cd4c..500c2b2 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -1,4 +1,22 @@ + + +