[M] google meta login

This commit is contained in:
2024-08-03 15:11:17 +08:00
parent 39e7214113
commit badf4d6250
7 changed files with 711 additions and 19 deletions

View File

@@ -35,7 +35,7 @@ namespace tysdk.editor
UnityEngine.Debug.Log($"XCodeProj {pbxprojPath}");
File.WriteAllText(pbxprojPath, proj.WriteToString());
//ProcessPlist(projPath);
ProcessPlist(pathToBuiltProject);
}
@@ -84,18 +84,83 @@ namespace tysdk.editor
private static void ProcessPlist(string root)
{
var trackingDescription = "Data will be used to deliver personalized content to you";
var photoLibraryUsageDescription = "The app requires your consent to add photos or videos to the photo gallery so that you can manage and share them more easily. We are committed to protecting your privacy and complying with relevant laws and regulations.";
string plistPath = root + "/Info.plist";
PlistDocument plist = new PlistDocument();
plist.ReadFromString(File.ReadAllText(plistPath));
PlistElementDict infoDict = plist.root;
PlistElementArray urlTypesArray = null;
if (!infoDict.values.ContainsKey("CFBundleURLTypes")) {
urlTypesArray = infoDict.CreateArray("CFBundleURLTypes");
} else {
urlTypesArray = infoDict.values["CFBundleURLTypes"].AsArray();
}
PlistElementArray queriesSchemesArray = null;
if (!infoDict.values.ContainsKey("LSApplicationQueriesSchemes")) {
queriesSchemesArray = infoDict.CreateArray("LSApplicationQueriesSchemes");
} else {
queriesSchemesArray = infoDict.values["LSApplicationQueriesSchemes"].AsArray();
}
// AAT
var trackingDescription = "Data will be used to deliver personalized content to you";
infoDict.SetString("NSUserTrackingUsageDescription", trackingDescription);
infoDict.SetBoolean("UIFileSharingEnabled", true);
// Photo Library
infoDict.SetBoolean("PHPhotoLibraryPreventAutomaticLimitedAccessAlert", true);
var photoLibraryUsageDescription = "The app requires your consent to add photos or videos to the photo gallery so that you can manage and share them more easily. We are committed to protecting your privacy and complying with relevant laws and regulations.";
infoDict.SetString("NSPhotoLibraryUsageDescription", photoLibraryUsageDescription);
// UIFileSharing
infoDict.SetBoolean("UIFileSharingEnabled", true);
// Google
string googleClientID = "481260393117-88n0v3ht8ashhk0r5ri47hced7o5qj62.apps.googleusercontent.com";
CreateURLTypes(urlTypesArray.AddDict(), "google", googleClientID);
//Facebook
{
string faceBookAppId = "162066986963808";
string faceBookDisPlayname = "arkgame";
string facebookClientToken = "5fe59b0d985ad7acb51f48081e69d45b";
PlistElementDict facebookDic = urlTypesArray.AddDict();
PlistElementArray fbSchmes = facebookDic.CreateArray("CFBundleURLSchemes");
CreateURLTypes(urlTypesArray.AddDict(), "fb", $"fb{faceBookAppId}");
infoDict.SetString("FacebookAppID", faceBookAppId);
infoDict.SetString("FacebookDisplayName", faceBookDisPlayname);
infoDict.SetString("FacebookClientToken", facebookClientToken);
//白名单
queriesSchemesArray.AddString("fb-messenger-share-api");
queriesSchemesArray.AddString("fbauth2");
queriesSchemesArray.AddString("fbauth");
queriesSchemesArray.AddString("fbshareextension");
queriesSchemesArray.AddString("fbapi");
queriesSchemesArray.AddString("fbapi20130214");
queriesSchemesArray.AddString("fbapi20130410");
queriesSchemesArray.AddString("fbapi20130702");
queriesSchemesArray.AddString("fbapi20131010");
queriesSchemesArray.AddString("fbapi20131219");
queriesSchemesArray.AddString("fbapi20140410");
queriesSchemesArray.AddString("fbapi20140116");
queriesSchemesArray.AddString("fbapi20150313");
queriesSchemesArray.AddString("fbapi20150629");
queriesSchemesArray.AddString("fbapi20160328");
}
File.WriteAllText(plistPath, plist.WriteToString());
}
private static void CreateURLTypes(PlistElementDict dict, string name, string scheme1)
{
dict.SetString("CFBundleTypeRole", "Editor");
dict.SetString("CFBundleURLName", name);
dict.CreateArray("CFBundleURLSchemes");
PlistElementArray schemes = dict.values["CFBundleURLSchemes"].AsArray();
schemes.AddString(scheme1);
}
}
}