FastDeploy refactor: 2+GB APK support, optimizations, tests.
- removed 2GB apk size cap,
- removed zip archive parsing on device (1.1M->236K agent size reduction),
- optimized matching entries search,
- added more robust matching entries search based on hash of CDr entry,
- reduced patch size by reusing Local File Header of matched entries,
- removed extra manifest parsing and extra agent calls,
- added device-side tests for agent,
- fix for Windows patch creation.
Test: atest adb_test fastdeploy_test FastDeployTests
Total time for 0-size patch reduction for 1.7G apk: 1m1.778s->0m36.234s.
Change-Id: I66d2cef1adf5b2be3325e355a7e72e9c99992369
diff --git a/fastdeploy/Android.bp b/fastdeploy/Android.bp
index 95e1a28..245d52a 100644
--- a/fastdeploy/Android.bp
+++ b/fastdeploy/Android.bp
@@ -13,15 +13,76 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-java_binary {
- name: "deployagent",
+java_library {
+ name: "deployagent_lib",
sdk_version: "24",
- srcs: ["deployagent/src/**/*.java", "deploylib/src/**/*.java", "proto/**/*.proto"],
- static_libs: ["apkzlib_zip"],
+ srcs: [
+ "deployagent/src/**/*.java",
+ "proto/**/*.proto",
+ ],
proto: {
type: "lite",
},
+}
+
+java_binary {
+ name: "deployagent",
+ static_libs: [
+ "deployagent_lib",
+ ],
dex_preopt: {
enabled: false,
}
-}
\ No newline at end of file
+}
+
+android_test {
+ name: "FastDeployTests",
+
+ manifest: "AndroidManifest.xml",
+
+ srcs: [
+ "deployagent/test/com/android/fastdeploy/ApkArchiveTest.java",
+ ],
+
+ static_libs: [
+ "androidx.test.core",
+ "androidx.test.runner",
+ "androidx.test.rules",
+ "deployagent_lib",
+ "mockito-target-inline-minus-junit4",
+ ],
+
+ libs: [
+ "android.test.runner",
+ "android.test.base",
+ "android.test.mock",
+ ],
+
+ data: [
+ "testdata/sample.apk",
+ "testdata/sample.cd",
+ ],
+
+ optimize: {
+ enabled: false,
+ },
+}
+
+java_test_host {
+ name: "FastDeployHostTests",
+ srcs: [
+ "deployagent/test/com/android/fastdeploy/FastDeployTest.java",
+ ],
+ data: [
+ "testdata/helloworld5.apk",
+ "testdata/helloworld7.apk",
+ ],
+ libs: [
+ "compatibility-host-util",
+ "cts-tradefed",
+ "tradefed",
+ ],
+ test_suites: [
+ "general-tests",
+ ],
+}