diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php
index d97811bb791e503052c8a85594d12555772b8920..ca3f2554e5eabacc4f1c145fc5e8693bd43710a5 100644
--- a/apps/files_encryption/appinfo/app.php
+++ b/apps/files_encryption/appinfo/app.php
@@ -22,6 +22,9 @@ if (!OC_Config::getValue('maintenance', false)) {
 	// Filesystem related hooks
 	OCA\Encryption\Helper::registerFilesystemHooks();
 
+	// App manager related hooks
+	OCA\Encryption\Helper::registerAppHooks();
+
 	stream_wrapper_register('crypt', 'OCA\Encryption\Stream');
 
 	// check if we are logged in
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index e39e068cc5d341897c5621a142262c8e8974e767..091539189405be2bc8953d8992953c93cf899b52 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -543,4 +543,17 @@ class Hooks {
 
 		\OC_FileProxy::$enabled = $proxyStatus;
 	}
+
+	/**
+	 * set migration status back to '0' so that all new files get encrypted
+	 * if the app gets enabled again
+	 * @param array $params contains the app ID
+	 */
+	public static function preDisable($params) {
+		if ($params['app'] === 'files_encryption') {
+			$query = \OC_DB::prepare('UPDATE `*PREFIX*encryption` SET `migration_status`=0');
+			$query->execute();
+		}
+	}
+
 }
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php
index a22c139c503cb694f859e5efec633f3f9d8423c5..b2045bfcea830a1868d833f460b10c47f87d659e 100755
--- a/apps/files_encryption/lib/helper.php
+++ b/apps/files_encryption/lib/helper.php
@@ -62,6 +62,15 @@ class Helper {
 		\OCP\Util::connectHook('OC_Filesystem', 'post_rename', 'OCA\Encryption\Hooks', 'postRename');
 	}
 
+	/**
+	 * @brief register filesystem related hooks
+	 *
+	 */
+	public static function registerAppHooks() {
+
+		\OCP\Util::connectHook('OC_App', 'pre_disable', 'OCA\Encryption\Hooks', 'preDisable');
+	}
+
 	/**
 	 * @brief setup user for files_encryption
 	 *
diff --git a/lib/app.php b/lib/app.php
index f974dd9f594d0330f6f48dd6219ab9cd1cf394e4..f9b1c5ca7b55c21c065568ce135d2a6e2fd3f7f9 100644
--- a/lib/app.php
+++ b/lib/app.php
@@ -259,6 +259,7 @@ class OC_App{
 	 */
 	public static function disable( $app ) {
 		// check if app is a shipped app or not. if not delete
+		\OC_Hook::emit('OC_App', 'pre_disable', array('app' => $app));
 		OC_Appconfig::setValue( $app, 'enabled', 'no' );
 
 		// check if app is a shipped app or not. if not delete