From f89bb6b1bd1a7a7cf4823e183cbb095789ebd110 Mon Sep 17 00:00:00 2001 From: Julian Winkler Date: Mon, 28 Aug 2017 13:54:19 +0200 Subject: [PATCH] DiskUsage: fix 3.8.0 (3080) Build scan5 from source. Add sources of system.jar as aidl files. --- metadata/com.google.android.diskusage.txt | 6 +- .../scan5-recipe.patch | 32 +++++++++ .../system-jar-sources.patch | 68 +++++++++++++++++++ 3 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 metadata/com.google.android.diskusage/scan5-recipe.patch create mode 100644 metadata/com.google.android.diskusage/system-jar-sources.patch diff --git a/metadata/com.google.android.diskusage.txt b/metadata/com.google.android.diskusage.txt index 166f2c6ce0..d5b6a4a0b2 100644 --- a/metadata/com.google.android.diskusage.txt +++ b/metadata/com.google.android.diskusage.txt @@ -78,11 +78,13 @@ Build:3.7.1,3071 build=$$NDK$$/ndk-build Build:3.8.0,3080 - disable=jni commit=471f435ef84b5a3a0c0d5d10d7c2d6ce012fe5a0 subdir=app + patch=scan5-recipe.patch,system-jar-sources.patch gradle=yes - buildjni=yes + rm=jni/scan,app/src/main/assets/scan*,app/src/main/extra/system.jar + scanignore=app/src/main/res/raw/mimes + build=$$NDK$$/ndk-build Maintainer Notes: The system.jar is from AOSP - see extra/system.jar.README and diff --git a/metadata/com.google.android.diskusage/scan5-recipe.patch b/metadata/com.google.android.diskusage/scan5-recipe.patch new file mode 100644 index 0000000000..1edbc3e159 --- /dev/null +++ b/metadata/com.google.android.diskusage/scan5-recipe.patch @@ -0,0 +1,32 @@ +diff --git a/jni/Android.mk b/jni/Android.mk +index d48786c..4f1e2f2 100644 +--- a/jni/Android.mk ++++ b/jni/Android.mk +@@ -13,6 +13,7 @@ + # limitations under the License. + # + LOCAL_PATH := $(call my-dir) ++NDK_APP_DST_DIR := src/main/assets + + include $(CLEAR_VARS) + +@@ -20,3 +21,12 @@ LOCAL_MODULE := scan + LOCAL_SRC_FILES := scan.c + + include $(BUILD_EXECUTABLE) ++ ++include $(CLEAR_VARS) ++ ++LOCAL_MODULE := scan5 ++LOCAL_SRC_FILES := scan.c ++LOCAL_CFLAGS += -fPIE ++LOCAL_LDFLAGS += -fPIE -pie ++ ++include $(BUILD_EXECUTABLE) +diff --git a/jni/Application.mk b/jni/Application.mk +index e69de29..7b5fd9c 100644 +--- a/jni/Application.mk ++++ b/jni/Application.mk +@@ -0,0 +1,2 @@ ++APP_ABI := armeabi ++APP_PIE := false diff --git a/metadata/com.google.android.diskusage/system-jar-sources.patch b/metadata/com.google.android.diskusage/system-jar-sources.patch new file mode 100644 index 0000000000..77ff08b4c5 --- /dev/null +++ b/metadata/com.google.android.diskusage/system-jar-sources.patch @@ -0,0 +1,68 @@ +diff --git a/app/build.gradle b/app/build.gradle +index f21eb15..b336565 100644 +--- a/app/build.gradle ++++ b/app/build.gradle +@@ -19,7 +19,3 @@ android { + } + } + } +- +-dependencies { +- compile files('src/main/extra/system.jar') +-} +diff --git a/app/src/main/aidl/android/content/pm/IPackageStatsObserver.aidl b/app/src/main/aidl/android/content/pm/IPackageStatsObserver.aidl +index e69de29..e282094 100644 +--- a/app/src/main/aidl/android/content/pm/IPackageStatsObserver.aidl ++++ b/app/src/main/aidl/android/content/pm/IPackageStatsObserver.aidl +@@ -0,0 +1,28 @@ ++/* ++** ++** Copyright 2007, 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. ++*/ ++package android.content.pm; ++import android.content.pm.PackageStats; ++/** ++ * API for package data change related callbacks from the Package Manager. ++ * Some usage scenarios include deletion of cache directory, generate ++ * statistics related to code, data, cache usage(TODO) ++ * {@hide} ++ */ ++oneway interface IPackageStatsObserver { ++ ++ void onGetStatsCompleted(in PackageStats pStats, boolean succeeded); ++} +diff --git a/app/src/main/aidl/android/content/pm/PackageStats.aidl b/app/src/main/aidl/android/content/pm/PackageStats.aidl +index e69de29..483a0d1 100644 +--- a/app/src/main/aidl/android/content/pm/PackageStats.aidl ++++ b/app/src/main/aidl/android/content/pm/PackageStats.aidl +@@ -0,0 +1,18 @@ ++/* //device/java/android/android/view/WindowManager.aidl ++** ++** Copyright 2007, 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. ++*/ ++package android.content.pm; ++parcelable PackageStats;