From f285cbe6d476a0cf46a5819a6c66a2bf0ae54c5c Mon Sep 17 00:00:00 2001 From: longforus Date: Sun, 15 Mar 2020 11:05:26 +0800 Subject: [PATCH] update to 1.6.5 --- build.gradle | 2 + gradle/wrapper/gradle-wrapper.properties | 2 +- .../adbidea/action/extend/PutStringAction.kt | 2 +- .../developerphil/adbidea/adb/AdbFacade.kt | 2 +- .../adb/command/receiver/PrintReceiver.java | 34 --- .../adb/command/receiver/PrintReceiver.kt | 27 +++ src/main/resources/META-INF/plugin.xml | 206 +++++++++++------- 7 files changed, 157 insertions(+), 118 deletions(-) delete mode 100644 src/main/kotlin/com/developerphil/adbidea/adb/command/receiver/PrintReceiver.java create mode 100644 src/main/kotlin/com/developerphil/adbidea/adb/command/receiver/PrintReceiver.kt diff --git a/build.gradle b/build.gradle index 6f34b37..eb0ad60 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ buildscript { ext.kotlin_version = '1.3.41' repositories { + maven {url 'https://maven.aliyun.com/repository/public'} mavenCentral() jcenter() } @@ -26,6 +27,7 @@ apply plugin: 'kotlin-kapt' repositories { + maven {url 'https://maven.aliyun.com/repository/public'} mavenCentral() jcenter() } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1b16c34..a95009c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/kotlin/com/developerphil/adbidea/action/extend/PutStringAction.kt b/src/main/kotlin/com/developerphil/adbidea/action/extend/PutStringAction.kt index 62a0cb5..9b76998 100644 --- a/src/main/kotlin/com/developerphil/adbidea/action/extend/PutStringAction.kt +++ b/src/main/kotlin/com/developerphil/adbidea/action/extend/PutStringAction.kt @@ -15,7 +15,7 @@ class PutStringAction : AdbAction() { override fun actionPerformed(e: AnActionEvent, project: Project) { - var result = JOptionPane.showInputDialog("Input simple string(ASCII) put to device") + var result = JOptionPane.showInputDialog("Input simple string(ASCII) put to device,need open USB debugging(Security settings)") if (!result.isNullOrEmpty()) { result = result.replace(" ","") AdbFacade.putStringToDevice(project,result) diff --git a/src/main/kotlin/com/developerphil/adbidea/adb/AdbFacade.kt b/src/main/kotlin/com/developerphil/adbidea/adb/AdbFacade.kt index 10eaa30..d097e12 100644 --- a/src/main/kotlin/com/developerphil/adbidea/adb/AdbFacade.kt +++ b/src/main/kotlin/com/developerphil/adbidea/adb/AdbFacade.kt @@ -97,7 +97,7 @@ object AdbFacade { if (result != null) { for (device in result.devices) { - EXECUTOR.submit({ runnable.run(project, device, result.facet, result.packageName) } as Runnable) + EXECUTOR.submit { runnable.run(project, device, result.facet, result.packageName) } } } else { NotificationHelper.error("No Device found") diff --git a/src/main/kotlin/com/developerphil/adbidea/adb/command/receiver/PrintReceiver.java b/src/main/kotlin/com/developerphil/adbidea/adb/command/receiver/PrintReceiver.java deleted file mode 100644 index c7b965b..0000000 --- a/src/main/kotlin/com/developerphil/adbidea/adb/command/receiver/PrintReceiver.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.developerphil.adbidea.adb.command.receiver; - -import com.android.ddmlib.IShellOutputReceiver; -import com.developerphil.adbidea.ui.Utils; -import com.google.common.base.Charsets; - -public class PrintReceiver implements IShellOutputReceiver { - - private String mString; - - public final void addOutput(byte[] data, int offset, int length) { - if (!this.isCancelled()) { - mString = new String(data, offset, length, Charsets.UTF_8) + "\r\n"; - } - } - - @Override - public void flush() { - - } - - public void done() { - } - - @Override - public boolean isCancelled() { - return false; - } - - @Override - public String toString() { - return Utils.Companion.isEmpty(mString) ? "" : mString; - } -} diff --git a/src/main/kotlin/com/developerphil/adbidea/adb/command/receiver/PrintReceiver.kt b/src/main/kotlin/com/developerphil/adbidea/adb/command/receiver/PrintReceiver.kt new file mode 100644 index 0000000..4dcb534 --- /dev/null +++ b/src/main/kotlin/com/developerphil/adbidea/adb/command/receiver/PrintReceiver.kt @@ -0,0 +1,27 @@ +package com.developerphil.adbidea.adb.command.receiver + +import com.android.ddmlib.IShellOutputReceiver +import com.developerphil.adbidea.ui.Utils.Companion.isEmpty +import com.google.common.base.Charsets + +class PrintReceiver : IShellOutputReceiver { + private var mString: String? = null + override fun addOutput(data: ByteArray, offset: Int, length: Int) { + if (!this.isCancelled) { + mString = """ + ${String(data, offset, length, Charsets.UTF_8)} + + """.trimIndent() + } + } + + override fun flush() {} + fun done() {} + override fun isCancelled(): Boolean { + return false + } + + override fun toString(): String { + return (if (isEmpty(mString)) "" else mString)!! + } +} \ No newline at end of file diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index e18fb80..0ff58e7 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -1,7 +1,7 @@ com.developerphil.adbidea ADB Idea - 1.6.4 + 1.6.5 Philippe Breault and Void Young 1.6.5 +
    +
  • update to origin : support Android Studio 3.6+
  • +
1.6.4
  • BUGFIX: The result of multi-module selection is inconsistent with the actual selection
  • -
1.6.3 + + 1.6.3
  • update to origin : BUGFIX: Show all connected devices on Android Studio 3.4+
@@ -147,93 +152,132 @@
  • Now support projects with more than one application module
  • ]]> - + - - - + + + - com.intellij.modules.platform - org.jetbrains.android + com.intellij.modules.platform + org.jetbrains.android - - - - - - - - + + + + + + + + + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - com.developerphil.adbidea.ObjectGraph - - + + + com.developerphil.adbidea.ObjectGraph + +
    \ No newline at end of file