├── .gitignore
├── .idea
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── dictionaries
│ └── zhangzhongping.xml
├── encodings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── gather
│ │ └── kuaisu
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── gather
│ │ │ └── kuaisu
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── gather
│ └── kuaisu
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── quickscan
├── .gitignore
├── .idea
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── dictionaries
│ │ └── zhangzhongping.xml
│ ├── encodings.xml
│ ├── gradle.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── runConfigurations.xml
│ └── workspace.xml
├── build.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── local.properties
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── duyin
│ │ └── quickscan
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── duyin
│ │ │ └── quickscan
│ │ │ ├── QuickScanManager.java
│ │ │ ├── api
│ │ │ ├── QuickScanApi.java
│ │ │ ├── QuickScanListener.java
│ │ │ ├── QuickScanService.java
│ │ │ └── RxUtlis
│ │ │ │ └── RxSubscriber.java
│ │ │ └── baen
│ │ │ └── ScanResult.java
│ └── res
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── duyin
│ └── quickscan
│ └── ExampleUnitTest.java
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/dictionaries/zhangzhongping.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | Abstraction issuesJava
39 |
40 |
41 | Android
42 |
43 |
44 | Android > Lint > Accessibility
45 |
46 |
47 | Android > Lint > Correctness
48 |
49 |
50 | Android > Lint > Correctness > Messages
51 |
52 |
53 | Android > Lint > Internationalization
54 |
55 |
56 | Android > Lint > Internationalization > Bidirectional Text
57 |
58 |
59 | Android > Lint > Performance
60 |
61 |
62 | Android > Lint > Security
63 |
64 |
65 | Android > Lint > Usability
66 |
67 |
68 | Android > Lint > Usability > Icons
69 |
70 |
71 | Android > Lint > Usability > Typography
72 |
73 |
74 | Assignment issuesGroovy
75 |
76 |
77 | Assignment issuesJava
78 |
79 |
80 | C/C++
81 |
82 |
83 | Class metricsJava
84 |
85 |
86 | Class structureJava
87 |
88 |
89 | Cloning issuesJava
90 |
91 |
92 | Code maturity issuesJava
93 |
94 |
95 | Code style issuesJava
96 |
97 |
98 | Concurrency annotation issuesJava
99 |
100 |
101 | Control FlowGroovy
102 |
103 |
104 | Control flow issuesJava
105 |
106 |
107 | CorrectnessLintAndroid
108 |
109 |
110 | Data flow analysisC/C++
111 |
112 |
113 | Data flow issuesJava
114 |
115 |
116 | Declaration redundancyJava
117 |
118 |
119 | DeclarationGroovy
120 |
121 |
122 | Dependency issuesJava
123 |
124 |
125 | Encapsulation issuesJava
126 |
127 |
128 | Error handlingGroovy
129 |
130 |
131 | Error handlingJava
132 |
133 |
134 | FunctionsC/C++
135 |
136 |
137 | GPath inspectionsGroovy
138 |
139 |
140 | General
141 |
142 |
143 | GeneralC/C++
144 |
145 |
146 | GeneralJava
147 |
148 |
149 | Google Cloud Endpoints
150 |
151 |
152 | Groovy
153 |
154 |
155 | Inheritance issuesJava
156 |
157 |
158 | Initialization issuesJava
159 |
160 |
161 | Internationalization issuesJava
162 |
163 |
164 | J2ME issuesJava
165 |
166 |
167 | JSON
168 |
169 |
170 | JUnit issuesJava
171 |
172 |
173 | Java
174 |
175 |
176 | Java language level issuesJava
177 |
178 |
179 | Java language level migration aidsJava
180 |
181 |
182 | JavaBeans issuesJava
183 |
184 |
185 | Javadoc issuesJava
186 |
187 |
188 | LintAndroid
189 |
190 |
191 | Logging issuesJava
192 |
193 |
194 | Memory issuesJava
195 |
196 |
197 | Method MetricsGroovy
198 |
199 |
200 | Method metricsJava
201 |
202 |
203 | Modularization issuesJava
204 |
205 |
206 | Naming ConventionsGroovy
207 |
208 |
209 | Naming conventionsJava
210 |
211 |
212 | Numeric issuesJava
213 |
214 |
215 | OtherGroovy
216 |
217 |
218 | Packaging issuesJava
219 |
220 |
221 | Pattern Validation
222 |
223 |
224 | Performance issuesJava
225 |
226 |
227 | Portability issuesJava
228 |
229 |
230 | Potentially confusing code constructsGroovy
231 |
232 |
233 | Probable bugsGroovy
234 |
235 |
236 | Probable bugsJava
237 |
238 |
239 | Resource management issuesJava
240 |
241 |
242 | Security issuesJava
243 |
244 |
245 | Serialization issuesJava
246 |
247 |
248 | TestNGJava
249 |
250 |
251 | Threading issuesGroovy
252 |
253 |
254 | Threading issuesJava
255 |
256 |
257 | Visibility issuesJava
258 |
259 |
260 | XML
261 |
262 |
263 | toString() issuesJava
264 |
265 |
266 |
267 |
268 | Android
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 | 1.8
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # QuickScan
2 | 手机文件快速扫描
3 | 基于getContentResolver实现手机文件扫描
4 |
5 | 1.使用技术 rxjava rxandroid material-dialogs
6 |
7 |
8 | public void button(View view){
9 | QuickScanManager.getQuickScanManager().Init(this).getAllResult(editText.getText().toString(), new QuickScanManager.OnResultListener() {
10 | @Override
11 | public void ScanSuccess(List lists) {
12 | list.clear();
13 | for(ScanResult scanResult:lists){
14 | list.add(scanResult.getName());
15 | }
16 | arrayAdapter.notifyDataSetChanged();
17 | }
18 |
19 | @Override
20 | public void ScanError(String msg) {
21 | Toast.makeText(getApplicationContext(),msg,0).show();
22 | }
23 | });
24 | }
25 |
26 | @Override
27 | protected void onDestroy() {
28 | super.onDestroy();
29 | QuickScanManager.getQuickScanManager().remove();
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion "24.0.2"
6 | defaultConfig {
7 | applicationId "com.gather.kuaisu"
8 | minSdkVersion 14
9 | targetSdkVersion 22
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25 | exclude group: 'com.android.support', module: 'support-annotations'
26 | })
27 | compile 'com.android.support:appcompat-v7:24.2.0'
28 | testCompile 'junit:junit:4.12'
29 | compile project(path: ':quickscan')
30 | }
31 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/zhangzhongping/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/gather/kuaisu/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.gather.kuaisu;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.gather.kuaisu", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/gather/kuaisu/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.gather.kuaisu;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 | import android.view.View;
6 | import android.widget.ArrayAdapter;
7 | import android.widget.EditText;
8 | import android.widget.ListView;
9 | import android.widget.Toast;
10 |
11 | import com.duyin.quickscan.QuickScanManager;
12 | import com.duyin.quickscan.baen.ScanResult;
13 |
14 | import java.util.ArrayList;
15 | import java.util.List;
16 |
17 | public class MainActivity extends AppCompatActivity {
18 | private EditText editText;
19 | private ListView listView;
20 | private List list = new ArrayList<>();
21 | private ArrayAdapter arrayAdapter;
22 | @Override
23 | protected void onCreate(Bundle savedInstanceState) {
24 | super.onCreate(savedInstanceState);
25 | setContentView(R.layout.activity_main);
26 | editText = (EditText) findViewById(R.id.editText);
27 | listView = (ListView) findViewById(R.id.list_item);
28 | arrayAdapter = new ArrayAdapter(this, android.R.layout.simple_expandable_list_item_1,list);
29 | listView.setAdapter(arrayAdapter);
30 |
31 | }
32 | public void button(View view){
33 | QuickScanManager.getQuickScanManager().Init(this).getAllResult(editText.getText().toString(), new QuickScanManager.OnResultListener() {
34 | @Override
35 | public void ScanSuccess(List lists) {
36 | list.clear();
37 | for(ScanResult scanResult:lists){
38 | list.add(scanResult.getName());
39 | }
40 | arrayAdapter.notifyDataSetChanged();
41 | }
42 |
43 | @Override
44 | public void ScanError(String msg) {
45 | Toast.makeText(getApplicationContext(),msg,0).show();
46 | }
47 | });
48 | }
49 |
50 | @Override
51 | protected void onDestroy() {
52 | QuickScanManager.getQuickScanManager().remove();
53 | super.onDestroy();
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
26 |
27 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androiddy/QuickScan/3ce7363d133b07a6240c4ea08c853c56f01b8cc0/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androiddy/QuickScan/3ce7363d133b07a6240c4ea08c853c56f01b8cc0/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androiddy/QuickScan/3ce7363d133b07a6240c4ea08c853c56f01b8cc0/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androiddy/QuickScan/3ce7363d133b07a6240c4ea08c853c56f01b8cc0/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androiddy/QuickScan/3ce7363d133b07a6240c4ea08c853c56f01b8cc0/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | kuaisu
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/gather/kuaisu/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.gather.kuaisu;
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 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.2.3'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/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/androiddy/QuickScan/3ce7363d133b07a6240c4ea08c853c56f01b8cc0/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
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-2.14.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 |
--------------------------------------------------------------------------------
/quickscan/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/quickscan/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/quickscan/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/quickscan/.idea/dictionaries/zhangzhongping.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/quickscan/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/quickscan/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/quickscan/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | Abstraction issuesJava
36 |
37 |
38 | Android
39 |
40 |
41 | Android > Lint > Accessibility
42 |
43 |
44 | Android > Lint > Correctness
45 |
46 |
47 | Android > Lint > Correctness > Messages
48 |
49 |
50 | Android > Lint > Internationalization
51 |
52 |
53 | Android > Lint > Internationalization > Bidirectional Text
54 |
55 |
56 | Android > Lint > Performance
57 |
58 |
59 | Android > Lint > Security
60 |
61 |
62 | Android > Lint > Usability
63 |
64 |
65 | Android > Lint > Usability > Icons
66 |
67 |
68 | Android > Lint > Usability > Typography
69 |
70 |
71 | Assignment issuesGroovy
72 |
73 |
74 | Assignment issuesJava
75 |
76 |
77 | C/C++
78 |
79 |
80 | Class metricsJava
81 |
82 |
83 | Class structureJava
84 |
85 |
86 | Cloning issuesJava
87 |
88 |
89 | Code maturity issuesJava
90 |
91 |
92 | Code style issuesJava
93 |
94 |
95 | Concurrency annotation issuesJava
96 |
97 |
98 | Control FlowGroovy
99 |
100 |
101 | Control flow issuesJava
102 |
103 |
104 | CorrectnessLintAndroid
105 |
106 |
107 | Data flow analysisC/C++
108 |
109 |
110 | Data flow issuesJava
111 |
112 |
113 | Declaration redundancyJava
114 |
115 |
116 | DeclarationGroovy
117 |
118 |
119 | Dependency issuesJava
120 |
121 |
122 | Encapsulation issuesJava
123 |
124 |
125 | Error handlingGroovy
126 |
127 |
128 | Error handlingJava
129 |
130 |
131 | FunctionsC/C++
132 |
133 |
134 | GPath inspectionsGroovy
135 |
136 |
137 | General
138 |
139 |
140 | GeneralC/C++
141 |
142 |
143 | GeneralJava
144 |
145 |
146 | Google Cloud Endpoints
147 |
148 |
149 | Groovy
150 |
151 |
152 | Inheritance issuesJava
153 |
154 |
155 | Initialization issuesJava
156 |
157 |
158 | Internationalization issuesJava
159 |
160 |
161 | J2ME issuesJava
162 |
163 |
164 | JSON
165 |
166 |
167 | JUnit issuesJava
168 |
169 |
170 | Java
171 |
172 |
173 | Java language level issuesJava
174 |
175 |
176 | Java language level migration aidsJava
177 |
178 |
179 | JavaBeans issuesJava
180 |
181 |
182 | Javadoc issuesJava
183 |
184 |
185 | LintAndroid
186 |
187 |
188 | Logging issuesJava
189 |
190 |
191 | Memory issuesJava
192 |
193 |
194 | Method MetricsGroovy
195 |
196 |
197 | Method metricsJava
198 |
199 |
200 | Modularization issuesJava
201 |
202 |
203 | Naming ConventionsGroovy
204 |
205 |
206 | Naming conventionsJava
207 |
208 |
209 | Numeric issuesJava
210 |
211 |
212 | OtherGroovy
213 |
214 |
215 | Packaging issuesJava
216 |
217 |
218 | Pattern Validation
219 |
220 |
221 | Performance issuesJava
222 |
223 |
224 | Portability issuesJava
225 |
226 |
227 | Potentially confusing code constructsGroovy
228 |
229 |
230 | Probable bugsGroovy
231 |
232 |
233 | Probable bugsJava
234 |
235 |
236 | Resource management issuesJava
237 |
238 |
239 | Security issuesJava
240 |
241 |
242 | Serialization issuesJava
243 |
244 |
245 | TestNGJava
246 |
247 |
248 | Threading issuesGroovy
249 |
250 |
251 | Threading issuesJava
252 |
253 |
254 | Visibility issuesJava
255 |
256 |
257 | XML
258 |
259 |
260 | toString() issuesJava
261 |
262 |
263 |
264 |
265 | Android
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 | 1.8
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
--------------------------------------------------------------------------------
/quickscan/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/quickscan/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/quickscan/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 | 1487328514831
323 |
324 |
325 | 1487328514831
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
--------------------------------------------------------------------------------
/quickscan/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion "24.0.2"
6 |
7 | defaultConfig {
8 | minSdkVersion 14
9 | targetSdkVersion 22
10 | versionCode 1
11 | versionName "1.0"
12 |
13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 |
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | compile fileTree(dir: 'libs', include: ['*.jar'])
26 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
27 | exclude group: 'com.android.support', module: 'support-annotations'
28 | })
29 | compile 'com.afollestad.material-dialogs:core:0.9.2.3'
30 | compile 'com.afollestad.material-dialogs:commons:0.9.2.3'
31 | compile 'com.android.support:appcompat-v7:24.2.0'
32 | testCompile 'junit:junit:4.12'
33 | compile 'io.reactivex:rxandroid:1.1.0'
34 | compile 'io.reactivex:rxjava:1.1.5'
35 | }
36 |
--------------------------------------------------------------------------------
/quickscan/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/androiddy/QuickScan/3ce7363d133b07a6240c4ea08c853c56f01b8cc0/quickscan/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/quickscan/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
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-2.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/quickscan/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 |
--------------------------------------------------------------------------------
/quickscan/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 |
--------------------------------------------------------------------------------
/quickscan/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Fri Feb 17 18:47:53 CST 2017
11 | ndk.dir=/Users/zhangzhongping/Library/Android/sdk/ndk-bundle
12 | sdk.dir=/Users/zhangzhongping/Library/Android/sdk
13 |
--------------------------------------------------------------------------------
/quickscan/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/zhangzhongping/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/quickscan/src/androidTest/java/com/duyin/quickscan/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.duyin.quickscan;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.duyin.quickscan.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/quickscan/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/quickscan/src/main/java/com/duyin/quickscan/QuickScanManager.java:
--------------------------------------------------------------------------------
1 | package com.duyin.quickscan;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import com.afollestad.materialdialogs.GravityEnum;
6 | import com.afollestad.materialdialogs.MaterialDialog;
7 | import com.duyin.quickscan.api.QuickScanApi;
8 | import com.duyin.quickscan.api.QuickScanService;
9 | import com.duyin.quickscan.api.RxUtlis.RxSubscriber;
10 | import com.duyin.quickscan.baen.ScanResult;
11 | import java.util.List;
12 |
13 | import rx.Subscription;
14 | import rx.android.schedulers.AndroidSchedulers;
15 | import rx.schedulers.Schedulers;
16 | import rx.subscriptions.CompositeSubscription;
17 |
18 | /**
19 | * 作者:zhangzhongping on 17/2/17 16:41
20 | * 邮箱:android_dy@163.com
21 | */
22 | public class QuickScanManager {
23 | private static QuickScanManager quickScanManager = new QuickScanManager();
24 | private Activity activity;
25 | protected CompositeSubscription mCompositeSubscription;
26 | private QuickScanApi quickScanApi = QuickScanApi.getInstance(QuickScanService.getQuickScanService());
27 | protected MaterialDialog mMaterialDialog = null;
28 |
29 | private QuickScanManager(){
30 |
31 | }
32 | public static QuickScanManager getQuickScanManager(){
33 | return quickScanManager;
34 | }
35 | public QuickScanManager Init(Activity activity){
36 | this.activity = activity;
37 | return this;
38 | }
39 | public void getAllResult(final String end, final OnResultListener onResultListener){
40 | showload();
41 | Subscription typebook = quickScanApi.getAllResult(activity.getApplicationContext(), end)
42 | .subscribeOn(Schedulers.io())
43 | .observeOn(AndroidSchedulers.mainThread())
44 | .subscribe(new RxSubscriber>() {
45 | @Override
46 | public void _onNext(List liveInfos) {
47 | if (liveInfos.size() > 0) {
48 | onResultListener.ScanSuccess(liveInfos);
49 | } else {
50 | onResultListener.ScanError("暂无扫描到 "+end+" 数据");
51 | }
52 | delload();
53 | }
54 |
55 | @Override
56 | public void _onError(String msg) {
57 | onResultListener.ScanError(msg);
58 | delload();
59 | }
60 | });
61 | addSubscrebe(typebook);
62 | }
63 |
64 | protected void unSubscribe() {
65 | if (mCompositeSubscription != null) {
66 | mCompositeSubscription.unsubscribe();
67 | }
68 | }
69 |
70 | protected void addSubscrebe(Subscription subscription) {
71 | if (mCompositeSubscription == null) {
72 | mCompositeSubscription = new CompositeSubscription();
73 | }
74 | mCompositeSubscription.add(subscription);
75 | }
76 | public interface OnResultListener{
77 | void ScanSuccess(List list);
78 | void ScanError(String msg);
79 | }
80 | protected void showload(){
81 | showProgressDeterminateDialog();
82 | }
83 | public void showProgressDeterminateDialog() {
84 | mMaterialDialog = new MaterialDialog.Builder(activity)
85 | .content("正在扫描中...")
86 | .progress(true, 0)
87 | .cancelable(false)
88 | .progressIndeterminateStyle(true)
89 | .show();
90 | }
91 |
92 | protected void delload(){
93 | if(mMaterialDialog!=null){
94 | mMaterialDialog.dismiss();
95 | }
96 | }
97 | public void remove(){
98 | unSubscribe();
99 | activity = null;
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/quickscan/src/main/java/com/duyin/quickscan/api/QuickScanApi.java:
--------------------------------------------------------------------------------
1 | package com.duyin.quickscan.api;
2 |
3 | import android.content.Context;
4 |
5 | import com.duyin.quickscan.baen.ScanResult;
6 |
7 | import java.util.List;
8 |
9 | import rx.Observable;
10 |
11 | /**
12 | * 作者:zhangzhongping on 17/2/17 16:44
13 | * 邮箱:android_dy@163.com
14 | */
15 | public class QuickScanApi {
16 | public static QuickScanApi quickScanApi;
17 | private QuickScanListener quickScanService;
18 |
19 | public QuickScanApi(QuickScanListener quickScanListener) {
20 | quickScanService = quickScanListener;
21 | }
22 |
23 | public static QuickScanApi getInstance(QuickScanListener quickScanListener) {
24 | if (quickScanApi == null)
25 | quickScanApi = new QuickScanApi(quickScanListener);
26 | return quickScanApi;
27 | }
28 | public Observable> getAllResult(Context context,String end){
29 | return quickScanService.getAllResult(context,end);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/quickscan/src/main/java/com/duyin/quickscan/api/QuickScanListener.java:
--------------------------------------------------------------------------------
1 | package com.duyin.quickscan.api;
2 |
3 | import android.content.Context;
4 |
5 | import com.duyin.quickscan.baen.ScanResult;
6 |
7 | import java.util.List;
8 |
9 | import rx.Observable;
10 |
11 | /**
12 | * 作者:zhangzhongping on 17/2/17 16:48
13 | * 邮箱:android_dy@163.com
14 | */
15 | public interface QuickScanListener {
16 | Observable> getAllResult(Context context, String end);
17 | }
18 |
--------------------------------------------------------------------------------
/quickscan/src/main/java/com/duyin/quickscan/api/QuickScanService.java:
--------------------------------------------------------------------------------
1 | package com.duyin.quickscan.api;
2 |
3 | import android.content.Context;
4 | import android.database.Cursor;
5 | import android.net.Uri;
6 | import android.provider.MediaStore;
7 |
8 | import com.duyin.quickscan.baen.ScanResult;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | import rx.Observable;
14 | import rx.Subscriber;
15 |
16 | /**
17 | * 作者:zhangzhongping on 17/2/17 16:45
18 | * 邮箱:android_dy@163.com
19 | */
20 | public class QuickScanService implements QuickScanListener {
21 |
22 | public static QuickScanService quickScanService;
23 | public synchronized static QuickScanService getQuickScanService(){
24 | if(quickScanService==null){
25 | quickScanService = new QuickScanService();
26 | }
27 | return quickScanService;
28 | }
29 | @Override
30 | public Observable> getAllResult(final Context context, final String end) {
31 | return Observable.create(new Observable.OnSubscribe>() {
32 | @Override
33 | public void call(Subscriber super List> subscriber) {
34 | subscriber.onNext(queryFiles(context,end));
35 | }
36 | });
37 | }
38 |
39 | private List queryFiles(Context context,String end) {
40 | String[] projection = new String[]{MediaStore.Files.FileColumns._ID,
41 | MediaStore.Files.FileColumns.DATA,
42 | MediaStore.Files.FileColumns.SIZE
43 | };
44 | Cursor cursor = context.getContentResolver().query(
45 | Uri.parse("content://media/external/file"),
46 | projection,
47 | MediaStore.Files.FileColumns.DATA + " like ?",
48 | new String[]{"%"+end},
49 | null);
50 |
51 | List list = new ArrayList<>();
52 | if (cursor != null) {
53 | if (cursor.moveToFirst()) {
54 | int dataindex = cursor.getColumnIndex(MediaStore.Files.FileColumns.DATA);
55 | do {
56 | String path = cursor.getString(dataindex);
57 | int dot = path.lastIndexOf("/");
58 | String name = path.substring(dot + 1);
59 | if (name.lastIndexOf(".") > 0)
60 | name = name.substring(0, name.lastIndexOf("."));
61 | if (!name.startsWith(".")) {
62 | ScanResult books = new ScanResult();
63 | books.setName(name);
64 | books.setPath(path);
65 | list.add(books);
66 | }
67 | } while (cursor.moveToNext());
68 | }
69 | }
70 | cursor.close();
71 | return list;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/quickscan/src/main/java/com/duyin/quickscan/api/RxUtlis/RxSubscriber.java:
--------------------------------------------------------------------------------
1 | package com.duyin.quickscan.api.RxUtlis;
2 |
3 |
4 | import rx.Subscriber;
5 |
6 | /**
7 | * Created by zhangzhongping on 17/1/11.
8 | */
9 |
10 | public abstract class RxSubscriber extends Subscriber {
11 | @Override
12 | public void onCompleted() {
13 |
14 | }
15 |
16 | @Override
17 | public void onError(Throwable e) {
18 | _onError("获取信息错误!");
19 | }
20 |
21 | @Override
22 | public void onNext(T t) {
23 | _onNext(t);
24 | }
25 |
26 | public abstract void _onNext(T t);
27 |
28 | public abstract void _onError(String msg);
29 | }
--------------------------------------------------------------------------------
/quickscan/src/main/java/com/duyin/quickscan/baen/ScanResult.java:
--------------------------------------------------------------------------------
1 | package com.duyin.quickscan.baen;
2 |
3 | /**
4 | * 作者:zhangzhongping on 17/2/17 16:50
5 | * 邮箱:android_dy@163.com
6 | */
7 | public class ScanResult {
8 |
9 | private String name;
10 | private String path;
11 |
12 | public String getName() {
13 | return name;
14 | }
15 |
16 | public String getPath() {
17 | return path;
18 | }
19 |
20 | public void setName(String name) {
21 | this.name = name;
22 | }
23 |
24 | public void setPath(String path) {
25 | this.path = path;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/quickscan/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | QuickScan
3 |
4 |
--------------------------------------------------------------------------------
/quickscan/src/test/java/com/duyin/quickscan/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.duyin.quickscan;
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 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':quickscan'
2 |
--------------------------------------------------------------------------------