add android platform build support
This commit is contained in:
@@ -1,16 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.Katboi01.UmaViewer">
|
|
||||||
|
|
||||||
<application>
|
|
||||||
<activity android:name="com.Katboi01.UmaViewer.MainActivity">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
|
|
||||||
</activity>
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 7a8ce2fd87b517b4eae4a125b76f65eb
|
|
||||||
TextScriptImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Binary file not shown.
@@ -1,32 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: cdeb84ba555594c4cbbc11f9a2a036a5
|
|
||||||
PluginImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
iconMap: {}
|
|
||||||
executionOrder: {}
|
|
||||||
defineConstraints: []
|
|
||||||
isPreloaded: 0
|
|
||||||
isOverridable: 0
|
|
||||||
isExplicitlyReferenced: 0
|
|
||||||
validateReferences: 1
|
|
||||||
platformData:
|
|
||||||
- first:
|
|
||||||
Android: Android
|
|
||||||
second:
|
|
||||||
enabled: 1
|
|
||||||
settings: {}
|
|
||||||
- first:
|
|
||||||
Any:
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings: {}
|
|
||||||
- first:
|
|
||||||
Editor: Editor
|
|
||||||
second:
|
|
||||||
enabled: 0
|
|
||||||
settings:
|
|
||||||
DefaultValueInitialized: true
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -15,8 +15,8 @@ public class LoadSound : ScriptableObject
|
|||||||
|
|
||||||
public UmaSoundInfo getSoundPath(string name) {
|
public UmaSoundInfo getSoundPath(string name) {
|
||||||
UmaSoundInfo info;
|
UmaSoundInfo info;
|
||||||
info.acbPath = UmaViewerBuilder.GetABPath(Main.AbList.FirstOrDefault(a => a.Name.Contains(name) && a.Name.EndsWith("acb")));
|
info.acbPath = UmaDatabaseController.GetABPath(Main.AbList.FirstOrDefault(a => a.Name.Contains(name) && a.Name.EndsWith("acb")));
|
||||||
info.awbPath = UmaViewerBuilder.GetABPath(Main.AbList.FirstOrDefault(a => a.Name.Contains(name) && a.Name.EndsWith("awb")));
|
info.awbPath = UmaDatabaseController.GetABPath(Main.AbList.FirstOrDefault(a => a.Name.Contains(name) && a.Name.EndsWith("awb")));
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,26 +56,33 @@ public class UmaDatabaseController
|
|||||||
/// Master Database Connection
|
/// Master Database Connection
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private SqliteConnection masterDb;
|
private SqliteConnection masterDb;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads the file database
|
/// Loads the file database
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public UmaDatabaseController()
|
public UmaDatabaseController()
|
||||||
{
|
{
|
||||||
if (Application.platform == RuntimePlatform.Android)
|
try
|
||||||
{
|
{
|
||||||
metaDb = new SqliteConnection($@"Data Source=/data/data/jp.co.cygames.umamusume/files/meta;");
|
if (Application.platform == RuntimePlatform.Android)
|
||||||
masterDb = new SqliteConnection($@"Data Source=/data/data/jp.co.cygames.umamusume/files/master/master.mdb;");
|
{
|
||||||
|
metaDb = new SqliteConnection($@"Data Source={GetGameRootPath()}/meta;");
|
||||||
|
masterDb = new SqliteConnection($@"Data Source={GetGameRootPath()}/master/master.mdb;");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
metaDb = new SqliteConnection($@"Data Source={Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Low"}\Cygames\umamusume\meta;");
|
||||||
|
masterDb = new SqliteConnection($@"Data Source={Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Low"}\Cygames\umamusume\master\master.mdb;");
|
||||||
|
}
|
||||||
|
metaDb.Open();
|
||||||
|
MetaEntries = ReadMeta(metaDb);
|
||||||
|
masterDb.Open();
|
||||||
|
CharaData = ReadMaster(masterDb);
|
||||||
}
|
}
|
||||||
else
|
catch
|
||||||
{
|
{
|
||||||
metaDb = new SqliteConnection($@"Data Source={Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Low"}\Cygames\umamusume\meta;");
|
UmaViewerUI.Instance.LyricsText.text = $"Database not found: \n{GetGameRootPath()}/meta\n{GetGameRootPath()}/master/master.mdb";
|
||||||
masterDb = new SqliteConnection($@"Data Source={Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Low"}\Cygames\umamusume\master\master.mdb;");
|
UmaViewerUI.Instance.LyricsText.color = Color.red;
|
||||||
}
|
}
|
||||||
metaDb.Open();
|
|
||||||
MetaEntries = ReadMeta(metaDb);
|
|
||||||
masterDb.Open();
|
|
||||||
CharaData = ReadMaster(masterDb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static IEnumerable<UmaDatabaseEntry> ReadMeta(SqliteConnection conn)
|
static IEnumerable<UmaDatabaseEntry> ReadMeta(SqliteConnection conn)
|
||||||
@@ -120,4 +127,23 @@ public class UmaDatabaseController
|
|||||||
}
|
}
|
||||||
//conn.Close();
|
//conn.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetABPath(UmaDatabaseEntry entry)
|
||||||
|
{
|
||||||
|
if (Application.platform == RuntimePlatform.Android)
|
||||||
|
{
|
||||||
|
return $"{GetGameRootPath()}/dat/{entry.Url.Substring(0, 2)}/{entry.Url}";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $"{GetGameRootPath()}\\dat\\{entry.Url.Substring(0, 2)}\\{entry.Url}";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetGameRootPath()
|
||||||
|
{
|
||||||
|
if (Application.platform == RuntimePlatform.Android)
|
||||||
|
{
|
||||||
|
return Application.persistentDataPath;
|
||||||
|
}
|
||||||
|
return $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Low"}\\Cygames\\umamusume";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
{
|
{
|
||||||
List<AudioClip> clips = new List<AudioClip>();
|
List<AudioClip> clips = new List<AudioClip>();
|
||||||
UmaViewerUI.Instance.LoadedAssetsAdd(awb);
|
UmaViewerUI.Instance.LoadedAssetsAdd(awb);
|
||||||
string awbPath = GetABPath(awb); ;
|
string awbPath = UmaDatabaseController.GetABPath(awb); ;
|
||||||
if (!File.Exists(awbPath)) return clips;
|
if (!File.Exists(awbPath)) return clips;
|
||||||
|
|
||||||
FileStream awbFile = File.OpenRead(awbPath);
|
FileStream awbFile = File.OpenRead(awbPath);
|
||||||
@@ -485,7 +485,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
UmaDatabaseEntry lyricsAsset = Main.AbList.FirstOrDefault(a => a.Name.Contains(lyricsVar));
|
UmaDatabaseEntry lyricsAsset = Main.AbList.FirstOrDefault(a => a.Name.Contains(lyricsVar));
|
||||||
if (lyricsAsset != null)
|
if (lyricsAsset != null)
|
||||||
{
|
{
|
||||||
string filePath = GetABPath(lyricsAsset);
|
string filePath = UmaDatabaseController.GetABPath(lyricsAsset);
|
||||||
if (File.Exists(filePath))
|
if (File.Exists(filePath))
|
||||||
{
|
{
|
||||||
AssetBundle bundle;
|
AssetBundle bundle;
|
||||||
@@ -533,7 +533,7 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
Debug.Log("Loading " + entry.Name);
|
Debug.Log("Loading " + entry.Name);
|
||||||
if (Main.LoadedBundles.ContainsKey(entry.Name)) return;
|
if (Main.LoadedBundles.ContainsKey(entry.Name)) return;
|
||||||
|
|
||||||
string filePath = GetABPath(entry);
|
string filePath = UmaDatabaseController.GetABPath(entry);
|
||||||
if (File.Exists(filePath))
|
if (File.Exists(filePath))
|
||||||
{
|
{
|
||||||
AssetBundle bundle = AssetBundle.LoadFromFile(filePath);
|
AssetBundle bundle = AssetBundle.LoadFromFile(filePath);
|
||||||
@@ -856,13 +856,5 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
UI.LoadedAssetsClear();
|
UI.LoadedAssetsClear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetABPath(UmaDatabaseEntry entry)
|
|
||||||
{
|
|
||||||
if(Application.platform == RuntimePlatform.Android)
|
|
||||||
{
|
|
||||||
return $"/data/data/jp.co.cygames.umamusume/files/dat/{entry.Url.Substring(0, 2)}/{entry.Url}";
|
|
||||||
}
|
|
||||||
|
|
||||||
return $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Low"}\\Cygames\\umamusume\\dat\\{entry.Url.Substring(0, 2)}\\{entry.Url}";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ public class UmaViewerMain : MonoBehaviour
|
|||||||
public static UmaViewerMain Instance;
|
public static UmaViewerMain Instance;
|
||||||
private UmaViewerUI UI => UmaViewerUI.Instance;
|
private UmaViewerUI UI => UmaViewerUI.Instance;
|
||||||
private UmaViewerBuilder Builder => UmaViewerBuilder.Instance;
|
private UmaViewerBuilder Builder => UmaViewerBuilder.Instance;
|
||||||
|
|
||||||
public JArray UmaCharaData;
|
public JArray UmaCharaData;
|
||||||
public JArray UmaLiveData;
|
public JArray UmaLiveData;
|
||||||
|
|
||||||
@@ -30,11 +31,11 @@ public class UmaViewerMain : MonoBehaviour
|
|||||||
{
|
{
|
||||||
Application.targetFrameRate = -1;
|
Application.targetFrameRate = -1;
|
||||||
Instance = this;
|
Instance = this;
|
||||||
AbList = UmaDatabaseController.Instance.MetaEntries.ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator Start()
|
IEnumerator Start()
|
||||||
{
|
{
|
||||||
|
AbList = UmaDatabaseController.Instance.MetaEntries.ToList();
|
||||||
yield return UmaViewerDownload.DownloadText("https://www.tracenacademy.com/api/BasicCharaDataInfo", txt =>
|
yield return UmaViewerDownload.DownloadText("https://www.tracenacademy.com/api/BasicCharaDataInfo", txt =>
|
||||||
{
|
{
|
||||||
UmaCharaData = JArray.Parse(txt);
|
UmaCharaData = JArray.Parse(txt);
|
||||||
|
|||||||
@@ -77,10 +77,10 @@ public class UmaViewerUI : MonoBehaviour,FaceLoadCallBack
|
|||||||
public void LoadedAssetsAdd(UmaDatabaseEntry entry)
|
public void LoadedAssetsAdd(UmaDatabaseEntry entry)
|
||||||
{
|
{
|
||||||
LoadedAssetCount++;
|
LoadedAssetCount++;
|
||||||
string filePath = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Low"}\\Cygames\\umamusume\\dat\\{entry.Url.Substring(0, 2)}\\{entry.Url}";
|
string filePath = UmaDatabaseController.GetABPath(entry);
|
||||||
var container = Instantiate(UmaContainerAssetsPrefab, LoadedAssetsPanel).GetComponent<UmaUIContainer>();
|
var container = Instantiate(UmaContainerAssetsPrefab, LoadedAssetsPanel).GetComponent<UmaUIContainer>();
|
||||||
container.Name.text = Path.GetFileName(entry.Name) + "\n" + entry.Url;
|
container.Name.text = Path.GetFileName(entry.Name) + "\n" + entry.Url;
|
||||||
container.Button.onClick.AddListener(() => { Process.Start("explorer.exe", "/select," + filePath);});
|
container.Button.onClick.AddListener(() => {Process.Start("explorer.exe", "/select," + filePath);});
|
||||||
LoadedAssetsPanel.sizeDelta = new Vector2(0, LoadedAssetCount * 35);
|
LoadedAssetsPanel.sizeDelta = new Vector2(0, LoadedAssetCount * 35);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user