Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental Android support #635

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions Install/How to install.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1.Patch the StardewValley.dll��see PatchStep.txt
2.Put the folder SMDroid into /sdcard/
3.Put the patched StardewValley.dll into /sdcard/SMDroid/
4.Replace StardewValley.dll and StardewModdingAPI.dll into game's base.apk(copy to user folder to operate if no root acesss), compress level must be storage.Resign apk if you have no root access.
5.Reinstall the patched base.apk
Enjoy it.
73 changes: 73 additions & 0 deletions Install/PatchStep.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
1. Inject assembly reference, namespace: StardewModdingAPI

2.Modify class StardewValley.Game1, modify constructor method��insert Instructions at beginning:
newobj System.Void SMDroid.ModEntry::.ctor()
stsfld StardewValley.ModHooks StardewValley.Game1::hooks

3.Modify class StardewValley.ModHooks, inject method:
public virtual void OnGame1_Update(GameTime time);
public virtual void OnGame1_Draw(GameTime time, RenderTarget2D toBuffer);
public virtual LocalizedContentManager OnGame1_CreateContentManager(IServiceProvider serviceProvider, string rootDirectory) => null;

4.Modify class StardewValley.Game1, modify method Update(GameTime gameTime), insert Instructions at beginning:
ldsfld StardewValley.ModHooks StardewValley.Game1::hooks
ldarg.1
callvirt System.Void StardewValley.ModHooks::OnGame1_Update(Microsoft.Xna.Framework.GameTime)

5.Modify class StardewValley.Game1, modify method CreateContentManager(GameTime gameTime), replace Instructions to:
ldsfld StardewValley.ModHooks StardewValley.Game1::hooks
ldarg.1
ldarg.2
callvirt StardewValley.LocalizedContentManager StardewValley.ModHooks::OnGame1_CreateContentManager(System.IServiceProvider,System.String)
ret

6.Modify class StardewValley.Game1, modify method Draw(GameTime gameTime, RenderTarget2D toBuffer), modify Instructions at beginning:
ldsfld StardewValley.ModHooks StardewValley.Game1::hooks
ldarg.1
ldnull
callvirt System.Void StardewValley.ModHooks::OnGame1_Draw(Microsoft.Xna.Framework.GameTime,Microsoft.Xna.Framework.Graphics.RenderTarget2D)


Optional Section

Fix back button��

Modify class StardewValley.Game1, modify method updateAndroidMenus(), modify Instructions at beginning:
ldsfld StardewValley.InputState StardewValley.Game1::input
callvirt Microsoft.Xna.Framework.Input.GamePadState StardewValley.InputState::GetGamePadState()



Json Asset Support��

Modify class StardewValley.Object, modify method checkForAction,insert instructions at beginning:
ldsfld StardewValley.ModHooks StardewValley.Game1::hooks
ldarg.0
callvirt System.Boolean StardewValley.ModHooks::OnObject_checkForAction(StardewValley.Object)
brtrue.s -> (6) ldarg.2
ldc.i4.0
ret

modify method isIndexOkForBasicShippedCategory,replace instructions:
ldarg.0
ldc.i4 434
bne.un.s -> (5) ldsfld StardewValley.ModHooks StardewValley.Game1::hooks
ldc.i4.0
ret
ldsfld StardewValley.ModHooks StardewValley.Game1::hooks
ldarg.0
ldloca.s -> (0) (System.Boolean)
callvirt System.Void StardewValley.ModHooks::OnObject_isIndexOkForBasicShippedCategory(System.Int32,System.Boolean&)
ldloc.0
ret

