|
|
@@ -176,6 +176,10 @@ setImmediate(() => {
|
|
|
let config = readConfig()
|
|
|
new Interaction().start(23947, (msg) => {
|
|
|
console.log('on message', msg)
|
|
|
+ if (msg.action === 'saveConfig') {
|
|
|
+ config = msg.data
|
|
|
+ saveConfig(config)
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
const DeviceIdentifiersPolicy = Java.use(
|
|
|
@@ -184,7 +188,7 @@ setImmediate(() => {
|
|
|
|
|
|
DeviceIdentifiersPolicy.getSerial.overload().implementation = function () {
|
|
|
const original = this.getSerial()
|
|
|
- const spoof = queryConfig('serial_no')
|
|
|
+ const spoof = config.serialNo || original
|
|
|
log(`DeviceIdentifiersPolicy.getSerial() called, returning: ${spoof}, original: ${original}`)
|
|
|
return spoof
|
|
|
}
|
|
|
@@ -192,7 +196,7 @@ setImmediate(() => {
|
|
|
DeviceIdentifiersPolicy.getSerialForPackage.overload('java.lang.String', 'java.lang.String').implementation =
|
|
|
function (callingPackage, callingFeatureId) {
|
|
|
const original = this.getSerialForPackage(callingPackage, callingFeatureId)
|
|
|
- const spoof = queryConfig('serial_no')
|
|
|
+ const spoof = config.serialNo || original
|
|
|
log(`DeviceIdentifiersPolicy.getSerialForPackage(${callingPackage}, ${callingFeatureId}) called`)
|
|
|
log(` ${original} -> ${spoof}`)
|
|
|
return spoof
|
|
|
@@ -204,7 +208,7 @@ setImmediate(() => {
|
|
|
const WifiServiceImpl = Java.use('com.android.server.wifi.WifiServiceImpl')
|
|
|
WifiServiceImpl.getFactoryMacAddresses.overload().implementation = function () {
|
|
|
const original = this.getFactoryMacAddresses()
|
|
|
- const spoof = [queryConfig('mac')]
|
|
|
+ const spoof = [config.mac || randomMac()]
|
|
|
log(`WifiServiceImpl.getFactoryMacAddresses() called`)
|
|
|
log(` ${original} -> ${spoof}`)
|
|
|
return spoof
|
|
|
@@ -216,8 +220,8 @@ setImmediate(() => {
|
|
|
const original = this.getConnectionInfo(callingPackage, callingFeatureId)
|
|
|
const originalMac = original.getMacAddress()
|
|
|
const originalBSSID = original.getBSSID()
|
|
|
- const spoofedMac = queryConfig('mac') || randomMac()
|
|
|
- const spoofedBSSID = queryConfig('bssid') || randomMac()
|
|
|
+ const spoofedMac = config.mac || randomMac()
|
|
|
+ const spoofedBSSID = config.bssid || randomMac()
|
|
|
original.setMacAddress(spoofedMac)
|
|
|
original.setBSSID(spoofedBSSID)
|
|
|
log(`WifiServiceImpl.getConnectionInfo(${callingPackage}, ${callingFeatureId}) called`)
|