CW-351-Add-option-in-Privacy-settings-to-enable-disable-screenshots (#885)

* add prevent screenshots option

* fix prevent screen recording

* update localization

* Update strings_ja.arb
This commit is contained in:
Serhii
2023-04-20 11:59:59 +02:00
committed by GitHub
parent 7b91b0e938
commit f26815efb8
31 changed files with 113 additions and 37 deletions
@@ -24,6 +24,7 @@ import java.security.SecureRandom;
public class MainActivity extends FlutterFragmentActivity {
final String UTILS_CHANNEL = "com.cake_wallet/native_utils";
final int UNSTOPPABLE_DOMAIN_MIN_VERSION_SDK = 24;
boolean isAppSecure = false;
@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
@@ -56,6 +57,14 @@ public class MainActivity extends FlutterFragmentActivity {
handler.post(() -> result.success(""));
}
break;
case "setIsAppSecure":
isAppSecure = call.argument("isAppSecure");
if (isAppSecure) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
} else {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
}
break;
default:
handler.post(() -> result.notImplemented());
}
@@ -80,10 +89,4 @@ public class MainActivity extends FlutterFragmentActivity {
}
});
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
}
}