Page MenuHomePhabricator

D5618.id18378.diff
No OneTemporary

D5618.id18378.diff

diff --git a/native/android/app/src/cpp/TerminateApp.cpp b/native/android/app/src/cpp/TerminateApp.cpp
new file mode 100644
--- /dev/null
+++ b/native/android/app/src/cpp/TerminateApp.cpp
@@ -0,0 +1,24 @@
+#include <Tools/TerminateApp.h>
+#include <fbjni/fbjni.h>
+
+using namespace facebook::jni;
+
+class TerminateAppJavaClass : public JavaClass<TerminateAppJavaClass> {
+public:
+ static auto constexpr kJavaDescriptor =
+ "Lapp/comm/android/fbjni/TerminateApp;";
+
+ static void terminate() {
+ static const auto cls = javaClassStatic();
+ static auto method = cls->getStaticMethod<void()>("terminate");
+ method(cls);
+ }
+};
+
+namespace comm {
+
+void TerminateApp::terminate() {
+ TerminateAppJavaClass::terminate();
+}
+
+} // namespace comm
diff --git a/native/android/app/src/main/java/app/comm/android/fbjni/TerminateApp.java b/native/android/app/src/main/java/app/comm/android/fbjni/TerminateApp.java
new file mode 100644
--- /dev/null
+++ b/native/android/app/src/main/java/app/comm/android/fbjni/TerminateApp.java
@@ -0,0 +1,7 @@
+package app.comm.android.fbjni;
+
+public class TerminateApp {
+ public static void terminate() {
+ android.os.Process.killProcess(android.os.Process.myPid());
+ }
+}
diff --git a/native/cpp/CommonCpp/Tools/TerminateApp.h b/native/cpp/CommonCpp/Tools/TerminateApp.h
new file mode 100644
--- /dev/null
+++ b/native/cpp/CommonCpp/Tools/TerminateApp.h
@@ -0,0 +1,10 @@
+#pragma once
+
+namespace comm {
+
+class TerminateApp {
+public:
+ static void terminate();
+};
+
+} // namespace comm
diff --git a/native/ios/Comm.xcodeproj/project.pbxproj b/native/ios/Comm.xcodeproj/project.pbxproj
--- a/native/ios/Comm.xcodeproj/project.pbxproj
+++ b/native/ios/Comm.xcodeproj/project.pbxproj
@@ -42,6 +42,7 @@
7F8D602926535F2A0053CB29 /* IBMPlexSans-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7F8D602626535EEE0053CB29 /* IBMPlexSans-Regular.ttf */; };
8B99BAAC28D50F3000EB5ADB /* libnative_rust_library.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B99BAAB28D50F3000EB5ADB /* libnative_rust_library.a */; };
8B99BAAE28D511FF00EB5ADB /* lib.rs.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B99BAAD28D511FF00EB5ADB /* lib.rs.cc */; };
+ 8E43C32C291E5B4A009378F5 /* TerminateApp.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8E43C32B291E5B4A009378F5 /* TerminateApp.mm */; };
B7162ABD28AAD461006588D3 /* CommIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = B7162ABC28AAD461006588D3 /* CommIcons.ttf */; };
B71AFF1F265EDD8600B22352 /* IBMPlexSans-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = B71AFF1E265EDD8600B22352 /* IBMPlexSans-Medium.ttf */; };
B734D11028ADD55200570D04 /* SWMansionIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = B734D10F28ADD55200570D04 /* SWMansionIcons.ttf */; };
@@ -184,6 +185,8 @@
8B99B59928D50D4900EB5ADB /* cxx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cxx.h; sourceTree = "<group>"; };
8B99BAAB28D50F3000EB5ADB /* libnative_rust_library.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libnative_rust_library.a; path = ../native_rust_library/target/universal/release/libnative_rust_library.a; sourceTree = "<group>"; };
8B99BAAD28D511FF00EB5ADB /* lib.rs.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lib.rs.cc; sourceTree = "<group>"; };
+ 8E43C32B291E5B4A009378F5 /* TerminateApp.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TerminateApp.mm; path = Comm/TerminateApp.mm; sourceTree = "<group>"; };
+ 8E43C32E291E5B9D009378F5 /* TerminateApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TerminateApp.h; path = ../cpp/CommonCpp/Tools/TerminateApp.h; sourceTree = "<group>"; };
913E5A7BDECB327E3DE11053 /* Pods-NotificationService.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationService.release.xcconfig"; path = "Target Support Files/Pods-NotificationService/Pods-NotificationService.release.xcconfig"; sourceTree = "<group>"; };
994BEBDD4E4959F69CEA0BC3 /* libPods-Comm.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Comm.a"; sourceTree = BUILT_PRODUCTS_DIR; };
B7055C6B26E477CF00BE0548 /* MessageStoreOperations.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageStoreOperations.h; sourceTree = "<group>"; };
@@ -334,6 +337,8 @@
71B8CCB626BD30EC0040C0A2 /* CommCoreImplementations */ = {
isa = PBXGroup;
children = (
+ 8E43C32E291E5B9D009378F5 /* TerminateApp.h */,
+ 8E43C32B291E5B4A009378F5 /* TerminateApp.mm */,
CBDEC69A28ED867000C17588 /* GlobalDBSingleton.mm */,
CB38B4782877177B00171182 /* TemporaryMessageStorage */,
71762A74270D8AAE00F565ED /* PlatformSpecificTools.mm */,
@@ -1008,6 +1013,7 @@
files = (
75291F0428F9A0D400F4C80E /* DeviceID.cpp in Sources */,
FC2DF95628BFCFE90017C4AF /* tunnelbroker.pb.cc in Sources */,
+ 8E43C32C291E5B4A009378F5 /* TerminateApp.mm in Sources */,
CB38B48628771CDD00171182 /* TemporaryMessageStorage.mm in Sources */,
CB38B48428771CAF00171182 /* EncryptedFileUtils.mm in Sources */,
CBFE58292885852B003B94C9 /* ThreadOperations.cpp in Sources */,
@@ -1071,6 +1077,7 @@
CB3C621227CE65030054F24C /* CommSecureStoreIOSWrapper.mm in Sources */,
CB3C621127CE4A320054F24C /* Logger.mm in Sources */,
724995D527B4103A00323FCE /* NotificationService.mm in Sources */,
+ 8E43C32D291E5B4A009378F5 /* TerminateApp.mm in Sources */,
CB4821AF27CFB19D001AB7E1 /* PlatformSpecificTools.mm in Sources */,
1F537ACC7B60DC049C0ECFA7 /* ExpoModulesProvider.swift in Sources */,
);
diff --git a/native/ios/Comm/TerminateApp.mm b/native/ios/Comm/TerminateApp.mm
new file mode 100644
--- /dev/null
+++ b/native/ios/Comm/TerminateApp.mm
@@ -0,0 +1,12 @@
+
+#import "TerminateApp.h"
+
+#import <React/RCTBridgeModule.h>
+
+namespace comm {
+
+void TerminateApp::terminate() {
+ exit(0);
+};
+
+} // namespace comm

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 16, 12:21 PM (20 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2497819
Default Alt Text
D5618.id18378.diff (6 KB)

Event Timeline