Skip to content

Commit

Permalink
Fix for Nougat remounting (SELinux-related)
Browse files Browse the repository at this point in the history
  • Loading branch information
DSteve595 committed Oct 25, 2016
1 parent 111b467 commit 0c6c0ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Emoji Switcher/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId 'com.stevenschoen.emojiswitcher'
minSdkVersion 19
targetSdkVersion 25
versionCode 20
versionName "2.1.1"
versionCode 21
versionName "2.1.2"
}

compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,13 @@ 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);
shell.add(new Command(0, "chmod " + permissions + " " + path));
if (shell.isSELinuxEnforcing()) {
shell.add(new Command(0, "mount -o rw,remount /system"));
} else {
RootTools.remount(path, "RW");
}
shell.add(new Command(1, "chmod " + permissions + " " + path));
shell.close();
}

Expand Down

0 comments on commit 0c6c0ae

Please sign in to comment.