fixed apk , fixed method returned string not working fine
- Dominant language
- C++
- Stars
- 7k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
`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 :

Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the report using apkpatch.sh, the shown App patch-loading flow, and MainActivity.sayGoodBye(), comparing the original and patched APKs. Check the generated .apatch and runtime output to determine why the changed returned string is not applied. Done means the patched app reliably displays the updated string.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, kotlin
- Domain
- mobile-dev, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100