iamironz / unsafe Goto Github PK
View Code? Open in Web Editor NEWAndroid unsafe wrapper around internal sun.misc.Unsafe api
Android unsafe wrapper around internal sun.misc.Unsafe api
java.lang.NoSuchMethodError: No virtual method getByte(J)B in class Lsun/misc/Unsafe; or its super classes (declaration of 'sun.misc.Unsafe' appears in /system/framework/core-libart.jar)
i got that error when trying to get value from spesific memory address using getByte() method. Please help
I was trying to use the library in "Nexus 4 API Level 16" and the following block throws NoSuchElement for theUnsafe
field
static {
try {
final Field field = Unsafe.class.getDeclaredField("theUnsafe");
field.setAccessible(true);
unsafe = (Unsafe) field.get(null);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
saw that backport libs such as retrostream handles NSFE in following way:
static {
try {
Field field = null;
try {
field = Unsafe.class.getDeclaredField("theUnsafe");
} catch (NoSuchFieldException oldAndroid) {
field = Unsafe.class.getDeclaredField("THE_ONE");
}
field.setAccessible(true);
unsafe = (Unsafe) field.get(null);
} catch (Exception e) {
throw new Error(e);
}
}
Hi,
Thanks for the lib but is there a way to use it on devices below api24?
I get this exception :
Caused by: java.lang.NoSuchMethodError: No virtual method getInt(J)I in class Lsun/misc/Unsafe; or its super classes (declaration of 'sun.misc.Unsafe' appears in /system/framework/core-libart.jar)
at com.ironz.unsafe.UnsafeAndroid.getInt(UnsafeAndroid.java:424)
Regards,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.