gcobb321 / icloud3_v3

iCloud3 v3, Development Version - This Repo/Version is used for development and testing of new and updated features. It is not the official release of iCloud3 v3, .
MIT License
169 stars 13 forks source link

Problem Signing into Apple Account #341

Closed LioBoul closed 2 weeks ago

LioBoul commented 1 month ago

Since update HA core-2024.10.3, I have a error message : "Warning: iCloud Account is not Logged Into" or "Login Error, Other Error or iCloud is not Available" If I request a new 6 digits code verification, nothing happens :-( Any idea ???

spry-salt commented 1 month ago

Same.

gcobb321 commented 1 month ago

I am away and have not updated to 10.3. I’ll be back this weekend and it will be Monday before I can get to it. I’m running 10.1 and have not noticed anything strange.

Are there any errors in the HA log ? Settings > System > Logs? Or in the iCloud-0.log?

Edit: I just looked at the HA change log and didn’t see anything related to iCloud3 or iCloud

spry-salt commented 1 month ago

STAGE 4 > SETUP ICLOUD & MOBAPP DATA SOURCE ⡇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2024-10-19 10:05:30.303 DEBUG (SyncWorker_59) [custom_components.icloud3] STAGE4 iCloud Account > Logging Into- (x....@x...........) 2024-10-19 10:05:30.303 DEBUG (SyncWorker_59) [custom_components.icloud3] STAGE4 Connecting to and Authenticating iCloud Location Service Interface (startup) 2024-10-19 10:05:30.303 DEBUG (SyncWorker_59) [custom_components.icloud3] STAGE4 Initialize PyiCloud Service, establish iCloud Location Services connection 2024-10-19 10:05:30.337 DEBUG (SyncWorker_59) [custom_components.icloud3] STAGE4 Authenticating account (x....@x...........) with token 2024-10-19 10:05:31.481 ERROR (SyncWorker_59) [custom_components.icloud3] iCloud3 Error > An error occurred logging into the iCloud Account. )

Jackyl1976 commented 1 month ago

image same problem here... not possible to login in icloud

spry-salt commented 1 month ago

II should add that I can login to iCloud.com just fine and my password hasn’t changed.

miraixyz commented 1 month ago

same here..please fix this

gcobb321 commented 1 month ago

Are there any program errors in the HA log other than just a message saying there was an error? Settings > System > Logs?

Set log level to Debug on Configure Settings > Page 2 > Format Parameters screen. Then restart HA. Then see if there is any more info that might help figure out what is going on when I get home.

Edit: If the problem started with HA 2024.10.3, restore HA to 2024.10.2 and see if it works there. I’m running 2024.10.1 and have not had any issues.

miraixyz commented 1 month ago

this is the only related error I can find:

10-19 10:31:31 [start_ic3_co:0345] 🛑 The following issues were detected when starting iCloud3. Scroll through the Startup Log for more information: , 1. iCloud Account Login Error, 2. iCloud username/password invalid or not set up, 3. Some devices could not be verified. Restart iCloud3

terminusxx commented 1 month ago

I assume this is the same issue: https://github.com/home-assistant/core/issues/128486 Here are my logs when trying to login from the configure page

