Skip to content

Commit 61bccfc

Browse files
author
朱辉\harry
committed
release demo,删除不必要的输出日志
1 parent 9c100d0 commit 61bccfc

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222

2323
### 使用方法
2424

25-
1. 使用Intellij Idea打开项目并运行
26-
2. 打开`web/index.html`
25+
1. 使用Gradle构建项目: `gradle jar`
26+
2. 进入到生成的目录:`cd build/libs`
27+
3. 运行服务器(这里使用本地服务器):`java -jar AndroidControl.jar localserver 6655`
28+
4. 打开`web/index.html`
29+
5. 点击网页中的`设置`,配置IP和端口:`127.0.0.1` `6655`
2730

2831
注意:
2932

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
apply plugin: 'java'// UTF-8支持tasks.withType(JavaCompile) { options.encoding = "UTF-8"}task "java-mkdirs" <<{ sourceSets*.java.srcDirs*.each{it.mkdirs()} sourceSets*.resources.srcDirs*.each{it.mkdirs()}}// 依赖库仓库repositories { mavenLocal() mavenCentral() }dependencies { compile group: 'com.android.tools.ddms', name: 'ddmlib', version: '25.3.0' compile group: 'io.netty', name: 'netty-all', version: '4.1.9.Final' compile group: 'com.alibaba', name: 'fastjson', version: '1.2.31' compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4' compile group: 'com.neovisionaries', name: 'nv-websocket-client', version: '1.31'} jar { manifest { attributes("Main-Class": "com.yeetor.Main") } from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } doLast { def s = file("$libsDir/resources") s.mkdirs() copy { from "$projectDir/resources" into "$libsDir/resources" } }}apply plugin: 'application'run { if ( project.hasProperty("appArgs") ) { args Eval.me(appArgs) } doLast { def s = file("$buildDir/classes/resources") s.mkdirs() copy { from "$projectDir/resources" into "$buildDir/classes/resources" } }}mainClassName= 'com.yeetor.Main'//task copyExtRes(type: Copy) {// def src = file("$projectDir/resources")// def dst = file("$buildDir/resources")//// from src// into dst//}////distributions {// main {// contents {// from (copyExtRes) {// into "resources"// }// }// }//}
1+
apply plugin: 'java'// UTF-8支持tasks.withType(JavaCompile) { options.encoding = "UTF-8"}task "java-mkdirs" <<{ sourceSets*.java.srcDirs*.each{it.mkdirs()} sourceSets*.resources.srcDirs*.each{it.mkdirs()}}// 依赖库仓库repositories { mavenLocal() mavenCentral() }dependencies { compile group: 'com.android.tools.ddms', name: 'ddmlib', version: '25.3.0' compile group: 'io.netty', name: 'netty-all', version: '4.1.9.Final' compile group: 'com.alibaba', name: 'fastjson', version: '1.2.31' compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4' compile group: 'com.neovisionaries', name: 'nv-websocket-client', version: '1.31'} jar { manifest { attributes("Main-Class": "com.yeetor.Main") } from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } doLast { def s = file("$libsDir/resources") s.mkdirs() copy { from "$projectDir/resources" into "$libsDir/resources" } }}apply plugin: 'application'run { if ( project.hasProperty("appArgs") ) { args Eval.me(appArgs) } doLast { def s = file("$buildDir/classes/resources") s.mkdirs() copy { from "$projectDir/resources" into "$buildDir/classes/resources" } }}mainClassName= 'com.yeetor.Main'

src/main/java/com/yeetor/adb/AdbServer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ private String getADBPath(){
4141
if(adbPath != null){
4242
adbPath += File.separator + adbPlatformTools;
4343
}else {
44-
return null;
44+
adbPath = "adb";
45+
return adbPath;
4546
}
4647
}
4748
adbPath += File.separator + "adb";

src/main/java/com/yeetor/androidcontrol/LocalClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public LocalClient(Protocol protocol) {
3030

3131

3232
public void executeCommand(ChannelHandlerContext ctx, Command command) {
33-
if (command.getSchem() != Command.Schem.WAITTING) {
33+
if (command.getSchem() != Command.Schem.WAITTING && command.getSchem() != Command.Schem.TOUCH) {
3434
System.out.println(command.getContent());
3535
}
3636
switch (command.getSchem()) {

src/main/java/com/yeetor/androidcontrol/LocalServer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ public void onDisconnect(ChannelHandlerContext ctx) {
7979
@Override
8080
public void onTextMessage(ChannelHandlerContext ctx, String text) {
8181
Command command = Command.ParseCommand(text);
82-
System.out.println(text);
8382
if (command != null) {
8483
switch (command.getSchem()) {
8584
case WAIT:

0 commit comments

Comments
 (0)