Open .mobileconfig file saved in application in safari ios

后端 未结 4 2016
北恋
北恋 2020-12-15 00:29

I\'m trying to open a mobile configuration file (mobileconfig) in safari to install it but nothing work. I use URL Scheme:

NSURL *finalURL = [NSURL URLWithS         


        
4条回答
  •  孤街浪徒
    2020-12-15 01:15

    quite had no luck either but I post this anyway if someone else can use this information. I tried opening the string via data: url which is supported by Mobile Safari, but not by openURL: – sadly.

    NSString *urlHeader = @"data:application/x-apple-aspen-config;charset=utf-8,";
    NSString *mobileConf = @""
        ""
        "PayloadUUIDA0670934-C558-42E1-9E80-9B8E079E9AB2PayloadDisplayNameEnableTetheringPayloadDescriptionEnablesTetheringPayloadOrganizationde.iphone-notesPayloadVersion1PayloadIdentifierde.iphone-notes.etisalatPayloadTypeConfigurationPayloadContentPayloadUUIDC1A41907-0CD9-4DC9-BAF1-A04A73B7E296PayloadDisplayNameAdvancedSettingsPayloadDescriptionProvidescustomizationofcarrierAccessPointName.PayloadOrganizationde.sendowskiPayloadVersion1PayloadIdentifierde.iphone-notes.etisalat.apnPayloadContentDefaultsDomainNamecom.apple.managedCarrierDefaultsDataapnsapnEtisalat.aeusernamepasswordtype-mask-2PayloadTypecom.apple.apn.managed";
    
    mobileConf = [mobileConf stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
    NSURL *finalURL = [NSURL URLWithString:[urlHeader stringByAppendingString:mobileConf]];
    
    BOOL canOpen = [[UIApplication sharedApplication] openURL:finalURL];
    if (canOpen) NSLog(@"can open");
    else NSLog(@"can't open");
    

    For testing you can prepend http:// before data: then it will at least open in Safari and you can delete the prefix to try it. Maybe some javascript injection to remove the prefix will work; I don't know.

提交回复
热议问题