Skip to content

Commit 1e61e53

Browse files
committed
commit from new windows install
1 parent 5072de9 commit 1e61e53

File tree

7 files changed

+8
-28
lines changed

7 files changed

+8
-28
lines changed

ExampleOut/API/exampleAPI.jar

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

ExampleOut/entryPoint.jar

0 Bytes
Binary file not shown.

examplepluginloader/bin/main/examplepluginloader/Plugger/DangerZone.kt

+8-22
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,14 @@ class DangerZone(pluginLocation: URI) {
4242
bcINFO.classBytes.forEach { (k,v) -> totalCInfos.addAll(getClassDangerInfo(bcINFO.yourURL, k, v)) }
4343
return totalCInfos
4444
}
45-
companion object{
46-
fun getClassDangerInfo(yourURL: URL, entryName: String, classBytes: ByteArray): List<ClassDangerCheckInfo> {
47-
val classInfo = mutableListOf<ClassDangerCheckInfo>()
48-
/*val classReader = ClassReader(classBytes)
49-
classReader.accept(object : ClassVisitor(Opcodes.ASM9) {
50-
override fun visitMethod(access: Int, name: String, descriptor: String, signature: String?, exceptions: Array<String>?): MethodVisitor? {
51-
print("${access}, ${name}, ${descriptor}, ${signature}" )
52-
exceptions?.forEach { print(it) }
53-
println()
54-
return null
55-
}
56-
override fun visitSource(source: String?, debug: String?){
57-
println("$source :: $debug")
58-
}
59-
override fun visitPermittedSubclass(permittedSubclass: String?){
60-
println("PSubC: $permittedSubclass")
61-
}
62-
//TODO: visit all the other things and add the object(s) to the list so we can dangerCheck() later!
63-
//Add them all to 1 object for ease of use later
64-
}, ClassReader.EXPAND_FRAMES)*/
65-
return classInfo
66-
}
45+
private fun getClassDangerInfo(yourURL: URL, entryName: String, classBytes: ByteArray): List<ClassDangerCheckInfo> {
46+
val classInfo = mutableListOf<ClassDangerCheckInfo>()
47+
val classReader = ClassReader(classBytes)
48+
classReader.accept(object : ClassVisitor(Opcodes.ASM9) {
49+
//TODO: visit all the other things and add the object(s) to the list so we can dangerCheck() later!
50+
//Add them all to 1 object for ease of use later
51+
}, ClassReader.EXPAND_FRAMES)
52+
return classInfo
6753
}
6854
fun rescDangerScan(bcINFO: JByteCodeURLINFO): List<CInfo> {
6955
val totalCInfos = mutableListOf<CInfo>()

examplepluginloader/bin/main/examplepluginloader/Plugger/PluginLoader.kt

-6
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,13 @@ import java.net.URL
55
import java.io.InputStream
66
import java.util.UUID
77
import java.util.Enumeration
8-
//import java.awt.Toolkit
9-
//import java.awt.EventQueue
10-
//import java.awt.event.InvocationEvent
118
class PluginLoader(val plugURL: URL, val plugID: UUID, val parentCL: ClassLoader): URLClassLoader(arrayOf(plugURL), parentCL){
129
init{this.setDefaultAssertionStatus(false)}
1310
//this loader actually loads the stuff for the plugin, and can cut it off.
1411
private var pluginIsLoaded = true
1512
fun getUUID()=plugID
1613
fun addPluginURLs(pluginURLs: List<URL>) = pluginURLs.forEach { plugURL -> this.addURL(plugURL) }
1714
override fun close(){
18-
//I was trying to get the event queue and remove all events launched by classes loaded by this classloader on close?
19-
//but I do not know how to do that
20-
//val eventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue()
2115
this.clearAssertionStatus()
2216
super.close()
2317
pluginIsLoaded=false

plugins/examplePlugins.jar

0 Bytes
Binary file not shown.

plugins/minesweeper.jar

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)