Skip to content

Commit 3546f32

Browse files
feat: upgrade APP_VERSION to 169.1.0.29.135
1 parent 117ac2a commit 3546f32

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "instagram-private-api",
33
"description": "Instagram private API wrapper for full access to instagram",
4-
"version": "1.43.3",
4+
"version": "1.43.4",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"files": [

src/core/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export const APP_VERSION = '121.0.0.29.119';
2-
export const APP_VERSION_CODE = '185203708';
1+
export const APP_VERSION = '169.1.0.29.135';
2+
export const APP_VERSION_CODE = '262886998';
33
export const SIGNATURE_KEY = '9193488027538fd3450b83b7d05286d4ca9599a0f7eeed90d8c85925698a05dc';
44
export const BREADCRUMB_KEY = 'iN4$aGr0m';
55
export const SIGNATURE_VERSION = '4';

src/core/request.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ export class Request {
107107
}
108108

109109
public signature(data: string) {
110-
return createHmac('sha256', this.client.state.signatureKey)
111-
.update(data)
112-
.digest('hex');
110+
return 'SIGNATURE';
113111
}
114112

115113
public sign(payload: Payload): SignedPost {

src/repositories/account.repository.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ export class AccountRepository extends Repository {
2626
if (!this.client.state.passwordEncryptionPubKey) {
2727
await this.client.qe.syncLoginExperiments();
2828
}
29-
const {encrypted, time} = this.encryptPassword(password);
29+
const { encrypted, time } = this.encryptPassword(password);
3030
const response = await Bluebird.try(() =>
3131
this.client.request.send<AccountRepositoryLoginResponseRootObject>({
3232
method: 'POST',
3333
url: '/api/v1/accounts/login/',
3434
form: this.client.request.sign({
3535
username,
36-
password,
3736
enc_password: `#PWD_INSTAGRAM:4:${time}:${encrypted}`,
3837
guid: this.client.state.uuid,
3938
phone_id: this.client.state.phoneId,
@@ -77,14 +76,17 @@ export class AccountRepository extends Repository {
7776
return `2${sum}`;
7877
}
7978

80-
public encryptPassword(password: string): { time: string, encrypted: string } {
79+
public encryptPassword(password: string): { time: string; encrypted: string } {
8180
const randKey = crypto.randomBytes(32);
8281
const iv = crypto.randomBytes(12);
83-
const rsaEncrypted = crypto.publicEncrypt({
84-
key: Buffer.from(this.client.state.passwordEncryptionPubKey, 'base64').toString(),
85-
// @ts-ignore
86-
padding: crypto.constants.RSA_PKCS1_PADDING,
87-
}, randKey);
82+
const rsaEncrypted = crypto.publicEncrypt(
83+
{
84+
key: Buffer.from(this.client.state.passwordEncryptionPubKey, 'base64').toString(),
85+
// @ts-ignore
86+
padding: crypto.constants.RSA_PKCS1_PADDING,
87+
},
88+
randKey,
89+
);
8890
const cipher = crypto.createCipheriv('aes-256-gcm', randKey, iv);
8991
const time = Math.floor(Date.now() / 1000).toString();
9092
cipher.setAAD(Buffer.from(time));
@@ -98,8 +100,10 @@ export class AccountRepository extends Repository {
98100
Buffer.from([1, this.client.state.passwordEncryptionKeyId]),
99101
iv,
100102
sizeBuffer,
101-
rsaEncrypted, authTag, aesEncrypted])
102-
.toString('base64'),
103+
rsaEncrypted,
104+
authTag,
105+
aesEncrypted,
106+
]).toString('base64'),
103107
};
104108
}
105109

0 commit comments

Comments
 (0)