Excuse me if I am oversimplifying or misunderstanding your question. It sounds like you are just looking for a way to use web3 on mobile without metamask. I will begin by referring you to this question about how dapps can work on mobile, although it is somewhat outdated it can give you some context.
This question shows a list of web3-js enabled mobile browsers.
In doing some research I stumbled across this helpful [Coinbase Wallet developer doc] which shows how to both check for mobile and web3 enabled browsers using javascript I will paste the code below for convenience.
// Check for mobile
const { userAgent: ua } = navigator
const isIOS = ua.includes('iPhone') // “iPhone OS”
const isAndroid = ua.includes('Android')
// Check for web3 enabled browsers
const { currentProvider: cp } = window.web3
const isToshi = !!cp.isToshi
const isCipher = !!cp.isCipher
const isStatus = !!cp.isStatus
const isTrust = !! cp.isTrust
const isMetaMask = !!cp.isMetaMask
Okay now we know whether we are mobile or desktop and if we have a web3 enabled browser. Next we want to start calling contract methods. This question shows us how to call contract methods with web3. Again I will paste a generalized version here for convenience and clarity.
/* First get the contract instance from the abi,
which should be stored locally in your dApp.
*/
const contract = web3.eth.contract(contractAbi)
const contractInstance = contract.at(contractAddress)
contractInstance.myMethod.(param1 [, param2, ...]
[, transactionObject]
[, defaultBlock]
[, callback]);
Finally, you specifically asked about signing transactions. The Coinbase doc that I liked above has a section about that:
window.web3.currentProvider.sendAsync({
jsonrpc: '2.0',
id: 1,
method: 'personal_sign',
params: [
'0x48656c6c6f20576f726c6421', // message
'0x4c37E2533D4B1c9aAA5d1bc31dd7259A0852F0E4' // address
]
}, (err, res) => {
console.log(err, res)
})
This is taken from page 26. It also explains the use of personal_sign
over the other signing methods.
Note: If this answer is what you are looking for, it may be useful to reformulate the header of this question to more accurately reflect what was being asked and what was answered.
Let me know if this helps at all! 🙂