Skip to content

Commit f39f21d

Browse files
committed
删除App Store审查限制4.2.7a。
1 parent 564ca9a commit f39f21d

File tree

3 files changed

+2
-120
lines changed

3 files changed

+2
-120
lines changed

Limelight/Network/AppListResponse.m

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -112,42 +112,6 @@ - (void) parseData {
112112
}
113113

114114
xmlFreeDoc(docPtr);
115-
116-
#ifdef ENABLE_APP_STORE_RESTRICTIONS
117-
// APP STORE REVIEW COMPLIANCE
118-
//
119-
// Remove default Steam entry from the app list to comply with Apple App Store Guideline 4.2.7d:
120-
//
121-
// The UI appearing on the client does not resemble an iOS or App Store view, does not provide a store-like interface,
122-
// or include the ability to browse, select, or purchase software not already owned or licensed by the user.
123-
//
124-
// However, if the user manually adds Steam themselves, then we will display it.
125-
TemporaryApp* officialSteamApp = nil;
126-
TemporaryApp* manuallyAddedSteamApp = nil;
127-
for (TemporaryApp* app in _appList) {
128-
if (app.installPath != nil && [[app.installPath lowercaseString] hasSuffix:@"\\steam\\"]) {
129-
// The official Steam app is marked as HDR supported, while manually added ones are not.
130-
if ([app.name isEqualToString:@"Steam"] && app.hdrSupported) {
131-
officialSteamApp = app;
132-
}
133-
else {
134-
manuallyAddedSteamApp = app;
135-
}
136-
}
137-
}
138-
139-
// To be safe, don't do anything if we didn't find an HDR-enabled Steam app.
140-
if (officialSteamApp != nil) {
141-
// If we didn't find a manually added Steam app, remove the official one to
142-
// comply with the App Store guidelines.
143-
if (manuallyAddedSteamApp == nil) {
144-
[_appList removeObject:officialSteamApp];
145-
}
146-
else {
147-
[_appList removeObject:manuallyAddedSteamApp];
148-
}
149-
}
150-
#endif
151115
}
152116

