This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
修改自 BTE Alpha 的 Renderer | |
正版默认有 MSAA 并自带一个 FBO | |
给正版用启动参数加 -nofbo -nomsaa | |
(很奇怪我的正版不会默认开 MSAA | |
*/ | |
// 初始化 FBO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 新的 windows 10 似乎已经修了问题 不需要这个了 | |
// 而且下面这玩意在 windows 8.1 之前用会爆炸 | |
typedef enum PROCESS_DPI_AWARENESS { | |
PROCESS_DPI_UNAWARE = 0, | |
PROCESS_SYSTEM_DPI_AWARE = 1, | |
PROCESS_PER_MONITOR_DPI_AWARE = 2 | |
} PROCESS_DPI_AWARENESS; | |
STDAPI SetProcessDpiAwareness( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean insertImage(File image) throws IOException { | |
ContentValues values; | |
values = new ContentValues(); | |
values.put(MediaStore.Images.ImageColumns.RELATIVE_PATH, Environment.DIRECTORY_PICTURES + "test"); | |
values.put(MediaStore.Images.ImageColumns.DISPLAY_NAME, Long.toString(System.currentTimeMillis())); | |
values.put(MediaStore.Images.ImageColumns.IS_PENDING, true); | |
Uri uri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); | |
if (uri == null) { | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean insertImage(File image) throws IOException { | |
ContentValues values; | |
values = new ContentValues(); | |
values.put(MediaStore.Images.ImageColumns.RELATIVE_PATH, Environment.DIRECTORY_PICTURES + "test"); | |
values.put(MediaStore.Images.ImageColumns.DISPLAY_NAME, Long.toString(System.currentTimeMillis())); | |
values.put(MediaStore.Images.ImageColumns.IS_PENDING, true); | |
Uri uri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); | |
if (uri == null) { | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
token = new Binder(); | |
try { | |
Context _context = android.app.ActivityThread.systemMain().getSystemContext(); | |
final Context context = new ContextWrapper(_context) { | |
@Override | |
public Object getSystemService(String name) { | |
if (Context.WINDOW_SERVICE.equals(name)) { | |
WindowManager wm = (WindowManager) super.getSystemService(name); | |
if (wm != null) { | |
((android.view.WindowManagerImpl) wm).setDefaultToken(token); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Context context = view.getContext(); | |
ContentResolver cr = context.getContentResolver(); | |
ContentValues values; | |
try { | |
// create a file for test | |
File file = new File(context.getFilesDir(), "1234568"); | |
file.createNewFile(); | |
try (OutputStream os = new FileOutputStream(file)) { | |
os.write("test".getBytes()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void api::OpenFiles(RiruFile *files, size_t count) { | |
struct sockaddr_un addr{}; | |
int fd; | |
socklen_t socklen; | |
uint8_t *data; | |
uint32_t data_size; | |
int32_t reply[count]; | |
uint32_t reply_size; | |
std::vector<int> fds; |