Skip to content

Commit 6284afc

Browse files
committed
fix: rollback gradle config android
1 parent 7d4d9f2 commit 6284afc

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

src/model/armor-encode-request.ts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// automatically generated by the FlatBuffers compiler, do not modify
2+
3+
import * as flatbuffers from 'flatbuffers';
4+
5+
export class ArmorEncodeRequest {
6+
bb: flatbuffers.ByteBuffer|null = null;
7+
bb_pos = 0;
8+
__init(i:number, bb:flatbuffers.ByteBuffer):ArmorEncodeRequest {
9+
this.bb_pos = i;
10+
this.bb = bb;
11+
return this;
12+
}
13+
14+
static getRootAsArmorEncodeRequest(bb:flatbuffers.ByteBuffer, obj?:ArmorEncodeRequest):ArmorEncodeRequest {
15+
return (obj || new ArmorEncodeRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
16+
}
17+
18+
static getSizePrefixedRootAsArmorEncodeRequest(bb:flatbuffers.ByteBuffer, obj?:ArmorEncodeRequest):ArmorEncodeRequest {
19+
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
20+
return (obj || new ArmorEncodeRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
21+
}
22+
23+
packet(index: number):number|null {
24+
const offset = this.bb!.__offset(this.bb_pos, 4);
25+
return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
26+
}
27+
28+
packetLength():number {
29+
const offset = this.bb!.__offset(this.bb_pos, 4);
30+
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
31+
}
32+
33+
packetArray():Uint8Array|null {
34+
const offset = this.bb!.__offset(this.bb_pos, 4);
35+
return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
36+
}
37+
38+
static startArmorEncodeRequest(builder:flatbuffers.Builder) {
39+
builder.startObject(1);
40+
}
41+
42+
static addPacket(builder:flatbuffers.Builder, packetOffset:flatbuffers.Offset) {
43+
builder.addFieldOffset(0, packetOffset, 0);
44+
}
45+
46+
static createPacketVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
47+
builder.startVector(1, data.length, 1);
48+
for (let i = data.length - 1; i >= 0; i--) {
49+
builder.addInt8(data[i]!);
50+
}
51+
return builder.endVector();
52+
}
53+
54+
static startPacketVector(builder:flatbuffers.Builder, numElems:number) {
55+
builder.startVector(1, numElems, 1);
56+
}
57+
58+
static endArmorEncodeRequest(builder:flatbuffers.Builder):flatbuffers.Offset {
59+
const offset = builder.endObject();
60+
return offset;
61+
}
62+
63+
static createArmorEncodeRequest(builder:flatbuffers.Builder, packetOffset:flatbuffers.Offset):flatbuffers.Offset {
64+
ArmorEncodeRequest.startArmorEncodeRequest(builder);
65+
ArmorEncodeRequest.addPacket(builder, packetOffset);
66+
return ArmorEncodeRequest.endArmorEncodeRequest(builder);
67+
}
68+
}

src/shim.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
if (typeof BigInt === 'undefined') {
2+
const bigInt = require('big-integer');
3+
bigInt.asUintN = function (bits:any, bigint:any) {
4+
bigint = bigInt(bigint);
5+
if (typeof bigint.value === 'bigint') {
6+
return bigInt(BigInt.asUintN(bits, bigint.value));
7+
}
8+
const p2bits = bigInt(1).shiftLeft(bits);
9+
const mod = bigint.and(p2bits.subtract(1));
10+
return mod;
11+
};
12+
bigInt.asIntN = function (bits:any, bigint:any) {
13+
bigint = bigInt(bigint);
14+
if (typeof bigint.value === 'bigint') {
15+
return bigInt(BigInt.asIntN(bits, bigint.value));
16+
}
17+
const p2bits = bigInt(1).shiftLeft(bits);
18+
const mod = bigint.and(p2bits.subtract(1));
19+
return mod.greaterOrEquals(p2bits.subtract(mod))
20+
? mod.subtract(p2bits)
21+
: mod;
22+
};
23+
global.BigInt = bigInt;
24+
}

0 commit comments

Comments
 (0)