mirror of
https://github.com/xivapi/ffxiv-datamining.git
synced 2026-07-26 03:49:09 +00:00
Remove libra php code and XIVDB specific stuff
Keeping the repo specific to dataming stuff
This commit is contained in:
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Libra Database
|
||||
*
|
||||
* @version 1.0
|
||||
* @author Josh Freeman <josh@viion.co.uk>
|
||||
*/
|
||||
|
||||
use LiteDatabase,
|
||||
LibraDatabaseTraits;
|
||||
|
||||
class LibraDatabase
|
||||
{
|
||||
use LibraDatabaseTraits;
|
||||
|
||||
protected $database;
|
||||
|
||||
function __construct($litefile)
|
||||
{
|
||||
if (!$litefile) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->database = new LiteDatabase($litefile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this
|
||||
*
|
||||
* @return $this;
|
||||
*/
|
||||
public function get()
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tables from the libra database
|
||||
*
|
||||
* @return Array - tables
|
||||
*/
|
||||
public function tables()
|
||||
{
|
||||
$tables = $this->database->sql("SELECT name FROM sqlite_master WHERE type = 'table'");
|
||||
$tables = $this->sortDataByColumn($tables, 'name');
|
||||
return $tables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run SQL on the libra database
|
||||
*
|
||||
* @param $string - the sql string to run
|
||||
* @return Array - array of data
|
||||
*/
|
||||
public function sql($sql)
|
||||
{
|
||||
return $this->database->sql($sql);
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Libra Database Traits
|
||||
* bunch of functions for libra
|
||||
*
|
||||
* @version 1.0
|
||||
* @author Josh Freeman <josh@viion.co.uk>
|
||||
*/
|
||||
|
||||
trait LibraDatabaseTraits
|
||||
{
|
||||
/**
|
||||
* Sorts an array by a column within the array,
|
||||
* main use is databases results
|
||||
*
|
||||
* @param $data - the data to resort
|
||||
* @param $column - the column to use for sorting
|
||||
* @return Array - the new array!
|
||||
*/
|
||||
protected function sortDataByColumn($data, $column)
|
||||
{
|
||||
$newData = [];
|
||||
foreach($data as $k => $v)
|
||||
{
|
||||
$newKey = $v[$column];
|
||||
$newData[$newKey] = $this->removeNumericIndexes($v);
|
||||
}
|
||||
|
||||
ksort($newData);
|
||||
return $newData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes numeric indexes, for some reason sqlite
|
||||
* returns both table column names and an index list,
|
||||
* so this helps strip index's and reduce data duplication
|
||||
*
|
||||
* @param $data - the array to remove from
|
||||
* @return Array - the new array, without numeric indexes!
|
||||
*/
|
||||
protected function removeNumericIndexes($data)
|
||||
{
|
||||
foreach($data as $k => $v)
|
||||
if (is_numeric($k))
|
||||
unset($data[$k]);
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Libra Database
|
||||
*
|
||||
* @version 1.0
|
||||
* @author Josh Freeman <josh@viion.co.uk>
|
||||
*/
|
||||
|
||||
use \PDO;
|
||||
|
||||
class LiteDatabase
|
||||
{
|
||||
protected $connection;
|
||||
|
||||
function __construct($sqlite)
|
||||
{
|
||||
if (!file_exists($sqlite)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// create connection
|
||||
$this->connection = new PDO('sqlite:'. $sqlite);
|
||||
if (!$this->connection) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function sql($sql)
|
||||
{
|
||||
if (!$this->connection) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$query = $this->connection->prepare($sql);
|
||||
$query->execute();
|
||||
return $query->fetchAll();
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
# FFXIV Libra
|
||||
Libra is SE's official mobile application, it can be found here: http://eu.finalfantasyxiv.com/pr/special/libraeorzea/
|
||||
|
||||
# Downloading the App
|
||||
The easiest way to download the app is through the android store. https://play.google.com/store/apps/details?id=com.square_enix.libra_eorzeaE
|
||||
|
||||
You can Google this easily "Download APK" etc. Or you can get browser extensions to do it if you have an Android phone.
|
||||
|
||||
Note that even if you download the APK when SE "update it", it may not have the latest database version, the application itself when downloaded from the store only contains the last SQLite database from when the application was fully updated. If SE update the SQLite database but not the actual applications code, then it does not get updated on the store.
|
||||
|
||||
So in order to always have the most up to date SQLite file, you need a rooted android where you can view the installation of Libra and you can get the SQLite file from there.
|
||||
|
||||
# Extracting
|
||||
|
||||
- Once you download the APK, just unzip it. It's just a zip file, any program can do it!
|
||||
- Database File: `assets/database/app_data.sqlite.zip`, extract to get an `app_data.sqlite` file.
|
||||
- Images: `res/drawable-xhdpi-v4/`, nice big icons!
|
||||
- Translations: `assets/strings/strings.zip` great if you want to translate your website. Some useful termonology.
|
||||
|
||||
# Viewing the code
|
||||
|
||||
There is a `classes.dex` file which can be decompiled. https://github.com/pxb1988/dex2jar worked for me, have fun with the Source Code, its not pretty =X
|
||||
|
||||
# Viewing the data
|
||||
|
||||
You can use a tool such as SQLLiteBrowser to view the data, but it will not output the SQLite file correctly. I've included some PHP code which can be used to connect to the SQLite file and you can then do normal SQL queries on the file.
|
||||
|
||||
# Rooted Android Way
|
||||
|
||||
If you have a rooted android phone, you can bypass a lot of the struggle of getting the APK online. Sometimes when SE only update the database file, they do not update the APK as it is not required, so a rooted phone is usually the easiest way to get the latest SQLite file.
|
||||
|
||||
Libra **sqlite** file lives in the folder: `/data/data/com.square_enix.libra_eorzeaE/databases/app_data.sqlite`
|
||||
|
||||
The app itself can be found: `/data/app/com.square_enix.libra_eorzeaE-1.apk`
|
||||
|
||||
ES Explorer has the ability to view this folder quite easily by enabling root access.
|
||||
|
||||
Sometimes you cannot send/share files directly from this folder, so copy it to your SD Card or out of a rooted folder (as some apps like gmail or dropbox don't have rooted access), once copied out you can upload to dropbox to access it or email it to yourself or however else you prefer to share files!
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +0,0 @@
|
||||
Columns are:
|
||||
|
||||
ItemID
|
||||
ItemName
|
||||
PatchIncrementValue
|
||||
PatchName
|
||||
|
||||
Open patch.csv to make use of PatchIncrementValue
|
||||
@@ -1,20 +0,0 @@
|
||||
2,EarlyAccess,1377648000,Early Access
|
||||
3,Halloween2013,1382054400,Halloween 2013
|
||||
4,ARealmAwoken2.1,1387267200,A Realm Awoken 2.1
|
||||
6,Patch2.15,1390278600,Patch 2.15
|
||||
7,Patch2.16,1392940800,Patch 2.16
|
||||
8,ThroughTheMaelstrom2.2,1395849600,Through The Maelstrom 2.2
|
||||
9,Patch2.25,1398347294,Patch 2.25
|
||||
10,Patch2.28,1401969600,Patch 2.28
|
||||
11,DefendersOfEorzea2.3,1404795600,Defenders Of Eorzea 2.3
|
||||
12,Patch2.35,1408442400,Patch 2.35
|
||||
13,Patch2.38,1410825600,Patch 2.38
|
||||
14,DreamsOfIce2.4,1414483200,Dreams Of Ice 2.4
|
||||
15,Patch2.45,1418119200,Patch 2.45
|
||||
16,BeforeTheFall2.5,1421744400,Before The Fall 2.5
|
||||
17,Patch2.51,1424768400,Patch 2.51
|
||||
18,Patch2.55,1427781600,Patch 2.55
|
||||
19,Patch3.0,1434700800,Heavensward! 3.0
|
||||
20,Patch3.01,1436263200,Patch 3.01
|
||||
21,Patch3.05,1437472800,Patch 3.05
|
||||
22,Patch3.07,1440495000,Patch 3.07
|
||||
|
@@ -1,8 +0,0 @@
|
||||
Columns are:
|
||||
|
||||
PatchIncrementValue
|
||||
PatchAlias
|
||||
PatchReleaseDate (unix)
|
||||
PatchName
|
||||
|
||||
Patch alias is just the name with no spaces, so it worked in urls/filters on XIVDB.
|
||||
Reference in New Issue
Block a user