diff --git a/Emoji Switcher/build.gradle b/Emoji Switcher/build.gradle index 02be4fd..e3a28a0 100644 --- a/Emoji Switcher/build.gradle +++ b/Emoji Switcher/build.gradle @@ -1,15 +1,15 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 23 - buildToolsVersion '23.0.3' + compileSdkVersion 25 + buildToolsVersion '24.0.2' defaultConfig { applicationId 'com.stevenschoen.emojiswitcher' minSdkVersion 19 - targetSdkVersion 23 - versionCode 19 - versionName "2.1" + targetSdkVersion 25 + versionCode 20 + versionName "2.1.1" } compileOptions { @@ -19,15 +19,15 @@ android { } dependencies { - compile 'com.google.android.gms:play-services-ads:9.0.2' + compile 'com.google.android.gms:play-services-ads:9.8.0' compile 'commons-io:commons-io:2.5' compile 'com.google.guava:guava:19.0' compile 'io.reactivex:rxandroid:1.2.0' - compile 'com.trello:rxlifecycle:0.6.1' - compile 'com.trello:rxlifecycle-components:0.6.1' + compile 'com.trello:rxlifecycle:0.8.0' + compile 'com.trello:rxlifecycle-components:0.8.0' compile files('libs/RootTools-4.2.jar') - compile 'com.android.support:appcompat-v7:23.4.0' - compile 'com.android.support:recyclerview-v7:23.4.0' + compile 'com.android.support:appcompat-v7:25.0.0' + compile 'com.android.support:recyclerview-v7:25.0.0' compile 'com.yqritc:recyclerview-flexibledivider:1.2.9' compile 'org.solovyev.android.views:linear-layout-manager:0.5@aar' compile 'com.squareup.retrofit:retrofit:1.9.0' diff --git a/Emoji Switcher/src/main/java/com/stevenschoen/emojiswitcher/EmojiSwitcherUtils.java b/Emoji Switcher/src/main/java/com/stevenschoen/emojiswitcher/EmojiSwitcherUtils.java index a914bef..4542d06 100644 --- a/Emoji Switcher/src/main/java/com/stevenschoen/emojiswitcher/EmojiSwitcherUtils.java +++ b/Emoji Switcher/src/main/java/com/stevenschoen/emojiswitcher/EmojiSwitcherUtils.java @@ -127,6 +127,11 @@ public void onNext(Boolean ready) { File backupFile = new File(systemEmojiBackupFilePath(context)); RootTools.copyFile(systemEmojiSetFile.getAbsolutePath(), backupFile.getAbsolutePath(), true, false); + try { + fixSELinuxContextIfNeeded(backupFile.getAbsolutePath()); + } catch (IOException | TimeoutException | RootDeniedException e) { + e.printStackTrace(); + } } InstallProgress progress = new InstallProgress(); @@ -303,8 +308,21 @@ public static String filePath(Context context, EmojiSetListing listing) { public static void applyPermissions(String permissions, String path) throws TimeoutException, RootDeniedException, IOException { RootTools.remount(path, "RW"); Shell shell = RootTools.getShell(true); - Command commandPermission = new Command(0, "chmod " + permissions + " " + path); - shell.add(commandPermission); + shell.add(new Command(0, "chmod " + permissions + " " + path)); + shell.close(); + } + + public static void fixSELinuxContextIfNeeded(final String path) throws IOException, TimeoutException, RootDeniedException { + Shell shell = RootTools.getShell(true); + if (shell.isSELinuxEnforcing()) { + shell.add(new Command(0, "restorecon " + path)); + // TODO Why doesn't sleep work in shell? + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } shell.close(); } @@ -336,6 +354,7 @@ public void call(Subscriber subscriber) { RootTools.copyFile(getSystemFontFilePath(), emojiSetDestinationFile.getAbsolutePath(), true, false); try { applyPermissions("777", emojiSetDestinationFile.getAbsolutePath()); + fixSELinuxContextIfNeeded(emojiSetDestinationFile.getAbsolutePath()); } catch (Exception e) { subscriber.onError(e); } diff --git a/Emoji Switcher/src/main/java/com/stevenschoen/emojiswitcher/SwitcherActivity.java b/Emoji Switcher/src/main/java/com/stevenschoen/emojiswitcher/SwitcherActivity.java index 3e3b24e..52c764d 100644 --- a/Emoji Switcher/src/main/java/com/stevenschoen/emojiswitcher/SwitcherActivity.java +++ b/Emoji Switcher/src/main/java/com/stevenschoen/emojiswitcher/SwitcherActivity.java @@ -21,6 +21,8 @@ import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdSize; import com.google.android.gms.ads.AdView; +import com.stericson.RootShell.RootShell; +import com.stericson.RootTools.RootTools; import com.stevenschoen.emojiswitcher.billing.IabHelper; import com.stevenschoen.emojiswitcher.billing.IabResult; import com.stevenschoen.emojiswitcher.billing.Inventory; @@ -54,6 +56,11 @@ public class SwitcherActivity extends RxAppCompatActivity implements InstallEmoj protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + if (BuildConfig.DEBUG) { + RootTools.debugMode = true; + RootShell.debugMode = true; + } + ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); if (cm.getActiveNetworkInfo() == null || !cm.getActiveNetworkInfo().isConnected()) { Toast.makeText(this, "This app needs internet access to work.", Toast.LENGTH_LONG).show(); diff --git a/Emoji Switcher/src/main/res/values-it/strings.xml b/Emoji Switcher/src/main/res/values-it/strings.xml index b12f5a8..9a13222 100644 --- a/Emoji Switcher/src/main/res/values-it/strings.xml +++ b/Emoji Switcher/src/main/res/values-it/strings.xml @@ -14,7 +14,7 @@ It\'s a different process for each device.\n\nDoes this app have root permission Impossibile ottenere root! Passa a emoji… Emoji impostate - Font originali di gonsa da XDA. App di Steven Schoen. + App di Steven Schoen. Riavvio? Ripristina predefinito Gestione download diff --git a/Emoji Switcher/src/main/res/values/strings.xml b/Emoji Switcher/src/main/res/values/strings.xml index 9c3076b..cad5231 100644 --- a/Emoji Switcher/src/main/res/values/strings.xml +++ b/Emoji Switcher/src/main/res/values/strings.xml @@ -15,7 +15,7 @@ It\'s a different process for each device.\n\nDoes this app have root permission Failed to get root! Switch emojis to… Set emojis to - Original fonts by gonsa from XDA. App by Steven Schoen. + App by Steven Schoen. Reboot? Restore default Manage downloads diff --git a/Emoji Switcher/src/main/res/values/styles.xml b/Emoji Switcher/src/main/res/values/styles.xml index 5478896..30c84fe 100644 --- a/Emoji Switcher/src/main/res/values/styles.xml +++ b/Emoji Switcher/src/main/res/values/styles.xml @@ -7,6 +7,7 @@ @color/emojiswitcher_orange_faded2 @drawable/gradient_orange + true @style/EmojiSwitcher.AutoScaleTextView @style/EmojiSwitcher.ActionBar @style/EmojiSwitcher.AlertDialog diff --git a/build.gradle b/build.gradle index c92ec9e..9813ca9 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - classpath 'com.github.ben-manes:gradle-versions-plugin:0.12.0' + classpath 'com.android.tools.build:gradle:2.2.2' + classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.0' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index dab2163..367f744 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Apr 12 23:25:35 EDT 2015 +#Tue Sep 20 17:50:48 EDT 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip