Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
capacitor-jok-helper
Advanced tools
Add this code in AppDelegate.swift
-> func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask
NotificationCenter.default.addObserver(forName: Notification.Name("getPushNotificationsStateRequest"), object: nil, queue: OperationQueue.main) { (notification) in
let status: OSPermissionSubscriptionState = OneSignal.getPermissionSubscriptionState()
let hasPrompted = status.permissionStatus.hasPrompted
let userStatus = status.permissionStatus.status
let isSubscribed = status.subscriptionStatus.subscribed
let userSubscriptionSetting = status.subscriptionStatus.userSubscriptionSetting
let userId = status.subscriptionStatus.userId
let pushToken = status.subscriptionStatus.pushToken
NotificationCenter.default.post(name: Notification.Name("getPushNotificationsStateResult"), object: nil, userInfo: [
"hasPrompted": hasPrompted,
"userStatus": userStatus.rawValue,
"isSubscribed": isSubscribed,
"userSubscriptionSetting": userSubscriptionSetting,
"userId": userId,
"pushToken": pushToken
]
)
}
NotificationCenter.default.addObserver(forName: Notification.Name("askPushNotificationsPermissionRequest"), object: nil, queue: OperationQueue.main) { (notification) in
OneSignal.promptForPushNotifications(userResponse: { accepted in
NotificationCenter.default.post(name: Notification.Name("askPushNotificationsPermissionResult"), object: nil, userInfo: [
"accepted": accepted
]
)
})
}
NotificationCenter.default.addObserver(forName: Notification.Name("SET_ORIENTATION_LOCK"), object: nil, queue: OperationQueue.main) { (notification) in
if let data = notification.userInfo as? [String: Any]
{
self.orientationLock = (data["orientationLock"] ?? UIInterfaceOrientationMask.all) as! UIInterfaceOrientationMask
let preferredOrientation = (data["preferredOrientation"] ?? UIInterfaceOrientation.unknown) as! UIInterfaceOrientation
var value = preferredOrientation.rawValue
if (self.orientationLock == UIInterfaceOrientationMask.portrait && preferredOrientation == UIInterfaceOrientation.unknown) {
value = UIInterfaceOrientation.portrait.rawValue
}
if (self.orientationLock == UIInterfaceOrientationMask.landscape && preferredOrientation == UIInterfaceOrientation.unknown) {
value = UIInterfaceOrientation.landscapeRight.rawValue
}
// change orientation also, if preferredOrientation was passed
if (value != UIInterfaceOrientation.unknown.rawValue) {
UIDevice.current.setValue(value, forKey: "orientation")
UINavigationController.attemptRotationToDeviceOrientation()
}
}
}
Add variable in AppDelegate
class
public var orientationLock: UIInterfaceOrientationMask = UIInterfaceOrientationMask.portrait
Create CustomCAPBridgeViewController.swift
file
import Foundation
import Capacitor
public class CustomCAPBridgeViewController : CAPBridgeViewController {
override public func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
NotificationCenter.default.post(name: Notification.Name("ORIENTATION_CHANGE"), object: nil, userInfo: [
"isLandscape": UIDevice.current.orientation.isLandscape,
"isPortrait": UIDevice.current.orientation.isPortrait,
"isFlat":UIDevice.current.orientation.isFlat,
"rawValue": UIDevice.current.orientation.rawValue,
]
)
}
}
FAQs
Helper functions for jok projects
The npm package capacitor-jok-helper receives a total of 34 weekly downloads. As such, capacitor-jok-helper popularity was classified as not popular.
We found that capacitor-jok-helper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.