("pixel6Api34") {
44 | device = "Pixel 6"
45 | apiLevel = 34
46 | systemImageSource = "google"
47 | }
48 | }
49 | }
50 |
51 | // This is the configuration block for the Baseline Profile plugin.
52 | // You can specify to run the generators on a managed devices or connected devices.
53 | baselineProfile {
54 | managedDevices += "pixel6Api34"
55 | useConnectedDevices = false
56 | }
57 |
58 | dependencies {
59 | implementation(libs.androidx.junit)
60 | implementation(libs.androidx.espresso.core)
61 | implementation(libs.androidx.uiautomator)
62 | implementation(libs.androidx.benchmark.macro.junit4)
63 | }
64 |
--------------------------------------------------------------------------------
/baseline/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/baseline/src/main/java/com/cyb3rko/flashdim/baseline/BaselineProfileGenerator.kt:
--------------------------------------------------------------------------------
1 | package com.cyb3rko.flashdim.baseline
2 |
3 | import androidx.benchmark.macro.junit4.BaselineProfileRule
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 | import androidx.test.filters.LargeTest
6 | import org.junit.Rule
7 | import org.junit.Test
8 | import org.junit.runner.RunWith
9 |
10 | /**
11 | * This test class generates a basic startup baseline profile for the target package.
12 | *
13 | * We recommend you start with this but add important user flows to the profile to improve their performance.
14 | * Refer to the [baseline profile documentation](https://d.android.com/topic/performance/baselineprofiles)
15 | * for more information.
16 | *
17 | * You can run the generator with the "Generate Baseline Profile" run configuration in Android Studio or
18 | * the equivalent `generateBaselineProfile` gradle task:
19 | * ```
20 | * ./gradlew :app:generateReleaseBaselineProfile
21 | * ```
22 | * The run configuration runs the Gradle task and applies filtering to run only the generators.
23 | *
24 | * Check [documentation](https://d.android.com/topic/performance/benchmarking/macrobenchmark-instrumentation-args)
25 | * for more information about available instrumentation arguments.
26 | *
27 | * After you run the generator, you can verify the improvements running the [StartupBenchmarks] benchmark.
28 | *
29 | * When using this class to generate a baseline profile, only API 33+ or rooted API 28+ are supported.
30 | *
31 | * The minimum required version of androidx.benchmark to generate a baseline profile is 1.2.0.
32 | **/
33 | @RunWith(AndroidJUnit4::class)
34 | @LargeTest
35 | class BaselineProfileGenerator {
36 |
37 | @get:Rule
38 | val rule = BaselineProfileRule()
39 |
40 | @Test
41 | fun generate() {
42 | // The application id for the running build variant is read from the instrumentation arguments.
43 | rule.collect(
44 | packageName = "com.cyb3rko.flashdim",
45 |
46 | // See: https://d.android.com/topic/performance/baselineprofiles/dex-layout-optimizations
47 | includeInStartupProfile = true
48 | ) {
49 | // This block defines the app's critical user journey. Here we are interested in
50 | // optimizing for app startup. But you can also navigate and scroll through your most important UI.
51 |
52 | // Start default activity for your app
53 | pressHome()
54 | startActivityAndWait()
55 |
56 | // TODO Write more interactions to optimize advanced journeys of your app.
57 | // For example:
58 | // 1. Wait until the content is asynchronously loaded
59 | // 2. Scroll the feed content
60 | // 3. Navigate to detail screen
61 |
62 | // Check UiAutomator documentation for more information how to interact with the app.
63 | // https://d.android.com/training/testing/other-components/ui-automator
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/baseline/src/main/java/com/cyb3rko/flashdim/baseline/StartupBenchmarks.kt:
--------------------------------------------------------------------------------
1 | package com.cyb3rko.flashdim.baseline
2 |
3 | import androidx.benchmark.macro.BaselineProfileMode
4 | import androidx.benchmark.macro.CompilationMode
5 | import androidx.benchmark.macro.StartupMode
6 | import androidx.benchmark.macro.StartupTimingMetric
7 | import androidx.benchmark.macro.junit4.MacrobenchmarkRule
8 | import androidx.test.ext.junit.runners.AndroidJUnit4
9 | import androidx.test.filters.LargeTest
10 | import org.junit.Rule
11 | import org.junit.Test
12 | import org.junit.runner.RunWith
13 |
14 | /**
15 | * This test class benchmarks the speed of app startup.
16 | * Run this benchmark to verify how effective a Baseline Profile is.
17 | * It does this by comparing [CompilationMode.None], which represents the app with no Baseline
18 | * Profiles optimizations, and [CompilationMode.Partial], which uses Baseline Profiles.
19 | *
20 | * Run this benchmark to see startup measurements and captured system traces for verifying
21 | * the effectiveness of your Baseline Profiles. You can run it directly from Android
22 | * Studio as an instrumentation test, or run all benchmarks for a variant, for example benchmarkRelease,
23 | * with this Gradle task:
24 | * ```
25 | * ./gradlew :baseline:connectedBenchmarkReleaseAndroidTest
26 | * ```
27 | *
28 | * You should run the benchmarks on a physical device, not an Android emulator, because the
29 | * emulator doesn't represent real world performance and shares system resources with its host.
30 | *
31 | * For more information, see the [Macrobenchmark documentation](https://d.android.com/macrobenchmark#create-macrobenchmark)
32 | * and the [instrumentation arguments documentation](https://d.android.com/topic/performance/benchmarking/macrobenchmark-instrumentation-args).
33 | **/
34 | @RunWith(AndroidJUnit4::class)
35 | @LargeTest
36 | class StartupBenchmarks {
37 |
38 | @get:Rule
39 | val rule = MacrobenchmarkRule()
40 |
41 | @Test
42 | fun startupCompilationNone() =
43 | benchmark(CompilationMode.None())
44 |
45 | @Test
46 | fun startupCompilationBaselineProfiles() =
47 | benchmark(CompilationMode.Partial(BaselineProfileMode.Require))
48 |
49 | private fun benchmark(compilationMode: CompilationMode) {
50 | // The application id for the running build variant is read from the instrumentation arguments.
51 | rule.measureRepeated(
52 | packageName = "com.cyb3rko.flashdim",
53 | metrics = listOf(StartupTimingMetric()),
54 | compilationMode = compilationMode,
55 | startupMode = StartupMode.COLD,
56 | iterations = 10,
57 | setupBlock = {
58 | pressHome()
59 | },
60 | measureBlock = {
61 | startActivityAndWait()
62 |
63 | // TODO Add interactions to wait for when your app is fully drawn.
64 | // The app is fully drawn when Activity.reportFullyDrawn is called.
65 | // For Jetpack Compose, you can use ReportDrawn, ReportDrawnWhen and ReportDrawnAfter
66 | // from the AndroidX Activity library.
67 |
68 | // Check the UiAutomator documentation for more information on how to
69 | // interact with the app.
70 | // https://d.android.com/training/testing/other-components/ui-automator
71 | }
72 | )
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | alias(libs.plugins.androidApplication) apply false
3 | alias(libs.plugins.androidTest) apply false
4 | alias(libs.plugins.jetbrainsKotlinAndroid) apply false
5 | alias(libs.plugins.baselineprofile) apply false
6 | }
7 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. For more details, visit
12 | # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Kotlin code style for this project: "official" or "obsolete":
19 | kotlin.code.style=official
20 | # Enables namespacing of each library's R class so that its R class includes only the
21 | # resources declared in the library itself and none from the library's dependencies,
22 | # thereby reducing the size of the R class for that library
23 | android.nonTransitiveRClass=true
24 | android.nonFinalResIds=true
25 |
--------------------------------------------------------------------------------
/gradle/libs.versions.toml:
--------------------------------------------------------------------------------
1 | [versions]
2 | agp = "8.10.1"
3 | kotlin = "2.0.21"
4 | kotlinter = "5.0.1"
5 | dexcount = "4.0.0"
6 | bundletool = "0.2.4"
7 |
8 | appcompat = "1.7.0"
9 | constraintlayout = "2.2.1"
10 | coreKtx = "1.16.0"
11 | preferenceKtx = "1.2.1"
12 | material = "1.12.0"
13 | profileinstaller = "1.4.1"
14 |
15 | junit = "1.2.1"
16 | benchmarkMacroJunit4 = "1.3.4"
17 | espressoCore = "3.6.1"
18 | uiautomator = "2.3.0"
19 | baselineprofile = "1.3.4"
20 |
21 | [libraries]
22 | androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
23 | androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
24 | androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
25 | androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "preferenceKtx" }
26 | androidx-profileinstaller = { module = "androidx.profileinstaller:profileinstaller", version.ref = "profileinstaller" }
27 | material = { module = "com.google.android.material:material", version.ref = "material" }
28 |
29 | androidx-junit = { module = "androidx.test.ext:junit", version.ref = "junit" }
30 | androidx-benchmark-macro-junit4 = { module = "androidx.benchmark:benchmark-macro-junit4", version.ref = "benchmarkMacroJunit4" }
31 | androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
32 | androidx-uiautomator = { group = "androidx.test.uiautomator", name = "uiautomator", version.ref = "uiautomator" }
33 |
34 | [plugins]
35 | androidApplication = { id = "com.android.application", version.ref = "agp" }
36 | androidTest = { id = "com.android.test", version.ref = "agp" }
37 | jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
38 | kotlinter = { id = "org.jmailen.kotlinter", version.ref = "kotlinter" }
39 | dexcount = { id = "com.getkeepsafe.dexcount", version.ref = "dexcount" }
40 | bundletool = { id = "app.accrescent.tools.bundletool", version.ref = "bundletool" }
41 | baselineprofile = { id = "androidx.baselineprofile", version.ref = "baselineprofile" }
42 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyb3rko/flashdim/f07deae13c3aa2b4e628507271f1affb1e75b5c5/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionSha256Sum=7197a12f450794931532469d4ff21a59ea2c1cd59a3ec3f89c035c3c420a6999
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
5 | networkTimeout=10000
6 | validateDistributionUrl=true
7 | zipStoreBase=GRADLE_USER_HOME
8 | zipStorePath=wrapper/dists
9 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # Copyright © 2015-2021 the original authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | # SPDX-License-Identifier: Apache-2.0
19 | #
20 |
21 | ##############################################################################
22 | #
23 | # Gradle start up script for POSIX generated by Gradle.
24 | #
25 | # Important for running:
26 | #
27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
28 | # noncompliant, but you have some other compliant shell such as ksh or
29 | # bash, then to run this script, type that shell name before the whole
30 | # command line, like:
31 | #
32 | # ksh Gradle
33 | #
34 | # Busybox and similar reduced shells will NOT work, because this script
35 | # requires all of these POSIX shell features:
36 | # * functions;
37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
39 | # * compound commands having a testable exit status, especially «case»;
40 | # * various built-in commands including «command», «set», and «ulimit».
41 | #
42 | # Important for patching:
43 | #
44 | # (2) This script targets any POSIX shell, so it avoids extensions provided
45 | # by Bash, Ksh, etc; in particular arrays are avoided.
46 | #
47 | # The "traditional" practice of packing multiple parameters into a
48 | # space-separated string is a well documented source of bugs and security
49 | # problems, so this is (mostly) avoided, by progressively accumulating
50 | # options in "$@", and eventually passing that to Java.
51 | #
52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
54 | # see the in-line comments for details.
55 | #
56 | # There are tweaks for specific operating systems such as AIX, CygWin,
57 | # Darwin, MinGW, and NonStop.
58 | #
59 | # (3) This script is generated from the Groovy template
60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
61 | # within the Gradle project.
62 | #
63 | # You can find Gradle at https://github.com/gradle/gradle/.
64 | #
65 | ##############################################################################
66 |
67 | # Attempt to set APP_HOME
68 |
69 | # Resolve links: $0 may be a link
70 | app_path=$0
71 |
72 | # Need this for daisy-chained symlinks.
73 | while
74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
75 | [ -h "$app_path" ]
76 | do
77 | ls=$( ls -ld "$app_path" )
78 | link=${ls#*' -> '}
79 | case $link in #(
80 | /*) app_path=$link ;; #(
81 | *) app_path=$APP_HOME$link ;;
82 | esac
83 | done
84 |
85 | # This is normally unused
86 | # shellcheck disable=SC2034
87 | APP_BASE_NAME=${0##*/}
88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
90 |
91 | # Use the maximum available, or set MAX_FD != -1 to use that value.
92 | MAX_FD=maximum
93 |
94 | warn () {
95 | echo "$*"
96 | } >&2
97 |
98 | die () {
99 | echo
100 | echo "$*"
101 | echo
102 | exit 1
103 | } >&2
104 |
105 | # OS specific support (must be 'true' or 'false').
106 | cygwin=false
107 | msys=false
108 | darwin=false
109 | nonstop=false
110 | case "$( uname )" in #(
111 | CYGWIN* ) cygwin=true ;; #(
112 | Darwin* ) darwin=true ;; #(
113 | MSYS* | MINGW* ) msys=true ;; #(
114 | NONSTOP* ) nonstop=true ;;
115 | esac
116 |
117 | CLASSPATH="\\\"\\\""
118 |
119 |
120 | # Determine the Java command to use to start the JVM.
121 | if [ -n "$JAVA_HOME" ] ; then
122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
123 | # IBM's JDK on AIX uses strange locations for the executables
124 | JAVACMD=$JAVA_HOME/jre/sh/java
125 | else
126 | JAVACMD=$JAVA_HOME/bin/java
127 | fi
128 | if [ ! -x "$JAVACMD" ] ; then
129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
130 |
131 | Please set the JAVA_HOME variable in your environment to match the
132 | location of your Java installation."
133 | fi
134 | else
135 | JAVACMD=java
136 | if ! command -v java >/dev/null 2>&1
137 | then
138 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
139 |
140 | Please set the JAVA_HOME variable in your environment to match the
141 | location of your Java installation."
142 | fi
143 | fi
144 |
145 | # Increase the maximum file descriptors if we can.
146 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
147 | case $MAX_FD in #(
148 | max*)
149 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
150 | # shellcheck disable=SC2039,SC3045
151 | MAX_FD=$( ulimit -H -n ) ||
152 | warn "Could not query maximum file descriptor limit"
153 | esac
154 | case $MAX_FD in #(
155 | '' | soft) :;; #(
156 | *)
157 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
158 | # shellcheck disable=SC2039,SC3045
159 | ulimit -n "$MAX_FD" ||
160 | warn "Could not set maximum file descriptor limit to $MAX_FD"
161 | esac
162 | fi
163 |
164 | # Collect all arguments for the java command, stacking in reverse order:
165 | # * args from the command line
166 | # * the main class name
167 | # * -classpath
168 | # * -D...appname settings
169 | # * --module-path (only if needed)
170 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
171 |
172 | # For Cygwin or MSYS, switch paths to Windows format before running java
173 | if "$cygwin" || "$msys" ; then
174 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
175 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
176 |
177 | JAVACMD=$( cygpath --unix "$JAVACMD" )
178 |
179 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
180 | for arg do
181 | if
182 | case $arg in #(
183 | -*) false ;; # don't mess with options #(
184 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
185 | [ -e "$t" ] ;; #(
186 | *) false ;;
187 | esac
188 | then
189 | arg=$( cygpath --path --ignore --mixed "$arg" )
190 | fi
191 | # Roll the args list around exactly as many times as the number of
192 | # args, so each arg winds up back in the position where it started, but
193 | # possibly modified.
194 | #
195 | # NB: a `for` loop captures its iteration list before it begins, so
196 | # changing the positional parameters here affects neither the number of
197 | # iterations, nor the values presented in `arg`.
198 | shift # remove old arg
199 | set -- "$@" "$arg" # push replacement arg
200 | done
201 | fi
202 |
203 |
204 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
205 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206 |
207 | # Collect all arguments for the java command:
208 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209 | # and any embedded shellness will be escaped.
210 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211 | # treated as '${Hostname}' itself on the command line.
212 |
213 | set -- \
214 | "-Dorg.gradle.appname=$APP_BASE_NAME" \
215 | -classpath "$CLASSPATH" \
216 | -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217 | "$@"
218 |
219 | # Stop when "xargs" is not available.
220 | if ! command -v xargs >/dev/null 2>&1
221 | then
222 | die "xargs is not available"
223 | fi
224 |
225 | # Use "xargs" to parse quoted args.
226 | #
227 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
228 | #
229 | # In Bash we could simply go:
230 | #
231 | # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
232 | # set -- "${ARGS[@]}" "$@"
233 | #
234 | # but POSIX shell has neither arrays nor command substitution, so instead we
235 | # post-process each arg (as a line of input to sed) to backslash-escape any
236 | # character that might be a shell metacharacter, then use eval to reverse
237 | # that process (while maintaining the separation between arguments), and wrap
238 | # the whole thing up as a single "set" statement.
239 | #
240 | # This will of course break if any of these variables contains a newline or
241 | # an unmatched quote.
242 | #
243 |
244 | eval "set -- $(
245 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
246 | xargs -n1 |
247 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
248 | tr '\n' ' '
249 | )" '"$@"'
250 |
251 | exec "$JAVACMD" "$@"
252 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 | @rem SPDX-License-Identifier: Apache-2.0
17 | @rem
18 |
19 | @if "%DEBUG%"=="" @echo off
20 | @rem ##########################################################################
21 | @rem
22 | @rem Gradle startup script for Windows
23 | @rem
24 | @rem ##########################################################################
25 |
26 | @rem Set local scope for the variables with windows NT shell
27 | if "%OS%"=="Windows_NT" setlocal
28 |
29 | set DIRNAME=%~dp0
30 | if "%DIRNAME%"=="" set DIRNAME=.
31 | @rem This is normally unused
32 | set APP_BASE_NAME=%~n0
33 | set APP_HOME=%DIRNAME%
34 |
35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
37 |
38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
40 |
41 | @rem Find java.exe
42 | if defined JAVA_HOME goto findJavaFromJavaHome
43 |
44 | set JAVA_EXE=java.exe
45 | %JAVA_EXE% -version >NUL 2>&1
46 | if %ERRORLEVEL% equ 0 goto execute
47 |
48 | echo. 1>&2
49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50 | echo. 1>&2
51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52 | echo location of your Java installation. 1>&2
53 |
54 | goto fail
55 |
56 | :findJavaFromJavaHome
57 | set JAVA_HOME=%JAVA_HOME:"=%
58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
59 |
60 | if exist "%JAVA_EXE%" goto execute
61 |
62 | echo. 1>&2
63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64 | echo. 1>&2
65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66 | echo location of your Java installation. 1>&2
67 |
68 | goto fail
69 |
70 | :execute
71 | @rem Setup the command line
72 |
73 | set CLASSPATH=
74 |
75 |
76 | @rem Execute Gradle
77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
78 |
79 | :end
80 | @rem End local scope for the variables with windows NT shell
81 | if %ERRORLEVEL% equ 0 goto mainEnd
82 |
83 | :fail
84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
85 | rem the _cmd.exe /c_ return code!
86 | set EXIT_CODE=%ERRORLEVEL%
87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
89 | exit /b %EXIT_CODE%
90 |
91 | :mainEnd
92 | if "%OS%"=="Windows_NT" endlocal
93 |
94 | :omega
95 |
--------------------------------------------------------------------------------
/included_devices.csv:
--------------------------------------------------------------------------------
1 | gplay-name,gplay-technical-name,branding,device
2 | OnePlus 11 5G,OnePlus OP594DL1,OnePlus,OP594DL1
3 | OnePlus 12,OnePlus OP595DL1,OnePlus,OP595DL1
4 | OnePlus 12R,OnePlus OP5D35L1,OnePlus,OP5D35L1
5 | Redmi Note 13 Pro+ 5G,Redmi zircon,Redmi,zircon
6 | Redmi POCO F5,POCO marblein,POCO,marblein
7 | Samsung Galaxy A71,samsung a71,Samsung,a71
8 | Vivo T2 Pro 5G,vivo V2321,Vivo,V2321
9 | Vivo V27,vivo V2231,Vivo,V2231
10 | Xiaomi 13,Xiaomi fuxi,Xiaomi,fuxi
11 |
--------------------------------------------------------------------------------
/legal/privacy_policy.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Privacy Policy
4 |
5 | Cyb3rKo built the Pazzword app as an Open Source app. This SERVICE is provided by Cyb3rKo at no cost and is intended for use as is.
6 |
7 | This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to
8 | use my Service.
9 |
10 | If you choose to use my Service, then you agree to this policy.
11 |
12 | Information Collection and Use
13 |
14 | The app does not use third party services that could collect information used to identify you.
15 |
16 | Cookies
17 |
18 | Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the
19 | websites that you visit and are stored on your device's internal memory.
20 | This Service does not use these “cookies” explicitly. However, Google may use “cookies” to collect information and improve their services.
21 |
22 | Links to Websites
23 |
24 | This Service may contain links to websites. Note that these external sites are not operated by me.
25 |
26 | Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and
27 | assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.
28 |
29 | Changes to this Privacy Policy
30 |
31 | I may update this Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes.
32 | I will notify you of any changes by posting a comment on the 'Recent changes' section on the Google Play Store or the release page on the GitHub repository
33 | (click here).
34 | These changes are effective immediately after they are posted on this page.
35 | This Policy is effective as of 2022-10-21.
36 |
37 | Contact
38 |
39 | If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at
40 | niko@cyb3rko.de.
41 |
42 | This Privacy Policy page was created at
43 | privacypolicytemplate.net
44 | and modified/generated by
45 | App Privacy Policy Generator
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyb3rko/flashdim/f07deae13c3aa2b4e628507271f1affb1e75b5c5/logo.png
--------------------------------------------------------------------------------
/metadata/en-US/full_description.txt:
--------------------------------------------------------------------------------
1 | About
2 | Starting with Android 13, it's possible to control multiple brightness levels of the flashlight.
3 | To be able to use this new feature I've developed this app.
4 |
5 | The full functionality of this app is ONLY AVAILABLE for devices which support the dim functionality of the flashlight (hardware limited).
6 | See Supported devices on GitHub
7 |
8 | If you think it's worth to support this project, feel free to give a small donation ♥️ (Donate).
9 |
10 | Join the FlashDim Matrix room to talk with the community about the app or to ask me (the dev) anything:
11 | https://matrix.to/#/#flashdim:matrix.org
12 |
13 | Features
14 | - 🔦 dimming your flashlight level by level
- 🎚 shortcut buttons for different brightness levels
- 🆘 SOS flash button
- 📫 morse code flash mode
- ⏲️ Interval / BPM mode
- ⚡ quick settings tile for fast access
- 🔊 press both volume buttons for easy flashlight toggle
- 🔒 private, no ads, no internet connection
- 💯 modern Material You (M3) design elements
- 🎨 app colors adapt to device's system colors
15 |
16 | Used Icons
17 |
18 |
--------------------------------------------------------------------------------
/metadata/en-US/images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyb3rko/flashdim/f07deae13c3aa2b4e628507271f1affb1e75b5c5/metadata/en-US/images/icon.png
--------------------------------------------------------------------------------
/metadata/en-US/images/phoneScreenshots/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyb3rko/flashdim/f07deae13c3aa2b4e628507271f1affb1e75b5c5/metadata/en-US/images/phoneScreenshots/1.png
--------------------------------------------------------------------------------
/metadata/en-US/images/phoneScreenshots/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyb3rko/flashdim/f07deae13c3aa2b4e628507271f1affb1e75b5c5/metadata/en-US/images/phoneScreenshots/2.png
--------------------------------------------------------------------------------
/metadata/en-US/images/phoneScreenshots/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyb3rko/flashdim/f07deae13c3aa2b4e628507271f1affb1e75b5c5/metadata/en-US/images/phoneScreenshots/3.png
--------------------------------------------------------------------------------
/metadata/en-US/images/phoneScreenshots/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyb3rko/flashdim/f07deae13c3aa2b4e628507271f1affb1e75b5c5/metadata/en-US/images/phoneScreenshots/4.png
--------------------------------------------------------------------------------
/metadata/en-US/images/phoneScreenshots/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyb3rko/flashdim/f07deae13c3aa2b4e628507271f1affb1e75b5c5/metadata/en-US/images/phoneScreenshots/5.png
--------------------------------------------------------------------------------
/metadata/en-US/images/phoneScreenshots/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyb3rko/flashdim/f07deae13c3aa2b4e628507271f1affb1e75b5c5/metadata/en-US/images/phoneScreenshots/6.png
--------------------------------------------------------------------------------
/metadata/en-US/short_description.txt:
--------------------------------------------------------------------------------
1 | Modern flashlight app with dim functionality on Android 13+
2 |
--------------------------------------------------------------------------------
/metadata/en-US/title.txt:
--------------------------------------------------------------------------------
1 | FlashDim - Dim your flashlight
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | @file:Suppress("UnstableApiUsage")
2 |
3 | pluginManagement {
4 | repositories {
5 | gradlePluginPortal()
6 | google()
7 | }
8 | }
9 | dependencyResolutionManagement {
10 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
11 | repositories {
12 | google()
13 | mavenCentral()
14 | }
15 | }
16 | rootProject.name = "FlashDim"
17 | include(":app")
18 | include(":baseline")
19 |
--------------------------------------------------------------------------------