|
4 | 4 | import android.content.ClipData; |
5 | 5 | import android.content.ClipboardManager; |
6 | 6 | import android.content.Context; |
| 7 | +import android.graphics.Color; |
7 | 8 | import android.os.Bundle; |
| 9 | +import android.view.Gravity; |
| 10 | +import android.view.ViewGroup; |
| 11 | +import android.widget.FrameLayout; |
| 12 | +import android.widget.TextView; |
8 | 13 | import android.widget.Toast; |
9 | 14 |
|
10 | 15 | import com.android.commands.hid.Hid; |
@@ -32,19 +37,18 @@ protected void onCreate(Bundle savedInstanceState) { |
32 | 37 | textView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); |
33 | 38 | setContentView(textView); |
34 | 39 |
|
35 | | - |
| 40 | + |
36 | 41 | File outputDir = getExternalFilesDir(null); |
37 | 42 | boolean success = extractDexFile(outputDir); |
38 | 43 | if (success) { |
39 | | - |
40 | 44 | ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); |
41 | 45 | String cmd = "export CLASSPATH=" + outputDir.getAbsolutePath() + "/classes.dex;app_process /system/bin " + Hid.class.getName(); |
42 | 46 | // 创建剪切板内容 |
43 | 47 | ClipData clip = ClipData.newPlainText("label", cmd); |
44 | 48 |
|
45 | 49 | // 将内容设置到剪切板 |
46 | 50 | clipboard.setPrimaryClip(clip); |
47 | | - Toast.makeText(this, "命令已复制到剪切板:\n"+cmd, Toast.LENGTH_SHORT).show(); |
| 51 | + Toast.makeText(this, "command copied to clipboard:\n"+cmd, Toast.LENGTH_SHORT).show(); |
48 | 52 | } |
49 | 53 | } |
50 | 54 |
|
|
0 commit comments