提交修改

This commit is contained in:
changyunjia
2026-06-09 15:16:52 +08:00
co-authored by changyunjia
parent d4442fc21f
commit 3ac4fe0cd0
330 changed files with 48115 additions and 36763 deletions
+16 -16
View File
@@ -1,17 +1,17 @@
package com.tool.countrycode;
import android.app.Activity;
import java.util.Locale;
public class AcquireCountryCode {
// 获取国家码
public static String getCountryCode()
{
Locale locale = Locale.getDefault();
return locale.getCountry();
}
public static String getCountryCode3() {
Locale currentLocale = Locale.getDefault();
return currentLocale.getISO3Country();
}
package com.tool.countrycode;
import android.app.Activity;
import java.util.Locale;
public class AcquireCountryCode {
// 获取国家码
public static String getCountryCode()
{
Locale locale = Locale.getDefault();
return locale.getCountry();
}
public static String getCountryCode3() {
Locale currentLocale = Locale.getDefault();
return currentLocale.getISO3Country();
}
}
View File
View File
+33 -33
View File
@@ -1,33 +1,33 @@
fileFormatVersion: 2
guid: 6e3da5c7fe21c1347a563e64e8f305d4
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 6e3da5c7fe21c1347a563e64e8f305d4
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
View File
View File
+12 -12
View File
@@ -1,12 +1,12 @@
#import <Foundation/Foundation.h>
extern "C" {
__attribute__((visibility("default")))
const char* _GetDeviceCountryCode() {
@autoreleasepool {
NSLocale *currentLocale = [NSLocale currentLocale];
NSString *countryCode = [currentLocale objectForKey:NSLocaleCountryCode];
return strdup([countryCode UTF8String]); // 使用strdup确保内存安全
}
}
}
#import <Foundation/Foundation.h>
extern "C" {
__attribute__((visibility("default")))
const char* _GetDeviceCountryCode() {
@autoreleasepool {
NSLocale *currentLocale = [NSLocale currentLocale];
NSString *countryCode = [currentLocale objectForKey:NSLocaleCountryCode];
return strdup([countryCode UTF8String]); // 使用strdup确保内存安全
}
}
}
View File