Skip to content

Conversation

@sam-jeffery
Copy link
Contributor

I've been missing the ability to track Cainiao (Aliexpress) parcels on this app which held me off from deleting my other parcel tracking app, so thought I'd have a look at adding it. Turns out it isn't that difficult!

Summary of changes:

  • Added new delivery service for Cainiao deliveries in CainiaoDeliveryService.kt
  • Added it to the Services enum and getDeliveryService in Core.kt
  • Added a new status for when items have cleared customs but not left it yet. I don't know if you've already decided against this before so happy to remove it if you want but though I'd add it as it's a bit more clear than just 'In transit'.
  • Updated readme to include Cainiao as a supported service.

I couldn't come up with any tests for this one as it seems that the tracking number can take a few formats based on the local delivery service used when the parcel arrives in the destination country, and I only have a few tracking numbers to test with from my own parcels. It will detect invalid codes in the app just fine by checking it with the API, though.

I gathered together any status codes I could find from my tracking codes and what I could find on the Aliexpress subreddit, I think most of them are covered but there may be a few uncommon ones that I didn't get. Its a bit difficult since there is no documentation for this api.

Main parcels list:
main

Package in transit:
in_transit

Delivered package:
delivered

Invalid tracking code:
invalid_tracking

Let me know what you think, happy to make any changes :)

Copy link
Owner

@itsvic-dev itsvic-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. this was already WIP in #24 but im glad to finally have a finished, more up-to-date implementation.

@itsvic-dev itsvic-dev merged commit 9be2e00 into itsvic-dev:master May 31, 2025
2 checks passed
@sam-jeffery sam-jeffery deleted the cainiao branch May 31, 2025 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants