Skip to main content

flutter_chaoxing 0.1.3 copy "flutter_chaoxing: ^0.1.3" to clipboard
flutter_chaoxing: ^0.1.3 copied to clipboard

retracted

Typed Chaoxing (学习通) protocol clients for Dart: request signing, device registration, passport2 login, classroom sign-in across all nine sign flavours, and a solver for the captcha.chaoxing.com slider captcha.

Changelog #

0.1.3 #

Live-verified against the production server (2026-09-24) with a real account and a course that had all nine sign flavours published at once. Five were signed end-to-end from Dart with no WebView.

Added #

  • ChaoxingCaptchaService — 超星's in-house captcha.chaoxing.com captcha, reversed from the obfuscated load.min.js web bundle (a javascript-obfuscator build; the rotating string array was decoded to recover CONFIG and the three jsonp endpoints). Covers captcha/get/conf, captcha/get/verification/image and captcha/check/verification/result, plus the MD5 parameter derivation (captchaKey, token with its 5-minute expiry, and the iv that must be replayed verbatim). solveSlide runs the whole loop and returns the validate string.
  • ChaoxingCaptchaDetector — four-cue slide-gap detection (contour gradient, normalised cross-correlation, surround darkness, colour SAD), min-max normalised over the interior band and fused, with an edge/NCC consensus shortcut. Measured 6/6 against the live service.
  • ChaoxingSignKind — the activeSort → flavour table (1 纯普通, 2 防作弊, 3 拍照, 4 位置, 5 位置+人脸, 6/7/8 二维码, 9 签到码), with isHeadlessCapable and usesPost. activeType is 2 for all nine and cannot discriminate.
  • ChaoxingActiveInfo — a model for v2/apis/active/getPPTActiveInfo, replacing the unparsed Map that fetchActiveInfo returned. Documents what the server discloses (locationText, locationRange, numberCount, the anti-cheat and face flags) and what it withholds (signCode, and the target's coordinates).
  • ChaoxingSignCodeCheck — widget/sign/pcStuSignController/checkSignCode, including isBanned so a caller stops instead of brute-forcing a code the server has already locked.
  • ChaoxingSecondaryVerificationRequired — thrown when passport2 accepts the password (status:true) but returns a tocheckmessage webUrl and no SSO url. Previously this fell through to a misleading SSO did not return an identity network failure.
  • buildClassroomSignParams and the POST submit path, so the 拍照, 签到码, 位置 and 二维码 flavours can be sent in the shape their pages use.

Changed #

  • submitClassroomSign gained the per-flavour arguments (signCode, objectId, photoResult, address, ifTiJiao, locationResult, location, enc, vpProbability, vpStrategy, currentFaceId, ifCFP, faceEnc, faceCode), a kind that selects the HTTP verb, and a usePost override. All new parameters are optional, so existing call sites are unaffected. Its latitude/longitude defaults are now -1, matching the pages.
  • ChaoxingClassroomSignResult classifies four more server replies: 您已签到过了 (alreadySigned, and now counted by isSigned), 签到失败,请重新扫描 (rescanRequired), [face]… (faceRequired), and …不在可签到范围内。 (outOfRange).
  • ChaoxingAuthService.login raises ChaoxingSecondaryVerificationRequired for the second-factor case instead of falling through.
  • Added image: ^4.9.1 as a dependency (pure Dart) for captcha image decoding.

Documentation #

  • The plaintext official User-Agent is not universally tolerated — this reverses a 0.1.1 claim. Measured: passport2-api rejects it and demands a new-device SMS second factor, while mobilelearn returns 请用学习通客户端打开活动列表 without it. Log in with a browser UA, then switch to ChaoxingUserAgent.build for the learn APIs.
  • doc/protocol.md was rewritten as a consumer-facing reference: hosts and which signing scheme each uses, the three schemes' wire contracts, device registration, login outcomes, the endpoint table, all nine sign flavours with their verbs and response tokens, the CXCaptcha protocol and detector, and a consolidated known-limits table. It now carries an explicit evidence-grading convention ([measured] / [reported] / [inferred] / [unverified]) so a caller can tell a live-verified fact from a claim inherited from write-ups about 4.0.1–6.7.x clients.
  • Removed the reverse-engineering archaeology from the published package — decompiled class/line citations in prose, native offsets, and the anti-analysis notes. Source comments in lib/src/ keep their per-constant provenance so the port stays auditable.

License #

  • MIT → Apache-2.0, for an explicit patent grant. Code already taken under MIT (0.1.0–0.1.2) may continue to be used under those terms.
  • Dropped the repository and issue_tracker fields from pubspec.yaml.

Not solved, by design #

位置+人脸识别 needs a CLIENT_FACE_RECOGNITION_BLINK liveness capture, and the three 二维码 flavours need an enc that only exists inside the teacher's live QR code. Both refusals come from the server, not from missing protocol knowledge. Non-slide captcha flavours (textclick, iconclick, rotate, obstacle) remain unsolved.

0.1.2 #

Live-verified against the production server (2026-09-23) with a real account.

  • Fix parseCourses: the production backclazzdata envelope is class-centric — channelList[].content is the class (id=classId, name, chatid, bbsid, cpi) and the course sits at content.course.data[] (id=courseId, name, teacherfactor, imageurl). The previous parser expected a course-centric content.clazz[] and returned zero courses. The legacy shape is kept as a fallback.
  • Add the classroom sign submit pptSign/stuSignajax (buildClassroomSignUri / submitClassroomSign / ChaoxingClassroomSignResult). This is the endpoint the H5 newsign/preSign page calls — the official Android client never invokes it natively (it drives the WebView), but it is a plain cookie-authenticated GET, so plain signs now work headlessly. Captured live: a 纯普通 sign returned success; an anti-cheat 防作弊(验证码) sign returned validate (needs a captcha.chaoxing.com token passed back via the validate parameter, plus the native CLIENT_DEVICE_FLAG deviceCode).
  • Add bbsid to ChaoxingCourse (the discussion-board id, present in the live payload and needed by ChaoxingApiService.fetchTopicList).
  • Confirm device registration end-to-end: a real login returned a 172-char clientId that resolveDeviceIdentity decrypted into a valid cxcid/sc pair, and the server issued it even though cdtype/cdid/mediaDrmId were omitted — so those three fields are optional for clientId issuance.

0.1.1 #

  • Add ChaoxingUserAgent, reproducing the official 7.0.2 User-Agent structure (p482ej/C30158f.java). Every constant is read from the decompiled source, not guessed: protocol tag 3 (C37365n.f144063a), screen code 264 (C32754f.f129562A via C32316b.m127070g), channel @Kalimdor (C32764p.mo127076e/mo127077f both false), package com.chaoxing.mobile. The native cryptUserAgent wrapper is not reversed, so the plaintext suffix is emitted (server-tolerated; see the class doc).
  • ChaoxingAuthService, ChaoxingSignService, and ChaoxingApiService now take an optional userAgent, defaulting to the previous value.
  • Confirm the device-registration public key: static RE shows getDeviceInfo (encrypt) and decryptDeviceInfo (decrypt) both use the SPKI key at libsecuritylib.so 0x52e19, which is the one already embedded. Document the getDeviceInfo JSON key order and that platform/os_name are "android" and mediaDrmId comes from Settings.Secure.getString.

0.1.0 #

  • Initial public preview extracted from the Luotopia app.
  • Byte-exact ports of the Chaoxing 7.0.2 request-signing primitives: the two inf_enc query-signing variants, the cxsign/signToken header scheme, and the webRequestSign RSA-SHA256 bridge used by CLIENT_FORM_SIGN.
  • Device registration helpers (CxDevice.getDeviceInfo / decryptDeviceInfo) with chunked RSA and jsoncpp FastWriter alignment.
  • Login and SSO cookie-harvest client (ChaoxingAuthService).
  • Classroom sign-in client (ChaoxingSignService), including the native Fanya usersign/addsign endpoint and the CLIENT_FORM_SIGN bridge implementation.
  • Student-facing API client (ChaoxingApiService): notices, grades, homework feed, live classes, course content, timetable, messages, and discussions.
  • Typed domain models mirroring the official StudentMission, Course, and Clazz schemas, plus the activeType dispatch table.
0
likes
0
points
483
downloads

Publisher

verified publisherwhu.sb

Weekly Downloads

Typed Chaoxing (学习通) protocol clients for Dart: request signing, device registration, passport2 login, classroom sign-in across all nine sign flavours, and a solver for the captcha.chaoxing.com slider captcha.

Topics

#chaoxing #xuexitong #sign-in #captcha #education

License

unknown (license)

Dependencies

crypto, dio, image, pointycastle

More

Packages that depend on flutter_chaoxing