Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
AiGptCode authored May 19, 2024
1 parent 7c82ef3 commit 75a08a8
Showing 1 changed file with 169 additions and 8 deletions.
177 changes: 169 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ <h4 class="alert-heading dns">DNS:</h4>
</div>
</div>

<!-- Raw File Modal -->
<!-- Bootstrap modal for showing raw file -->
<div class="modal fade" id="raw-modal" tabindex="-1" aria-labelledby="raw-modal-label" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable">
<div class="modal-content">
Expand Down Expand Up @@ -224,14 +224,92 @@ <h5 class="modal-title" id="raw-modal-label">Raw Configuration File</h5>

// Create the XML-formatted plist string
const configPlist = `<?xml version="1.0" encoding="UTF-8"?>
...
</plist>
`; // The same XML-formatted plist string as before
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDisplayName</key>
<string>Cellular</string>
<key>PayloadIdentifier</key>
<string>com.apple.cellular</string>
<key>PayloadType</key>
<string>com.apple.cellular</string>
<key>PayloadUUID</key>
<string>${generateUniqueUUID()}</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>APNs</key>
<array>
<dict>
<key>AuthenticationType</key>
<string>CHAP</string>
<key>Enabled</key>
<true/>
<key>Name</key>
<string>${apn}</string>
</dict>
</array>
<key>SignalBoostEnabled</key>
<true/>
<key>Proxy</key>
<dict>
<key>Enabled</key>
<true/>
<key>PayloadType</key>
<string>com.apple.proxy</string>
<key>PayloadUUID</key>
<string>${generateUniqueUUID()}</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>HTTPEnable</key>
<true/>
<key>HTTPPort</key>
<integer>8080</integer>
<key>HTTPSEnable</key>
<true/>
<key>HTTPSPort</key>
<integer>8080</integer>
<key>FTPEnable</key>
<true/>
<key>FTPPort</key>
<integer>21</integer>
<key>SOCKSEnable</key>
<true/>
<key>SOCKSPort</key>
<integer>1080</integer>
<key>Server</key>
<string>proxy.example.com</string>
<key>ExclusionList</key>
<array>
<string>localhost</string>
<string>127.0.0.1</string>
<string>169.254.0.0/16</string>
</array>
</dict>
</dict>
</array>
<key>PayloadDisplayName</key>
<string>Cellular and Network Settings</string>
<key>PayloadIdentifier</key>
<string>com.example.cellular</string>
<key>PayloadOrganization</key>
<string>Example Inc.</string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>${generateUniqueUUID()}</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>
`;

// Create a Blob object from the configuration plist string
const configBlob = new Blob([configPlist], {
type: 'application/xml'
});
const configBlob = new Blob([configPlist], { type: 'application/xml' });

// Create a download link and click it to download the file
const downloadLink = document.createElement('a');
Expand All @@ -246,7 +324,90 @@ <h5 class="modal-title" id="raw-modal-label">Raw Configuration File</h5>
}

function handleShowRawClick() {
const configPlist = `<?xml version="1.0" encoding="UTF-8"?></plist>`; // The same XML-formatted plist string as before
const configPlist = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDisplayName</key>
<string>Cellular</string>
<key>PayloadIdentifier</key>
<string>com.apple.cellular</string>
<key>PayloadType</key>
<string>com.apple.cellular</string>
<key>PayloadUUID</key>
<string>${generateUniqueUUID()}</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>APNs</key>
<array>
<dict>
<key>AuthenticationType</key>
<string>CHAP</string>
<key>Enabled</key>
<true/>
<key>Name</key>
<string>${document.getElementById('apn').value}</string>
</dict>
</array>
<key>SignalBoostEnabled</key>
<true/>
<key>Proxy</key>
<dict>
<key>Enabled</key>
<true/>
<key>PayloadType</key>
<string>com.apple.proxy</string>
<key>PayloadUUID</key>
<string>${generateUniqueUUID()}</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>HTTPEnable</key>
<true/>
<key>HTTPPort</key>
<integer>8080</integer>
<key>HTTPSEnable</key>
<true/>
<key>HTTPSPort</key>
<integer>8080</integer>
<key>FTPEnable</key>
<true/>
<key>FTPPort</key>
<integer>21</integer>
<key>SOCKSEnable</key>
<true/>
<key>SOCKSPort</key>
<integer>1080</integer>
<key>Server</key>
<string>proxy.example.com</string>
<key>ExclusionList</key>
<array>
<string>localhost</string>
<string>127.0.0.1</string>
<string>169.254.0.0/16</string>
</array>
</dict>
</dict>
</array>
<key>PayloadDisplayName</key>
<string>Cellular and Network Settings</string>
<key>PayloadIdentifier</key>
<string>com.example.cellular</string>
<key>PayloadOrganization</key>
<string>Example Inc.</string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>${generateUniqueUUID()}</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>
`;

const pre = document.createElement('pre');
pre.textContent = configPlist;
Expand Down

0 comments on commit 75a08a8

Please sign in to comment.