From c94d2a139535eef69faf58ff3e438ea9e87c3510 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 21 Jun 2016 17:02:40 +0200 Subject: [PATCH 1/3] gitlab-ci: another gradle bit to delete for good caching recommended here, seems like it can't hurt: https://docs.travis-ci.com/user/languages/java/#Caching --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3eb22b6c2..824432f91 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,6 +21,7 @@ test: } # this file changes every time but should not be cached - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock + - rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/ connected10: variables: @@ -69,6 +70,7 @@ connected24: done # this file changes every time but should not be cached - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock + - rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/ - exit $EXITVALUE allow_failure: true # remove once install it runs reliably @@ -78,6 +80,7 @@ pmd: - ./gradlew pmd -PdisablePreDex # this file changes every time but should not be cached - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock + - rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/ checkstyle: script: @@ -85,6 +88,7 @@ checkstyle: - ./gradlew checkstyle -PdisablePreDex # this file changes every time but should not be cached - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock + - rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/ tools: script: From 1192410d87f9bae6f8fee4d5d980f09d3e1f1ad2 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 9 Aug 2016 16:14:10 +0200 Subject: [PATCH 2/3] remove scripts for creating update.zip, moved to priv-ext https://gitlab.com/fdroid/privileged-extension/merge_requests/5 --- app/tools/build-zip | 40 ---------------------------- app/tools/zip-installer | 56 --------------------------------------- app/tools/zip-uninstaller | 38 -------------------------- 3 files changed, 134 deletions(-) delete mode 100755 app/tools/build-zip delete mode 100755 app/tools/zip-installer delete mode 100755 app/tools/zip-uninstaller diff --git a/app/tools/build-zip b/app/tools/build-zip deleted file mode 100755 index 2fe6a1082..000000000 --- a/app/tools/build-zip +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -ex - -# Copyright 2014 Ron Rieve -# -# 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. - -# find the real path to the base of fdroidclient -project_dir=$(cd `echo $0 | sed 's|\(.*\)/.*$|\1|'`/.. && pwd) -cd "$project_dir" - -rm -rf "${project_dir}/bin/zip/" - -for apk in bin/*.apk -do - apk=${apk##*/} - apk=${apk%%\.apk} - rm -f bin/${apk}.zip - mkdir -p bin/zip/${apk} - cp bin/${apk}.apk bin/zip/${apk}/FDroid.apk - mkdir -p bin/zip/${apk}/META-INF/com/google/android - cp tools/zip-installer bin/zip/${apk}/META-INF/com/google/android/update-binary - (cd "${project_dir}/bin/zip/${apk}" && \ - zip -r -X ../../${apk}.zip FDroid.apk META-INF/com/google/android/update-binary) -done - -rm -rf "bin/zip/F-Droid-remove*" -mkdir -p bin/zip/F-Droid-remove/META-INF/com/google/android -cp tools/zip-uninstaller bin/zip/F-Droid-remove/META-INF/com/google/android/update-binary -(cd "${project_dir}/bin/zip/F-Droid-remove" && \ - zip -r -X ../../F-Droid-remove.zip FDroid.apk META-INF/com/google/android/update-binary) diff --git a/app/tools/zip-installer b/app/tools/zip-installer deleted file mode 100755 index 1d288886e..000000000 --- a/app/tools/zip-installer +++ /dev/null @@ -1,56 +0,0 @@ -#!/sbin/sh - -# Copyright 2013 Koushik Dutta, 2014 Ron Rieve -# -# 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. - -# arg 1 is recovery api version, generally 3. -# arg 2 is the pipe fd, to the recovery binary. -# communicate with it using the recovery api. -# arg 3 is the zip file - -echo -n -e 'ui_print Installing F-Droid...\n' > /proc/self/fd/$2 -echo -n -e 'ui_print\n' > /proc/self/fd/$2 - -cd /tmp -mkdir fdroid -cd fdroid -unzip -o "$3" -if [ "$?" -ne "0" ] -then - cp /cache/FDroid.apk . -fi - -mount /system -rm -f /system/app/FDroid.* -rm -f /system/priv-app/FDroid.* - - -# if the system is < 4.4, a system app has to be in /system/app -# if the system is >= 4.4, a privileged (new name for system) app has to be in /system/priv-app -BUILD_RELEASE_VERSION="$(grep 'ro\.build\.version\.release' /system/build.prop)" -VERSION="${BUILD_RELEASE_VERSION##*=}" -MAJ=${VERSION%%.*} -MIN=${VERSION#*.} -MIN=${MIN//.*} - -if [ "${MAJ}${MIN}" -ge 44 ] -then - INSTDIR="/system/priv-app" -else - INSTDIR="/system/app" -fi -cp FDroid.apk ${INSTDIR} -chmod 644 ${INSTDIR}/FDroid.apk - -umount /system diff --git a/app/tools/zip-uninstaller b/app/tools/zip-uninstaller deleted file mode 100755 index 4937659ce..000000000 --- a/app/tools/zip-uninstaller +++ /dev/null @@ -1,38 +0,0 @@ -#!/sbin/sh - -# Copyright 2013 Koushik Dutta, 2014 Ron Rieve -# -# 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. - -# arg 1 is recovery api version, generally 3. -# arg 2 is the pipe fd, to the recovery binary. -# communicate with it using the recovery api. -# arg 3 is the zip file - -echo -n -e 'ui_print Removing system instances of F-Droid...\n' > /proc/self/fd/$2 -echo -n -e 'ui_print\n' > /proc/self/fd/$2 - -cd /tmp -mkdir fdroid -cd fdroid -unzip -o "$3" -if [ "$?" -ne "0" ] -then - cp /cache/FDroid.apk . -fi - -mount /system -rm -f /system/app/FDroid.* -rm -f /system/priv-app/FDroid.* - -umount /system From 7afee40d8f72cadc3de53f133126e69acd70a8d2 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 12 Aug 2016 11:28:36 +0200 Subject: [PATCH 3/3] standardize priv-app install name as FDroidPrivilegedExtension This syncs up the name the root install method uses with what is used by the ROM integration and update.zip. It also uses the full name for consistency, with non-alpha and spaces removed following priv-app naming conventions. https://gitlab.com/fdroid/privileged-extension/merge_requests/3 https://gitlab.com/fdroid/privileged-extension/merge_requests/5 --- .../fdroid/fdroid/privileged/install/InstallExtension.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/fdroid/fdroid/privileged/install/InstallExtension.java b/app/src/main/java/org/fdroid/fdroid/privileged/install/InstallExtension.java index 3ea179fec..773dc738a 100644 --- a/app/src/main/java/org/fdroid/fdroid/privileged/install/InstallExtension.java +++ b/app/src/main/java/org/fdroid/fdroid/privileged/install/InstallExtension.java @@ -41,7 +41,8 @@ abstract class InstallExtension { final Context context; - private static final String APK_FILE_NAME = "FDroidPrivileged.apk"; + private static final String BASE_NAME = "FDroidPrivilegedExtension"; + private static final String APK_FILE_NAME = BASE_NAME + ".apk"; InstallExtension(final Context context) { this.context = context; @@ -191,7 +192,7 @@ abstract class InstallExtension { */ @Override protected String getSystemFolder() { - return FDroidApp.SYSTEM_DIR_NAME + "/priv-app/FDroidPrivileged/"; + return FDroidApp.SYSTEM_DIR_NAME + "/priv-app/" + BASE_NAME + "/"; } /**