2024-10-18` 15:40:04.023 INFO (MainThread) [icloud3] [config_flow.:2242] ------ icloud_account (login_icloud_account) > UserInput-{'data_source_icloud': ['famshr'], 'username': '..........@ya.......', 'password': '********', 'url_suffix_china': False, 'data_source_mobapp': ['mobapp'], 'endpoint_suffix': 'None', 'data_source': 'famshr, mobapp'}, Errors-None

2024-10-18 15:40:04.094 INFO (MainThread) [icloud3] [config_flow.:2488] ------ Logging into iCloud Acct > UserInput-{'data_source_icloud': ['famshr'], 'username': '..........', 'password': '********', 'url_suffix_china': False, 'data_source_mobapp': ['mobapp'], 'endpoint_suffix': 'None', 'data_source': 'famshr, mobapp'}, Errors-{}, Step-icloud_account, CalledFrom-icloud_account

2024-10-18 15:40:04.166 INFO (MainThread) [icloud3] [config_flow.:2527] ------ Configure Settings > Logging into iCloud Account,
• iCloud Account Currently Used > ..........@ya.......
• New iCloud Account > ..........@ya.......

2024-10-18 15:40:04.169 INFO (SyncWorker_28) [icloud3] [pyicloud_ic3:0536] ------ ❗Initialize PyiCloud Service, establish iCloud Location Services connection

2024-10-18 15:40:04.171 INFO (SyncWorker_28) [icloud3] [pyicloud_ic3:0927] ------ ❗Read Cookies from /config/.storage/icloud/.....

2024-10-18 15:40:04.174 INFO (SyncWorker_28) [icloud3] [pyicloud_ic3:0494] ------ ❗AUTHENTICATING iCloud Account Access, (........@.......), config

2024-10-18 15:40:04.176 INFO (SyncWorker_28) [icloud3] [pyicloud_ic3:0618] ------ ❗Authenticating account (..........@ya.......) with token

2024-10-18 15:40:04.685 INFO (SyncWorker_28) [icloud3] [pyicloud_ic3:0689] ------ ❗PyiCloudAPIResponseException.authenticate_with_token > Token is not valid, error-Missing apple_id field, 2fa Needed-False

2024-10-18 15:40:05.112 INFO (SyncWorker_28) [icloud3] [pyicloud_ic3:0737] ------ ❗PyiCloudAPIResponseException.authenticate_with_password > Password is not valid, Error-Could not connect to iCloud Location Servers (Error Code 503), 2fa Needed-False
spry-salt commented 1 month ago

I rolled back to HA 2024.10.2 and the problem persists.

spry-salt commented 1 month ago

I can sign into idmsa.apple.com with the same credentials and that works fine.

747Rocker commented 1 month ago

I rolled back to HA 2024.10.2 and the problem persists.

So downgrading isn‘t an Option?

spry-salt commented 1 month ago

Looks like the digital certificate for apple.com might have just been updated. It says Not valid before Saturday 19 October 2024 at 04:00:26 Australian Eastern Daylight Time, which was early this morning here.

tydalforce commented 1 month ago

Here's my log, with debug enabled. Not a whole lot - I tried my normal password and a fresh App-Specific Password and got the same messages

10-18 22:39:55 [config_flow.:2242] ------ icloud_account (login_icloud_account) > UserInput-{'data_source_icloud': ['famshr'], 'username': 'ty........@ma.....', 'password': '****', 'url_suf 10-18 22:39:55 [config_flow.:2488] ------ Logging into iCloud Acct > UserInput-{'data_source_icloud': ['famshr'], 'username': 'xxxxxx@mac.com', 'password': '****', 'url_suffix_china': F 10-18 22:39:55 [config_flow.:2527] ------ Configure Settings > Logging into iCloud Account,
... iCloud Account Currently Used > ty........@ma..... ... New iCloud Account > ty........@ma.....
10-18 22:39:55 [pyicloud_ic3:0536] ------ ...Initialize PyiCloud Service, establish iCloud Location Services connection 10-18 22:39:55 [pyicloud_ic3:0902] ------ ...session file > (config/.storage/icloud/session)
... Deleted file (...tydalforcemaccom)
10-18 22:39:55 [pyicloud_ic3:0909] ------ ...Session file does not exist
10-18 22:39:55 [pyicloud_ic3:0927] ------ ...Read Cookies from /config/.storage/icloud/tydalforcemaccom 10-18 22:39:55 [pyicloud_ic3:0494] ------ ...AUTHENTICATING iCloud Account Access, (ty........@ma.....), config 10-18 22:39:55 [pyicloud_ic3:0618] ------ ...Authenticating account (ty........@ma.....) with token 10-18 22:39:55 [pyicloud_ic3:0689] ------ ...PyiCloudAPIResponseException.authenticate_with_token > Token is not valid, error-Missing apple_id field, 2fa Needed-False 10-18 22:39:56 [pyicloud_ic3:0737] ------ ...PyiCloudAPIResponseException.authenticate_with_password > Password is not valid, Error-Could not connect to iCloud Location Servers (Error Code 503), 10-18 22:39:56 [config_flow.:4375] ------ Show Form-icloud_account, Errors-{'base': 'icloud_acct_login_error_other'} 10-18 22:39:56 [start_ic3...:0610] ------ Checking Mobile App Integration > Loaded, Devices-myPhone
10-18 22:39:56 [config_flow.:4375] ------ Show Form-icloud_account, Errors-{'base': 'icloud_acct_login_error_other'} 10-18 22:39:56 [start_ic3...:0610] ------ Checking Mobile App Integration > Loaded, Devices-myPhone

JtwoA commented 1 month ago

Looks like the digital certificate for apple.com might have just been updated. It says Not valid before Saturday 19 October 2024 at 04:00:26 Australian Eastern Daylight Time, which was early this morning here.

Apple is doing some cert and cipher work in preparation for changes to ciphers in Feb 2025 (I work for a software company that integrates with Apple Pay and we had an outage associated with this work two weeks ago. The RCA on the outage just came today containing their admission to erroneously removing some ciphers prematurely.

Unsure if related but the timing is suspect.

ounyai commented 1 month ago

I also receive the same error, see my log below. Not much unfortunatley.

2024-10-19 19:02:22.431 ERROR (MainThread) [icloud3-cf] Error logging into iCloud service: 2024-10-19 19:02:30.523 ERROR (MainThread) [icloud3-cf] Error logging into iCloud service: 2024-10-19 19:02:40.179 ERROR (MainThread) [icloud3-cf] Error logging into iCloud service:

marcel-eugel commented 1 month ago

Same Here

gcobb321 commented 1 month ago

I’ve seen some errors in my own home-assistant.log file where the remote server (Apple) just disconnects without any reason. In my log, it was trying to reauthentication the Apple Account. Obviously, iCloud3 has no control over what Apple does, why it disconnects and can not stop that from happening.

I will investigate trying to establish the connection when that happens. Debugging something like this is almost impossible because it is difficult to predict when this will occur. Since this is a new issue, Apple must have made some changes to something dealing with remote connections.

The error that shows up in the home-assistant.lof file is:


Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 802, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/urllib3/util/retry.py", line 552, in increment
    raise six.reraise(type(error), error, _stacktrace)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/urllib3/packages/six.py", line 769, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 716, in urlopen
    httplib_response = self._make_request(
                       ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 468, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 463, in _make_request
    httplib_response = conn.getresponse()
                       ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/http/client.py", line 1428, in getresponse
    response.begin()
  File "/usr/local/lib/python3.12/http/client.py", line 331, in begin
    version, status, reason = self._read_status()
                              ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/http/client.py", line 300, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/icloud3/support/pyicloud_ic3.py", line 192, in request
    response = Session.request(self, method, url, **response_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 682, in send
    raise ConnectionError(err, request=request)

Look at your own file and verify that this is the error you are seeing.

ounyai commented 1 month ago

Hi Gary,

My log (home-assistant.log)wiht debug enabled is giveing the below error, but password is definately correct as I can log into iCloud through a browser and through several Apple devices. Not sure if this helps.

`2024-10-19 21:51:08.017 DEBUG (MainThread) [custom_components.icloud3] [config_flow.:2488] ------ Logging into iCloud Acct > UserInput-{'data_source_icloud': ['famshr'], 'username': 'nadi8768', 'password': 'Nadi8768', 'url_suffix_china': False, 'data_source_mobapp': ['mobapp'], 'endpoint_suffix': 'None', 'data_source': 'famshr, mobapp'}, Errors-{}, Step-icloud_account, CalledFrom-icloud_account

