Open histausse opened 5 months ago
I fixed the problem that the jni type name was wrong for arrays of type primary. Here's my fix
function makeBaseJniObjectTypeName(typeName) { if (typeName.length === 1) return typeName let convertType = typeName.replace(/./g, '/') if (convertType[0] !== 'L'){ convertType = 'L' + convertType +';' } return convertType }
function makeJniObjectTypeName(typeName) { let arrayCount = 0; while (typeName[arrayCount] === '[') { arrayCount += 1; } if (typeName.length === arrayCount + 1) { return typeName } if (arrayCount > 0) { const baseType = makeBaseJniObjectTypeName(typeName.slice(arrayCount)); return "[".repeat(arrayCount) + baseType; } return makeBaseJniObjectTypeName(typeName); }
// const internalTypeName = '[L' + elementTypeName.replace(/\./g, '/') + ';';
const internalTypeName = '[' + makeJniObjectTypeName(elementTypeName);
Hello, I run into a problem while trying to instrument methods that take an array of array of byte as argument. For exemple:
I believe the issue comes from here: https://github.com/frida/frida-java-bridge/blob/1e23abb71fd26726d59627e4da3ad8e10ba849aa/lib/types.js#L480
I think something like this could be a rough solution, but I did not manage to get frida to use patched version of frida-java-bridge:
PS: Is there some documentation for running a patched java-bridge? I tried https://github.com/frida/frida-tools?tab=readme-ov-file#loading-your-custom-frida-java-bridge and failled