Skip to content

Commit 1c27c8a

Browse files
committed
implement plateform adaptability
1 parent ed55c4d commit 1c27c8a

File tree

19 files changed

+651
-407
lines changed

19 files changed

+651
-407
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
## Getting started
22

33
Coming soon
4+
5+
6+
7+
<!-- Android displays the "cleartext HTTP traffic not permitted" error because it defaults to preventing apps from using unencrypted, cleartext HTTP connections, especially for apps targeting API level 28 or higher. This is a security measure to protect sensitive data from being intercepted.
8+
Here's a more detailed explanation:
9+
Security:
10+
Android prioritizes data security by default. Using HTTP (which is not encrypted) can expose data to eavesdropping, especially over public Wi-Fi networks.
11+
API Level 28 and Above:
12+
Apps targeting API level 28 or higher (Android 9 Pie and later) are automatically configured to disallow cleartext traffic.
13+
Using usesCleartextTraffic:
14+
If your app needs to use cleartext HTTP, you can enable it by adding the android:usesCleartextTraffic="true" attribute to the <application> tag in your AndroidManifest.xml file, or by explicitly configuring it in a network_security_config.xml file.
15+
Alternatives:
16+
Whenever possible, it's recommended to use HTTPS, which encrypts the communication and provides a secure channe -->

example/android/app/src/main/AndroidManifest.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
<uses-permission android:name="android.permission.INTERNET"/>
4+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
25
<application
3-
android:label="example"
6+
android:label="flutter_on_rails_example"
47
android:name="${applicationName}"
5-
android:icon="@mipmap/ic_launcher">
8+
android:icon="@mipmap/ic_launcher"
9+
android:usesCleartextTraffic="true">
610
<activity
711
android:name=".MainActivity"
812
android:exported="true"
@@ -42,4 +46,4 @@
4246
<data android:mimeType="text/plain"/>
4347
</intent>
4448
</queries>
45-
</manifest>
49+
</manifest>

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 63 additions & 63 deletions
Large diffs are not rendered by default.

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import 'package:flutter_on_rails/flutter_on_rails.dart';
44
void main() async {
55
WidgetsFlutterBinding.ensureInitialized();
66
await init();
7-
runApp(MaterialApp(home: MainScreen()));
7+
runApp(MaterialApp(home: MainScreen(url: "http://172.20.10.12:3000")));
88
}

example/macos/Podfile.lock

Lines changed: 0 additions & 42 deletions
This file was deleted.

example/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 1 addition & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
2828
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
2929
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
30-
4A2E5A30A89F6782FE592F29 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EFE6E7120BF670463F4C310 /* Pods_RunnerTests.framework */; };
31-
7BD8FF71BFFBBF6E06728D69 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0878F6ACD03EB463ED2A9ED1 /* Pods_Runner.framework */; };
3230
/* End PBXBuildFile section */
3331

3432
/* Begin PBXContainerItemProxy section */
@@ -62,16 +60,11 @@
6260
/* End PBXCopyFilesBuildPhase section */
6361

6462
/* Begin PBXFileReference section */
65-
0878F6ACD03EB463ED2A9ED1 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
66-
0FFD5F4F10241ABB672D800F /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
67-
1EFE6E7120BF670463F4C310 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
68-
22DE15387ECE38D523753E7F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
69-
2330EB693A95D9CEC3524F9D /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
7063
331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
7164
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
7265
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
7366
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
74-
33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; };
67+
33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
7568
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7669
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
7770
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
@@ -83,10 +76,7 @@
8376
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
8477
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
8578
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
86-
3C22237ADDA5C5D5793227E5 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
87-
57F2A5314E39EA689B20B2A3 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
8879
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
89-
93D8414221BAD35034550489 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
9080
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
9181
/* End PBXFileReference section */
9282

@@ -95,35 +85,19 @@
9585
isa = PBXFrameworksBuildPhase;
9686
buildActionMask = 2147483647;
9787
files = (
98-
4A2E5A30A89F6782FE592F29 /* Pods_RunnerTests.framework in Frameworks */,
9988
);
10089
runOnlyForDeploymentPostprocessing = 0;
10190
};
10291
33CC10EA2044A3C60003C045 /* Frameworks */ = {
10392
isa = PBXFrameworksBuildPhase;
10493
buildActionMask = 2147483647;
10594
files = (
106-
7BD8FF71BFFBBF6E06728D69 /* Pods_Runner.framework in Frameworks */,
10795
);
10896
runOnlyForDeploymentPostprocessing = 0;
10997
};
11098
/* End PBXFrameworksBuildPhase section */
11199

