简书链接:关于AndroidStudio4以上版本不能attach和项目模块包名不一样的应用问题逆向研究报告
文章字数:396,阅读全文大约需要1分钟
image.png

image.png

研究的结果是失败的,虽然找到了一些痕迹。
在搜字符串的时候搜到了一点和这相关的东西。
![image.png][C6YZ83B%BP%FMXMI`KH8A.png](https://upload-images.jianshu.io/upload_images/2815884-4a1ae45059918771.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

image.png

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
   */
public class AndroidProcessChooserDialog extends DialogWrapper {
static final /* synthetic */ boolean $assertionsDisabled = (!AndroidProcessChooserDialog.class.desiredAssertionStatus());
@NonNls
private static final String DEBUGGABLE_DEVICE_PROPERTY = "DEBUGGABLE_DEVICE";
@NonNls
private static final String DEBUGGABLE_PROCESS_PROPERTY = "DEBUGGABLE_PROCESS";
@NonNls
private static final String DEBUGGER_ID_PROPERTY = "DEBUGGER_ID";
@NonNls
private static final String SHOW_ALL_PROCESSES_PROPERTY = "SHOW_ALL_PROCESSES";
private final MyProcessTreeCellRenderer myCellRenderer;
private final AndroidDebugBridge.IClientChangeListener myClientChangeListener;
private JPanel myContentPanel;
private JLabel myDebuggerLabel;
private JComboBox<RunConfiguration> myDebuggerRunConfigCombo;
private JLabel myDebuggerRunConfigLabel;
private JComboBox<AndroidDebugger> myDebuggerTypeCombo;
private final AndroidDebugBridge.IDeviceChangeListener myDeviceChangeListener;
private String myLastSelectedDevice;
private String myLastSelectedProcess;
private Tree myProcessTree;
private final Project myProject;
private AndroidDebugger mySelectedAndroidDebugger;
private Client mySelectedClient;
private RunConfiguration mySelectedRunConfiguration;
private JBCheckBox myShowAllProcessesCheckBox;
private final boolean myShowDebuggerSelection;
private final MergingUpdateQueue myUpdatesQueue = new MergingUpdateQueue("AndroidProcessChooserDialogUpdatingQueue", (int) LayerSpacingSliderActionKt.MAX_LAYER_SPACING, true, MergingUpdateQueue.ANY_COMPONENT, getDisposable());

private /* synthetic */ void $$$setupUI$$$() {
JPanel jPanel = new JPanel();
this.myContentPanel = jPanel;
jPanel.setLayout(new GridLayoutManager(5, 2, new Insets(0, 0, 0, 0), -1, -1, false, false));
JBLabel jBLabel = new JBLabel();
jBLabel.setText("Select a process to attach to:");
jBLabel.setDisplayedMnemonic('S');
jBLabel.setDisplayedMnemonicIndex(0);
jPanel.add(jBLabel, new GridConstraints(0, 0, 1, 2, 8, 0, 0, 0, (Dimension) null, (Dimension) null, (Dimension) null));
JBScrollPane jBScrollPane = new JBScrollPane();
jPanel.add(jBScrollPane, new GridConstraints(4, 0, 1, 2, 0, 3, 3, 3, (Dimension) null, new Dimension(250, 300), (Dimension) null));
Tree tree = new Tree();
this.myProcessTree = tree;
tree.setRootVisible(false);
tree.setShowsRootHandles(true);
jBScrollPane.setViewportView(tree);
JBCheckBox jBCheckBox = new JBCheckBox();
this.myShowAllProcessesCheckBox = jBCheckBox;
jBCheckBox.setText("Show all processes");
jBCheckBox.setMnemonic('A');
jBCheckBox.setDisplayedMnemonicIndex(5);
jPanel.add(jBCheckBox, new GridConstraints(1, 0, 1, 2, 8, 0, 0, 0, (Dimension) null, (Dimension) null, (Dimension) null));
JLabel jLabel = new JLabel();
this.myDebuggerRunConfigLabel = jLabel;
jLabel.setText("Use Android Debugger Settings from:");
jPanel.add(jLabel, new GridConstraints(2, 0, 1, 1, 8, 0, 0, 0, (Dimension) null, (Dimension) null, (Dimension) null));
JComboBox<RunConfiguration> jComboBox = new JComboBox<>();
this.myDebuggerRunConfigCombo = jComboBox;
jPanel.add(jComboBox, new GridConstraints(2, 1, 1, 1, 8, 1, 2, 0, (Dimension) null, (Dimension) null, (Dimension) null));
JLabel jLabel2 = new JLabel();
this.myDebuggerLabel = jLabel2;
jLabel2.setText("Debug Type:");
jPanel.add(jLabel2, new GridConstraints(3, 0, 1, 1, 8, 0, 0, 0, (Dimension) null, (Dimension) null, (Dimension) null));
JComboBox<AndroidDebugger> jComboBox2 = new JComboBox<>();
this.myDebuggerTypeCombo = jComboBox2;
jComboBox2.setEnabled(true);
jPanel.add(jComboBox2, new GridConstraints(3, 1, 1, 1, 8, 1, 2, 0, (Dimension) null, (Dimension) null, (Dimension) null));
jBLabel.setLabelFor(jBScrollPane);
jLabel2.setLabelFor(jComboBox2);
}

public /* synthetic */ JComponent $$$getRootComponent$$$() {
return this.myContentPanel;
}

目前找不到什么方法,我不会hook window的java字符串之类的东西,接下来靠各位分析了,我目前只研究到这个类,这个类在.gradle里面的一个 android.jar里面。