Programming[Solved] CURL works on iPhone but not on computer??
Posted:

Programming[Solved] CURL works on iPhone but not on computer??Posted:

CriticaI
  • TTG Addict
Status: Offline
Joined: Nov 05, 201311Year Member
Posts: 2,749
Reputation Power: 452
Status: Offline
Joined: Nov 05, 201311Year Member
Posts: 2,749
Reputation Power: 452
I'm trying to download a plist file using CURL.

Background:


I have 2 URIs that use the itms-services protocol. When the itms-services URI is used on an iPhone (or other apple mobile devices), it will fetch a plist which gives the iPhone information about an IPA file. If done correctly, the plist will cause a prompt to be displayed on the device, which will ask if the user want to install the IPA file. The itms-services protocol cannot be used on a desktop, or none-apple device.

A.
itms-services://?action=download-manifest&url=https://app.app-valley.vip/plists/289/install.plist

B.
itms-services://?action=download-manifest&url=https://app.iosgods.com/store/installApp/1224-funimate-be-music-video-star-modded%3Ftoken%3DeyJpdiI6IlZLeHVrWlI2bFNiVjRcL2dOaDJlOFRBPT0iLCJ2YWx1ZSI6IjZDVm5ET1ROTm1XdzNuSnd1bncyTEZ3eGhvYlZLTmlxTUIxeTlxaUx3b0U2S01sU2xWNTZQK053ZDdyWng0aGl2YnRVYnlwb21Hd0JvZU5GQ253U1RPNnV6aG9tTXVNUVRHZDljZ0JqTGVxY2ZWOGtrd2N2bkFFc2pVSG1RUWVJT084Vk91ZWc5QTlRaDdMTkR0RVJzUT09IiwibWFjIjoiZjUwZjQ5NzdlYTZkYzUyYjFmNjQ0NTJhOTFlMWYzNzRiNzFkZmJhNWI3YjllNGVmMjQwMDY2OTg4YzNlMGYwYSJ9


The plist file location is defined by the url parameter. So by getting rid of everything else and going to the URL should give a plist file response. This means the url could have redirects as long as the end result is a plist.



I usually use CURL to get the plist contents. Here is example 'A' of what I would put. It returns an XML document aka a plist.
curl "https://app.app-valley.vip/plists/289/install.plist"

<?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>items</key>
      <array>
         <dict>
            <key>assets</key>
            <array>
               <dict>
                  <key>kind</key>
                  <string>software-package</string>
                  <key>url</key>
                  <string>https://cdn.app-valley.vip/289.com.me.8ballpool.ipa?1564550549</string>
               </dict>
            </array>
            <key>metadata</key>
            <dict>
               <key>bundle-identifier</key>
               <string>com.me.8ballpool</string>
               <key>bundle-version</key>
               <string>4.2.1</string>
               <key>kind</key>
               <string>software</string>
               <key>title</key>
               <string><![CDATA[8 Ball Pool]]></string>
            </dict>
         </dict>
      </array>
   </dict>
</plist>

However when I try to do the same thing with example 'B' it returns an html document with a redirect meta tag.

curl "https://app.iosgods.com/store/installApp/1224-funimate-be-music-video-star-modded%3Ftoken%3DeyJpdiI6IlZLeHVrWlI2bFNiVjRcL2dOaDJlOFRBPT0iLCJ2YWx1ZSI6IjZDVm5ET1ROTm1XdzNuSnd1bncyTEZ3eGhvYlZLTmlxTUIxeTlxaUx3b0U2S01sU2xWNTZQK053ZDdyWng0aGl2YnRVYnlwb21Hd0JvZU5GQ253U1RPNnV6aG9tTXVNUVRHZDljZ0JqTGVxY2ZWOGtrd2N2bkFFc2pVSG1RUWVJT084Vk91ZWc5QTlRaDdMTkR0RVJzUT09IiwibWFjIjoiZjUwZjQ5NzdlYTZkYzUyYjFmNjQ0NTJhOTFlMWYzNzRiNzFkZmJhNWI3YjllNGVmMjQwMDY2OTg4YzNlMGYwYSJ9"


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="0;url=https://app.iosgods.com/store" />
<title>Redirecting to https://app.iosgods.com/store</title>
</head>
<body>
Redirecting to <a href="https://app.iosgods.com/store">https://app.iosgods.com/store</a>.
</body>
</html>


Finally, I'm positive that I have the correct URL for example 'B' because it will download the IPA file successfully on my phone.

So my question is, how can I use curl to get the plist document when the server is blocking it with a redirect?

Edit: What is really weird is I'm able to use a curl application on my iPhone and I get the expected result. However, I want to be able to use curl on my computer.


Last edited by CriticaI ; edited 2 times in total
#2. Posted:
Cyimking
  • E3 2016
