From 6378595ca19bc3b4552e937e6715e0e5b2e02245 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Mon, 25 Aug 2014 14:21:21 +0300 Subject: [PATCH] Move to /system/priv-app instead of /system/app when api level >= 19 --- src/ro/ieval/fonbot/FonBotPreferenceActivity.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ro/ieval/fonbot/FonBotPreferenceActivity.java b/src/ro/ieval/fonbot/FonBotPreferenceActivity.java index 89b8682..eae2b0f 100644 --- a/src/ro/ieval/fonbot/FonBotPreferenceActivity.java +++ b/src/ro/ieval/fonbot/FonBotPreferenceActivity.java @@ -106,10 +106,11 @@ public final class FonBotPreferenceActivity extends PreferenceActivity { return true; try { + final String privapp = android.os.Build.VERSION.SDK_INT < 19 ? "app" : "priv-app"; final String remountCommand="mount -o remount,rw /system"; - final String copyToSystemCommand="cp "+info.sourceDir+" /system/app/FonBot.apk"; - final String chmodSystemCommand="chmod 644 /system/app/FonBot.apk"; - final String rmSystemCommand="rm /system/app/FonBot.apk"; + final String copyToSystemCommand="cp "+info.sourceDir+" /system/" + privapp + "/FonBot.apk"; + final String chmodSystemCommand="chmod 644 /system/" + privapp + "/FonBot.apk"; + final String rmSystemCommand="rm /system/" + privapp + "/FonBot.apk"; final String copyToUserCommand="cp "+info.sourceDir+" /data/app/FonBot.apk"; final String chmodUserCommand="chmod 644 /data/app/FonBot.apk"; final String rmUserCommand="rm "+info.sourceDir; -- 2.39.2