Revert "Replace a shell script with a java_library"

This reverts commit 6fa6b8755fc8d9a7b78e04a0a371c04c047e0f20.

Reason for revert: <Build failed>

Change-Id: I634fbb7170f1f07ad974473323e79f45175fb29f
diff --git a/hostsidetests/security/app/Android.bp b/hostsidetests/security/app/Android.bp
index 80dcc97..41e2346 100644
--- a/hostsidetests/security/app/Android.bp
+++ b/hostsidetests/security/app/Android.bp
@@ -38,18 +38,5 @@
         "vts",
         "general-tests",
     ],
-    java_resources: [":zip_validation_test_jar_named_test"],
-}
-
-java_library {
-    name: "zip_validation_test_jar",
-    java_resource_dirs: ["test-jar"],
-}
-
-// temporary genrule to rename the output jar file until b/285843207 is fixed
-java_genrule {
-    name: "zip_validation_test_jar_named_test",
-    srcs: [":zip_validation_test_jar"],
-    out: ["test.jar"],
-    cmd: "mv $(in) $(out)",
+    java_resource_dirs: ["resources/"],
 }
diff --git a/hostsidetests/security/app/etc/test-jar/README.txt b/hostsidetests/security/app/etc/test-jar/README.txt
new file mode 100644
index 0000000..77df49e
--- /dev/null
+++ b/hostsidetests/security/app/etc/test-jar/README.txt
@@ -0,0 +1,8 @@
+This directory contains the source code for the test jar required for
+ZipPathValidatorTest#
+loadingApksWillNotCallZipPathValidator_changeEnabledOrDisabled.
+
+The Android build system doesn't support dynamically producing
+resources in any practical way. To update the resource, use the script
+build.sh in this directory, which copies the resulting file into the
+test resources directory.
diff --git a/hostsidetests/security/app/etc/test-jar/build.sh b/hostsidetests/security/app/etc/test-jar/build.sh
new file mode 100755
index 0000000..030b8b1
--- /dev/null
+++ b/hostsidetests/security/app/etc/test-jar/build.sh
@@ -0,0 +1,20 @@
+#!/bin/bash -e
+#
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+resourceDir=../../resources
+jar cf test.jar -C resources .
+mkdir -p ${resourceDir}
+mv test.jar ${resourceDir}
diff --git a/hostsidetests/security/app/test-jar/test/resource.txt b/hostsidetests/security/app/etc/test-jar/resources/test/resource.txt
similarity index 100%
rename from hostsidetests/security/app/test-jar/test/resource.txt
rename to hostsidetests/security/app/etc/test-jar/resources/test/resource.txt
diff --git a/hostsidetests/security/app/resources/test.jar b/hostsidetests/security/app/resources/test.jar
new file mode 100644
index 0000000..abffee2
--- /dev/null
+++ b/hostsidetests/security/app/resources/test.jar
Binary files differ