execResult = executeCommand(strCmd);
158 | if (execResult != null) {
159 | Log.i(LOG_TAG, "execResult=" + execResult.toString());
160 | return true;
161 | } else {
162 | Log.i(LOG_TAG, "execResult=null");
163 | return false;
164 | }
165 | } catch (Exception e) {
166 | Log.i(LOG_TAG, "Unexpected error - Here is what I know: "
167 | + e.getMessage());
168 | return false;
169 | }
170 | }
171 |
172 | public static synchronized boolean checkAccessRootData() {
173 | try {
174 | Log.i(LOG_TAG, "to write /data");
175 | String fileContent = "test_ok";
176 | Boolean writeFlag = writeFile("/data/su_test", fileContent);
177 | if (writeFlag) {
178 | Log.i(LOG_TAG, "write ok");
179 | } else {
180 | Log.i(LOG_TAG, "write failed");
181 | }
182 |
183 | Log.i(LOG_TAG, "to read /data");
184 | String strRead = readFile("/data/su_test");
185 | Log.i(LOG_TAG, "strRead=" + strRead);
186 | if (fileContent.equals(strRead)) {
187 | return true;
188 | } else {
189 | return false;
190 | }
191 | } catch (Exception e) {
192 | Log.i(LOG_TAG, "Unexpected error - Here is what I know: "
193 | + e.getMessage());
194 | return false;
195 | }
196 | }
197 |
198 | //写文件
199 | public static Boolean writeFile(String fileName, String message) {
200 | try {
201 | FileOutputStream fout = new FileOutputStream(fileName);
202 | byte[] bytes = message.getBytes();
203 | fout.write(bytes);
204 | fout.close();
205 | return true;
206 | } catch (Exception e) {
207 | e.printStackTrace();
208 | return false;
209 | }
210 | }
211 |
212 | //读文件
213 | public static String readFile(String fileName) {
214 | File file = new File(fileName);
215 | try {
216 | FileInputStream fis = new FileInputStream(file);
217 | byte[] bytes = new byte[1024];
218 | ByteArrayOutputStream bos = new ByteArrayOutputStream();
219 | int len;
220 | while ((len = fis.read(bytes)) > 0) {
221 | bos.write(bytes, 0, len);
222 | }
223 | String result = new String(bos.toByteArray());
224 | Log.i(LOG_TAG, result);
225 | return result;
226 | } catch (Exception e) {
227 | e.printStackTrace();
228 | return null;
229 | }
230 | }
231 | }
232 |
--------------------------------------------------------------------------------
/app/src/main/java/com/greens1995/myapplication/CheckVirtual.java:
--------------------------------------------------------------------------------
1 | package com.greens1995.myapplication;
2 |
3 | import java.io.BufferedInputStream;
4 | import java.io.BufferedOutputStream;
5 | import java.io.File;
6 | import java.io.IOException;
7 | import java.util.Locale;
8 |
9 | /**
10 | * Created by zaratustra on 2017/9/14.
11 | *原repo地址:https://github.com/ZaratustraN/Check_VirtualAPK
12 | */
13 | public class CheckVirtual {
14 |
15 | private static final String TAG = "CheckVirtual";
16 |
17 | public static boolean isRunInVirtual() {
18 |
19 | String filter = getUidStrFormat();
20 | if (filter == null || filter.length() == 0){
21 | return false;
22 | }
23 |
24 | String result = exec("ps");
25 | if (result == null || result.isEmpty()) {
26 | return false;
27 | }
28 |
29 | String[] lines = result.split("\n");
30 | if (lines == null || lines.length <= 0) {
31 | return false;
32 | }
33 |
34 | int exitDirCount = 0;
35 |
36 | for (int i = 0; i < lines.length; i++) {
37 | if (lines[i].contains(filter)) {
38 | int pkgStartIndex = lines[i].lastIndexOf(" ");
39 | String processName = lines[i].substring(pkgStartIndex <= 0
40 | ? 0 : pkgStartIndex + 1, lines[i].length());
41 | File dataFile = new File(String.format("/data/data/%s",
42 | processName, Locale.CHINA));
43 | if (dataFile.exists()) {
44 | exitDirCount++;
45 | }
46 | }
47 | }
48 |
49 | return exitDirCount > 1;
50 | }
51 |
52 |
53 | private static String exec(String command) {
54 | BufferedOutputStream bufferedOutputStream = null;
55 | BufferedInputStream bufferedInputStream = null;
56 | Process process = null;
57 | try {
58 | process = Runtime.getRuntime().exec("sh");
59 | bufferedOutputStream = new BufferedOutputStream(process.getOutputStream());
60 |
61 | bufferedInputStream = new BufferedInputStream(process.getInputStream());
62 | bufferedOutputStream.write(command.getBytes());
63 | bufferedOutputStream.write('\n');
64 | bufferedOutputStream.flush();
65 | bufferedOutputStream.close();
66 |
67 | process.waitFor();
68 |
69 | String outputStr = getStrFromBufferInputSteam(bufferedInputStream);
70 | return outputStr;
71 | } catch (Exception e) {
72 | return null;
73 | } finally {
74 | if (bufferedOutputStream != null) {
75 | try {
76 | bufferedOutputStream.close();
77 | } catch (IOException e) {
78 | e.printStackTrace();
79 | }
80 | }
81 | if (bufferedInputStream != null) {
82 | try {
83 | bufferedInputStream.close();
84 | } catch (IOException e) {
85 | e.printStackTrace();
86 | }
87 | }
88 | if (process != null) {
89 | process.destroy();
90 | }
91 | }
92 | }
93 |
94 | private static String getStrFromBufferInputSteam(BufferedInputStream bufferedInputStream) {
95 | if (null == bufferedInputStream) {
96 | return "";
97 | }
98 | int BUFFER_SIZE = 512;
99 | byte[] buffer = new byte[BUFFER_SIZE];
100 | StringBuilder result = new StringBuilder();
101 | try {
102 | while (true) {
103 | int read = bufferedInputStream.read(buffer);
104 | if (read > 0) {
105 | result.append(new String(buffer, 0, read));
106 | }
107 | if (read < BUFFER_SIZE) {
108 | break;
109 | }
110 | }
111 | } catch (Exception e) {
112 | e.printStackTrace();
113 | }
114 | return result.toString();
115 | }
116 |
117 | public static String getUidStrFormat() {
118 | String filter = exec("cat /proc/self/cgroup");
119 | if (filter == null || filter.length() == 0){
120 | return null;
121 | }
122 |
123 | int uidStartIndex = filter.lastIndexOf("uid");
124 | int uidEndIndex = filter.lastIndexOf("/pid");
125 | if (uidStartIndex < 0) {
126 | return null;
127 | }
128 | if (uidEndIndex<=0){
129 | uidEndIndex = filter.length();
130 | }
131 |
132 | filter = filter.substring(uidStartIndex + 4, uidEndIndex);
133 | try {
134 | String strUid = filter.replaceAll("\n", "");
135 | if (isNumericZidai(strUid)){
136 | int uid = Integer.valueOf(strUid);
137 | filter = String.format("u0_a%d", uid - 10000);
138 | return filter;
139 | }
140 | return null;
141 | } catch (Exception e) {
142 | e.printStackTrace();
143 | return null;
144 | }
145 | }
146 |
147 | public static boolean isNumericZidai(String str) {
148 | if (str == null || str.length() == 0){
149 | return false;
150 | }
151 | for (int i = 0; i < str.length(); i++) {
152 | if (!Character.isDigit(str.charAt(i))) {
153 | return false;
154 | }
155 | }
156 | return true;
157 | }
158 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/greens1995/myapplication/EmulatorDetector.java:
--------------------------------------------------------------------------------
1 | package com.greens1995.myapplication;
2 |
3 | import android.content.Context;
4 | import android.os.Build;
5 | import android.os.Environment;
6 | import android.util.Log;
7 |
8 | import java.io.File;
9 | import java.lang.reflect.Method;
10 |
11 | /**
12 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
13 | * the License. You may obtain a copy of the License at
14 | *
15 | * http://www.apache.org/licenses/LICENSE-2.0
16 | *
17 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
18 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
19 | * specific language governing permissions and limitations under the License.
20 | *
21 | * Copyright (C) 2013, Vladislav Gingo Skoumal (http://www.skoumal.net)
22 | * 在原Repo基础上增加了一些判定
23 | */
24 | public class EmulatorDetector {
25 |
26 | private static final String TAG = "EmulatorDetector";
27 |
28 | private static int rating = -1;
29 |
30 | public static boolean isEmulatorAbsoluly(Context context) {
31 |
32 | if (mayOnEmulatorViaQEMU(context)) {
33 | return true;
34 | }
35 |
36 | if (Build.PRODUCT.contains("sdk") ||
37 | Build.PRODUCT.contains("sdk_x86") ||
38 | Build.PRODUCT.contains("sdk_google") ||
39 | Build.PRODUCT.contains("Andy") ||
40 | Build.PRODUCT.contains("Droid4X") ||
41 | Build.PRODUCT.contains("nox") ||
42 | Build.PRODUCT.contains("vbox86p") ||
43 | Build.PRODUCT.contains("aries")) {
44 | return true;
45 | }
46 | if (Build.MANUFACTURER.equals("Genymotion") ||
47 | Build.MANUFACTURER.contains("Andy") ||
48 | Build.MANUFACTURER.contains("nox") ||
49 | Build.MANUFACTURER.contains("TiantianVM")) {
50 | return true;
51 | }
52 | if (Build.BRAND.contains("Andy")) {
53 | return true;
54 | }
55 | if (Build.DEVICE.contains("Andy") ||
56 | Build.DEVICE.contains("Droid4X") ||
57 | Build.DEVICE.contains("nox") ||
58 | Build.DEVICE.contains("vbox86p") ||
59 | Build.DEVICE.contains("aries")) {
60 | return true;
61 | }
62 | if (Build.MODEL.contains("Emulator") ||
63 | Build.MODEL.equals("google_sdk") ||
64 | Build.MODEL.contains("Droid4X") ||
65 | Build.MODEL.contains("TiantianVM") ||
66 | Build.MODEL.contains("Andy") ||
67 | Build.MODEL.equals("Android SDK built for x86_64") ||
68 | Build.MODEL.equals("Android SDK built for x86")) {
69 | return true;
70 | }
71 | if (Build.HARDWARE.equals("vbox86") ||
72 | Build.HARDWARE.contains("nox") ||
73 | Build.HARDWARE.contains("ttVM_x86")) {
74 | return true;
75 | }
76 | if (Build.FINGERPRINT.contains("generic/sdk/generic") ||
77 | Build.FINGERPRINT.contains("generic_x86/sdk_x86/generic_x86") ||
78 | Build.FINGERPRINT.contains("Andy") ||
79 | Build.FINGERPRINT.contains("ttVM_Hdragon") ||
80 | Build.FINGERPRINT.contains("generic/google_sdk/generic") ||
81 | Build.FINGERPRINT.contains("vbox86p") ||
82 | Build.FINGERPRINT.contains("generic/vbox86p/vbox86p")) {
83 | return true;
84 | }
85 |
86 | return false;
87 | }
88 |
89 | /**
90 | * Detects if app is currenly running on emulator, or real device.
91 | *
92 | * @return true for emulator, false for real devices
93 | */
94 | public static boolean isEmulator(Context context) {
95 | if (isEmulatorAbsoluly(context)) {
96 | return true;
97 | }
98 | int newRating = 0;
99 | if (rating < 0) {
100 | if (Build.PRODUCT.contains("sdk") ||
101 | Build.PRODUCT.contains("Andy") ||
102 | Build.PRODUCT.contains("ttVM_Hdragon") ||
103 | Build.PRODUCT.contains("google_sdk") ||
104 | Build.PRODUCT.contains("Droid4X") ||
105 | Build.PRODUCT.contains("nox") ||
106 | Build.PRODUCT.contains("sdk_x86") ||
107 | Build.PRODUCT.contains("sdk_google") ||
108 | Build.PRODUCT.contains("vbox86p")||
109 | Build.PRODUCT.contains("aries")) {
110 | newRating++;
111 | }
112 |
113 | if (Build.MANUFACTURER.equals("unknown") ||
114 | Build.MANUFACTURER.equals("Genymotion") ||
115 | Build.MANUFACTURER.contains("Andy") ||
116 | Build.MANUFACTURER.contains("MIT") ||
117 | Build.MANUFACTURER.contains("nox") ||
118 | Build.MANUFACTURER.contains("TiantianVM")) {
119 | newRating++;
120 | }
121 |
122 | if (Build.BRAND.equals("generic") ||
123 | Build.BRAND.equals("generic_x86") ||
124 | Build.BRAND.equals("TTVM") ||
125 | Build.BRAND.contains("Andy")) {
126 | newRating++;
127 | }
128 |
129 | if (Build.DEVICE.contains("generic") ||
130 | Build.DEVICE.contains("generic_x86") ||
131 | Build.DEVICE.contains("Andy") ||
132 | Build.DEVICE.contains("ttVM_Hdragon") ||
133 | Build.DEVICE.contains("Droid4X") ||
134 | Build.DEVICE.contains("nox") ||
135 | Build.DEVICE.contains("generic_x86_64") ||
136 | Build.DEVICE.contains("vbox86p")||
137 | Build.DEVICE.contains("aries")) {
138 | newRating++;
139 | }
140 |
141 | if (Build.MODEL.equals("sdk") ||
142 | Build.MODEL.contains("Emulator") ||
143 | Build.MODEL.equals("google_sdk") ||
144 | Build.MODEL.contains("Droid4X") ||
145 | Build.MODEL.contains("TiantianVM") ||
146 | Build.MODEL.contains("Andy") ||
147 | Build.MODEL.equals("Android SDK built for x86_64") ||
148 | Build.MODEL.equals("Android SDK built for x86")) {
149 | newRating++;
150 | }
151 |
152 | if (Build.HARDWARE.equals("goldfish") ||
153 | Build.HARDWARE.equals("vbox86") ||
154 | Build.HARDWARE.contains("nox") ||
155 | Build.HARDWARE.contains("ttVM_x86")) {
156 | newRating++;
157 | }
158 |
159 | if (Build.FINGERPRINT.contains("generic/sdk/generic") ||
160 | Build.FINGERPRINT.contains("generic_x86/sdk_x86/generic_x86") ||
161 | Build.FINGERPRINT.contains("Andy") ||
162 | Build.FINGERPRINT.contains("ttVM_Hdragon") ||
163 | Build.FINGERPRINT.contains("generic_x86_64") ||
164 | Build.FINGERPRINT.contains("generic/google_sdk/generic") ||
165 | Build.FINGERPRINT.contains("vbox86p") ||
166 | Build.FINGERPRINT.contains("generic/vbox86p/vbox86p")) {
167 | newRating++;
168 | }
169 |
170 | try {
171 | String opengl = android.opengl.GLES20.glGetString(android.opengl.GLES20.GL_RENDERER);
172 | if (opengl != null) {
173 | if (opengl.contains("Bluestacks") ||
174 | opengl.contains("Translator")
175 | ) {
176 | newRating += 10;
177 | }
178 | }
179 | } catch (Exception e) {
180 | e.printStackTrace();
181 | }
182 |
183 | try {
184 | File sharedFolder = new File(Environment
185 | .getExternalStorageDirectory().toString()
186 | + File.separatorChar
187 | + "windows"
188 | + File.separatorChar
189 | + "BstSharedFolder");
190 |
191 | if (sharedFolder.exists()) {
192 | newRating += 10;
193 | }
194 | } catch (Exception e) {
195 | e.printStackTrace();
196 | }
197 | rating = newRating;
198 | }
199 | return rating > 3;//不能再少了,否则有可能误判,若增减了新的嫌疑度判定属性,要重新评估该值
200 | }
201 |
202 |
203 | private static final boolean mayOnEmulatorViaQEMU(Context context) {
204 | String qemu = getProp(context, "ro.kernel.qemu");
205 | return "1".equals(qemu);
206 | }
207 |
208 | // /**
209 | // * 有权限可以打开这个判断
210 | // * @param context
211 | // * @return
212 | // */
213 | // private static final boolean mayOnEmulatorViaTelephonyDeviceId(Context context) {
214 | // TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
215 | // if (tm == null) {
216 | // return false;
217 | // }
218 | //
219 | // String deviceId = tm.getDeviceId();
220 | // if (TextUtils.isEmpty(deviceId)) {
221 | // return false;
222 | // }
223 | //
224 | // /**
225 | // * device id of telephony likes '0*'
226 | // */
227 | // for (int i = 0; i < deviceId.length(); i++) {
228 | // if (deviceId.charAt(i) != '0') {
229 | // return false;
230 | // }
231 | // }
232 | //
233 | // return true;
234 | // }
235 |
236 | /**
237 | * Returns string with human-readable listing of Build.* parameters used in {@link #isEmulator()} method.
238 | *
239 | * @return all involved Build.* parameters and its values
240 | */
241 | public static String getDeviceListing() {
242 | return "Build.PRODUCT: " + Build.PRODUCT + "\n" +
243 | "Build.MANUFACTURER: " + Build.MANUFACTURER + "\n" +
244 | "Build.BRAND: " + Build.BRAND + "\n" +
245 | "Build.DEVICE: " + Build.DEVICE + "\n" +
246 | "Build.MODEL: " + Build.MODEL + "\n" +
247 | "Build.HARDWARE: " + Build.HARDWARE + "\n" +
248 | "Build.FINGERPRINT: " + Build.FINGERPRINT + "\n" +
249 | "Build.TAGS: " + Build.TAGS + "\n" +
250 | "GL_RENDERER: " + android.opengl.GLES20.glGetString(android.opengl.GLES20.GL_RENDERER) + "\n" +
251 | "GL_VENDOR: " + android.opengl.GLES20.glGetString(android.opengl.GLES20.GL_VENDOR) + "\n" +
252 | "GL_VERSION: " + android.opengl.GLES20.glGetString(android.opengl.GLES20.GL_VERSION) + "\n" +
253 | "GL_EXTENSIONS: " + android.opengl.GLES20.glGetString(android.opengl.GLES20.GL_EXTENSIONS) + "\n";
254 | }
255 |
256 |
257 | private static final String getProp(Context context, String property) {
258 | try {
259 | ClassLoader cl = context.getClassLoader();
260 | Class> SystemProperties = cl.loadClass("android.os.SystemProperties");
261 | Method method = SystemProperties.getMethod("get", String.class);
262 | Object[] params = new Object[1];
263 | params[0] = property;
264 | return (String) method.invoke(SystemProperties, params);
265 | } catch (Exception e) {
266 | return null;
267 | }
268 | }
269 |
270 | /**
271 | * Prints all Build.* parameters used in {@link #isEmulator()} method to logcat.
272 | */
273 | public static void logcat() {
274 | Log.d(TAG, getDeviceListing());
275 | }
276 |
277 | }
278 |
--------------------------------------------------------------------------------
/app/src/main/java/com/greens1995/myapplication/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.greens1995.myapplication;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.widget.TextView;
6 |
7 | public class MainActivity extends AppCompatActivity {
8 |
9 | @Override
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | setContentView(R.layout.activity_main);
13 | boolean isHook = CheckHook.isHook(this);
14 | boolean isRoot = CheckRoot.isDeviceRooted();
15 | boolean isVirtual = CheckVirtual.isRunInVirtual();
16 | boolean isEmulator = EmulatorDetector.isEmulator(this);
17 | ((TextView) findViewById(R.id.text)).setText("is virtual " + isVirtual + ",isHook " + isHook + ",isRoot " + isRoot+ ",isEmulator " +isEmulator);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/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/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/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.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Labmem003/anti-counterfeit-android/3c4061f09a2b767690e748584fb7ac44c95d5c3c/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Labmem003/anti-counterfeit-android/3c4061f09a2b767690e748584fb7ac44c95d5c3c/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Labmem003/anti-counterfeit-android/3c4061f09a2b767690e748584fb7ac44c95d5c3c/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Labmem003/anti-counterfeit-android/3c4061f09a2b767690e748584fb7ac44c95d5c3c/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Labmem003/anti-counterfeit-android/3c4061f09a2b767690e748584fb7ac44c95d5c3c/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Labmem003/anti-counterfeit-android/3c4061f09a2b767690e748584fb7ac44c95d5c3c/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Labmem003/anti-counterfeit-android/3c4061f09a2b767690e748584fb7ac44c95d5c3c/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Labmem003/anti-counterfeit-android/3c4061f09a2b767690e748584fb7ac44c95d5c3c/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Labmem003/anti-counterfeit-android/3c4061f09a2b767690e748584fb7ac44c95d5c3c/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Labmem003/anti-counterfeit-android/3c4061f09a2b767690e748584fb7ac44c95d5c3c/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Detect Result
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/greens1995/myapplication/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.greens1995.myapplication;
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() throws Exception {
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 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.0.0'
11 |
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Labmem003/anti-counterfeit-android/3c4061f09a2b767690e748584fb7ac44c95d5c3c/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Jan 30 17:28:58 CST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------