Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

若有一个activity类需要修复,尝试dx打包之后不可以使用 #20

@cby0310

Description

@cby0310

若有一个activity类需要修复,尝试dx打包之后修复的代码(模拟修复了按钮点击事件中为btn设置的文本和toast的文本)无效,并且反编译之后的代码和 apk原来的代码反编译只有有很大差异,为什么?大家遇到过吗?
dx手工打包反编译得:
package dodola.hotfix;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;

public class LoginActivity extends Activity
{
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
setContentView(2130968601);
Button localButton = (Button)findViewById(2131492975);
LoginActivity.1 local1 = new LoginActivity.1(this, localButton);
localButton.setOnClickListener(local1);
}
}

apk反编译得:

package dodola.hotfix;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class LoginActivity extends Activity {
public LoginActivity() {
}

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.setContentView(2130968601);
    final Button btn = (Button)this.findViewById(2131492975);
    btn.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            btn.setText("ddddddd   rr");
            Toast.makeText(LoginActivity.this, "111   rr", 1).show();
        }
    });
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions