Skip to content

Commit 628c2f6

Browse files
committed
Danger Scanning scaffolding
1 parent d498be5 commit 628c2f6

File tree

9 files changed

+12
-2
lines changed

9 files changed

+12
-2
lines changed

ExampleOut/API/exampleAPI.jar

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

ExampleOut/entryPoint.jar

0 Bytes
Binary file not shown.

examplepluginloader/bin/main/examplepluginloader/Plugger/JByteCodeURLINFO.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ class JByteCodeURLINFO(public val yourURL: URL){
2020
private val classBytes: Map<String,ByteArray>
2121
private val urlDangerInfos = mutableListOf<CInfo>()
2222
abstract class CInfo {
23+
var isBlocked = false
2324
abstract val urURL: URL
2425
abstract val entryName: String
26+
fun sameItemAs(other: Any?)=
27+
if(this == other) true
28+
else if(other !is CInfo) false
29+
else (other.urURL == this.urURL && other.entryName == this.entryName)
2530
override fun equals(other: Any?): Boolean =
2631
if(this == other) true
2732
else if(other !is CInfo) false

examplepluginloader/bin/main/examplepluginloader/Plugger/PluginManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ object PluginManager {
245245
updateCacheForURL(plugURL, JByteCodeURLINFO(plugURL).classInfoAtURL)
246246
}
247247
//Step 3: map to name and add to the list to pass to loadPluginClasses
248-
val pluginNames = classInfoByURLs[plugURL]?.mapNotNull {it.name}
248+
val pluginNames = classInfoByURLs[plugURL]?.filter { !it.isBlocked }?.mapNotNull {it.name}
249249
// Step 4: create plugin instances and populate the globals at the top of file
250250
if(pluginNames!=null)plugIDs.addAll(loadPluginClasses(plugURL, pluginNames, targetCNames))
251251
}catch(e: Exception){e.printStackTrace()}

examplepluginloader/src/main/kotlin/examplepluginloader/Plugger/JByteCodeURLINFO.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ class JByteCodeURLINFO(public val yourURL: URL){
2020
private val classBytes: Map<String,ByteArray>
2121
private val urlDangerInfos = mutableListOf<CInfo>()
2222
abstract class CInfo {
23+
var isBlocked = false
2324
abstract val urURL: URL
2425
abstract val entryName: String
26+
fun sameItemAs(other: Any?)=
27+
if(this == other) true
28+
else if(other !is CInfo) false
29+
else (other.urURL == this.urURL && other.entryName == this.entryName)
2530
override fun equals(other: Any?): Boolean =
2631
if(this == other) true
2732
else if(other !is CInfo) false

examplepluginloader/src/main/kotlin/examplepluginloader/Plugger/PluginManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ object PluginManager {
245245
updateCacheForURL(plugURL, JByteCodeURLINFO(plugURL).classInfoAtURL)
246246
}
247247
//Step 3: map to name and add to the list to pass to loadPluginClasses
248-
val pluginNames = classInfoByURLs[plugURL]?.mapNotNull {it.name}
248+
val pluginNames = classInfoByURLs[plugURL]?.filter { !it.isBlocked }?.mapNotNull {it.name}
249249
// Step 4: create plugin instances and populate the globals at the top of file
250250
if(pluginNames!=null)plugIDs.addAll(loadPluginClasses(plugURL, pluginNames, targetCNames))
251251
}catch(e: Exception){e.printStackTrace()}

plugins/examplePlugins.jar

0 Bytes
Binary file not shown.

plugins/minesweeper.jar

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)