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 12:59:59 +03:00 committed by GitHub
parent 7b91b0e938
commit f26815efb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 113 additions and 37 deletions

View file

@ -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);
}
}