Skip to content

Commit

Permalink
fixed linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chame1eon committed Nov 3, 2020
1 parent 9cb342f commit 99ddca8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jnitrace/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ JNILibraryWatcher.setCallback({
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const op = recv("config", (message: any): void => {
const builder = new ConfigBuilder();
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
builder.libraries = message.payload.libraries;
builder.backtrace = message.payload.backtrace;
Expand All @@ -31,6 +32,7 @@ JNILibraryWatcher.setCallback({
transport.setIncludeFilter(message.payload.include);
transport.setExcludeFilter(message.payload.exclude);
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
/* eslint-enable @typescript-eslint/no-unsafe-assignment */
});
op.wait();
}
Expand Down
22 changes: 22 additions & 0 deletions jnitrace/src/transport/data_transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ const JNI_ENV_INDEX = 0;

class NativeMethodJSONContainer {
public readonly name: { [id: string]: string | null } = {};

public readonly sig: { [id: string]: string | null } = {};

public readonly addr: { [id: string]: string | null } = {};


public constructor (
name: { [id: string]: string | null },
sig: { [id: string]: string | null },
Expand All @@ -30,10 +33,14 @@ class NativeMethodJSONContainer {
/* eslint-disable @typescript-eslint/camelcase */
class DataJSONContainer {
public readonly value: NativeArgumentValue | NativeReturnValue;

public readonly data: ArrayBuffer | NativeArgumentValue | NativeReturnValue
| string | NativeMethodJSONContainer[] | undefined;

public readonly data_for: number | undefined;

public readonly has_data: boolean | undefined;

private metadata: string | undefined;

public constructor (
Expand Down Expand Up @@ -71,7 +78,9 @@ class DataJSONContainer {

class BacktraceJSONContainer {
public readonly address: NativePointer;

public readonly module: Module | null;

public readonly symbol: DebugSymbol | null;

public constructor (
Expand All @@ -87,14 +96,21 @@ class BacktraceJSONContainer {

class RecordJSONContainer {
public readonly type: string;

public readonly call_type: string;

public readonly method: JNIMethod;

public readonly args: DataJSONContainer[];

public readonly ret: DataJSONContainer;

public readonly thread_id: number;

public readonly timestamp: number;

public readonly java_params: string[] | undefined;

public readonly backtrace: BacktraceJSONContainer[] | undefined;

public constructor (
Expand Down Expand Up @@ -122,11 +138,17 @@ class RecordJSONContainer {

class DataTransport {
private readonly start: number;

private readonly byteArraySizes: Map<string, number>;

private readonly jobjects: Map<string, string>;

private readonly jfieldIDs: Map<string, string>;

private readonly jmethodIDs: Map<string, string>;

private include: string[];

private exclude: string[];

public constructor () {
Expand Down
2 changes: 2 additions & 0 deletions jnitrace/src/utils/java_method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ const SEMI_COLON_OFFSET = 1;

class JavaMethod {
private readonly __: string;

private readonly _params: string[];

private readonly _ret: string;

public constructor (signature: string) {
Expand Down
4 changes: 4 additions & 0 deletions jnitrace/src/utils/method_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import { JavaMethod } from "jnitrace-engine";

class MethodData {
private readonly _method: JNIMethod;

private readonly _jmethod: JavaMethod | undefined;

private readonly _args: NativeArgumentValue[];

private readonly _jparams: string[];

private readonly _ret: NativeReturnValue;

public constructor (
Expand Down

0 comments on commit 99ddca8

Please sign in to comment.