This repository has been archived by the owner on Apr 8, 2020. It is now read-only.
/
BMSPS_BASIC_FUNCTIONS.c
120 lines (99 loc) · 2.54 KB
/
BMSPS_BASIC_FUNCTIONS.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
* BMSPS_BASIC_FUNCTIONS.c
* Created on: 11-25-2011
* Author: JasonStein
* E-mail: JasonStein@live.cn
*
* ===== BlendMIUI Speed-Porting Software =====
*
* This is a 100% free software and you can add all kinds
* of functions you like to make it powerful and useful.
* However,it's intended for personal and/or educational
* use only.It may not be duplicated for monetary benefit
* or any other purpose without the permission of the developer.
*
*/
#include <stdio.h>
#include <conio.h>
#include <string.h>
void PAUSE()
{
getch();
}
int FILE_CHECK(char *PATH)
{
if ((access(PATH, 0) == 0)) return 1;
else return 0;
}
void DELETE_FILE(char *PATH) /* Delete single file */
{
char DEL[128]="del /F /Q ";
strcat(DEL,PATH);
if(FILE_CHECK(PATH)) system(DEL);
}
void DELETE_DIC(char *PATH) /* Delete folder */
{
char DEL[128]="RD /S /Q ";
strcat(DEL,PATH);
if(FILE_CHECK(PATH)) system(DEL);
}
void COPY_FILE(char *A,char *B) /* Copy file from A to B */
{
char Copy[128]="xcopy ";
strcat(Copy,A);
strcat(Copy," ");
strcat(Copy,B);
strcat(Copy," /Q /Y");
strcat(Copy," > temp_log.txt");
system(Copy);
}
void COPY_FILE_HERE(char *PATH) /* Copy file from PATH to main Dic (workspace) */
{
char Copy[128]="xcopy ";
strcat(Copy,PATH);
strcat(Copy," /Q /Y");
strcat(Copy," > temp_log.txt");
system(Copy);
}
void COPY_DIC_HERE(char *PATH) /* Copy Dic from PATH to main Dic (workspace) */
{
char Copy[128]="xcopy ";
strcat(Copy,PATH);
strcat(Copy," /E /Q /Y");
strcat(Copy," > temp_log.txt");
system(Copy);
}
void RENAME(char *A,char *B)
{
char Rename[128]="ren ";
strcat(Rename,A);
strcat(Rename," ");
strcat(Rename,B);
strcat(Rename," > temp_log.txt");
system(Rename);
}
void _7zPACK(char *A,char *B) /* Use 7z to Pack B folder into A file */
{
char Pack[128]="7z a ";
strcat(Pack,A);
strcat(Pack," ");
strcat(Pack,B);
strcat(Pack," > temp_log.txt");
system(Pack);
}
void _7zUNPACK(char *PATH) /* Use 7z to upack */
{
char Unpack[128]="7z x ";
strcat(Unpack,PATH);
strcat(Unpack," > temp_log.txt");
system(Unpack);
}
void SIGN(char *A,char *B)
{
char Sign[123]="java -jar signapk.jar testkey.x509.pem testkey.pk8 ";
strcat(Sign,A);
strcat(Sign," ");
strcat(Sign,B);
strcat(Sign," > temp_log.txt");
system(Sign);
}