From 30d834dfadd19962219fc4ad99a45105e702b53d Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Fri, 1 Mar 2019 23:37:34 +0530 Subject: [PATCH] Securing Flutter Apps --- android/.project | 17 ++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ android/app/.classpath | 6 +++++ android/app/.project | 23 +++++++++++++++++++ .../org.eclipse.buildship.core.prefs | 2 ++ .../example/flutteruikit/MainActivity.java | 2 ++ .../xcshareddata/IDEWorkspaceChecks.plist | 8 +++++++ ios/Runner/AppDelegate.m | 8 +++++++ 8 files changed, 68 insertions(+) create mode 100644 android/.project create mode 100644 android/.settings/org.eclipse.buildship.core.prefs create mode 100644 android/app/.classpath create mode 100644 android/app/.project create mode 100644 android/app/.settings/org.eclipse.buildship.core.prefs create mode 100644 ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/android/.project b/android/.project new file mode 100644 index 0000000..3964dd3 --- /dev/null +++ b/android/.project @@ -0,0 +1,17 @@ + + + android + Project android created by Buildship. + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.buildship.core.gradleprojectnature + + diff --git a/android/.settings/org.eclipse.buildship.core.prefs b/android/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..e889521 --- /dev/null +++ b/android/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir= +eclipse.preferences.version=1 diff --git a/android/app/.classpath b/android/app/.classpath new file mode 100644 index 0000000..eb19361 --- /dev/null +++ b/android/app/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/android/app/.project b/android/app/.project new file mode 100644 index 0000000..ac485d7 --- /dev/null +++ b/android/app/.project @@ -0,0 +1,23 @@ + + + app + Project app created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + diff --git a/android/app/.settings/org.eclipse.buildship.core.prefs b/android/app/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..b1886ad --- /dev/null +++ b/android/app/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=.. +eclipse.preferences.version=1 diff --git a/android/app/src/main/java/com/example/flutteruikit/MainActivity.java b/android/app/src/main/java/com/example/flutteruikit/MainActivity.java index fae3a68..0701a9c 100644 --- a/android/app/src/main/java/com/example/flutteruikit/MainActivity.java +++ b/android/app/src/main/java/com/example/flutteruikit/MainActivity.java @@ -3,11 +3,13 @@ import android.os.Bundle; import io.flutter.app.FlutterActivity; import io.flutter.plugins.GeneratedPluginRegistrant; +import android.view.WindowManager.LayoutParams; public class MainActivity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GeneratedPluginRegistrant.registerWith(this); + getWindow().addFlags(LayoutParams.FLAG_SECURE); } } diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner/AppDelegate.m b/ios/Runner/AppDelegate.m index 59a72e9..3511a21 100644 --- a/ios/Runner/AppDelegate.m +++ b/ios/Runner/AppDelegate.m @@ -10,4 +10,12 @@ - (BOOL)application:(UIApplication *)application return [super application:application didFinishLaunchingWithOptions:launchOptions]; } +- (void)applicationWillResignActive:(UIApplication *)application{ + self.window.hidden = YES; +} + +- (void)applicationDidBecomeActive:(UIApplication *)application{ + self.window.hidden = NO; +} + @end