2024-10-19 21:51:08.062 DEBUG (MainThread) [custom_components.icloud3] [config_flow.:2527] ------ Configure Settings > Logging into iCloud Account, • iCloud Account Currently Used > • New iCloud Account > na...... 2024-10-19 21:51:08.065 DEBUG (SyncWorker_52) [custom_components.icloud3] [pyicloud_ic3:0536] ------ ❗Initialize PyiCloud Service, establish iCloud Location Services connection

2024-10-19 21:51:08.069 DEBUG (SyncWorker_52) [custom_components.icloud3] [pyicloud_ic3:0927] ------ ❗Read Cookies from /config/.storage/icloud/nadi8768

2024-10-19 21:51:08.071 DEBUG (SyncWorker_52) [custom_components.icloud3] [pyicloud_ic3:0494] ------ ❗AUTHENTICATING iCloud Account Access, (na......), config

2024-10-19 21:51:08.072 DEBUG (SyncWorker_52) [custom_components.icloud3] [pyicloud_ic3:0618] ------ ❗Authenticating account (na......) with token

2024-10-19 21:51:08.684 DEBUG (SyncWorker_52) [custom_components.icloud3] [pyicloud_ic3:0737] ------ ❗PyiCloudAPIResponseException.authenticate_with_password > Password is not valid, Error-Could not connect to iCloud Location Servers (Error Code 503), 2fa Needed-False

2024-10-19 21:51:08.684 ERROR (MainThread) [icloud3-cf] Error logging into iCloud service:

2024-10-19 21:51:08.731 DEBUG (MainThread) [custom_components.icloud3] [config_flow.:4375] ------ Show Form-icloud_account, Errors-{'base': 'icloud_acct_login_error_other'}

2024-10-19 21:51:08.793 DEBUG (MainThread) [custom_components.icloud3] [start_ic3...:0610] ------ Checking Mobile App Integration > Loaded, Devices-iPhone-ooo-App, iPhoneooo, iPhone-xxx-App, iPhone-x, xx iPad, Oxx iPad, xzx iPad, yyt iPad

2024-10-19 21:51:08.837 DEBUG (MainThread) [custom_components.icloud3] [config_flow.:4375] ------ Show Form-icloud_account, Errors-{'base': 'icloud_acct_login_error_other'}

