Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Saving and Loading Data to getDirectoryData

Featured Replies

I am getting an error when i try to save to: access denied ("java.lang.reflect.ReflectPermission" "suppressAccessChecks")

	public void saveUserProfiles(Script script) 
	{
		try 
		{
			FileOutputStream fileOut = new FileOutputStream(script.getDirectoryData() + USER_FILE);
			PrintStream printStream = new PrintStream(fileOut);
			fileOut.close();
			printStream.print(json.toJson(profiles));
			printStream.close();
		}
		catch (Exception e) 
		{
			script.logger.debug(e.getMessage());
		}
	}
	/**
	 * The user profiles file
	 */
	public static final String USER_FILE = "user_profiles.dat";

Edited by Optimum Scripts

My guess is that you're using an external library to parse JSON? And that library probably uses reflection, which requires the -allow reflection argument when opening the client.

But if this is the case, ext. libraries aren't copied to the SDN regardless

  • Author

Does the error really belong to this code? Seems like you are using reflection...

I doubt that is has anything to do with this code.

 

If you mean reflection client mode, I've tried both clients

My guess is that you're using an external library to parse JSON? And that library probably uses reflection, which requires the -allow reflection argument when opening the client.

But if this is the case, ext. libraries aren't copied to the SDN regardless

 

Actually i'm using GSON's original source code within my application, no library. But all json is doing is parsing the object, not writing the file

If you mean reflection client mode, I've tried both clients

 

Actually i'm using GSON's original source code within my application, no library. But all json is doing is parsing the object, not writing the file

 

GSON probably uses reflection somewhere, even if you dont use that particular method, if the classloader sees that any of your classes use it, it will act up.

 

  • Author

GSON probably uses reflection somewhere, even if you dont use that particular method, if the classloader sees that any of your classes use it, it will act up.

 

 

Had to resort to serializeable objects :( 

Had to resort to serializeable objects sad.png

 

That won't fly with the SDN either. Method names and class members have their identifiers changed by the obfuscator (including serialVersionUID)

In other words, you wont be able to load objects serialized by an earlier osbot client version

Edited by FrostBug

  • Author

That won't fly with the SDN either. Method names and class members have their identifiers changed by the obfuscator (including serialVersionUID)

In other words, you wont be able to load objects serialized by an earlier osbot client version

Any recommendations ? 

Any recommendations ? 

 

Well, there aren't rly many good options left.

 

I personally made some API around java 'Properties'

 

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.