Android Modify the Jar package source code and then re-package the Jar package

1. Find the github source code of the framework used by the jar package and download it
. For example: the original jar package.
Insert image description here
Find the github address of the framework source code:
https://github.com/eclipse/paho.mqtt.android

Use git to pull the source code project to the local

2. New Module — Select Java or Kotlin Library to create
the entire project downloaded in (1):
Insert image description here

(2) Find the path content in the java directory under the org.eclipse.paho.client.mqttv3 folder to be packaged , as shown in the figure
org.eclipse.paho.client.mqttv3
Insert image description here
(3) Fill in the path name into the new Java or Kotlin Library In the Package name box below

Insert image description here
3. Put the source code into the module
(1) Copy from the java directory just now
Insert image description here
(2) Paste it into the java directory of the new module
Insert image description here

4. After modifying the source code, package the jar package. The
Insert image description here
packaged jar package is in the build-libs directory under this mudule (the name of the packaged jar package will be consistent with the module name, you can also modify the name of the jar package and then use it) 5
Insert image description here
. Import the jar package using
(1) serve the jar package into your own project
(2) introduce it in build
Insert image description here
6. Completed, Nice!

Guess you like

Origin blog.csdn.net/qq_46269365/article/details/130240074