Skip to content

Commit

Permalink
add copy adb command back
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkaW committed Jul 21, 2019
1 parent b409dea commit 4ed4556
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ task clean(type: Delete) {

def gitCommitId = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
def gitCommitCount = Integer.parseInt('git rev-list --count HEAD'.execute([], project.rootDir).text.trim())
def baseVersionName = '3.4.2'
def baseVersionName = '3.4.3'

ext {
androidXLibraryVersion = '1.0.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package moe.shizuku.manager.viewholder;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.Toast;

import moe.shizuku.manager.Helps;
import moe.shizuku.manager.R;
import moe.shizuku.manager.ServerLauncher;
import moe.shizuku.manager.utils.CustomTabsHelper;
import moe.shizuku.manager.utils.MultiLocaleEntity;
import moe.shizuku.support.recyclerview.BaseViewHolder;
import moe.shizuku.support.utils.ClipboardUtils;

public class StartAdbViewHolder extends BaseViewHolder<Object> {

Expand All @@ -17,11 +22,20 @@ public StartAdbViewHolder(View itemView) {

itemView.findViewById(android.R.id.button1).setOnClickListener(v -> CustomTabsHelper.launchUrlOrCopy(v.getContext(), Helps.ADB.get()));

/*itemView.findViewById(android.R.id.button2).setOnClickListener(v -> {
itemView.findViewById(android.R.id.button2).setOnClickListener(v -> {
Context context = v.getContext();
if (ClipboardUtils.put(context, ServerLauncher.COMMAND_ADB)) {
Toast.makeText(context, context.getString(R.string.copied_to_clipboard, ServerLauncher.COMMAND_ADB), Toast.LENGTH_SHORT).show();
}
});*/
});

itemView.findViewById(android.R.id.button3).setOnClickListener(v -> {
Context context = v.getContext();
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, ServerLauncher.COMMAND_ADB);
intent = Intent.createChooser(intent, context.getString(R.string.send_command));
context.startActivity(intent);
});
}
}
12 changes: 12 additions & 0 deletions manager/src/main/res/layout/item_home_start_adb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,16 @@
android:drawableStart="@drawable/ic_help_outline_24dp"
style="@style/CardButton" />

<TextView
android:id="@android:id/button2"
android:text="@string/copy_command"
android:drawableStart="@drawable/ic_content_copy_24dp"
style="@style/CardButton" />

<TextView
android:id="@android:id/button3"
android:text="@string/send_command"
android:drawableStart="@drawable/ic_send_24dp"
style="@style/CardButton" />