2024-10-19 21:51:08.901 DEBUG (MainThread) [custom_components.icloud3] [start_ic3...:0610] ------ Checking Mobile App Integration > Loaded, Devices-iPhone-ooo-App, iPhoneooo, iPhone-x-App, iPhone-x, xx’s iPad, ooo iPad, xzx iPad, yyt iPad`

gcobb321 commented 1 month ago

I can not log into my own Apple accounts and am now getting the same invalid password error. I will investigate when I return home tomorrow

tydalforce commented 1 month ago

With debug logging enabled, I don't see that same full exception in home-assistant.log. Here's what I see below. Of concern: The first two debug lines seen here originally included my full password in plain text; you might want to update the code to obfuscate them (c:

2024-10-19 08:15:00.782 DEBUG (MainThread) [custom_components.icloud3] [config_flow.:2242] ------ icloud_account (login_icloud_account) > UserInput-{'data_source_icloud': ['famshr'], 'username': 'XX........@ma.....', 'password': 'xxxxxxxxxx', 'url_suffix_china': False, 'data_source_mobapp': ['mobapp'], 'endpoint_suffix': 'None', 'data_source': 'famshr, mobapp'}, Errors-None 2024-10-19 08:15:00.894 DEBUG (MainThread) [custom_components.icloud3] [config_flow.:2488] ------ Logging into iCloud Acct > UserInput-{'data_source_icloud': ['famshr'], 'username': 'xxxxx@mac.com', 'password': 'XXXXXXXX', 'url_suffix_china': False, 'data_source_mobapp': ['mobapp'], 'endpoint_suffix': 'None', 'data_source': 'famshr, mobapp'}, Errors-{}, Step-icloud_account, CalledFrom-icloud_account 2024-10-19 08:15:01.017 DEBUG (MainThread) [custom_components.icloud3] [config_flow.:2527] ------ Configure Settings > Logging into iCloud Account, • iCloud Account Currently Used > • New iCloud Account > XX........@ma..... 2024-10-19 08:15:01.019 DEBUG (SyncWorker_2) [custom_components.icloud3] [pyicloud_ic3:0536] ------ ❗Initialize PyiCloud Service, establish iCloud Location Services connection 2024-10-19 08:15:01.022 DEBUG (SyncWorker_2) [custom_components.icloud3] [pyicloud_ic3:0927] ------ ❗Read Cookies from /config/.storage/icloud/xxxxxxxxxxx 2024-10-19 08:15:01.026 DEBUG (SyncWorker_2) [custom_components.icloud3] [pyicloud_ic3:0494] ------ ❗AUTHENTICATING iCloud Account Access, (XX........@ma.....), config 2024-10-19 08:15:01.028 DEBUG (SyncWorker_2) [custom_components.icloud3] [pyicloud_ic3:0618] ------ ❗Authenticating account (XX........@ma.....) with token 2024-10-19 08:15:01.164 DEBUG (SyncWorker_2) [custom_components.icloud3] [pyicloud_ic3:0689] ------ ❗PyiCloudAPIResponseException.authenticate_with_token > Token is not valid, error-Missing apple_id field, 2fa Needed-False 2024-10-19 08:15:01.600 DEBUG (SyncWorker_2) [custom_components.icloud3] [pyicloud_ic3:0737] ------ ❗PyiCloudAPIResponseException.authenticate_with_password > Password is not valid, Error-Could not connect to iCloud Location Servers (Error Code 503), 2fa Needed-False 2024-10-19 08:15:01.601 ERROR (MainThread) [icloud3-cf] Error logging into iCloud service: 2024-10-19 08:15:01.733 DEBUG (MainThread) [custom_components.icloud3] [config_flow.:4375] ------ Show Form-icloud_account, Errors-{'base': 'icloud_acct_login_error_other'} 2024-10-19 08:15:01.892 DEBUG (MainThread) [custom_components.icloud3] [start_ic3...:0610] ------ Checking Mobile App Integration > Loaded, Devices-XXXXXX 2024-10-19 08:15:02.016 DEBUG (MainThread) [custom_components.icloud3] [config_flow.:4375] ------ Show Form-icloud_account, Errors-{'base': 'icloud_acct_login_error_other'} 2024-10-19 08:15:02.160 DEBUG (MainThread) [custom_components.icloud3] [start_ic3...:0610] ------ Checking Mobile App Integration > Loaded, Devices-XXXXXX

XDOM-JR commented 1 month ago

same problem here... not possible to login in icloud

granborja commented 1 month ago

Same here..

victor-homar commented 1 month ago

Same here... Can login to icloud.com but cannot make icloud3 v3 to login.

mpipeling commented 1 month ago

same; I'm still running 10.1 so suspect issue related to change on Apple/iCloud side of things

tomballgithub commented 1 month ago

This app identified a change needed but the apple-tools repository with the fix is not public. https://status.expo.dev/incidents/t3cwh0l0x5qd?u=9bkhv9wfr16k

gcobb321 commented 1 month ago

FYI-The problem is not limited to iCloud3. It is impacting all applications that access an Apple account using the webAuth protocols.

This is a note published. In another web site:

This app identified a change needed but the apple-tools repository with the fix is not public. https://status.expo.dev/incidents/t3cwh0l0x5qd?u=9bkhv9wfr16k

N3rdix commented 1 month ago

Couldn't the 2 versions of apple-utils be compared to find out what EXPO did?

https://www.npmjs.com/package/@expo/apple-utils?activeTab=versions

Ghawken commented 1 month ago

Hi all,

Apple has changed login pretty significantly. Basically pyicloud will need a major re-write I would be guessing.

They have moved to Secure Remote Password

Seems to now:

Need:

'https://idmsa.apple.com/appleauth/auth/authorize/signin'

With headers to get Apple-X-Auth-attributes and Hashcash X-Bits and Challenge for adding

Then use SRP remote tools/encryption to login to: "https://idmsa.apple.com/appleauth/auth"

*/init: With data:

            init_data = {
                'a': base64.b64encode(srp.User(username, password).start_authentication()[1]).decode('utf-8'),
                'accountName': username,
                'rememberMe': True,
                'trustTokens': [],
                'protocols': ['s2k', 's2k_fo']
            }

This returns c-value salt

& then to */complete

With calculated m1 and m2

        # Prepare data for the /signin/complete request
            complete_data = {
                'accountName': username,
                'rememberMe': True,
                'trustTokens': [],
                'c': C_value,
                'm1': m1_b64,
                'm2': m2_b64
            }

Having calculated the m1 and m2 correctly.... as per apples specifications....

Then have Session-ID and Token to login to accountLogin as usual I would guess.

Have it almost working in python - but time consuming and calculation of m1 and m2 has a lot of encoding issues/variables which simplify fail.. No time line.... be good if someone else fixes!

gcobb321 commented 1 month ago

@N3rdix I’ve linked to the v2.0.2 code and will do a comparison of the v2.0.1 code on my computer in a few hours to see if something of interest shows up.

@Ghawken Can you link me to your code and I’ll put it in my authorization routines. My latest development iCloud3 isn’t available yet but I can get a copy to you if it will help.

Ghawken commented 1 month ago

The 2.0.2 JS is here: https://cdn.jsdelivr.net/npm/@expo/apple-utils@2.0.2/build/index.js

Happy to link code when working... far from that at moment. Have locked my account out twice, 2nd time happened very quickly. Think I'm going to have to pause for a bit, the flow I've posted above

2 steps forward, one (or perhaps 3) step backwards....

smarthomefamilyverrips commented 1 month ago

Also started happening after restart of HA on version 2024.9.2, But integration still starts up using data from Mobile App

This error originated from a custom integration.

Logger: custom_components.icloud3 Source: custom_components/icloud3/helpers/messaging.py:467 integration: iCloud3 v3: iDevice Tracker (documentation, issues) First occurred: 12:26:19 (2 occurrences) Last logged: 12:26:19

iCloud3 Error > An error occurred logging into the iCloud Account. )

RijkVeenendaal commented 1 month ago

Same here

jjvelar commented 1 month ago

Same problem here.

Aldon777 commented 1 month ago

And Here

pedropombeiro commented 1 month ago

If you want to be alerted with activity, just hit Subscribe. Creating more noise in this issue won't make things go any faster.

smarthomefamilyverrips commented 1 month ago

If you want to be alerted with activity, just hit Subscribe. Creating more noise in this issue won't make things go any faster.

And if you not want to be alerted with people saying "same here" just unsubscribe. 😉

gcobb321 commented 1 month ago

@Ghawken The code link leads to the code but it is not in a raw format and is hard to read. It looks like all new line characters have been stripped (see below). Do you have another link leading to the raw code I can use? Or zip it and send to geekstergary@gmail.com if that is easier.

''' (()=>{var e={42421:(e,t,r)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.shouldHighlight=d,t.getChalk=h,t.default=function(e,t={}){if(d(t)){const r=function(e){return{keyword:e.cyan,capitalized:e.yellow,jsx_tag:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.grey,invalid:e.white.bgRed.bold}}(h(t));return p(r,e)}return e};var n=function(e){if(e&&e.esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,t&&t.set(e,r);return r}(r(48035)),i=r(51697),s=function(e){return e&&e.esModule?e:{default:e}}(r(26870));function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}const o=/\r\n|[\n\r\u2028\u2029]/,u=/^[a-z][\w-]*$/i,c=/^[()[]{}]$/;function l(e){const[t,r]=e.slice(-2),s=(0,n.matchToToken)(e);if("name"===s.type){if((0,i.isKeyword)(s.value)||(0,i.isReservedWord)(s.value))return"keyword";if(u.test(s.value)&&("<"===r[t-1]||"</"==r.substr(t-2,2)))return"jsx_tag";if(s.value[0]!==s.value[0].toLowerCase())return"capitalized"}return"punctuator"===s.type&&c.test(s.value)?"bracket":"invalid"!==s.type||"@"!==s.value&&"#"!==s.value?s.type:"punctuator"}function p(e,t){return t.replace(n.default,(function(...t){const r=l(t),n=e[r];return n?t[0].split(o).map((e=>n(e))).join("\n"):t[0]}))}function d(e){return s.default.supportsColor||e.forceColor}function h(e){let t=s.default;return e.forceColor&&(t=new s.default.constructor({enabled:!0,level:1})),t}},53282:(e,t)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.isIdentifierStart=c,t.isIdentifierChar=l,t.isIdentifierName=function(e){let t=!0;for(let r=0,n=Array.from(e);r<n.length;r++){const e=n[r].codePointAt(0);if(t){if(!c(e))return!1;t=!1}else if(!l(e))return!1}return!t};let r="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",n="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_";const i=new RegExp("["+r+"]"),s=new RegExp("["+r+n+"]");r=n=null;const a=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],o= '''

Aulig commented 1 month ago

@Ghawken The code link leads to the code but it is not in a raw format and is hard to read. It looks like all new line characters have been stripped (see below). Do you have another link leading to the raw code I can use? Or zip it and send to geekstergary@gmail.com if that is easier.

''' (()=>{var e={42421:(e,t,r)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.shouldHighlight=d,t.getChalk=h,t.default=function(e,t={}){if(d(t)){const r=function(e){return{keyword:e.cyan,capitalized:e.yellow,jsx_tag:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.grey,invalid:e.white.bgRed.bold}}(h(t));return p(r,e)}return e};var n=function(e){if(e&&e.esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}r.default=e,t&&t.set(e,r);return r}(r(48035)),i=r(51697),s=function(e){return e&&e.esModule?e:{default:e}}(r(26870));function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}const o=/\r\n|[\n\r\u2028\u2029]/,u=/^[a-z][\w-]*$/i,c=/^[()[]{}]$/;function l(e){const[t,r]=e.slice(-2),s=(0,n.matchToToken)(e);if("name"===s.type){if((0,i.isKeyword)(s.value)||(0,i.isReservedWord)(s.value))return"keyword";if(u.test(s.value)&&("<"===r[t-1]||"</"==r.substr(t-2,2)))return"jsx_tag";if(s.value[0]!==s.value[0].toLowerCase())return"capitalized"}return"punctuator"===s.type&&c.test(s.value)?"bracket":"invalid"!==s.type||"@"!==s.value&&"#"!==s.value?s.type:"punctuator"}function p(e,t){return t.replace(n.default,(function(...t){const r=l(t),n=e[r];return n?t[0].split(o).map((e=>n(e))).join("\n"):t[0]}))}function d(e){return s.default.supportsColor||e.forceColor}function h(e){let t=s.default;return e.forceColor&&(t=new s.default.constructor({enabled:!0,level:1})),t}},53282:(e,t)=>{"use strict";Object.defineProperty(t,"esModule",{value:!0}),t.isIdentifierStart=c,t.isIdentifierChar=l,t.isIdentifierName=function(e){let t=!0;for(let r=0,n=Array.from(e);r<n.length;r++){const e=n[r].codePointAt(0);if(t){if(!c(e))return!1;t=!1}else if(!l(e))return!1}return!t};let r="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",n="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_";const i=new RegExp("["+r+"]"),s=new RegExp("["+r+n+"]");r=n=null;const a=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],o= '''

You can check out Fastlane who have a fix now: https://github.com/fastlane/fastlane/commit/faee8dcc2d3c66fd07426bcc46f3055f26a18ab5

It's in ruby, but at least public. But I haven't been able to convert it to python yet either.

gcobb321 commented 1 month ago

I have downloaded that code but all the ruby-to-python converters limit the source to 4000-characters. It would have been easier to convert it all at once rather than a piece at a time. That was why the v2.0.2 in a raw source format will help.

pedropombeiro commented 1 month ago

If you want to be alerted with activity, just hit Subscribe. Creating more noise in this issue won't make things go any faster.

And if you not want to be alerted with people saying "same here" just unsubscribe. 😉

The point of subscribing is to follow actual progress on the issue, not something you can do by adding a 👍 reaction on the OP.

Aulig commented 1 month ago

I have downloaded that code but all the ruby-to-python converters limit the source to 4000-characters. It would have been easier to convert it all at once rather than a piece at a time. That was why the v2.0.2 in a raw source format will help.

I ran it through chatgpt to convert it, but its not quite correct as expected. I've sent it to you via e-mail (not posting publicly in case i forgot to remove any secrets) if you want to use it as a starting point :)

gcobb321 commented 1 month ago

@Ghawken I converted the Fastlane program Apple auth code mentioned in a previous post from ruby to python. I think I have all of the necessary modules but have not reviewed it yet. It may help, or not help at all.

Now for the fun part.

fastlane_apple_auth__ruby_to_python.zip

jurekjure commented 1 month ago

Same here … login not possible

Ghawken commented 1 month ago

@gcobb321 @Aulig Thanks for the fast lane

The hashcash, calculated from /siginin x-bit header - I had implemented and then removed as didn’t seem necessary— so will check where they use in more detail here..

I have successfuly, logged in via /signin, then init, just failing on the last step..

I can get to /complete which is the end basically - if successfully gives a 409 and cookies with Session Details like before, which then needs 2FA steps..

I’m getting a 403 here at this last step and an error request via requests to enter email/details.

I can only presume my calculated m1 and m2, which I send are incorrect.

Issue is calculating m1 and m2 depends on base64, encoding, padding bytes or not - very python specific aspects and various SRP python library differences.
The apple browser given m1 and m2 - also seems shorter to what I would expect

But its another day here - although pressing demands... the issue will be encoding of base64 and these factors.

Reviewing the RUBY: (for my future reference as away at moment)

Init:

       #a: Base64.encode64(a),
        a: Base64.strict_encode64(to_byte(a))
       def to_byte(str)
           [str].pack('H*')
       end

Obviously encode failed (given commented out) and strict_encode with conversion to bytes before needed... interesting, not sure I have done this..

Python conversion of above:

def to_byte(hex_str):
    return bytes.fromhex(hex_str)
a = base64.b64encode(to_byte(a)).decode('ascii')

Return from init;

      iterations = body["iteration"]
      salt = Base64.strict_decode64(body["salt"])
      b = Base64.strict_decode64(body["b"])
      c = body["c"]
     key_length = 32

           m1 = client.process_challenge(
                user,
                to_hex(encrypted_password),
                to_hex(salt),
                to_hex(b),
                is_password_encrypted: true
            )
      m2 = client.H_AMK

            data = {
                    accountName: user,
                    c: c,
                    m1: Base64.encode64(to_byte(m1)).strip,
                    m2: Base64.encode64(to_byte(m2)).strip,
                    rememberMe: false
      }

Python3 Conversion:

def to_hex(input_str):
    if isinstance(input_str, str):
        byte_str = input_str.encode('utf-8')
    elif isinstance(input_str, bytes):
        byte_str = input_str
    else:
        raise TypeError("Input must be a string or bytes object.")

    return byte_str.hex()

&& not forgetting the hashcash to /complete req.headers["X-Apple-HC"] = hashcash if hashcash

    def pbkdf2(password, salt, iterations, key_length, digest = OpenSSL::Digest::SHA256.new)
            require 'openssl'
      password = OpenSSL::Digest::SHA256.digest(password)
            OpenSSL::PKCS5.pbkdf2_hmac(password, salt, iterations, key_length, digest)
        end

Python3 Conversion of Password Encryption:

import hashlib

def pbkdf2(password, salt, iterations, key_length, digest='sha256'):
    """
    Derives a cryptographic key from the given password and salt using PBKDF2 HMAC.

    Parameters:
        password (bytes): The input password as bytes.
        salt (bytes): The cryptographic salt as bytes.
        iterations (int): The number of iterations to perform.
        key_length (int): The desired length of the derived key in bytes.
        digest (str): The name of the hash digest algorithm to use (default: 'sha256').

    Returns:
        bytes: The derived cryptographic key.
    """
    # Step 1: Hash the password using SHA256
    password_hashed = hashlib.sha256(password).digest()

    # Step 2: Derive the key using PBKDF2 HMAC
    derived_key = hashlib.pbkdf2_hmac(
        hash_name=digest,          # Digest algorithm (e.g., 'sha256')
        password=password_hashed,  # Hashed password bytes
        salt=salt,                 # Salt bytes
        iterations=iterations,     # Number of iterations
        dklen=key_length           # Desired key length in bytes
    )

    return derived_key
gcobb321 commented 1 month ago

@Ghawken Hey Glenn, I hope it helps a little. I have not dug into the code to see what they are doing, other than seeing what needed to be converted. I thought that might be a tomorrow project. My thinking was to create a _pyicloud_ic3auth.py module with all the authentication support code rather than including it in my main pyicloud_ic3.py file. Then it will be portable between the current version (v3.0.5.9) and the next version (v3.1) of iCloud3.

I also have been using another way to validate the username/password by calling https://setup.icloud.com/setup/authenticate/{self.username} with the username/password base64 encoded in the headings. It returns a 409 if valid and 401 if invalid. It's a lot faster and does not have to go through all of the password & token validation routines and fail if invalid. That is still working, probably because it does not actually logging into the account, just validating it's credentials.

I can send you that code if it will prove useful to you.

Ghawken commented 1 month ago

@gcobb321 Hi Gary, The setup.icloud.com/...authenicate - is interesting - I would presume apple is going to remove this as well..

The move to Secure Remote Password - is to remove any need to send password, base64 encoded or otherwise. Because they have made that move suspect they will remove others like this that do send ... eventually....

I'm actually very close... may be as simple as strict_encode versus encode ... as I allude to in above. Annoyingly no way to test as generated keys etc are all unique

My usage, like yours has moved from the base of pyicloud, currently updating the old pyicloud authenicate code - which once done should be easy to drop back in.

bungasnail commented 1 month ago

It seems that the fix code is already available in Ruby. I am waiting for the code to be fixed in Python as well as soon as possible.

https://github.com/picklepete/pyicloud/issues/456#issuecomment-2424946183

Aulig commented 1 month ago

I think the best way to figure it out might be to debug both the ruby & python implementation side by side and see where the python one starts deviating (probably due to differences in python/ruby provided functions like base64 encoding like you said)

On Mon, 21 Oct 2024, 00:04 Ghawken, @.***> wrote:

@gcobb321 https://github.com/gcobb321 @Aulig https://github.com/Aulig Thanks for the fast lane

The hashcash, calculated from /siginin x-bit header - I had implemented and then removed as didn’t seem necessary— so will check where they use in more detail here..

I have successfuly, logged in via /signin, then init, just failing on the last step..

I can get to /complete which is the end basically - if successfully gives a 409 and cookies with Session Details like before, which then needs 2FA steps..

I’m getting a 403 here at this last step and an error request via requests to enter email/details.

I can only presume my calculated m1 and m2, which I send are incorrect.

Issue is calculating m1 and m2 depends on base64, encoding, padding bytes or not - very python specific aspects and various SRP python library differences. The apple browser given m1 and m2 - also seems shorter to what I would expect

But its another day here - although pressing demands... the issue will be encoding of base64 and these factors.

Reviewing the RUBY: (for my future reference as away at moment)

Init:

   #a: Base64.encode64(a),
    a: Base64.strict_encode64(to_byte(a)),

Obviously encode failed and strict_encode with conversion to bytes before needed... interesting..,

Return from init;

  iterations = body["iteration"]
  salt = Base64.strict_decode64(body["salt"])
  b = Base64.strict_decode64(body["b"])
  c = body["c"]
 key_length = 32

       m1 = client.process_challenge(
          user,
          to_hex(encrypted_password),
          to_hex(salt),
          to_hex(b),
          is_password_encrypted: true
      )
  m2 = client.H_AMK

        data = {
                accountName: user,
                c: c,
                m1: Base64.encode64(to_byte(m1)).strip,
                m2: Base64.encode64(to_byte(m2)).strip,
                rememberMe: false
  }

&& not forgetting the hashcash to /complete req.headers["X-Apple-HC"] = hashcash if hashcash

def pbkdf2(password, salt, iterations, key_length, digest = OpenSSL::Digest::SHA256.new)
      require 'openssl'
  password = OpenSSL::Digest::SHA256.digest(password)
      OpenSSL::PKCS5.pbkdf2_hmac(password, salt, iterations, key_length, digest)
  end

— Reply to this email directly, view it on GitHub https://github.com/gcobb321/icloud3_v3/issues/341#issuecomment-2425202020, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVIUYWV5JPPXYYTMUUM5F3Z4QLEFAVCNFSM6AAAAABQGYQPE6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRVGIYDEMBSGA . You are receiving this because you were mentioned.Message ID: @.***>

Ghawken commented 1 month ago

@gcobb321

Stand alone testing:

Modify username, and password

https://gist.github.com/Ghawken/3786d67333258d8b2b61c66c1eaf1b32

Above is a reasonable start... still some issue with bytes, encoding, base64 and m1 and m2.
Ideally should get a 409 on last page and need to then do 2FA