Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.
Python adbadblockandroid-tvandroid-tv-launcherapple-tvbloatware-removalclaude-codedebloatfire-tvgoogle-tvlauncherprivacysmart-tvsony-braviatclvibe-codingxiaomi
addons: Digital Rain, a Matrix-style screensaver
Dennis OLeary4dde4d9a4370
diff --git a/addons/README.md b/addons/README.mdindex 500076b9a..e0c259670 100644--- a/addons/README.md+++ b/addons/README.md@@ -29,6 +29,7 @@ the core bigger or change how it behaves. You install an add-on only if you want| [Startup & Branding](startup-branding/) | A welcome screen of your own: your picture, a background colour and a line of text, full screen for a few seconds or until Back or OK, with a live preview, Fit/Fill/Stretch/Original scaling and a compatibility check of what the TV allows without root | [@maxhayim](https://github.com/maxhayim) | MOKA M1G (Android TV 11) | None | <img src="startup-branding/screenshot.jpg" width="240" alt="Startup & Branding on a TV"> || [World Clock](world-clock/) | One to six offline clocks with dates, UTC offsets and day differences; city search and D-pad controls | [@SaviorOneZero](https://github.com/SaviorOneZero) | Samsung C71KW-200 / AT&T Osprey (Android TV 11) | None | <img src="world-clock/screenshot.jpg" width="240" alt="World Clock on a TV"> || [Flock](flock/) | An interactive flocking simulation using separation, alignment and cohesion, controlled with the TV remote | CleanYourTV contributors | TCL 32S5K (Android TV 14) | None | <img src="flock/screenshot.jpg" width="240" alt="Flock on TCL Android TV"> |+| [Digital Rain](digital-rain/) | A Matrix-style screensaver: mirrored katakana and digits falling in green trails with bright heads, drawn on the TV with no network; the card starts it at once | [@dennis-oleary](https://github.com/dennis-oleary) | NVIDIA SHIELD Android TV Pro 2019 (Android TV 11) | None | <img src="digital-rain/screenshot.jpg" width="240" alt="Digital Rain on a TV"> |A widget, an info tile, a storage or smart-home card: if it can live as its own small app, it can livehere. See the rules below.diff --git a/addons/digital-rain/.gitignore b/addons/digital-rain/.gitignorenew file mode 100644index 000000000..a7e04a21b--- /dev/null+++ b/addons/digital-rain/.gitignore@@ -0,0 +1,4 @@+.gradle/+build/+app/build/+local.propertiesdiff --git a/addons/digital-rain/README.md b/addons/digital-rain/README.mdnew file mode 100644index 000000000..7dfa89c57--- /dev/null+++ b/addons/digital-rain/README.md@@ -0,0 +1,57 @@+# Digital Rain++A screensaver in the style of the film's digital rain: columns of mirrored half-width katakana and digits fall down+a black screen, each with a bright head and a green trail that fades behind it, while a few glyphs in the trails+change as they fall. It is drawn on the TV at about 20 frames a second, with no pictures or fonts to download.++On cleanyourtv's Home it is also a module card, **Digital Rain**: press OK on it to start the rain at once, and+Back to leave.++- Package: `io.github.dennisoleary.digitalrain`+- Author: [@dennis-oleary](https://github.com/dennis-oleary)+- Tested on: NVIDIA SHIELD Android TV Pro 2019 (Android TV 11)++## Permissions++None. No network access (no `INTERNET` permission): nothing leaves the TV. No background service: it runs only+while the screensaver or the card's screen is showing.++## Build and install++JDK 17 and Android SDK 34, as for the launcher. From the repo root:++```bash+cd addons/digital-rain && ./gradlew assembleRelease && cd ../..+TV_HOST=<tv ip> tools/venv/bin/python -I tools/tv.py --push addons/digital-rain/app/build/outputs/apk/release/app-release.apk /data/local/tmp/addon.apk+TV_HOST=<tv ip> tools/venv/bin/python -I tools/tv.py 'pm install -r /data/local/tmp/addon.apk; rm -f /data/local/tmp/addon.apk'+```++Press Home: the launcher asks once whether to show the card.++## Use it as the screensaver++Settings > Device Preferences > Screen saver > **Digital Rain** (the menu's name depends on the TV), or:++```bash+TV_HOST=<tv ip> tools/venv/bin/python -I tools/tv.py 'settings put secure screensaver_components io.github.dennisoleary.digitalrain/.RainDream'+```++To see it without waiting, start the screensaver now:++```bash+TV_HOST=<tv ip> tools/venv/bin/python -I tools/tv.py 'am start -n com.android.systemui/.Somnambulator'+```++## Change the look++The constants at the top of `RainView.java`: `FRAME_NS` for the speed, `DROPS_PER_COLUMN` for how dense the rain+is, `TRAIL` and `HEAD` for the colours. The glyph size is the `12` in `onSizeChanged` (in dp), and the fade colour+in the constructor sets how long the trails stay.++## Remove++```bash+TV_HOST=<tv ip> tools/venv/bin/python -I tools/tv.py 'pm uninstall io.github.dennisoleary.digitalrain'+```++If it was the screensaver, pick another one in Settings.diff --git a/addons/digital-rain/app/build.gradle b/addons/digital-rain/app/build.gradlenew file mode 100644index 000000000..542e9e8b9--- /dev/null+++ b/addons/digital-rain/app/build.gradle@@ -0,0 +1,31 @@+plugins {+ id 'com.android.application'+}++android {+ namespace 'io.github.dennisoleary.digitalrain'+ compileSdk 34++ defaultConfig {+ applicationId 'io.github.dennisoleary.digitalrain'+ minSdk 26+ targetSdk 34+ versionCode 1+ versionName '1.0'+ }++ buildTypes {+ release {+ minifyEnabled true+ shrinkResources true+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')+ // Sideloaded over ADB like the launcher: signed with the debug key.+ signingConfig signingConfigs.debug+ }+ }++ compileOptions {+ sourceCompatibility JavaVersion.VERSION_17+ targetCompatibility JavaVersion.VERSION_17+ }+}diff --git a/addons/digital-rain/app/src/main/AndroidManifest.xml b/addons/digital-rain/app/src/main/AndroidManifest.xmlnew file mode 100644index 000000000..6f72c1ba7--- /dev/null+++ b/addons/digital-rain/app/src/main/AndroidManifest.xml@@ -0,0 +1,43 @@+<?xml version="1.0" encoding="utf-8"?>+<!-- No permissions: everything is drawn on the box, nothing goes over the network. -->+<manifest xmlns:android="http://schemas.android.com/apk/res/android">++ <uses-feature android:name="android.software.leanback" android:required="false" />+ <uses-feature android:name="android.hardware.touchscreen" android:required="false" />++ <application+ android:allowBackup="false"+ android:banner="@drawable/banner"+ android:icon="@drawable/icon"+ android:label="@string/app_name"+ android:supportsRtl="false">++ <!-- The tile, and the card on cleanyourtv's Home (docs/modules.md): the rain, at once, until Back. -->+ <activity+ android:name=".RainActivity"+ android:exported="true"+ android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">+ <intent-filter>+ <action android:name="android.intent.action.MAIN" />+ <category android:name="android.intent.category.LEANBACK_LAUNCHER" />+ </intent-filter>+ <intent-filter>+ <action android:name="android.intent.action.MAIN" />+ <category android:name="com.gathin.tvhome.category.DOCK_CARD" />+ </intent-filter>+ <meta-data android:name="com.gathin.tvhome.card" android:resource="@xml/module_card" />+ </activity>++ <!-- The screensaver: Settings > Device Preferences > Screen saver > Digital Rain. -->+ <service+ android:name=".RainDream"+ android:exported="true"+ android:label="@string/app_name"+ android:permission="android.permission.BIND_DREAM_SERVICE">+ <intent-filter>+ <action android:name="android.service.dreams.DreamService" />+ <category android:name="android.intent.category.DEFAULT" />+ </intent-filter>+ </service>+ </application>+</manifest>diff --git a/addons/digital-rain/app/src/main/java/io/github/dennisoleary/digitalrain/RainActivity.java b/addons/digital-rain/app/src/main/java/io/github/dennisoleary/digitalrain/RainActivity.javanew file mode 100644index 000000000..3ee621307--- /dev/null+++ b/addons/digital-rain/app/src/main/java/io/github/dennisoleary/digitalrain/RainActivity.java@@ -0,0 +1,31 @@+package io.github.dennisoleary.digitalrain;++import android.app.Activity;+import android.os.Bundle;+import android.view.WindowManager;++/** The tile and the card: the same rain as the screensaver, at once, until Back. */+public class RainActivity extends Activity {++ private RainView rain;++ @Override+ protected void onCreate(Bundle state) {+ super.onCreate(state);+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);+ rain = new RainView(this);+ setContentView(rain);+ }++ @Override+ protected void onResume() {+ super.onResume();+ rain.start();+ }++ @Override+ protected void onPause() {+ rain.stop();+ super.onPause();+ }+}diff --git a/addons/digital-rain/app/src/main/java/io/github/dennisoleary/digitalrain/RainDream.java b/addons/digital-rain/app/src/main/java/io/github/dennisoleary/digitalrain/RainDream.javanew file mode 100644index 000000000..83422b604--- /dev/null+++ b/addons/digital-rain/app/src/main/java/io/github/dennisoleary/digitalrain/RainDream.java@@ -0,0 +1,31 @@+package io.github.dennisoleary.digitalrain;++import android.service.dreams.DreamService;++/** The screensaver: digital rain until any key wakes the box back to where it was. */+public class RainDream extends DreamService {++ private RainView rain;++ @Override+ public void onAttachedToWindow() {+ super.onAttachedToWindow();+ setInteractive(false);+ setFullscreen(true);+ setScreenBright(false);+ rain = new RainView(this);+ setContentView(rain);+ }++ @Override+ public void onDreamingStarted() {+ super.onDreamingStarted();+ rain.start();+ }++ @Override+ public void onDreamingStopped() {+ rain.stop();+ super.onDreamingStopped();+ }+}diff --git a/addons/digital-rain/app/src/main/java/io/github/dennisoleary/digitalrain/RainView.java b/addons/digital-rain/app/src/main/java/io/github/dennisoleary/digitalrain/RainView.javanew file mode 100644index 000000000..e86059e56--- /dev/null+++ b/addons/digital-rain/app/src/main/java/io/github/dennisoleary/digitalrain/RainView.java@@ -0,0 +1,151 @@+package io.github.dennisoleary.digitalrain;++import android.content.Context;+import android.graphics.Bitmap;+import android.graphics.Canvas;+import android.graphics.Paint;+import android.graphics.Typeface;+import android.view.Choreographer;+import android.view.View;++import java.util.Random;++/**+ * Columns of mirrored half-width katakana and digits falling down the screen. Each frame dims the whole picture a+ * little, so the glyphs drawn earlier fade into trails behind a bright head. Drawn into one offscreen bitmap at about+ * 20 frames a second; nothing runs when the screensaver is not showing.+ */+final class RainView extends View implements Choreographer.FrameCallback {+ private static final long FRAME_NS = 50_000_000L; // 20 fps is plenty for rain and easy on the box+ private static final int TRAIL = 0xFF00FF41;+ private static final int HEAD = 0xFFD8FFD8;+ private static final int DROPS_PER_COLUMN = 2; // two streams can share a column, for a denser rain+ private static final String GLYPHS;++ static {+ StringBuilder b = new StringBuilder();+ for (char c = 'ヲ'; c <= 'ン'; c++) b.append(c); // half-width katakana+ b.append("0123456789Z:.=*+-<>¦");+ GLYPHS = b.toString();+ }++ private final Random random = new Random();+ private final Paint glyph = new Paint(Paint.ANTI_ALIAS_FLAG);+ private final Paint fade = new Paint();+ private final Paint clear = new Paint();+ private Bitmap frame;+ private Canvas canvas;+ private float cell;+ private int columns;+ private float[] row; // each drop's head row (drop d falls in column d % columns), fractional; negative while waiting to start+ private float[] speed; // rows per frame+ private int[] lastRow; // where the head was drawn, to turn it green when it moves on+ private char[] lastGlyph;+ private boolean running;+ private long lastFrame;++ RainView(Context context) {+ super(context);+ setBackgroundColor(0xFF000000);+ glyph.setTypeface(Typeface.MONOSPACE);+ glyph.setTextAlign(Paint.Align.CENTER);+ fade.setColor(0x16000000); // a little slower fade, so trails run longer+ clear.setColor(0xFF000000);+ }++ void start() {+ if (running) return;+ running = true;+ lastFrame = 0;+ Choreographer.getInstance().postFrameCallback(this);+ }++ void stop() {+ running = false;+ Choreographer.getInstance().removeFrameCallback(this);+ }++ @Override+ protected void onSizeChanged(int w, int h, int oldw, int oldh) {+ if (w == 0 || h == 0) return;+ cell = 12 * getResources().getDisplayMetrics().density;+ glyph.setTextSize(cell * 0.92f);+ frame = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);+ canvas = new Canvas(frame);+ canvas.drawColor(0xFF000000);+ columns = (int) Math.ceil(w / cell);+ int drops = columns * DROPS_PER_COLUMN;+ row = new float[drops];+ speed = new float[drops];+ lastRow = new int[drops];+ lastGlyph = new char[drops];+ int rows = (int) (h / cell);+ for (int c = 0; c < drops; c++) {+ row[c] = -random.nextInt(rows * DROPS_PER_COLUMN); // staggered start, so the screen fills over a few seconds+ speed[c] = newSpeed();+ lastRow[c] = -1;+ }+ }++ @Override+ public void doFrame(long now) {+ if (!running) return;+ if (canvas != null && now - lastFrame >= FRAME_NS) {+ lastFrame = now;+ step();+ invalidate();+ }+ Choreographer.getInstance().postFrameCallback(this);+ }++ private float newSpeed() {+ return 0.35f + random.nextFloat() * 0.65f;+ }++ private void step() {+ canvas.drawRect(0, 0, frame.getWidth(), frame.getHeight(), fade);+ int rows = (int) (frame.getHeight() / cell) + 1;+ for (int c = 0; c < row.length; c++) {+ row[c] += speed[c];+ int r = (int) Math.floor(row[c]);+ if (r == lastRow[c]) continue;+ if (lastRow[c] >= 0) draw(c % columns, lastRow[c], lastGlyph[c], TRAIL); // the old head joins the trail+ if (r >= rows) {+ // Off the bottom: start again from the top after a short random pause.+ row[c] = -random.nextInt(rows / 3 + 1);+ speed[c] = newSpeed();+ lastRow[c] = -1;+ continue;+ }+ if (r >= 0) {+ char g = GLYPHS.charAt(random.nextInt(GLYPHS.length()));+ draw(c % columns, r, g, HEAD);+ lastRow[c] = r;+ lastGlyph[c] = g;+ }+ }+ // A few glyphs in the trails change, as in the film.+ for (int i = 0; i < row.length / 6; i++) {+ int c = random.nextInt(row.length);+ int r = lastRow[c] - 1 - random.nextInt(12);+ if (r >= 0) draw(c % columns, r, GLYPHS.charAt(random.nextInt(GLYPHS.length())), TRAIL & 0x99FFFFFF);+ }+ }++ private void draw(int column, int r, char g, int colour) {+ float left = column * cell;+ float top = r * cell;+ canvas.drawRect(left, top, left + cell, top + cell, clear);+ glyph.setColor(colour);+ float cx = left + cell / 2;+ canvas.save();+ canvas.scale(-1, 1, cx, 0); // mirrored, like the film's glyphs+ canvas.drawText(String.valueOf(g), cx, top + cell * 0.85f, glyph);+ canvas.restore();+ }++ @Override+ protected void onDraw(Canvas c) {+ if (frame != null) c.drawBitmap(frame, 0, 0, null);+ }+}diff --git a/addons/digital-rain/app/src/main/res/drawable/banner.xml b/addons/digital-rain/app/src/main/res/drawable/banner.xmlnew file mode 100644index 000000000..21bd2b6d9--- /dev/null+++ b/addons/digital-rain/app/src/main/res/drawable/banner.xml@@ -0,0 +1,13 @@+<?xml version="1.0" encoding="utf-8"?>+<!-- The TV banner: three green rain streaks with bright heads on black. Drawn for this add-on. -->+<vector xmlns:android="http://schemas.android.com/apk/res/android"+ android:width="320dp" android:height="180dp"+ android:viewportWidth="320" android:viewportHeight="180">+ <path android:fillColor="#FF000000" android:pathData="M0,0h320v180h-320z" />+ <path android:fillColor="#5500FF41" android:pathData="M100,20h12v100h-12z" />+ <path android:fillColor="#FFD8FFD8" android:pathData="M100,120h12v12h-12z" />+ <path android:fillColor="#8800FF41" android:pathData="M154,0h12v140h-12z" />+ <path android:fillColor="#FFD8FFD8" android:pathData="M154,140h12v12h-12z" />+ <path android:fillColor="#4400FF41" android:pathData="M208,40h12v60h-12z" />+ <path android:fillColor="#FFD8FFD8" android:pathData="M208,100h12v12h-12z" />+</vector>diff --git a/addons/digital-rain/app/src/main/res/drawable/icon.xml b/addons/digital-rain/app/src/main/res/drawable/icon.xmlnew file mode 100644index 000000000..83b3de76a--- /dev/null+++ b/addons/digital-rain/app/src/main/res/drawable/icon.xml@@ -0,0 +1,13 @@+<?xml version="1.0" encoding="utf-8"?>+<!-- The app icon: the banner's streaks, square. -->+<vector xmlns:android="http://schemas.android.com/apk/res/android"+ android:width="48dp" android:height="48dp"+ android:viewportWidth="108" android:viewportHeight="108">+ <path android:fillColor="#FF000000" android:pathData="M0,0h108v108h-108z" />+ <path android:fillColor="#6600FF41" android:pathData="M30,14h10v56h-10z" />+ <path android:fillColor="#FFD8FFD8" android:pathData="M30,70h10v10h-10z" />+ <path android:fillColor="#9900FF41" android:pathData="M49,6h10v76h-10z" />+ <path android:fillColor="#FFD8FFD8" android:pathData="M49,82h10v10h-10z" />+ <path android:fillColor="#5500FF41" android:pathData="M68,26h10v34h-10z" />+ <path android:fillColor="#FFD8FFD8" android:pathData="M68,60h10v10h-10z" />+</vector>diff --git a/addons/digital-rain/app/src/main/res/values/strings.xml b/addons/digital-rain/app/src/main/res/values/strings.xmlnew file mode 100644index 000000000..ddb79c168--- /dev/null+++ b/addons/digital-rain/app/src/main/res/values/strings.xml@@ -0,0 +1,4 @@+<?xml version="1.0" encoding="utf-8"?>+<resources>+ <string name="app_name">Digital Rain</string>+</resources>diff --git a/addons/digital-rain/app/src/main/res/xml/module_card.xml b/addons/digital-rain/app/src/main/res/xml/module_card.xmlnew file mode 100644index 000000000..dd8f500ce--- /dev/null+++ b/addons/digital-rain/app/src/main/res/xml/module_card.xml@@ -0,0 +1,2 @@+<?xml version="1.0" encoding="utf-8"?>+<card spec="1" label="Digital Rain" caption="Matrix screensaver" accent="#00FF41" />diff --git a/addons/digital-rain/build.gradle b/addons/digital-rain/build.gradlenew file mode 100644index 000000000..48978475f--- /dev/null+++ b/addons/digital-rain/build.gradle@@ -0,0 +1,3 @@+plugins {+ id 'com.android.application' version '8.5.2' apply false+}diff --git a/addons/digital-rain/gradle.properties b/addons/digital-rain/gradle.propertiesnew file mode 100644index 000000000..1edaf2baa--- /dev/null+++ b/addons/digital-rain/gradle.properties@@ -0,0 +1 @@+org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8diff --git a/addons/digital-rain/gradle/wrapper/gradle-wrapper.jar b/addons/digital-rain/gradle/wrapper/gradle-wrapper.jarnew file mode 100644index 000000000..2c3521197Binary files /dev/null and b/addons/digital-rain/gradle/wrapper/gradle-wrapper.jar differdiff --git a/addons/digital-rain/gradle/wrapper/gradle-wrapper.properties b/addons/digital-rain/gradle/wrapper/gradle-wrapper.propertiesnew file mode 100644index 000000000..77f5d0ba6--- /dev/null+++ b/addons/digital-rain/gradle/wrapper/gradle-wrapper.properties@@ -0,0 +1,8 @@+distributionBase=GRADLE_USER_HOME+distributionPath=wrapper/dists+distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip+distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab+networkTimeout=10000+validateDistributionUrl=true+zipStoreBase=GRADLE_USER_HOME+zipStorePath=wrapper/distsdiff --git a/addons/digital-rain/gradlew b/addons/digital-rain/gradlewnew file mode 100644index 000000000..f5feea6d6--- /dev/null+++ b/addons/digital-rain/gradlew@@ -0,0 +1,252 @@+#!/bin/sh++#+# Copyright © 2015-2021 the original 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+#+# https://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.+#+# SPDX-License-Identifier: Apache-2.0+#++##############################################################################+#+# Gradle start up script for POSIX generated by Gradle.+#+# Important for running:+#+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is+# noncompliant, but you have some other compliant shell such as ksh or+# bash, then to run this script, type that shell name before the whole+# command line, like:+#+# ksh Gradle+#+# Busybox and similar reduced shells will NOT work, because this script+# requires all of these POSIX shell features:+# * functions;+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;+# * compound commands having a testable exit status, especially «case»;+# * various built-in commands including «command», «set», and «ulimit».+#+# Important for patching:+#+# (2) This script targets any POSIX shell, so it avoids extensions provided+# by Bash, Ksh, etc; in particular arrays are avoided.+#+# The "traditional" practice of packing multiple parameters into a+# space-separated string is a well documented source of bugs and security+# problems, so this is (mostly) avoided, by progressively accumulating+# options in "$@", and eventually passing that to Java.+#+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;+# see the in-line comments for details.+#+# There are tweaks for specific operating systems such as AIX, CygWin,+# Darwin, MinGW, and NonStop.+#+# (3) This script is generated from the Groovy template+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt+# within the Gradle project.+#+# You can find Gradle at https://github.com/gradle/gradle/.+#+##############################################################################++# Attempt to set APP_HOME++# Resolve links: $0 may be a link+app_path=$0++# Need this for daisy-chained symlinks.+while+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path+ [ -h "$app_path" ]+do+ ls=$( ls -ld "$app_path" )+ link=${ls#*' -> '}+ case $link in #(+ /*) app_path=$link ;; #(+ *) app_path=$APP_HOME$link ;;+ esac+done++# This is normally unused+# shellcheck disable=SC2034+APP_BASE_NAME=${0##*/}+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s+' "$PWD" ) || exit++# Use the maximum available, or set MAX_FD != -1 to use that value.+MAX_FD=maximum++warn () {+ echo "$*"+} >&2++die () {+ echo+ echo "$*"+ echo+ exit 1+} >&2++# OS specific support (must be 'true' or 'false').+cygwin=false+msys=false+darwin=false+nonstop=false+case "$( uname )" in #(+ CYGWIN* ) cygwin=true ;; #(+ Darwin* ) darwin=true ;; #(+ MSYS* | MINGW* ) msys=true ;; #(+ NONSTOP* ) nonstop=true ;;+esac++CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar+++# Determine the Java command to use to start the JVM.+if [ -n "$JAVA_HOME" ] ; then+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then+ # IBM's JDK on AIX uses strange locations for the executables+ JAVACMD=$JAVA_HOME/jre/sh/java+ else+ JAVACMD=$JAVA_HOME/bin/java+ fi+ if [ ! -x "$JAVACMD" ] ; then+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME++Please set the JAVA_HOME variable in your environment to match the+location of your Java installation."+ fi+else+ JAVACMD=java+ if ! command -v java >/dev/null 2>&1+ then+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.++Please set the JAVA_HOME variable in your environment to match the+location of your Java installation."+ fi+fi++# Increase the maximum file descriptors if we can.+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then+ case $MAX_FD in #(+ max*)+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.+ # shellcheck disable=SC2039,SC3045+ MAX_FD=$( ulimit -H -n ) ||+ warn "Could not query maximum file descriptor limit"+ esac+ case $MAX_FD in #(+ '' | soft) :;; #(+ *)+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.+ # shellcheck disable=SC2039,SC3045+ ulimit -n "$MAX_FD" ||+ warn "Could not set maximum file descriptor limit to $MAX_FD"+ esac+fi++# Collect all arguments for the java command, stacking in reverse order:+# * args from the command line+# * the main class name+# * -classpath+# * -D...appname settings+# * --module-path (only if needed)+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.++# For Cygwin or MSYS, switch paths to Windows format before running java+if "$cygwin" || "$msys" ; then+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )++ JAVACMD=$( cygpath --unix "$JAVACMD" )++ # Now convert the arguments - kludge to limit ourselves to /bin/sh+ for arg do+ if+ case $arg in #(+ -*) false ;; # don't mess with options #(+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath+ [ -e "$t" ] ;; #(+ *) false ;;+ esac+ then+ arg=$( cygpath --path --ignore --mixed "$arg" )+ fi+ # Roll the args list around exactly as many times as the number of+ # args, so each arg winds up back in the position where it started, but+ # possibly modified.+ #+ # NB: a `for` loop captures its iteration list before it begins, so+ # changing the positional parameters here affects neither the number of+ # iterations, nor the values presented in `arg`.+ shift # remove old arg+ set -- "$@" "$arg" # push replacement arg+ done+fi+++# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'++# Collect all arguments for the java command:+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,+# and any embedded shellness will be escaped.+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be+# treated as '${Hostname}' itself on the command line.++set -- \+ "-Dorg.gradle.appname=$APP_BASE_NAME" \+ -classpath "$CLASSPATH" \+ org.gradle.wrapper.GradleWrapperMain \+ "$@"++# Stop when "xargs" is not available.+if ! command -v xargs >/dev/null 2>&1+then+ die "xargs is not available"+fi++# Use "xargs" to parse quoted args.+#+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.+#+# In Bash we could simply go:+#+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&+# set -- "${ARGS[@]}" "$@"+#+# but POSIX shell has neither arrays nor command substitution, so instead we+# post-process each arg (as a line of input to sed) to backslash-escape any+# character that might be a shell metacharacter, then use eval to reverse+# that process (while maintaining the separation between arguments), and wrap+# the whole thing up as a single "set" statement.+#+# This will of course break if any of these variables contains a newline or+# an unmatched quote.+#++eval "set -- $(+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |+ xargs -n1 |+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |+ tr '\n' ' '+ )" '"$@"'++exec "$JAVACMD" "$@"diff --git a/addons/digital-rain/gradlew.bat b/addons/digital-rain/gradlew.batnew file mode 100644index 000000000..9d21a2183--- /dev/null+++ b/addons/digital-rain/gradlew.bat@@ -0,0 +1,94 @@+@rem+@rem Copyright 2015 the original author or authors.+@rem+@rem Licensed under the Apache License, Version 2.0 (the "License");+@rem you may not use this file except in compliance with the License.+@rem You may obtain a copy of the License at+@rem+@rem https://www.apache.org/licenses/LICENSE-2.0+@rem+@rem Unless required by applicable law or agreed to in writing, software+@rem distributed under the License is distributed on an "AS IS" BASIS,+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+@rem See the License for the specific language governing permissions and+@rem limitations under the License.+@rem+@rem SPDX-License-Identifier: Apache-2.0+@rem++@if "%DEBUG%"=="" @echo off+@rem ##########################################################################+@rem+@rem Gradle startup script for Windows+@rem+@rem ##########################################################################++@rem Set local scope for the variables with windows NT shell+if "%OS%"=="Windows_NT" setlocal++set DIRNAME=%~dp0+if "%DIRNAME%"=="" set DIRNAME=.+@rem This is normally unused+set APP_BASE_NAME=%~n0+set APP_HOME=%DIRNAME%++@rem Resolve any "." and ".." in APP_HOME to make it shorter.+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi++@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"++@rem Find java.exe+if defined JAVA_HOME goto findJavaFromJavaHome++set JAVA_EXE=java.exe+%JAVA_EXE% -version >NUL 2>&1+if %ERRORLEVEL% equ 0 goto execute++echo. 1>&2+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2+echo. 1>&2+echo Please set the JAVA_HOME variable in your environment to match the 1>&2+echo location of your Java installation. 1>&2++goto fail++:findJavaFromJavaHome+set JAVA_HOME=%JAVA_HOME:"=%+set JAVA_EXE=%JAVA_HOME%/bin/java.exe++if exist "%JAVA_EXE%" goto execute++echo. 1>&2+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2+echo. 1>&2+echo Please set the JAVA_HOME variable in your environment to match the 1>&2+echo location of your Java installation. 1>&2++goto fail++:execute+@rem Setup the command line++set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar+++@rem Execute Gradle+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*++:end+@rem End local scope for the variables with windows NT shell+if %ERRORLEVEL% equ 0 goto mainEnd++:fail+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of+rem the _cmd.exe /c_ return code!+set EXIT_CODE=%ERRORLEVEL%+if %EXIT_CODE% equ 0 set EXIT_CODE=1+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%+exit /b %EXIT_CODE%++:mainEnd+if "%OS%"=="Windows_NT" endlocal++:omegadiff --git a/addons/digital-rain/screenshot.jpg b/addons/digital-rain/screenshot.jpgnew file mode 100644index 000000000..0c8a0093bBinary files /dev/null and b/addons/digital-rain/screenshot.jpg differdiff --git a/addons/digital-rain/settings.gradle b/addons/digital-rain/settings.gradlenew file mode 100644index 000000000..e6a34549a--- /dev/null+++ b/addons/digital-rain/settings.gradle@@ -0,0 +1,16 @@+pluginManagement {+ repositories {+ google()+ mavenCentral()+ gradlePluginPortal()+ }+}+dependencyResolutionManagement {+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)+ repositories {+ google()+ mavenCentral()+ }+}+rootProject.name = "digital-rain"+include ':app'