Status: Offline
Joined: May 02, 201212Year Member
Posts: 1,129
Reputation Power: 34
Status: Offline
Joined: May 02, 201212Year Member
Posts: 1,129
Reputation Power: 34
The second URL is incorrect. Confirm that the URL is indeed correct. It's redirecting for me as well.
#3. Posted:
CoNdEmR
  • Blind Luck
Status: Offline
Joined: Apr 29, 200915Year Member
Posts: 4,420
Reputation Power: 1211
Status: Offline
Joined: Apr 29, 200915Year Member
Posts: 4,420
Reputation Power: 1211
Adding an
-L
flag will instruct cURL to follow redirects.
#4. Posted:
CriticaI
  • 2 Million
Status: Offline
Joined: Nov 05, 201311Year Member
Posts: 2,749
Reputation Power: 452
Status: Offline
Joined: Nov 05, 201311Year Member
Posts: 2,749
Reputation Power: 452
Cyimking wrote The second URL is incorrect. Confirm that the URL is indeed correct. It's redirecting for me as well.


If you download a curl application on the iPhone and paste in the URL it will work. But it won't work on the computer.

CoNdEmR wrote Adding an
-L
flag will instruct cURL to follow redirects.


I see that it follows the redirect, but it's following the URL in the meta tag. What is weird is when you use curl on an iPhone it gives the expected result.
#5. Posted:
CoNdEmR
  • Shoutbox Hero
Status: Offline
Joined: Apr 29, 200915Year Member
Posts: 4,420
Reputation Power: 1211
Status: Offline
Joined: Apr 29, 200915Year Member
Posts: 4,420
Reputation Power: 1211
Sounds like you might need to pass the user-agent as well. Try something like the following along with the url and any other flags you want to pass the cURL.


curl -H "User-Agent: Mozilla/5.0 (iPhone; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.25 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"
#6. Posted:
CriticaI
  • Shoutbox Hero
Status: Offline
Joined: Nov 05, 201311Year Member
Posts: 2,749
Reputation Power: 452
Status: Offline
Joined: Nov 05, 201311Year Member
Posts: 2,749
Reputation Power: 452
CoNdEmR wrote Sounds like you might need to pass the user-agent as well. Try something like the following along with the url and any other flags you want to pass the cURL.


curl -H "User-Agent: Mozilla/5.0 (iPhone; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.25 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"


After you commented, I looked at this again. It didn't work because the URL was bad and it was encoded too. Once I tried a new URL and decoded it, I was able to use CURL without any flags.

Encoded URL (same issue as OP)
curl 'https://app.iosgods.com/store/installApp/567-crunchyroll-hack%3Ftoken%3DeyJpdiI6IlprNG9BRDV5dFVBZkxtU0Y5TWpwY1E9PSIsInZhbHVlIjoiK3A1V1JuWWYzTGRGTkZaVk51MTB3bU5Nta1wvV1hyUlFXM0FBNU85bGVXNEJXRFZ3aFZqZFwvdVJRd1ZFMTM2N0ZucTZYRnd1aDBVK2ZTU0U1c09ucDR6a0RtTkJIaWVlQTlySHJYY2xEUytCR3BzUGgrRWFlZFpvYmVZWk1lUmI3ajhjbHhTWUx1TmJvSCtTNXc9PSIsIm1hYyI6IjhmMjI1MmEwY2Q0NTUyYTllZDRmNDU3NjQwNzNhNDU2MzI2ZjMzZmM4ZDgwN2MxNzNjNzI5MDM3NTI3YmRhMzcifQ%3D%3D'


Decoded URL (works as expected)
curl 'https://app.iosgods.com/store/installApp/567-crunchyroll-hack?token=eyJpdiI6IlprNG9BRDV5dFVBZkxtU0Y5TWpwY1E9PSIsInZhbHVlIjoiK3A1V1JuWWYzTGRGTkZaVk51MTB3bU50RE1uV0Nta1wvV1hyUlFXM0FBNU85bGVXNEJXRFZ3aFZqZFwvdVJRd1ZFMTM2N0ZucTZYRnd1aDBVK2ZTU0U1c09ucDR6a0RtTkJIaWVlQTlySHJYY2xEUytCR3BzUGgrRWFlZFpvYmVZWk1lUmI3ajhjbHhTWUx1TmJvSCtTNXc9PSIsIm1hYyI6IjhmMjI1MmEwY2Q0NTUyYTllZDRmNDU3NjQwNzNhNDU2MzI2ZjMzZmM4ZDgwN2MxNzNjNzI5MDM3NTI3YmRhMzcifQ=='
Users browsing this topic: None
Jump to:


RECENT POSTS

HOT TOPICS