Returning to thinking seems to be the only way to return old functions. Look at your own custom method as follows and call it.
Paint paint = new Paint(); // configure paint here Method m = paint.getClass().getDeclaredMethod("native_measureText", String.class, int.class); float size = m.invoke(paint, text, 0x2); // text - text to measure // 0x2 - default for Right-To-Left text
Although this does not look very clean, this should work for you.
source share