() {{
68 | put("product", Build.PRODUCT);
69 | put("model", Build.MODEL);
70 | put("fingerprint", Build.FINGERPRINT);
71 | put("os", System.getProperty("os.version"));
72 | }});
73 | }
74 |
75 | button.setBackgroundColor(vulnerable ? Color.GREEN : Color.RED);
76 |
77 | if (vulnerable) {
78 | new AlertDialog.Builder(this)
79 | .setTitle(android.R.string.dialog_alert_title)
80 | .setMessage(R.string.vulnerable_tips)
81 | .setPositiveButton(android.R.string.ok, (dialog, which) -> dialog.dismiss())
82 | .show();
83 | }
84 | });
85 | }
86 |
87 | @Override
88 | public boolean onCreateOptionsMenu(Menu menu) {
89 | getMenuInflater().inflate(R.menu.main_menu, menu);
90 |
91 | MenuItem item = menu.findItem(R.id.memu_getroot);
92 | item.setOnMenuItemClickListener(item1 -> {
93 |
94 | new AlertDialog.Builder(this)
95 | .setTitle(android.R.string.dialog_alert_title)
96 | .setMessage(R.string.get_root_confirm)
97 | .setPositiveButton(R.string.i_know_it,
98 | (dialog, which) -> {
99 | Check.getRoot(MainActivity.this, getWindow());
100 |
101 | new AlertDialog.Builder(this)
102 | .setTitle(android.R.string.dialog_alert_title)
103 | .setMessage(R.string.get_root_tips)
104 | .setPositiveButton(android.R.string.ok, (dialog1, which1) -> {
105 | new AlertDialog.Builder(this).setTitle(android.R.string.dialog_alert_title)
106 | .setMessage(R.string.get_root_tips2)
107 | .setCancelable(false)
108 | .setPositiveButton(android.R.string.ok, (dialog2, which2) -> {
109 | dialog2.dismiss();
110 | dialog1.dismiss();
111 | dialog.dismiss();
112 | }).show();
113 | })
114 | .setCancelable(false)
115 | .show();
116 |
117 | })
118 | .setNegativeButton(android.R.string.cancel, null)
119 | .show();
120 | return true;
121 | });
122 |
123 | MenuItem about = menu.findItem(R.id.menu_about);
124 | about.setOnMenuItemClickListener(item1 -> {
125 |
126 | new AlertDialog.Builder(this)
127 | .setTitle(R.string.about)
128 | .setMessage(R.string.author)
129 | .show();
130 | return true;
131 | });
132 |
133 | return super.onCreateOptionsMenu(menu);
134 | }
135 | }
--------------------------------------------------------------------------------
/app/src/main/java/me/weishu/dirtypipecheck/ShellUtils.java:
--------------------------------------------------------------------------------
1 | package me.weishu.dirtypipecheck;
2 |
3 | import java.io.BufferedReader;
4 | import java.io.DataOutputStream;
5 | import java.io.IOException;
6 | import java.io.InputStreamReader;
7 | import java.util.List;
8 |
9 | /**
10 | *
11 | * author: Blankj
12 | * blog : http://blankj.com
13 | * time : 2016/08/07
14 | * desc : utils about shell
15 | *
16 | */
17 | public final class ShellUtils {
18 |
19 | private static final String LINE_SEP = System.getProperty("line.separator");
20 |
21 | private ShellUtils() {
22 | throw new UnsupportedOperationException("u can't instantiate me...");
23 | }
24 |
25 | /**
26 | * Execute the command.
27 | *
28 | * @param command The command.
29 | * @param isRooted True to use root, false otherwise.
30 | * @return the single {@link CommandResult} instance
31 | */
32 | public static CommandResult execCmd(final String command, final boolean isRooted) {
33 | return execCmd(new String[]{command}, isRooted, true);
34 | }
35 |
36 | /**
37 | * Execute the command.
38 | *
39 | * @param command The command.
40 | * @param envp The environment variable settings.
41 | * @param isRooted True to use root, false otherwise.
42 | * @return the single {@link CommandResult} instance
43 | */
44 | public static CommandResult execCmd(final String command, final List envp, final boolean isRooted) {
45 | return execCmd(new String[]{command},
46 | envp == null ? null : envp.toArray(new String[]{}),
47 | isRooted,
48 | true);
49 | }
50 |
51 | /**
52 | * Execute the command.
53 | *
54 | * @param commands The commands.
55 | * @param isRooted True to use root, false otherwise.
56 | * @return the single {@link CommandResult} instance
57 | */
58 | public static CommandResult execCmd(final List commands, final boolean isRooted) {
59 | return execCmd(commands == null ? null : commands.toArray(new String[]{}), isRooted, true);
60 | }
61 |
62 | /**
63 | * Execute the command.
64 | *
65 | * @param commands The commands.
66 | * @param envp The environment variable settings.
67 | * @param isRooted True to use root, false otherwise.
68 | * @return the single {@link CommandResult} instance
69 | */
70 | public static CommandResult execCmd(final List commands,
71 | final List envp,
72 | final boolean isRooted) {
73 | return execCmd(commands == null ? null : commands.toArray(new String[]{}),
74 | envp == null ? null : envp.toArray(new String[]{}),
75 | isRooted,
76 | true);
77 | }
78 |
79 | /**
80 | * Execute the command.
81 | *
82 | * @param commands The commands.
83 | * @param isRooted True to use root, false otherwise.
84 | * @return the single {@link CommandResult} instance
85 | */
86 | public static CommandResult execCmd(final String[] commands, final boolean isRooted) {
87 | return execCmd(commands, isRooted, true);
88 | }
89 |
90 | /**
91 | * Execute the command.
92 | *
93 | * @param command The command.
94 | * @param isRooted True to use root, false otherwise.
95 | * @param isNeedResultMsg True to return the message of result, false otherwise.
96 | * @return the single {@link CommandResult} instance
97 | */
98 | public static CommandResult execCmd(final String command,
99 | final boolean isRooted,
100 | final boolean isNeedResultMsg) {
101 | return execCmd(new String[]{command}, isRooted, isNeedResultMsg);
102 | }
103 |
104 | /**
105 | * Execute the command.
106 | *
107 | * @param command The command.
108 | * @param envp The environment variable settings.
109 | * @param isRooted True to use root, false otherwise.
110 | * @param isNeedResultMsg True to return the message of result, false otherwise.
111 | * @return the single {@link CommandResult} instance
112 | */
113 | public static CommandResult execCmd(final String command,
114 | final List envp,
115 | final boolean isRooted,
116 | final boolean isNeedResultMsg) {
117 | return execCmd(new String[]{command}, envp == null ? null : envp.toArray(new String[]{}),
118 | isRooted,
119 | isNeedResultMsg);
120 | }
121 |
122 | /**
123 | * Execute the command.
124 | *
125 | * @param command The command.
126 | * @param envp The environment variable settings array.
127 | * @param isRooted True to use root, false otherwise.
128 | * @param isNeedResultMsg True to return the message of result, false otherwise.
129 | * @return the single {@link CommandResult} instance
130 | */
131 | public static CommandResult execCmd(final String command,
132 | final String[] envp,
133 | final boolean isRooted,
134 | final boolean isNeedResultMsg) {
135 | return execCmd(new String[]{command}, envp, isRooted, isNeedResultMsg);
136 | }
137 |
138 | /**
139 | * Execute the command.
140 | *
141 | * @param commands The commands.
142 | * @param isRooted True to use root, false otherwise.
143 | * @param isNeedResultMsg True to return the message of result, false otherwise.
144 | * @return the single {@link CommandResult} instance
145 | */
146 | public static CommandResult execCmd(final List commands,
147 | final boolean isRooted,
148 | final boolean isNeedResultMsg) {
149 | return execCmd(commands == null ? null : commands.toArray(new String[]{}),
150 | isRooted,
151 | isNeedResultMsg);
152 | }
153 |
154 | /**
155 | * Execute the command.
156 | *
157 | * @param commands The commands.
158 | * @param isRooted True to use root, false otherwise.
159 | * @param isNeedResultMsg True to return the message of result, false otherwise.
160 | * @return the single {@link CommandResult} instance
161 | */
162 | public static CommandResult execCmd(final String[] commands,
163 | final boolean isRooted,
164 | final boolean isNeedResultMsg) {
165 | return execCmd(commands, null, isRooted, isNeedResultMsg);
166 | }
167 |
168 | /**
169 | * Execute the command.
170 | *
171 | * @param commands The commands.
172 | * @param envp Array of strings, each element of which
173 | * has environment variable settings in the format
174 | * name=value, or
175 | * null if the subprocess should inherit
176 | * the environment of the current process.
177 | * @param isRooted True to use root, false otherwise.
178 | * @param isNeedResultMsg True to return the message of result, false otherwise.
179 | * @return the single {@link CommandResult} instance
180 | */
181 | public static CommandResult execCmd(final String[] commands,
182 | final String[] envp,
183 | final boolean isRooted,
184 | final boolean isNeedResultMsg) {
185 | int result = -1;
186 | if (commands == null || commands.length == 0) {
187 | return new CommandResult(result, "", "");
188 | }
189 | Process process = null;
190 | BufferedReader successResult = null;
191 | BufferedReader errorResult = null;
192 | StringBuilder successMsg = null;
193 | StringBuilder errorMsg = null;
194 | DataOutputStream os = null;
195 | try {
196 | process = Runtime.getRuntime().exec(isRooted ? "su" : "sh", envp, null);
197 | os = new DataOutputStream(process.getOutputStream());
198 | for (String command : commands) {
199 | if (command == null) continue;
200 | os.write(command.getBytes());
201 | os.writeBytes(LINE_SEP);
202 | os.flush();
203 | }
204 | os.writeBytes("exit" + LINE_SEP);
205 | os.flush();
206 | result = process.waitFor();
207 | if (isNeedResultMsg) {
208 | successMsg = new StringBuilder();
209 | errorMsg = new StringBuilder();
210 | successResult = new BufferedReader(
211 | new InputStreamReader(process.getInputStream(), "UTF-8")
212 | );
213 | errorResult = new BufferedReader(
214 | new InputStreamReader(process.getErrorStream(), "UTF-8")
215 | );
216 | String line;
217 | if ((line = successResult.readLine()) != null) {
218 | successMsg.append(line);
219 | while ((line = successResult.readLine()) != null) {
220 | successMsg.append(LINE_SEP).append(line);
221 | }
222 | }
223 | if ((line = errorResult.readLine()) != null) {
224 | errorMsg.append(line);
225 | while ((line = errorResult.readLine()) != null) {
226 | errorMsg.append(LINE_SEP).append(line);
227 | }
228 | }
229 | }
230 | } catch (Exception e) {
231 | e.printStackTrace();
232 | } finally {
233 | try {
234 | if (os != null) {
235 | os.close();
236 | }
237 | } catch (IOException e) {
238 | e.printStackTrace();
239 | }
240 | try {
241 | if (successResult != null) {
242 | successResult.close();
243 | }
244 | } catch (IOException e) {
245 | e.printStackTrace();
246 | }
247 | try {
248 | if (errorResult != null) {
249 | errorResult.close();
250 | }
251 | } catch (IOException e) {
252 | e.printStackTrace();
253 | }
254 | if (process != null) {
255 | process.destroy();
256 | }
257 | }
258 | return new CommandResult(
259 | result,
260 | successMsg == null ? "" : successMsg.toString(),
261 | errorMsg == null ? "" : errorMsg.toString()
262 | );
263 | }
264 |
265 | /**
266 | * The result of command.
267 | */
268 | public static class CommandResult {
269 | public int result;
270 | public String successMsg;
271 | public String errorMsg;
272 |
273 | public CommandResult(final int result, final String successMsg, final String errorMsg) {
274 | this.result = result;
275 | this.successMsg = successMsg;
276 | this.errorMsg = errorMsg;
277 | }
278 |
279 | @Override
280 | public String toString() {
281 | return "result: " + result + "\n" +
282 | "successMsg: " + successMsg + "\n" +
283 | "errorMsg: " + errorMsg;
284 | }
285 | }
286 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiann/DirtyPipeRoot/c635bd4746d54a2e7f65e578a5141df77068bba3/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiann/DirtyPipeRoot/c635bd4746d54a2e7f65e578a5141df77068bba3/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiann/DirtyPipeRoot/c635bd4746d54a2e7f65e578a5141df77068bba3/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiann/DirtyPipeRoot/c635bd4746d54a2e7f65e578a5141df77068bba3/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiann/DirtyPipeRoot/c635bd4746d54a2e7f65e578a5141df77068bba3/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiann/DirtyPipeRoot/c635bd4746d54a2e7f65e578a5141df77068bba3/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiann/DirtyPipeRoot/c635bd4746d54a2e7f65e578a5141df77068bba3/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiann/DirtyPipeRoot/c635bd4746d54a2e7f65e578a5141df77068bba3/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiann/DirtyPipeRoot/c635bd4746d54a2e7f65e578a5141df77068bba3/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiann/DirtyPipeRoot/c635bd4746d54a2e7f65e578a5141df77068bba3/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/app/src/main/res/values-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 48dp
3 |
--------------------------------------------------------------------------------
/app/src/main/res/values-zh-rCN/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | DirtyPipeRoot
4 | 说明:绿色代表设备可以用 DirtyPipe(https://github.com/polygraphene/DirtyPipe-Android) 获取临时 Root,红色则意味着不行。
5 | 获取 ROOT
6 | 接下来的操作可能会让的手机变砖,也有可能导致你手机内部的数据完全丢失,确认要继续 ROOT 吗?
7 | 确认
8 | 关于
9 | 你的设备可通过 DirtyPipe 获取 ROOT 权限,点击右上角菜单继续。
10 | 请等待大约 30 秒,Magisk 将自动安装完成;警告:\n1. 不要在 Magisk 内部执行任何安装操作,如果你的手机没有解锁,手机必定变砖,只能找售后解决。\n2. Magisk 如果提示你需要重启,请忽略它。\n3. Magisk 内只有 ROOT 可以使用,模块和 Zygisk 无法使用。
11 | 请再次确认:不要在 Magisk 内部执行安装操作,如果你的手机没解锁,必定会变砖!!!!
12 | 开始检测
13 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | DirtyPipeRoot
3 |
4 | Author: weishu \nContact me: https://github.com/tiann/DirtyPipeCheck
5 | Description: Green means this device is vulnerable using DirtyPipe(https://github.com/polygraphene/DirtyPipe-Android), red is invulnerable
6 | Get Root
7 | This may brick your device and cuase your data loss, continue?
8 | Confirm it
9 | About
10 | Your device can gain root by DirtyPipe, Click Settings to continue.
11 | Please wait about 30s, and the Magisk would be installed. Warning:\n 1. Don\'t use install button on magisk app. It will brick your phone.\n 2. Don\'t reboot even if Magisk app request. It will lose temporary root.\n 3. Only support root access. No magisk/zygisk modules support.
12 | Please confirm again that you should not INSTALL Magisk in Magisk App!!!! YOUR DEVICE WOULD BE BRICK !!!
13 | Check
14 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/backup_rules.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/data_extraction_rules.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/app/src/test/java/me/weishu/dirtypipecheck/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package me.weishu.dirtypipecheck;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | plugins {
3 | id 'com.android.application' version '7.3.0' apply false
4 | id 'com.android.library' version '7.3.0' apply false
5 | }
--------------------------------------------------------------------------------
/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=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec: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 | # Enables namespacing of each library's R class so that its R class includes only the
19 | # resources declared in the library itself and none from the library's dependencies,
20 | # thereby reducing the size of the R class for that library
21 | android.nonTransitiveRClass=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tiann/DirtyPipeRoot/c635bd4746d54a2e7f65e578a5141df77068bba3/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Nov 26 22:37:48 CST 2022
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or 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 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/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 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | gradlePluginPortal()
4 | google()
5 | mavenCentral()
6 | }
7 | }
8 | dependencyResolutionManagement {
9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10 | repositories {
11 | google()
12 | mavenCentral()
13 | }
14 | }
15 | rootProject.name = "DirtyPipeCheck"
16 | include ':app'
17 |
--------------------------------------------------------------------------------