112100
/* Begin PBXGroup section */
113-
3053978D6DBA75E49449C69F /* Pods */ = {
114-
isa = PBXGroup;
115-
children = (
116-
22DE15387ECE38D523753E7F /* Pods-Runner.debug.xcconfig */,
117-
93D8414221BAD35034550489 /* Pods-Runner.release.xcconfig */,
118-
57F2A5314E39EA689B20B2A3 /* Pods-Runner.profile.xcconfig */,
119-
0FFD5F4F10241ABB672D800F /* Pods-RunnerTests.debug.xcconfig */,
120-
2330EB693A95D9CEC3524F9D /* Pods-RunnerTests.release.xcconfig */,
121-
3C22237ADDA5C5D5793227E5 /* Pods-RunnerTests.profile.xcconfig */,
122-
);
123-
name = Pods;
124-
path = Pods;
125-
sourceTree = "<group>";
126-
};
127101
331C80D6294CF71000263BE5 /* RunnerTests */ = {
128102
isa = PBXGroup;
129103
children = (
@@ -151,7 +125,6 @@
151125
331C80D6294CF71000263BE5 /* RunnerTests */,
152126
33CC10EE2044A3C60003C045 /* Products */,
153127
D73912EC22F37F3D000D13A0 /* Frameworks */,
154-
3053978D6DBA75E49449C69F /* Pods */,
155128
);
156129
sourceTree = "<group>";
157130
};
@@ -202,8 +175,6 @@
202175
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
203176
isa = PBXGroup;
204177
children = (
205-
0878F6ACD03EB463ED2A9ED1 /* Pods_Runner.framework */,
206-
1EFE6E7120BF670463F4C310 /* Pods_RunnerTests.framework */,
207178
);
208179
name = Frameworks;
209180
sourceTree = "<group>";
@@ -215,7 +186,6 @@
215186
isa = PBXNativeTarget;
216187
buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
217188
buildPhases = (
218-
754DC94F152DA8CE2482187C /* [CP] Check Pods Manifest.lock */,
219189
331C80D1294CF70F00263BE5 /* Sources */,
220190
331C80D2294CF70F00263BE5 /* Frameworks */,
221191
331C80D3294CF70F00263BE5 /* Resources */,
@@ -234,13 +204,11 @@
234204
isa = PBXNativeTarget;
235205
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
236206
buildPhases = (
237-
AD43078C880C329ACB953DB9 /* [CP] Check Pods Manifest.lock */,
238207
33CC10E92044A3C60003C045 /* Sources */,
239208
33CC10EA2044A3C60003C045 /* Frameworks */,
240209
33CC10EB2044A3C60003C045 /* Resources */,
241210
33CC110E2044A8840003C045 /* Bundle Framework */,
242211
3399D490228B24CF009A79C7 /* ShellScript */,
243-
5FF012F422D6021A55C3DA8A /* [CP] Embed Pods Frameworks */,
244212
);
245213
buildRules = (
246214
);
@@ -361,67 +329,6 @@
361329
shellPath = /bin/sh;
362330
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
363331
};
364-
5FF012F422D6021A55C3DA8A /* [CP] Embed Pods Frameworks */ = {
365-
isa = PBXShellScriptBuildPhase;
366-
buildActionMask = 2147483647;
367-
files = (
368-
);
369-
inputFileListPaths = (
370-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
371-
);
372-
name = "[CP] Embed Pods Frameworks";
373-
outputFileListPaths = (
374-
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
375-
);
376-
runOnlyForDeploymentPostprocessing = 0;
377-
shellPath = /bin/sh;
378-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
379-
showEnvVarsInLog = 0;
380-
};
381-
754DC94F152DA8CE2482187C /* [CP] Check Pods Manifest.lock */ = {
382-
isa = PBXShellScriptBuildPhase;
383-
buildActionMask = 2147483647;
384-
files = (
385-
);
386-
inputFileListPaths = (
387-
);
388-
inputPaths = (
389-
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
390-
"${PODS_ROOT}/Manifest.lock",
391-
);
392-
name = "[CP] Check Pods Manifest.lock";
393-
outputFileListPaths = (
394-
);
395-
outputPaths = (
396-
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
397-
);
398-
runOnlyForDeploymentPostprocessing = 0;
399-
shellPath = /bin/sh;
400-
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
401-
showEnvVarsInLog = 0;
402-
};
403-
AD43078C880C329ACB953DB9 /* [CP] Check Pods Manifest.lock */ = {
404-
isa = PBXShellScriptBuildPhase;
405-
buildActionMask = 2147483647;
406-
files = (
407-
);
408-
inputFileListPaths = (
409-
);
410-
inputPaths = (
411-
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
412-
"${PODS_ROOT}/Manifest.lock",
413-
);
414-
name = "[CP] Check Pods Manifest.lock";
415-
outputFileListPaths = (
416-
);
417-
outputPaths = (
418-
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
419-
);
420-
runOnlyForDeploymentPostprocessing = 0;
421-
shellPath = /bin/sh;
422-
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
423-
showEnvVarsInLog = 0;
424-
};
425332
/* End PBXShellScriptBuildPhase section */
426333

427334
/* Begin PBXSourcesBuildPhase section */
@@ -473,7 +380,6 @@
473380
/* Begin XCBuildConfiguration section */
474381
331C80DB294CF71000263BE5 /* Debug */ = {
475382
isa = XCBuildConfiguration;
476-
baseConfigurationReference = 0FFD5F4F10241ABB672D800F /* Pods-RunnerTests.debug.xcconfig */;
477383
buildSettings = {
478384
BUNDLE_LOADER = "$(TEST_HOST)";
479385
CURRENT_PROJECT_VERSION = 1;
@@ -488,7 +394,6 @@
488394
};
489395
331C80DC294CF71000263BE5 /* Release */ = {
490396
isa = XCBuildConfiguration;
491-
baseConfigurationReference = 2330EB693A95D9CEC3524F9D /* Pods-RunnerTests.release.xcconfig */;
492397
buildSettings = {
493398
BUNDLE_LOADER = "$(TEST_HOST)";
494399
CURRENT_PROJECT_VERSION = 1;
@@ -503,7 +408,6 @@
503408
};
504409
331C80DD294CF71000263BE5 /* Profile */ = {
505410
isa = XCBuildConfiguration;
506-
baseConfigurationReference = 3C22237ADDA5C5D5793227E5 /* Pods-RunnerTests.profile.xcconfig */;
507411
buildSettings = {
508412
BUNDLE_LOADER = "$(TEST_HOST)";
509413
CURRENT_PROJECT_VERSION = 1;

example/macos/Runner.xcworkspace/contents.xcworkspacedata

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)