Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Move database to /data/system/xprivacy
Browse files Browse the repository at this point in the history
Refs #1437
  • Loading branch information
M66B committed Feb 24, 2014
1 parent e1c4c82 commit 1b993e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Changelog

* Toggle restriction will allow to choose between, clear, restrict and template ([issue](/../../issues/1319))
* Option to select if existing restrictions should be deleted on fetch ([issue](/../../issues/1119))
* Move database to /data/system ([issue](/../../issues/1437))
* Submit restricted functions with a whitelist as an exception ([issue](/../../issues/1438))
* Move database to /data/system/xprivacy ([issue](/../../issues/1437))
* Submit restricted functions with a whitelist as having an exception ([issue](/../../issues/1438))
* Updated Dutch translation
* Updated Italian translation

Expand Down
10 changes: 8 additions & 2 deletions src/biz/bokhorst/xprivacy/PrivacyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ public static void setupDatabase() {
try {
File dbFile = getDbFile();

// Create database folder
dbFile.getParentFile().mkdirs();

// Check database folder
if (dbFile.getParentFile().isDirectory())
Util.log(null, Log.WARN, "Database folder=" + dbFile.getParentFile());
Expand Down Expand Up @@ -112,6 +115,7 @@ public static void setupDatabase() {
// Owner: rwx (system)
// Group: rwx (system)
// World: ---
Util.setPermissions(dbFile.getParentFile().getAbsolutePath(), 0770, Process.SYSTEM_UID, Process.SYSTEM_UID);
File[] files = dbFile.getParentFile().listFiles();
if (files != null)
for (File file : files)
Expand Down Expand Up @@ -220,11 +224,13 @@ public static IPrivacyService getClient() {
}

private static File getDbFile() {
return new File(Environment.getDataDirectory() + File.separator + "system" + File.separator + "xprivacy.db");
return new File(Environment.getDataDirectory() + File.separator + "system" + File.separator + "xprivacy"
+ File.separator + "xprivacy.db");
}

private static File getDbUsageFile() {
return new File(Environment.getDataDirectory() + File.separator + "system" + File.separator + "usage.db");
return new File(Environment.getDataDirectory() + File.separator + "system" + File.separator + "xprivacy"
+ File.separator + "usage.db");
}

public static void reportErrorInternal(String message) {
Expand Down

0 comments on commit 1b993e5

Please sign in to comment.