Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to get the release date for an old AppGallery app #1630

Closed
StSav012 opened this issue May 17, 2024 · 2 comments
Closed

Failed to get the release date for an old AppGallery app #1630

StSav012 opened this issue May 17, 2024 · 2 comments
Labels
bug Something isn't working needs follow up Further information is requested source-specific This bug/feature affects a specific source

Comments

@StSav012
Copy link

StSav012 commented May 17, 2024

Obtainium fails to find the release date for https://appgallery.cloud.huawei.com/appdl/C104450749 and, possibly, other apps published years ago.

Steps to Reproduce:

  1. Add an app using this URL: https://appgallery.cloud.huawei.com/appdl/C104450749.
  2. Click the Add button.
  3. See error: FormatException: Trying to read yy from ru-/d-l/-ap-pd-l/-ap-pl-ic-at-io-n/-ap-k/-32-/3-2d-dd-aa-c6-30-34-75-b9-6d-cb-98-04-da-16-96-4/-16-66-97-26-48-78-4--16-55-e5-a0--e-85-5--46-33--9-34-6--42-66-7a-74-4c-5c at 0 or another beginning.

Investigation

The server redirects to https://appdlc-drru.hispace.dbankcloud.ru/dl/appdl/application/apk/32/32dddaac6303475b96dcb9804da16964/1666972648784-1655e5a0-e855-4633-9346-42667a744c5c.apk?maple=0&trackId=0&distOpEntity=HKS

The app adds numerous dashes due to the lines:

var i = 2;
while (i < tempLen) {
relDateStrAdj?.insert((i + i ~/ 2 - 1), '-');
i += 2;
}

Before that, the app gets the first part of the URL:

var relDateStr =
res.headers['location']?.split('?')[0].split('.').reversed.toList()[1];

Namely,

  • res.headers['location'] is https://appdlc-drru.hispace.dbankcloud.ru/dl/appdl/application/apk/32/32dddaac6303475b96dcb9804da16964/1666972648784-1655e5a0-e855-4633-9346-42667a744c5c.apk?maple=0&trackId=0&distOpEntity=HKS (or another host, depending on the load balancer).
  • res.headers['location']?.split('?')[0] is https://appdlc-drru.hispace.dbankcloud.ru/dl/appdl/application/apk/32/32dddaac6303475b96dcb9804da16964/1666972648784-1655e5a0-e855-4633-9346-42667a744c5c.apk (or another host, depending on the load balancer).
  • res.headers['location']?.split('?')[0].split('.').reversed.toList()[1] is ru/dl/appdl/application/apk/32/32dddaac6303475b96dcb9804da16964/1666972648784-1655e5a0-e855-4633-9346-42667a744c5c (or another beginning, depending on the load balancer).
    See that the latter contains no '.'.

The Solution

Check whether relDateStr contains a '/'.

  • If so,
    var relDate = DateTime.fromMillisecondsSinceEpoch(int.parse(relDateStr?.split('/').last.split('-').first));
    Or something like that. It's my first Dart line.
  • Otherwise, use the existing code:
    var relDateStrAdj = relDateStr?.split('');
    var tempLen = relDateStrAdj?.length ?? 0;
    var i = 2;
    while (i < tempLen) {
    relDateStrAdj?.insert((i + i ~/ 2 - 1), '-');
    i += 2;
    }
    var relDate = relDateStrAdj == null
    ? null
    : DateFormat('yy-MM-dd-HH-mm', 'en_US').parse(relDateStrAdj.join(''));
@StSav012 StSav012 added bug Something isn't working to check Issue has not been reviewed labels May 17, 2024
@ImranR98
Copy link
Owner

This URL seems to be different from AppGallery pages I've seen before - it leads to a direct download, and https://appgallery.huawei.com/app/C104450749 is empty. It might not be possible to use it since we can't get a valid app ID or release date. Do you have a link to the actual app listing page?

@ImranR98 ImranR98 added needs follow up Further information is requested source-specific This bug/feature affects a specific source and removed to check Issue has not been reviewed labels May 17, 2024
@StSav012
Copy link
Author

That seems to mean that the app is geo-restricted. I haven't expected that.

The page I see following https://appgallery.huawei.com/app/C104450749 looks like this:
image

The page also reads that the app was updated on 10/31/2022. I couldn't find another app that's that old.

I'm unsure if the issue is relevant for anyone but me, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs follow up Further information is requested source-specific This bug/feature affects a specific source
Projects
None yet
Development

No branches or pull requests

2 participants