153117
- (NSSet*) getAppList {

Limelight/Network/DiscoveryManager.m

Lines changed: 2 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -81,44 +81,6 @@ + (BOOL) isAddressLAN:(in_addr_t)addr {
8181
return NO;
8282
}
8383

84-
// This ensures that only RFC 1918 IPv4 addresses can be passed to
85-
// the Add PC dialog. This is required to comply with Apple App Store
86-
// Guideline 4.2.7a.
87-
+ (BOOL) isProhibitedAddress:(NSString*)address {
88-
#ifdef ENABLE_APP_STORE_RESTRICTIONS
89-
struct addrinfo hints;
90-
struct addrinfo* result;
91-
int err;
92-
93-
// We're explicitly using AF_INET here because we don't want to
94-
// ever receive a synthesized IPv6 address here, even on NAT64.
95-
// IPv6 addresses are not restricted here because we cannot easily
96-
// tell whether they are local or not.
97-
memset(&hints, 0, sizeof(hints));
98-
hints.ai_family = AF_INET;
99-
err = getaddrinfo([address UTF8String], NULL, &hints, &result);
100-
if (err != 0 || result == NULL) {
101-
Log(LOG_W, @"getaddrinfo(%@) failed: %d", address, err);
102-
return NO;
103-
}
104-
105-
if (result->ai_family != AF_INET) {
106-
// This should never happen due to our hints
107-
assert(result->ai_family == AF_INET);
108-
Log(LOG_W, @"Unexpected address family: %d", result->ai_family);
109-
freeaddrinfo(result);
110-
return NO;
111-
}
112-
113-
BOOL ret = ![DiscoveryManager isAddressLAN:((struct sockaddr_in*)result->ai_addr)->sin_addr.s_addr];
114-
freeaddrinfo(result);
115-
116-
return ret;
117-
#else
118-
return NO;
119-
#endif
120-
}
121-
12284
- (ServerInfoResponse*) getServerInfoResponseForAddress:(NSString*)address {
12385
HttpManager* hMan = [[HttpManager alloc] initWithAddress:address httpsPort:0 serverCert:nil];
12486
ServerInfoResponse* serverInfoResponse = [[ServerInfoResponse alloc] init];
@@ -127,14 +89,6 @@ - (ServerInfoResponse*) getServerInfoResponseForAddress:(NSString*)address {
12789
}
12890

12991
- (void) discoverHost:(NSString *)hostAddress withCallback:(void (^)(TemporaryHost *, NSString*))callback {
130-
BOOL prohibitedAddress = [DiscoveryManager isProhibitedAddress:hostAddress];
131-
NSString* prohibitedAddressMessage = [NSString stringWithFormat: @"Moonlight only supports adding PCs on your local network on %s.",
132-
#if TARGET_OS_TV
133-
"tvOS"
134-
#else
135-
"iOS"
136-
#endif
137-
];
13892
ServerInfoResponse* serverInfoResponse = [self getServerInfoResponseForAddress:hostAddress];
13993

14094
TemporaryHost* host = nil;
@@ -146,40 +100,7 @@ - (void) discoverHost:(NSString *)hostAddress withCallback:(void (^)(TemporaryHo
146100

147101
// Check if this is a new PC
148102
if (![self getHostInDiscovery:host.uuid]) {
149-
// Enforce LAN restriction for App Store Guideline 4.2.7a
150-
if ([DiscoveryManager isProhibitedAddress:hostAddress]) {
151-
// We have a prohibited address. This might be because the user specified their WAN address
152-
// instead of their LAN address. If that's the case, we'll try their LAN address and if we
153-
// can reach it through that address, we'll allow it.
154-
ServerInfoResponse* lanInfo = [self getServerInfoResponseForAddress:host.localAddress];
155-
if ([lanInfo isStatusOk]) {
156-
TemporaryHost* lanHost = [[TemporaryHost alloc] init];
157-
[lanInfo populateHost:lanHost];
158-
159-
if (![lanHost.uuid isEqualToString:host.uuid]) {
160-
// This is a different host, so it's prohibited
161-
prohibitedAddress = YES;
162-
}
163-
else {
164-
// This is the same host that is reachable on the LAN
165-
prohibitedAddress = NO;
166-
}
167-
}
168-
else {
169-
// LAN request failed, so it's a prohibited address
170-
prohibitedAddress = YES;
171-
}
172-
}
173-
else {
174-
// It's an RFC 1918 IPv4 address or IPv6 address which counts as LAN
175-
prohibitedAddress = NO;
176-
}
177-
178-
if (prohibitedAddress) {
179-
callback(nil, prohibitedAddressMessage);
180-
return;
181-
}
182-
else if ([DiscoveryManager isAddressLAN:inet_addr([hostAddress UTF8String])]) {
103+
if ([DiscoveryManager isAddressLAN:inet_addr([hostAddress UTF8String])]) {
183104
// Don't send a STUN request if we're connected to a VPN. We'll likely get the VPN
184105
// gateway's external address rather than the external address of the LAN.
185106
if (![Utils isActiveNetworkVPN]) {
@@ -201,10 +122,8 @@ - (void) discoverHost:(NSString *)hostAddress withCallback:(void (^)(TemporaryHo
201122
} else {
202123
callback(host, nil);
203124
}
204-
} else if (!prohibitedAddress) {
205-
callback(nil, @"Could not connect to host.\n\nIf you're hosting using GeForce Experience, make sure you've enabled the toggle on the SHIELD tab.\n\nIf you're hosting using Sunshine, ensure it is running properly. If you're using a non-default port, you will need to include that here.");
206125
} else {
207-
callback(nil, prohibitedAddressMessage);
126+
callback(nil, @"Could not connect to host.\n\nIf you're hosting using GeForce Experience, make sure you've enabled the toggle on the SHIELD tab.\n\nIf you're hosting using Sunshine, ensure it is running properly. If you're using a non-default port, you will need to include that here.");
208127
}
209128
}
210129

Moonlight.xcodeproj/project.pbxproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,6 @@
13511351
GCC_NO_COMMON_BLOCKS = YES;
13521352
GCC_PREPROCESSOR_DEFINITIONS = (
13531353
NDEBUG,
1354-
ENABLE_APP_STORE_RESTRICTIONS,
13551354
);
13561355
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
13571356
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;

0 commit comments

Comments
 (0)