Officially, Dilithium is earned through in-game activities (PvP and PvE daily Assignments, spotlighted missions, events, qualified Foundry missions, etc.). However, the cracked version of this game grants you unlimited dilithium ore for no additional cost.