Skip to content

Commit

Permalink
fixed import issue and bumped to v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
s5dev committed Apr 16, 2023
1 parent 77c83cd commit 4fd1c40
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion manifest-scanner/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "manifest-scanner",
"version": "1.0.2",
"version": "1.0.4",
"description": "Manifest Scanner for Android Application",
"author": "Shivasurya @s5dev",
"bin": {
Expand Down
5 changes: 3 additions & 2 deletions manifest-scanner/src/commands/scan.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Args, Command, Flags } from "@oclif/core";
import { findFileInDirectory, parseXmlFileToJson } from "../utils/fileutils";
import ManifestPlugin from "../plugins/ManifestPlugin";
import { ManifestPlugin } from "../plugins/ManifestPlugin";
import path = require("path");
const fs = require("fs/promises");

Expand Down Expand Up @@ -72,7 +72,8 @@ export default class Scan extends Command {
const files = await fs.readdir(folder);
for (const file of files) {
// console.log(folder + "/" + file);
let filePath = path.join(__dirname, "..", 'plugins', 'manifest', file);
let fileWithoutExtension = file.split(".")[0];
let filePath = path.join(__dirname, "..", 'plugins', 'manifest', fileWithoutExtension);
const { default: Rule } = await import(
filePath
);
Expand Down
2 changes: 2 additions & 0 deletions manifest-scanner/src/plugins/ManifestPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ export default abstract class ManifestPlugin extends BasePlugin {

abstract run(): void; // User should define how their plugin runs
}

export { ManifestPlugin };
2 changes: 1 addition & 1 deletion manifest-scanner/src/plugins/manifest/APIKeysRule.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ManifestPlugin from "../ManifestPlugin";
import { ManifestPlugin } from "../ManifestPlugin";
import { Severity, getRelativePath, searchKeywordInFile } from "../util";
import * as fs from "fs";

Expand Down
2 changes: 1 addition & 1 deletion manifest-scanner/src/plugins/manifest/AllowBackupRule.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ManifestPlugin from "../ManifestPlugin";
import { ManifestPlugin } from "../ManifestPlugin";
import { Severity, searchKeywordInFile, getRelativePath } from "../util";

// write a rule to check if the allowBackup attribute is set to true or false inside class AllowBackupRule extended from BaseRule implemeting run method
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ManifestPlugin from "../ManifestPlugin";
import { ManifestPlugin } from "../ManifestPlugin";
import { Severity, getRelativePath, searchKeywordInFile } from "../util";

// write a rule to check if the allowBackup attribute is set to true or false inside class AndroidDebuggable extended from BaseRule implemeting run method
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ManifestPlugin from "../ManifestPlugin";
import { ManifestPlugin } from "../ManifestPlugin";
import { Severity, getRelativePath, searchKeywordInFile } from "../util";

// write a rule to check if the custom permission tag is available
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BaseJavaCstVisitorWithDefaults } from "java-parser";
import ManifestPlugin from "../ManifestPlugin";
import { ManifestPlugin } from "../ManifestPlugin";
import { Severity, getRelativePath, searchKeywordInFile } from "../util";
import { getJavaFiles } from "../../utils/fileutils";
const { parse } = require("java-parser");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ManifestPlugin from "../ManifestPlugin";
import { ManifestPlugin } from "../ManifestPlugin";
import { Severity, getRelativePath, searchKeywordInFile } from "../util";

export default class SingleTaskLaunchModeRule extends ManifestPlugin {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ManifestPlugin from "../ManifestPlugin";
import { ManifestPlugin } from "../ManifestPlugin";
import { Severity, getRelativePath, searchKeywordInFile } from "../util";

export default class TaskReParentingRule extends ManifestPlugin {
Expand Down
3 changes: 2 additions & 1 deletion manifest-scanner/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"outDir": "dist",
"rootDir": "src",
"strict": true,
"target": "es2019"
"target": "es2019",
"esModuleInterop": true,
},
"include": ["src/**/*"]
}

0 comments on commit 4fd1c40

Please sign in to comment.