Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed apk , fixed method returned string not working fine #370

Open
miladev95 opened this issue Mar 6, 2020 · 3 comments
Open

fixed apk , fixed method returned string not working fine #370

miladev95 opened this issue Mar 6, 2020 · 3 comments

Comments

@miladev95
Copy link

miladev95 commented Mar 6, 2020

`public class App extends Application {

private static final String TAG = "test";

private static final String APATCH_PATH = "/out.apatch";
/**
 * patch manager
 */
private PatchManager mPatchManager;

@Override
public void onCreate() {
    super.onCreate();
    // initialize
    mPatchManager = new PatchManager(this);
    mPatchManager.init("1.0");
    Log.d(TAG, "inited.");

    // load patch
    mPatchManager.loadPatch();
    Log.d(TAG, "apatch loaded.");

    // add patch at runtime
    try {
        // .apatch file path
        String patchFileString = Environment.getExternalStorageDirectory()
                .getAbsolutePath()+"/Download" + APATCH_PATH;
        mPatchManager.addPatch(patchFileString);
        Log.d(TAG, "apatch:" + patchFileString + " added.");
    } catch (Exception e) {
        Log.e(TAG, "", e);
        Toast.makeText(getApplicationContext(),"catch : "+e.getMessage(),Toast.LENGTH_LONG).show();
    }

}

}
`

`class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
    main_txt.text = sayGoodBye()
    Toast.makeText(this,sayGoodBye(),Toast.LENGTH_SHORT).show()
}

fun sayGoodBye():String{
    return "hello"
}

}
`

after replacing sayGoodbye function return string with goodbye string and generate apatch file with below command :
bash apkpatch.sh -f app2.apk -t app1.apk -o . -k test.jks -p 123 -a test -e 123
and copy apatch to sdcard/download dirctory the output is :
Screenshot_1583495083

@wangankang
Copy link

wangankang commented Dec 16, 2021 via email

@cugyong
Copy link

cugyong commented Dec 16, 2021 via email

@miladev95
Copy link
Author

miladev95 commented Dec 16, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants