Android SDK for greedpatch
Maven:
<dependency>
<groupId>com.greedlab</groupId>
<artifactId>greedpatch-android</artifactId>
<version>1.0</version>
</dependency>
or Gradle:
compile 'com.greedlab:greedpatch-android:1.0'
Use other library to generate patch, eg: tinker
greedpatch > select the project > click Create patch
> upload zip file rom the last step, click Upload > select the project version
, input the hash from the last step > Create
config greedpatch like
// config access token
Greedpatch.getInstance(this).token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE0NzM2NDg2MzA0ODgsImlkIjoiNTdkM2JmMmY5MDE1ZWU0N2ZjYzNjYWJhIiwic2NvcGUiOiJwYXRjaDpjaGVjayJ9.YPedieEibUgLecWDmuIVIdkY_Ra-4Qa2HeIQpE7Z_k8";
// config project ID
Greedpatch.getInstance(this).projectId = "57e0db7108e1483add770ad1";
visit Generate new token to generate it.
greedpatch > Create project
> Project Detail
. And then you can see Project ID
// request at the end of this method
Greedpatch.getInstance(this).requestPatch(this);
request remote server whether there are a new patch for current project version.
Use other library to patch, eg: tinker
public class MyApplication extends Application {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
File file = Greedpatch.getInstance(this).getPatchFile(this);
if (file != null && file.exists()) {
Log.d("greedpatch", "start local patch");
// Use other library to patch, eg: [RocooFix](https://github.com/dodola/RocooFix)
} else {
Log.d("greedpatch", "no local patch");
}
}
}