modify method canBePlacedHere insert instructions at beginning:
ldsfld StardewValley.ModHooks StardewValley.Game1::hooks
ldarg.0
ldarg.1
ldarg.2
ldloca.s -> (1) (System.Boolean)
callvirt System.Boolean StardewValley.ModHooks::OnObject_canBePlacedHere(StardewValley.Object,StardewValley.GameLocation,Microsoft.Xna.Framework.Vector2,System.Boolean&)
brtrue.s -> (9) ldarg.1
ldloc.1
ret
Binary file added Install/SMDroid/MonoGame.Framework.dll
Binary file not shown.
Binary file added Install/SMDroid/StardewModdingAPI.dll
Binary file not shown.
Binary file added Install/SMDroid/mscorlib.dll
Binary file not shown.
77 changes: 77 additions & 0 deletions Install/SMDroid/smapi-internal/StardewModdingAPI.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*



This file contains advanced configuration for SMAPI. You generally shouldn't change this file.



*/
{
/**
* The console color theme to use. The possible values are:
* - AutoDetect: SMAPI will assume a light background on Mac, and detect the background color automatically on Linux or Windows.
* - LightBackground: use darker text colors that look better on a white or light background.
* - DarkBackground: use lighter text colors that look better on a black or dark background.
*/
"ColorScheme": "AutoDetect",

/**
* Whether SMAPI should check for newer versions of SMAPI and mods when you load the game. If new
* versions are available, an alert will be shown in the console. This doesn't affect the load
* time even if your connection is offline or slow, because it happens in the background.
*/
"CheckForUpdates": true,

/**
* Whether to enable features intended for mod developers. Currently this only makes TRACE-level
* messages appear in the console.
*/
"DeveloperMode": false,

/**
* Whether to add a section to the 'mod issues' list for mods which directly use potentially
* sensitive .NET APIs like file or shell access. Note that many mods do this legitimately as
* part of their normal functionality, so these warnings are meaningless without further
* investigation. When this is commented out, it'll be true for local debug builds and false
* otherwise.
*/
//"ParanoidWarnings": true,

/**
* Whether SMAPI should show newer beta versions as an available update. When this is commented
* out, it'll be true if the current SMAPI version is beta, and false otherwise.
*/
//"UseBetaChannel": true,

/**
* SMAPI's GitHub project name, used to perform update checks.
*/
"GitHubProjectName": "Pathoschild/SMAPI",

/**
* The base URL for SMAPI's web API, used to perform update checks.
* Note: the protocol will be changed to http:// on Linux/Mac due to OpenSSL issues with the
* game's bundled Mono.
*/
"WebApiBaseUrl": "https://api.smapi.io",

/**
* Whether SMAPI should log more information about the game context.
*/
"VerboseLogging": false,

/**
* Whether to generate a 'SMAPI-latest.metadata-dump.json' file in the logs folder with the full mod
* metadata for detected mods. This is only needed when troubleshooting some cases.
*/
"DumpMetadata": false,

/**
* The mod IDs SMAPI should ignore when performing update checks or validating update keys.
*/
"SuppressUpdateChecks": [
"SMAPI.ConsoleCommands",
"SMAPI.SaveBackup"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@
"Default | UpdateKey": "Nexus:2270"
},

//"Content Patcher": {
// "ID": "Pathoschild.ContentPatcher",
// "Default | UpdateKey": "Nexus:1915"
//},
"Content Patcher": {
"ID": "Pathoschild.ContentPatcher",
"Default | UpdateKey": "Nexus:1915"
},

//"Custom Farming Redux": {
// "ID": "Platonymous.CustomFarming",
// "Default | UpdateKey": "Nexus:991"
//},
"Custom Farming Redux": {
"ID": "Platonymous.CustomFarming",
"Default | UpdateKey": "Nexus:991"
},

"Custom Shirts": {
"ID": "Platonymous.CustomShirts",
Expand Down Expand Up @@ -234,141 +234,6 @@
"~ | StatusReasonPhrase": "debug mode was removed in SMAPI 1.0."
},

/*********
** Broke in SMAPI 3.0 (runtime errors due to lifecycle changes)
*********/
"Advancing Sprinklers": {
"ID": "warix3.advancingsprinklers",
"~1.0.0 | Status": "AssumeBroken"
},

"Arcade 2048": {
"ID": "Platonymous.2048",
"~1.0.6 | Status": "AssumeBroken" // possibly due to PyTK
},

"Arcade Snake": {
"ID": "Platonymous.Snake",
"~1.1.0 | Status": "AssumeBroken" // possibly due to PyTK
},

"Better Sprinklers": {
"ID": "Speeder.BetterSprinklers",
"~2.3.1-unofficial.7-pathoschild | Status": "AssumeBroken"
},

"Companion NPCs": {
"ID": "Redwood.CompanionNPCs",
"~0.0.9 | Status": "AssumeBroken"
},

"Content Patcher": {
"ID": "Pathoschild.ContentPatcher",
"Default | UpdateKey": "Nexus:1915",
"~1.6.4 | Status": "AssumeBroken"
},

"Crop Transplant Mod": {
"ID": "DIGUS.CropTransplantMod",
"~1.1.3 | Status": "AssumeBroken"
},

"Custom Adventure Guild Challenges": {
"ID": "DefenTheNation.CustomGuildChallenges",
"~1.8 | Status": "AssumeBroken"
},

"Custom Farming Redux": {
"ID": "Platonymous.CustomFarming",
"Default | UpdateKey": "Nexus:991",
"~2.10.10 | Status": "AssumeBroken" // possibly due to PyTK
},

"Deep Woods": {
"ID": "maxvollmer.deepwoodsmod",
"~1.5-beta.1 | Status": "AssumeBroken"
},

"Everlasting Baits and Unbreaking Tackles": {
"ID": "DIGUS.EverlastingBaitsAndUnbreakableTacklesMod",
"~1.2.4 | Status": "AssumeBroken"
},

"Farmhouse Redone": {
"ID": "mabelsyrup.farmhouse",
"~0.2 | Status": "AssumeBroken"
},

"Geode Info Menu": {
"ID": "cat.geodeinfomenu",
"~1.5 | Status": "AssumeBroken"
},

"Harp of Yoba Redux": {
"ID": "Platonymous.HarpOfYobaRedux",
"~2.6.3 | Status": "AssumeBroken" // possibly due to PyTK
},

"Infested Levels": {
"ID": "Eireon.InfestedLevels",
"~1.0.5 | Status": "AssumeBroken"
},

"JoJaBan - Arcade Sokoban": {
"ID": "Platonymous.JoJaBan",
"~0.4.3 | Status": "AssumeBroken" // possibly due to PyTK
},

"Level Extender": {
"ID": "DevinLematty.LevelExtender",
"~3.1 | Status": "AssumeBroken"
},

"Mod Update Menu": {
"ID": "cat.modupdatemenu",
"~1.4 | Status": "AssumeBroken"
},

"Mushroom Levels": {
"ID": "Eireon.MushroomLevels",
"~1.0.4 | Status": "AssumeBroken"
},

"Notes": {
"ID": "Platonymous.Notes",
"~1.0.5 | Status": "AssumeBroken" // possibly due to PyTK
},

"Quick Start": {
"ID": "WuestMan.QuickStart",
"~1.5 | Status": "AssumeBroken"
},

"Seed Bag": {
"ID": "Platonymous.SeedBag",
"~1.2.7 | Status": "AssumeBroken" // possibly due to PyTK
},

"Separate Money": {
"ID": "funnysnek.SeparateMoney",
"~1.4.2 | Status": "AssumeBroken"
},

"Split Money": {
"ID": "Platonymous.SplitMoney",
"~1.2.4 | Status": "AssumeBroken" // possibly due to PyTK
},

"Stack to Nearby Chests": {
"ID": "Ilyaki.StackToNearbyChests",
"~1.4.4 | Status": "AssumeBroken"
},

"Tree Transplant": {
"ID": "TreeTransplant",
"~1.0.5 | Status": "AssumeBroken"
},

/*********
** Broke in SDV 1.3.36
*********/
Expand Down
Binary file added Install/SMDroid/xTile.dll
Binary file not shown.
Loading