File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -723,6 +723,7 @@ class _LoginByPasswordScreenState extends State<LoginByPasswordScreen>
723723 ),
724724 const SizedBox (width: 10 ),
725725 Column (
726+ crossAxisAlignment: CrossAxisAlignment .start,
726727 children: [
727728 Text (
728729 _userInfo! .name,
Original file line number Diff line number Diff line change 1313 * If not, see <https://www.gnu.org/licenses/>.
1414 */
1515
16+ import 'dart:convert' ;
17+ import 'dart:math' ;
18+ import 'dart:typed_data' ;
19+
1620import 'package:twitee/Utils/utils.dart' ;
1721
1822class RequestHeaderUtil {
@@ -22,7 +26,18 @@ class RequestHeaderUtil {
2226 static const String defaultUA =
2327 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0" ;
2428
29+ static const String defaultForward = "ffae6b0ad5900b5c0f7aaecda11b845111487f41d7f79cd4dd6b44f7b7d2d68188842dea6b5c7c565ce5b8acb9d4f118a548300b414c545bc83db8c7f9de73887562ad7bddddb8be3d005afccc25fb164787ea04b089450971d178e23859f1b0bdd03d263d9981c051592fd3f3e4186efa038ad3a4d042e0931c984c0b1abf9724f4c51df49544b57a55f83b03fa790b8c5e050da192c77c74633d0875767c914c6a844aa7b4c7cbb153583f27ae2616de1d39c6894999a464485d056aa8615a65986d9841f6cc43d35596080cd9889b595e6130ee9c3acef982c94f46fdd0a67aaca353790e7de570dd23e3e8eee1878a4d5b9186a486d736b02abd601536dff69465a8da6dd3b3" ;
30+
2531 static String getXReqId ({int length = 8 }) {
2632 return Utils .getRandomString (length: length);
2733 }
34+
35+ static String generateTransactionId ({int byteLength = 75 }) {
36+ final random = Random .secure ();
37+ final bytes = Uint8List (byteLength);
38+ for (int i = 0 ; i < byteLength; i++ ) {
39+ bytes[i] = random.nextInt (256 );
40+ }
41+ return base64Url.encode (bytes).replaceAll ('=' , '' );
42+ }
2843}
Original file line number Diff line number Diff line change @@ -228,6 +228,8 @@ class RequestUtil {
228228 "User-Agent" : RequestHeaderUtil .defaultUA,
229229 "x-twitter-client-language" : "zh-cn" ,
230230 "x-twitter-active-user" : "yes" ,
231+ "x-xp-forwarded-for" : RequestHeaderUtil .defaultForward,
232+ "x-client-transaction-id" : RequestHeaderUtil .generateTransactionId (),
231233 });
232234 if (domainType != DomainType .api || forceCsrfToken) {
233235 options.headers? .addAll ({
You can’t perform that action at this time.
0 commit comments