</LinearLayout>
6 changes: 3 additions & 3 deletions manager/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
<string name="service_restart">重新启动</string>
<string name="start_service_title_root"><![CDATA[通过 root 权限启动服务]]></string>
<string name="start_service_title_adb"><![CDATA[通过 adb 启动或升级服务]]></string>
<string name="start_service_summary_adb"><![CDATA[使用 adb 并不困难,请阅读下面的帮助。<br>帮助随时更新,并包含遇到问题的解决方案。]]></string>
<string name="start_service_summary_adb"><![CDATA[使用 adb 并不困难,请阅读下面的帮助。帮助随时更新,并包含遇到问题的解决方案。]]></string>
<string name="start_service_summary_root"><![CDATA[
若启动成功,则 Shizuku 将在开机后自动启动。
<br>如果无法正常开机启动,请检查您的系统或是第三方工具是否限制了 Shizuku。
<p>除 Google 外,几乎所有厂商都有自己的后台限制机制(部分厂商尤为疯狂,如 OnePlus,严重影响许多应用的功能)。
<br>请参考 <b><a href="https://dontkillmyapp.com/">dontkillmyapp.com</a></b> 了解如何关闭限制。]]></string>
<string name="copy_command">复制</string>
<string name="send_command">发送</string>
<string name="copy_command">复制指令</string>
<string name="send_command">发送指令</string>
<string name="auth_allow">总是允许</string>
<string name="auth_deny">拒绝</string>
<string name="auth_message"><![CDATA[要允许 <b>%1$s</b> 以 <b>%2$s</b> 身份调用 API 吗?]]></string>
Expand Down
6 changes: 3 additions & 3 deletions manager/src/main/res/values-zh-rHK/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
<string name="service_restart">重新啟動</string>
<string name="start_service_title_root"><![CDATA[透過 root 權限啟動服務]]></string>
<string name="start_service_title_adb"><![CDATA[透過 adb 啟動或升級服務]]></string>
<string name="start_service_summary_adb"><![CDATA[使用 adb 並不困難,請閱讀下面的幫助。<br>幫助隨時更新,幷包含遇到問題的解決方案。]]></string>
<string name="start_service_summary_adb"><![CDATA[使用 adb 並不困難,請閱讀下面的幫助。幫助隨時更新,幷包含遇到問題的解決方案。]]></string>
<string name="start_service_summary_root"><![CDATA[
若啓動成功,則 Shizuku 將在開機後自動啓動。
<br>如果無法正常開機啓動,請檢查您的系統或是第三方工具是否限制了 Shizuku。
<p>除 Google 外,幾乎所有廠商都有自己的後臺限制機制(部分廠商尤為瘋狂,如 OnePlus,嚴重影響許多應用程式的功能)。
<br>請參考 <b><a href="https://dontkillmyapp.com/">dontkillmyapp.com</a></b> 瞭解如何關閉限制。]]></string>
<string name="copy_command">複製</string>
<string name="send_command">傳送</string>
<string name="copy_command">複製指令</string>
<string name="send_command">傳送指令</string>
<string name="auth_allow">一律允許</string>
<string name="auth_deny">拒絕</string>
<string name="auth_message"><![CDATA[要允許 <b>%1$s</b> 以 <b>%2$s</b> 身份調用 API 嗎?]]></string>
Expand Down
6 changes: 3 additions & 3 deletions manager/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
<string name="service_restart">重新啟動</string>
<string name="start_service_title_root"><![CDATA[透過 root 權限啟動服務]]></string>
<string name="start_service_title_adb"><![CDATA[透過 adb 啟動或升級服務]]></string>
<string name="start_service_summary_adb"><![CDATA[使用 adb 並不困難,請閱讀下面的幫助。<br>幫助隨時更新,幷包含遇到問題的解決方案。]]></string>
<string name="start_service_summary_adb"><![CDATA[使用 adb 並不困難,請閱讀下面的幫助。幫助隨時更新,幷包含遇到問題的解決方案。]]></string>
<string name="start_service_summary_root"><![CDATA[
若啓動成功,則 Shizuku 將在開機後自動啓動。
<br>如果無法正常開機啓動,請檢查您的系統或是第三方工具是否限制了 Shizuku。
<p>除 Google 外,幾乎所有廠商都有自己的後臺限制機制(部分廠商尤為瘋狂,如 OnePlus,嚴重影響許多應用程式的功能)。
<br>請參考 <b><a href="https://dontkillmyapp.com/">dontkillmyapp.com</a></b> 瞭解如何關閉限制。]]></string>
<string name="copy_command">複製</string>
<string name="send_command">傳送</string>
<string name="copy_command">複製指令</string>
<string name="send_command">傳送指令</string>
<string name="auth_allow">一律允許</string>
<string name="auth_deny">拒絕</string>
<string name="auth_message"><![CDATA[要允許 <b>%1$s</b> 以 <b>%2$s</b> 身份調用 API 嗎?]]></string>
Expand Down
6 changes: 3 additions & 3 deletions manager/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<string name="service_restart">Restart</string>
<string name="start_service_title_root"><![CDATA[Start service with root permission]]></string>
<string name="start_service_title_adb"><![CDATA[Start / update service with adb]]></string>
<string name="start_service_summary_adb"><![CDATA[Using adb is not difficult, please read the help below.<br>Help will update at any time, includes solutions to problems.]]></string>
<string name="start_service_summary_adb"><![CDATA[Using adb is not difficult, please read the help below. Help will update at any time, includes solutions to problems.]]></string>
<string name="start_service_summary_root"><![CDATA[
If successful starts, Shizuku will automatically start after boot.
<br>If Shizuku can\'t start on boot properly, please check if your system or third-party tools have restricted Shizuku Manager.
<p>Almost all vendors except Google have their own background restriction mechanism (some vendors are vary crazy, such as OnePlus, which seriously affects the functionality of many apps).
<br>Please refer to <b><a href="https://dontkillmyapp.com/">dontkillmyapp.com</a></b> for instructions on how to turn off restrictions. ]]></string>
<string name="copy_command">Copy</string>
<string name="send_command">Send</string>
<string name="copy_command">Copy command</string>
<string name="send_command">Send command</string>
<string name="auth_allow">Always allow</string>
<string name="auth_deny">Deny</string>
<string name="auth_message"><![CDATA[Allow <b>%1$s</b> use APIs with the identity of <b>%2$s</b>?]]></string>
Expand Down

0 comments on commit 4ed4556

Please sign in to comment.