Skip to content

Renaming PublicKey and PrivateKey Classes#257

Open
kmy504 wants to merge 3 commits into
TakeScoop:masterfrom
kmy504:feature/rename-publicKey
Open

Renaming PublicKey and PrivateKey Classes#257
kmy504 wants to merge 3 commits into
TakeScoop:masterfrom
kmy504:feature/rename-publicKey

Conversation

@kmy504

@kmy504 kmy504 commented Nov 16, 2023

Copy link
Copy Markdown

Hello,

Our project currently faces a significant name collision issue. Specifically, the PublicKey class is implemented in both the MessageProtection framework and the SwiftyRSA framework. This is causing the following warning message to appear:

objc[13599]: Class PublicKey is implemented in both /System/Library/PrivateFrameworks/MessageProtection.framework/MessageProtection (0x254bf2000) and /private/var/containers/Bundle/Application/9866BA82-B322-4442-BDD8-AD39140E4AEC/Band.app/Frameworks/SwiftyRSA.framework/SwiftyRSA (0x11354e1d0). One of the two will be used. Which one is undefined.

To resolve this issue, I propose renaming the PublicKey and PrivateKey classes within the SwiftyRSA framework to SwiftyRSAPublicKey and SwiftyRSAPrivateKey, respectively. This change will address the name collision and improve code readability and maintainability.

The changes are as follows:

PublicKey -> SwiftyRSA.PublicKey
PrivateKey -> SwiftyRSA.PrivateKey
I believe these changes will positively impact the project. I appreciate your review and feedback on this matter.

Thank you.

kmy504 and others added 3 commits November 16, 2023 12:56
- to SwiftyRSA.PublicKey, SwiftyRSA.PrivateKey
objc[13181]: Class PublicKey is implemented in both /System/Library/PrivateFrameworks/MessageProtection.framework/MessageProtection (0x24e9dbcc0) and /private/var/containers/Bundle/Application/AA0EFB35-6414-4395-98E5-1F3AFD934168/Band.app/Frameworks/SwiftyRSA.framework/SwiftyRSA (0x10f18a1e0). One of the two will be used. Which one is undefined.
Fixed 'Class PublicKey is implemented both'
@pc-scoop

pc-scoop commented Mar 4, 2024

Copy link
Copy Markdown
Contributor

@kmy504 This is good update and thanks for the contribution. I'll look into how this might affect our internal usage of the framework and get back on this.

@Misantrofia

Copy link
Copy Markdown

Hello,

When is this going to be merged? I have the same collision on my project.

@kmy504

kmy504 commented May 30, 2024

Copy link
Copy Markdown
Author

@pc-scoop Apple has been implement same name with PublicKey. So if some project use Apple's framework like MessageProtection framework, It would be cause name collision.

So I wrapped SwiftyRSA's struct that cause name collision with SwiftyRsa enum extension to look like a namespace.

@Misantrofia Use my forked repository before merge. :)

@ivarornh

Copy link
Copy Markdown

Any updates on when this will be merged ?

@rasberik

Copy link
Copy Markdown

@pc-scoop Any updates?

@reshadf

reshadf commented Sep 22, 2025

Copy link
Copy Markdown

we still have this warning would love it to be merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants