Valid PETEP extension is any JAR file that contains package "petep" with class "PetepExtension" that extends the Extension class and implements all the abstract methods.
/*
* PEnetration TEsting Proxy (PETEP)
*
* Copyright (C) 2020 Michal Válka
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program. If
* not, see <https://www.gnu.org/licenses/>.
*/
/** Superclass for extensions. */
@PetepAPI
public abstract class Extension {
/** Path where the extension .jar file is located. */
protected final String path;
public Extension(String path) {
this.path = path;
}
public final String getPath() {
return path;
}
/** Initializes the extension. */
public abstract void init(ExtensionHelper helper);
/** Initializes the extension GUI. */
public abstract void initGui(GuiHelper helper);
public abstract String getCode();
public abstract String getName();
public abstract String getDescription();
public abstract String getVersion();
}
If you want to take some action before or after initalization, you can implement the following interfaces into your extension class (you can use this, for example, to add rule factories to Tagger/Modifier before it initializes):
/*
* PEnetration TEsting Proxy (PETEP)
*
* Copyright (C) 2020 Michal Válka
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program. If
* not, see <https://www.gnu.org/licenses/>.
*/
@PetepAPI
public interface ExtensionInitListener {
/** Runs before extensions are initialized. */
void beforeInit(ExtensionHelper helper);
/** Runs after extensions are initialized. */
void afterInit(ExtensionHelper helper);
}
/*
* PEnetration TEsting Proxy (PETEP)
*
* Copyright (C) 2020 Michal Válka
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program. If
* not, see <https://www.gnu.org/licenses/>.
*/
@PetepAPI
public interface ExtensionGuiInitListener {
/** Runs before extension GUIs are initialized. */
void beforeInitGui(GuiHelper helper);
/** Runs after extension GUIs are initialized. */
void afterInitGui(GuiHelper helper);
}
These methods will be automatically called if you implement these interfaces.