Comments (5)
While I was solving the problem on my own I found this : #1675
I tried Execute packageUberJarForCurrentOS, Run with java -jar file.jar, and an error occurred. According to the operation in the article, I added
tasks.register<Zip>("repackageUberJar") {
val packageReleaseUberJarForCurrentOS = tasks.getByName("packageReleaseUberJarForCurrentOS")
dependsOn(packageReleaseUberJarForCurrentOS)
val file = packageReleaseUberJarForCurrentOS.outputs.files.first()
val output = File(file.parentFile, "${file.nameWithoutExtension}-repacked.jar")
archiveFileName.set(output.absolutePath)
destinationDirectory.set(file.parentFile.absoluteFile)
exclude("META-INF/*.SF")
exclude("META-INF/*.RSA")
exclude("META-INF/*.DSA")
from(project.zipTree(file))
doLast {
delete(file)
output.renameTo(file)
logger.lifecycle("The repackaged jar is written to ${archiveFile.get().asFile.canonicalPath}")
}
}
I Execute packageUberJarForCurrentOS again, and Run with java -jar file.jar, all functions run normally, but when I want to Execute packageReleaseDistributionForCurrentOS, I found that there will still be SecurityException, so How to exclude few META-INF files for packageReleaseDistributionForCurrentOS, I think this may work for me very useful
from compose-multiplatform.
I tried again to solve this problem myself
- Try to execute
runReleaseDistributable
and an error occurs.
- Looking at the log, I found that this jar package was copied from .gradle and filtered. I donβt know what was done in the middle.
- Find the original jar file, execute
jarsigner -verify
, and it will prompt that the jar has been verified. - Find the copied jar file and execute
jarsigner -verify
again, prompt
jarsigner: java.lang.SecurityException: SHA-256 digest error for org/bouncycastle/LICENSE.class
- Delete the internal
META-INF/*.RSA, META-INF/*.SF, META-INF/*.DSA, META-INF/*.EC
files from the copied bcpkix, bcprov, and bcutil jars. - Execute
zip -d file.jar 'META-INF/*.SF' 'META-INF/*.RSA' 'META-INF/*.DSA' 'META-INF/*.EC'
- Double-click to launch file.app
- The program runs normally, no errors are reported
I want to know what was filtered in step 2, and how can I delete some files under META-INF when copying?
from compose-multiplatform.
I'm very sorry. During my subsequent debugging, I found that this has nothing to do with resources
. I will provide a minimal reproduction program to help troubleshoot the problem.
https://github.com/LazyIonEs/compose-multiplatform-desktop-template
In the above program, when I add in compose-desktop.pro
-keepclasseswithmembers public class MainKt {
public static void main(java.lang.String[]);
}
-keep class org.bouncycastle.** { *; }
When executing runReleaseDistributable
, an error message java.lang.SecurityException: SHA-256 digest error for org/bouncycastle/operator/OperatorCreationException.class
will appear.
I think it may be because of the rule -keep class org.bouncycastle.** { *; }
, but when I delete it, the rule in compose-desktop.pro
is
-keepclasseswithmembers public class MainKt {
public static void main(java.lang.String[]);
}
# -keep class org.bouncycastle.** { *; }
I executed runReleaseDistributable
again, and an error message cannot create signer: no such algorithm: SHA256WITHRSA for provider BC
appeared.
I don't understand why
Can you help me solve this problem?
from compose-multiplatform.
The following code in the AbstractProguardTask
file
jarsConfigurationFile.ioFile.bufferedWriter().use { writer ->
val toSingleOutputJar = joinOutputJars.orNull == true
for ((input, output) in inputToOutputJars.entries) {
writer.writeLn("-injars '${input.normalizedPath()}'")
if (!toSingleOutputJar)
writer.writeLn("-outjars '${output.normalizedPath()}'")
}
if (toSingleOutputJar)
writer.writeLn("-outjars '${mainJarInDestinationDir.ioFile.normalizedPath()}'")
for (jmod in jmods) {
writer.writeLn("-libraryjars '${jmod.normalizedPath()}'(!**.jar;!module-info.class)")
}
}
Does adding (!META-INF/*.SF,!META-INF/*.RSA,!META-INF/*.DSA)
after -injars
solve this problem?
writer.writeLn("-outjars '${output.normalizedPath()}' (!META-INF/*.SF,!META-INF/*.RSA,!META-INF/*.DSA)")
All of the above is caused by the introduction of signed jar
I'm not sure if this is correct, but I'm still trying to figure it out.
from compose-multiplatform.
Solution Found
from compose-multiplatform.
Related Issues (20)
- Scaffold scrolls improperly when keyboard opened on iOS HOT 2
- ShaderBrush#createShader state reads do not invalidate Text composable HOT 4
- Compose Wasm: Unable to make field private volatile java.lang.ref.Reference java.lang.ref.ReferenceQueue.head accessible: module java.base does not "opens java.lang.ref" to unnamed module @14bd221f HOT 1
- 1nMakeRasterN32Premul is not defined when running runComposeUiTest with js HOT 1
- Disable tab navigation to focus on other Pager's page Composable when Pager sets userScrollEnable = false
- Material 3 depends on some Material 2 modules
- String resource parsing works differently when compared to Android HOT 3
- [iOS] App crashes with "UIPress with null key is not supported" when the arrow key on a hardware keyboard is pressed on an iPad
- Compose on iOS resulting huge memory and CPU consumption resulting in ios app crashing, phone warming and freezing issues HOT 7
- WkWebView inside a UIKit View is not displayed when height is fixed and used inside a LazyColumn Item HOT 1
- Can't build with compose 1.6.10 and kotlin 2.0.0 HOT 5
- ContextMenuArea not working with SwingPanel HOT 1
- kotlin.IllegalStateException: ComposeScene is closed for Popup on iOS HOT 1
- Focus the first item at the start HOT 5
- ComposePanel. Focus moves to child after focusing/unfocusing the main window HOT 4
- Increasing space in Column content (with Arrangement.spacedBy(16.dp)) when ModalBottomSheet is opened
- Cannot determine the version of Skiko for Compose '1.6.11' HOT 2
- IOS. Text and cursor not visible in text field inside dialog HOT 2
- IOS Material3 ripple increases button size on click HOT 2
- Change visibility of helper functions (Resources) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compose-multiplatform.