├── .gitignore
├── GalaxySFrontend
└── LowLevelUnbrick
│ ├── build.xml
│ ├── flowchart.odg
│ ├── icon.png
│ ├── manifest.mf
│ ├── nbproject
│ ├── build-impl.xml
│ ├── genfiles.properties
│ ├── project.properties
│ └── project.xml
│ └── src
│ ├── META-INF
│ └── services
│ │ └── org.jdesktop.application.Application
│ ├── README
│ └── com
│ └── AdamOutler
│ └── LowLevelUnBrick
│ ├── FileOperations.java
│ ├── LinkLauncher.java
│ ├── Log.java
│ ├── LowLevelUnbrickOneClickApp.java
│ ├── LowLevelUnbrickOneClickView.form
│ ├── LowLevelUnbrickOneClickView.java
│ ├── Shell.java
│ ├── Statics.java
│ ├── TimeOutOptionPane.java
│ ├── Unzip.java
│ └── resources
│ ├── LowLevelUnbrickOneClickApp.properties
│ ├── LowLevelUnbrickOneClickView.properties
│ ├── NewApplication.properties
│ ├── UnBrickPack.zip
│ ├── WindowsProblem.properties
│ └── images
│ ├── DebugMode.jpg
│ ├── DeviceNotFound.jpg
│ ├── DownloadMode.jpg
│ ├── MassStorage.jpg
│ ├── MediaPlayer.jpeg
│ ├── S5PC110.jpg
│ ├── SamsungKies.jpg
│ ├── SamsungKies.png
│ ├── TI.jpg
│ ├── Unbrickable.png
│ └── fastboot.jpg
├── HummingBirdInterceptorBootloader
├── BL1_stage1.bin
├── Captivate_SBL.bin
├── HIBL.ASM
├── HIBL.bin
├── S8500_BL3.bin
├── S8530_BL3.bin
├── functions.inc
├── infuse.inc
├── init_by_rebell.bin
├── sgs.inc
└── uart_test.ASM
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | /GalaxySFrontend/LowLevelUnbrick/nbproject/private/
2 | /GalaxySFrontend/LowLevelUnbrick/build/
3 | /GalaxySFrontend/LowLevelUnbrick/dist/
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Builds, tests, and runs the project LowLevelUnBrick.
12 |
13 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/flowchart.odg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmarszk/hummingbird-hibl/65a935a1ce076297c0e569afffe207e6285b1a95/GalaxySFrontend/LowLevelUnbrick/flowchart.odg
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dmarszk/hummingbird-hibl/65a935a1ce076297c0e569afffe207e6285b1a95/GalaxySFrontend/LowLevelUnbrick/icon.png
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/manifest.mf:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | X-COMMENT: Main-Class will be added automatically by build
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/nbproject/build-impl.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
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 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 | Must set src.dir
234 | Must set test.src.dir
235 | Must set build.dir
236 | Must set dist.dir
237 | Must set build.classes.dir
238 | Must set dist.javadoc.dir
239 | Must set build.test.classes.dir
240 | Must set build.test.results.dir
241 | Must set build.classes.excludes
242 | Must set dist.jar
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 | Must set javac.includes
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 | No tests executed.
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 | Must set JVM to use for profiling in profiler.info.jvm
723 | Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
724 |
725 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
846 |
847 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 |
884 |
885 |
886 |
891 |
892 |
893 |
894 |
895 |
896 |
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 |
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 |
929 |
930 |
931 |
932 |
933 |
934 |
935 |
936 |
937 |
938 |
939 |
940 |
941 |
942 |
943 |
944 |
945 |
946 |
947 |
948 |
949 |
950 |
951 | Must select some files in the IDE or set javac.includes
952 |
953 |
954 |
955 |
956 |
957 |
958 |
959 |
960 |
965 |
966 |
967 |
968 |
969 |
970 |
971 |
972 |
973 |
974 |
975 |
976 |
977 |
978 |
979 |
980 |
981 |
982 |
983 |
984 |
985 |
986 |
987 |
988 |
989 |
990 |
991 |
992 |
993 |
994 |
995 |
996 |
997 |
998 |
999 |
1000 |
1001 | To run this application from the command line without Ant, try:
1002 |
1003 | java -jar "${dist.jar.resolved}"
1004 |
1005 |
1006 |
1007 |
1008 |
1009 |
1010 |
1011 |
1012 |
1013 |
1014 |
1015 |
1016 |
1017 |
1018 |
1019 |
1020 |
1021 |
1022 |
1023 |
1024 |
1025 |
1026 |
1027 |
1028 |
1029 |
1030 |
1031 |
1032 |
1033 |
1034 |
1039 |
1040 |
1041 |
1042 |
1043 |
1044 |
1045 |
1046 |
1047 |
1048 |
1049 |
1050 | Must select one file in the IDE or set run.class
1051 |
1052 |
1053 |
1054 | Must select one file in the IDE or set run.class
1055 |
1056 |
1057 |
1062 |
1063 |
1064 |
1065 |
1066 |
1067 |
1068 |
1069 |
1070 |
1071 |
1072 |
1073 |
1074 |
1075 |
1076 |
1077 |
1078 |
1079 |
1080 |
1081 | Must select one file in the IDE or set debug.class
1082 |
1083 |
1084 |
1085 |
1086 | Must select one file in the IDE or set debug.class
1087 |
1088 |
1089 |
1090 |
1091 | Must set fix.includes
1092 |
1093 |
1094 |
1095 |
1096 |
1097 |
1098 |
1103 |
1106 |
1107 | This target only works when run from inside the NetBeans IDE.
1108 |
1109 |
1110 |
1111 |
1112 |
1113 |
1114 |
1115 |
1116 | Must select one file in the IDE or set profile.class
1117 | This target only works when run from inside the NetBeans IDE.
1118 |
1119 |
1120 |
1121 |
1122 |
1123 |
1124 |
1125 |
1126 | This target only works when run from inside the NetBeans IDE.
1127 |
1128 |
1129 |
1130 |
1131 |
1132 |
1133 |
1134 |
1135 |
1136 |
1137 |
1138 |
1139 | This target only works when run from inside the NetBeans IDE.
1140 |
1141 |
1142 |
1143 |
1144 |
1145 |
1146 |
1147 |
1148 |
1149 |
1150 |
1151 |
1152 |
1153 |
1154 |
1155 |
1156 |
1157 |
1158 |
1159 |
1160 |
1161 |
1164 |
1165 |
1166 |
1167 |
1168 |
1169 |
1170 |
1171 |
1172 |
1173 |
1174 |
1175 |
1176 |
1177 | Must select one file in the IDE or set run.class
1178 |
1179 |
1180 |
1181 |
1182 |
1183 | Must select some files in the IDE or set test.includes
1184 |
1185 |
1186 |
1187 |
1188 | Must select one file in the IDE or set run.class
1189 |
1190 |
1191 |
1192 |
1193 | Must select one file in the IDE or set applet.url
1194 |
1195 |
1196 |
1197 |
1202 |
1203 |
1204 |
1205 |
1206 |
1207 |
1208 |
1209 |
1210 |
1211 |
1212 |
1213 |
1214 |
1215 |
1216 |
1217 |
1218 |
1219 |
1220 |
1221 |
1222 |
1223 |
1224 |
1225 |
1226 |
1227 |
1228 |
1229 |
1230 |
1231 |
1232 |
1233 |
1234 |
1235 |
1236 |
1237 |
1238 |
1239 |
1240 |
1241 |
1246 |
1247 |
1248 |
1249 |
1250 |
1251 |
1252 |
1253 |
1254 |
1255 |
1256 |
1257 |
1258 |
1259 |
1260 |
1261 |
1262 |
1263 |
1264 |
1265 |
1266 |
1267 |
1268 |
1269 |
1270 |
1271 |
1272 | Must select some files in the IDE or set javac.includes
1273 |
1274 |
1275 |
1276 |
1277 |
1278 |
1279 |
1280 |
1281 |
1282 |
1283 |
1284 |
1289 |
1290 |
1291 |
1292 |
1293 |
1294 |
1295 |
1296 | Some tests failed; see details above.
1297 |
1298 |
1299 |
1300 |
1301 |
1302 |
1303 |
1304 |
1305 | Must select some files in the IDE or set test.includes
1306 |
1307 |
1308 |
1309 | Some tests failed; see details above.
1310 |
1311 |
1312 |
1313 | Must select some files in the IDE or set test.class
1314 | Must select some method in the IDE or set test.method
1315 |
1316 |
1317 |
1318 | Some tests failed; see details above.
1319 |
1320 |
1321 |
1326 |
1327 | Must select one file in the IDE or set test.class
1328 |
1329 |
1330 |
1331 | Must select one file in the IDE or set test.class
1332 | Must select some method in the IDE or set test.method
1333 |
1334 |
1335 |
1336 |
1337 |
1338 |
1339 |
1340 |
1341 |
1342 |
1343 |
1344 |
1349 |
1350 | Must select one file in the IDE or set applet.url
1351 |
1352 |
1353 |
1354 |
1355 |
1356 |
1357 |
1362 |
1363 | Must select one file in the IDE or set applet.url
1364 |
1365 |
1366 |
1367 |
1368 |
1369 |
1370 |
1371 |
1376 |
1377 |
1378 |
1379 |
1380 |
1381 |
1382 |
1383 |
1384 |
1385 |
1386 |
1387 |
1388 |
1389 |
1390 |
1391 |
1392 |
1393 |
1394 |
1395 |
1396 |
1397 |
1398 |
1399 |
1400 |
1401 |
1402 |
1403 |
1404 |
1405 |
1406 |
1407 |
1408 |
1409 |
1410 |
1411 |
1412 |
1413 |
1414 |
1415 |
1416 |
1417 |
1418 |
1419 |
1420 |
1421 |
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=86fed732
2 | build.xml.script.CRC32=dc21daf1
3 | build.xml.stylesheet.CRC32=28e38971@1.43.1.45
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=23a47b73
7 | nbproject/build-impl.xml.script.CRC32=97932733
8 | nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48
9 |
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/nbproject/project.properties:
--------------------------------------------------------------------------------
1 | annotation.processing.enabled=true
2 | annotation.processing.enabled.in.editor=false
3 | annotation.processing.processors.list=
4 | annotation.processing.run.all.processors=true
5 | application.desc=Ultimate UnBrick Resurrection
6 | application.homepage=http://www.adamoutler.com
7 | application.splash=/home/adam/code/HeimdallOneClick/src/resources/splash.png
8 | application.title=Heimdall One-Click
9 | application.vendor=Adam Outler
10 | build.classes.dir=${build.dir}/classes
11 | build.classes.excludes=**/*.java,**/*.form
12 | # This directory is removed when the project is cleaned:
13 | build.dir=build
14 | build.generated.dir=${build.dir}/generated
15 | build.generated.sources.dir=${build.dir}/generated-sources
16 | # Only compile against the classpath explicitly listed here:
17 | build.sysclasspath=ignore
18 | build.test.classes.dir=${build.dir}/test/classes
19 | build.test.results.dir=${build.dir}/test/results
20 | debug.classpath=\
21 | ${run.classpath}
22 | debug.test.classpath=\
23 | ${run.test.classpath}
24 | # This directory is removed when the project is cleaned:
25 | dist.dir=dist
26 | dist.jar=${dist.dir}/LowLevelUnbrick.jar
27 | dist.javadoc.dir=${dist.dir}/javadoc
28 | endorsed.classpath=
29 | excludes=
30 | includes=**
31 | jar.archive.disabled=${jnlp.enabled}
32 | jar.compress=false
33 | jar.index=${jnlp.enabled}
34 | javac.classpath=\
35 | ${libs.swing-app-framework.classpath}
36 | # Space-separated list of extra javac options
37 | javac.compilerargs=
38 | javac.deprecation=false
39 | javac.external.vm=false
40 | javac.processorpath=\
41 | ${javac.classpath}
42 | javac.source=1.6
43 | javac.target=1.6
44 | javac.test.classpath=\
45 | ${javac.classpath}:\
46 | ${build.classes.dir}
47 | javadoc.additionalparam=
48 | javadoc.author=false
49 | javadoc.encoding=${source.encoding}
50 | javadoc.noindex=false
51 | javadoc.nonavbar=false
52 | javadoc.notree=false
53 | javadoc.private=false
54 | javadoc.splitindex=true
55 | javadoc.use=true
56 | javadoc.version=true
57 | javadoc.windowtitle=
58 | jnlp.codebase.type=no.codebase
59 | jnlp.descriptor=application
60 | jnlp.enabled=false
61 | jnlp.mixed.code=default
62 | jnlp.offline-allowed=false
63 | jnlp.signed=false
64 | jnlp.signing=
65 | jnlp.signing.alias=
66 | jnlp.signing.keystore=
67 | main.class=com.AdamOutler.LowLevelUnBrick.LowLevelUnbrickOneClickApp
68 | # Optional override of default Application-Library-Allowable-Codebase attribute identifying the locations where your signed RIA is expected to be found.
69 | manifest.custom.application.library.allowable.codebase=
70 | # Optional override of default Caller-Allowable-Codebase attribute identifying the domains from which JavaScript code can make calls to your RIA without security prompts.
71 | manifest.custom.caller.allowable.codebase=
72 | # Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed
73 | manifest.custom.codebase=
74 | # Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions)
75 | manifest.custom.permissions=
76 | manifest.file=manifest.mf
77 | meta.inf.dir=${src.dir}/META-INF
78 | mkdist.disabled=false
79 | platform.active=default_platform
80 | run.classpath=\
81 | ${javac.classpath}:\
82 | ${build.classes.dir}
83 | # Space-separated list of JVM arguments used when running the project
84 | # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
85 | # or test-sys-prop.name=value to set system properties for unit tests):
86 | run.jvmargs=
87 | run.test.classpath=\
88 | ${javac.test.classpath}:\
89 | ${build.test.classes.dir}
90 | source.encoding=UTF-8
91 | src.dir=src
92 | test.src.dir=test
93 |
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.netbeans.modules.java.j2seproject
4 |
5 |
6 | LowLevelUnbrick
7 | 1.6.5
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/src/META-INF/services/org.jdesktop.application.Application:
--------------------------------------------------------------------------------
1 | com.AdamOutler.HeimdallOneClick.LowLevelUnbrick
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/src/README:
--------------------------------------------------------------------------------
1 | If you are reading this, you are doing something wrong.
2 |
3 | This is an executable file, it should not be decompressed.
4 |
5 | Please visit the following site to ensure you have the latest version of Java
6 | http://java.com/en/download/installed.jsp
7 |
8 | Then right-click and open this file as an executable.
9 |
10 |
11 | Again, if you are trying to use this program, you should not be in here.
12 |
13 | If you're trying to see what makes the program tick, then visit this site
14 | http://oneclick.adamoutler.com for source code.
15 |
16 |
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/src/com/AdamOutler/LowLevelUnBrick/FileOperations.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011 Adam Outler
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
4 | * of this software and associated documentation files (the "Software"), to deal
5 | * in the Software without restriction, including without limitation the rights
6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | * copies of the Software, and to permit persons to whom the Software is
8 | * furnished to do so, subject to the following conditions:
9 | *
10 | * The above copyright notice and this permission notice shall be included in
11 | * all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | * SOFTWARE.
20 | */
21 |
22 | package com.AdamOutler.LowLevelUnBrick;
23 |
24 | import java.io.BufferedOutputStream;
25 | import java.io.BufferedWriter;
26 | import java.io.DataOutputStream;
27 | import java.io.File;
28 | import java.io.FileInputStream;
29 | import java.io.FileOutputStream;
30 | import java.io.FileWriter;
31 | import java.io.IOException;
32 | import java.io.InputStream;
33 | import java.io.InputStreamReader;
34 | import java.nio.channels.FileChannel;
35 | import java.util.logging.Level;
36 | import java.util.logging.Logger;
37 | import javax.swing.JOptionPane;
38 |
39 |
40 | /**
41 | *
42 | * @author adam
43 | */
44 | public class FileOperations {
45 | Log Log = new Log();
46 | Shell shellCommand = new Shell();
47 |
48 | public FileOperations(){
49 | }
50 |
51 |
52 |
53 | public boolean copyFromResourceToFile(String Resource, String toFile){
54 | try {
55 | InputStream resourceAsStream = getClass().getResourceAsStream(Resource);
56 | try {
57 | if ( resourceAsStream.available() >= 1 ){
58 | File Destination = new File(toFile);
59 | writeInputStreamToFile(resourceAsStream, Destination);
60 | if (Destination.length() >= 1){
61 | return true;
62 | } else {
63 |
64 | Log.level0("Failed to write file");
65 | return false;
66 | }
67 |
68 | } else {
69 | Log.level0("Critical Error copying " + Resource);
70 | }
71 | } catch ( NullPointerException e){
72 | return false;
73 | }
74 |
75 |
76 |
77 |
78 | } catch (IOException ex) {
79 | Logger.getLogger(FileOperations.class.getName()).log(Level.SEVERE, null, ex);
80 | Log.level0("Critical Error copying "+ Resource);
81 | return false;
82 | }
83 | return false;
84 | }
85 |
86 | public void recursiveDelete(String path){
87 | recursiveDelete(new File(path));
88 | }
89 |
90 | public void recursiveDelete(File path){
91 | File[] c = path.listFiles();
92 | if (path.exists()){
93 | Log.level2("Cleaning up folder:" + path.toString());
94 |
95 | for (File file : c){
96 | if (file.isDirectory()){
97 | Log.level3("Deleting " + file.toString());
98 | recursiveDelete(file);
99 | file.delete();
100 | } else {
101 | file.delete();
102 | }
103 | }
104 | path.delete();
105 | }
106 | }
107 |
108 |
109 | public boolean verifyPermissionsRecursive(String path){
110 | File Check = new File(path);
111 | File[] c = Check.listFiles();
112 | if (Check.exists()){
113 | Log.level2("Verifying permissions in folder:" + path.toString());
114 | for (File file : c){
115 | if (!file.canWrite()){
116 | return false;
117 | }
118 | }
119 | }
120 | return true;
121 | }
122 | public String findRecursive(String PathToSearch,String FileName){
123 | File Check = new File(PathToSearch);
124 | File[] c = Check.listFiles();
125 | if (Check.exists()){
126 | Log.level2("Searching for file in folder:" + PathToSearch.toString());
127 | for (File file : c){
128 | String x = file.getName();
129 | if (file.isDirectory()){
130 | Log.level3("Searching " + file.toString());
131 | File[] subdir = file.listFiles();
132 | for (File sub : subdir){
133 | if (sub.isDirectory()) {
134 | String FoundFile = findRecursive(sub.toString(),FileName);
135 | if (FoundFile.toString().endsWith("heimdall.exe")){
136 | return FoundFile;
137 | }
138 | } else {
139 | if (sub.toString().equals(FileName)) return sub.toString();
140 | }
141 | }
142 | } else if (file.getName().equals("heimdall.exe")){
143 | return file.getAbsoluteFile().toString();
144 | }
145 | }
146 | }
147 | return null;
148 | }
149 |
150 |
151 |
152 |
153 |
154 | public boolean makeFolder(String Folder){
155 | Boolean CreatedFolder = false;
156 | File folder= new File(Folder);
157 |
158 | if (folder.exists()){
159 | return false;
160 | } else{
161 | CreatedFolder=folder.mkdir();
162 | }
163 | if ( CreatedFolder ){
164 | Log.level2("System temp folder created sucessfully in: "+Folder);
165 | }else{
166 |
167 | CreatedFolder=false;
168 | Log.level0("Could not create temp folder in " + Folder);
169 | }
170 |
171 | return CreatedFolder;
172 | }
173 |
174 |
175 | private boolean writeInputStreamToFile(InputStream is, File file) {
176 | Log.level3("Attempting to write "+file.getPath());
177 | try {
178 | DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
179 | int c;
180 | if (is.available() > 0 ){
181 | while((c = is.read()) != -1) {
182 | out.writeByte(c);
183 | }
184 | } else {
185 | Log.level0("ERROR: FILE READ WAS 0 LENGTH");
186 | return false;
187 | }
188 | is.close();
189 | out.close();
190 |
191 | } catch(IOException e) {
192 | System.err.print(e);
193 | System.err.println("Error Writing/Reading Streams.");
194 | return false;
195 | }
196 | if ((file.exists()) && (file.length() >= 4)){
197 | return true;
198 | } else {
199 | return false;
200 | }
201 |
202 | }
203 |
204 |
205 |
206 |
207 |
208 |
209 | public Boolean deleteFile(String FileName){
210 | Boolean Deleted=true;
211 | File file = new File(FileName);
212 | if (file.exists()){
213 | Deleted=false;
214 | if (file.delete()){
215 | Deleted=true;
216 | Log.level3("Deleted "+ FileName);
217 | } else {
218 | Deleted=false;
219 | Log.level0("ERROR DELETING FILE:" + FileName);
220 | JOptionPane.showMessageDialog(null, "Could not delete "+FileName+
221 | ". Delete this folder manually",
222 | "file error", JOptionPane.ERROR_MESSAGE);
223 |
224 | }
225 | } else {
226 | Deleted=true;
227 | }
228 | return Deleted;
229 | }
230 |
231 | public void copyFile(File sourceFile, File destFile) throws IOException {
232 |
233 | Log.level3("Copying " + sourceFile.getPath() + " to " + destFile.getPath());
234 | if(!destFile.exists()) {
235 | destFile.createNewFile();
236 | }
237 | FileChannel source = null;
238 | FileChannel destination = null;
239 | try {
240 | source = new FileInputStream(sourceFile).getChannel();
241 | destination = new FileOutputStream(destFile).getChannel();
242 | destination.transferFrom(source, 0, source.size());
243 | } finally {
244 | if(source != null) {
245 | source.close();
246 | }
247 | }
248 | if(destination != null) {
249 | destination.close();
250 |
251 | }
252 |
253 |
254 | }
255 |
256 | public String currentDir() {
257 | String CurrentDir=new File(".").getAbsolutePath();
258 | Log.level3("Detected current folder: "+ CurrentDir);
259 | if (CurrentDir.endsWith(".")){
260 | CurrentDir=CurrentDir.substring(0,CurrentDir.length()-1);
261 | }
262 | return CurrentDir;
263 | }
264 | public boolean copyFile(String FromFile, String ToFile){
265 | File OriginalFile = new File(FromFile);
266 | File DestinationFile = new File(ToFile);
267 | try {
268 | copyFile(OriginalFile, DestinationFile);
269 | return true;
270 | } catch (IOException ex) {
271 | return false;
272 | }
273 |
274 | }
275 |
276 | public boolean verifyFileExists(String Folder){
277 | File FileFolder = new File(Folder);
278 | boolean Result=(FileFolder.length()>=1);
279 | Log.level3("Verifying "+Folder+" . Result="+Result);
280 | Log.level3("Result=" +Result);
281 | return (Result);
282 | }
283 |
284 | public boolean setExecutableBit(String Executable){
285 | File Exe = new File(Executable);
286 | boolean Result = Exe.setExecutable(true);
287 | Log.level3("Setting executable "+Exe+". Result="+Result);
288 | return Result;
289 | }
290 |
291 |
292 |
293 | public boolean verifyResource(String Res){
294 | boolean Result;
295 | //this.statusAnimationLabel.setText(Res);
296 | Log.progress("Uncompressing "+Res+".... ");
297 | deleteFile(Res);
298 | Result=copyFromResourceToFile(setRes(Res), setDest(Res));
299 | //Log.level3("Unpacking " + setDest(Res) + " Performed correctly: " + Result );
300 | if (Result){
301 | Log.progress("Uncompressed\n");
302 | } else {
303 | Log.progress("FAILED!!!!\n");
304 | }
305 | return Result;
306 | }
307 | private String setDest(String FileName){
308 | return Statics.TempFolder + FileName;
309 | }
310 |
311 |
312 |
313 |
314 |
315 | private String setRes(String FileName ){
316 | return Statics.ROMPackageResourceFolder + FileName;
317 | }
318 |
319 | public String readTextFromResource(String Resource){
320 | FileInputStream fis = null;
321 | InputStreamReader in = null;
322 | String TextFile="";
323 | InputStream resourceAsStream = getClass().getResourceAsStream(Resource);
324 | StringBuilder text = new StringBuilder();
325 | try {
326 | in = new InputStreamReader(resourceAsStream, "UTF-8");
327 | int read;
328 | while ((read = in.read())!= -1 ){
329 | char C = Character.valueOf((char)read);
330 | text.append(C);
331 | }
332 |
333 | } catch (IOException ex) {
334 | Logger.getLogger(FileOperations.class.getName()).log(Level.SEVERE, null, ex);
335 | }
336 | Log.level2(text.toString());
337 | return text.toString();
338 | }
339 |
340 |
341 |
342 |
343 | public void writeToFile(String Text, String File) throws IOException{
344 |
345 | BufferedWriter bw;
346 | bw = new BufferedWriter(new FileWriter(File,true));
347 | bw.write(Text);
348 | bw.close();
349 |
350 | }
351 | }
352 |
353 |
354 |
355 |
356 |
357 |
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/src/com/AdamOutler/LowLevelUnBrick/LinkLauncher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this template, choose Tools | Templates
3 | * and open the template in the editor.
4 | */
5 | package com.AdamOutler.LowLevelUnBrick;
6 |
7 | import java.awt.Desktop;
8 | import java.io.IOException;
9 | import java.net.URI;
10 | import java.net.URISyntaxException;
11 |
12 | /**
13 | *
14 | * @author adam
15 | */
16 | public class LinkLauncher implements Runnable {
17 | static String Link;
18 | public void launchLink(String link){
19 | Link = link;
20 | Runnable runnable = new LinkLauncher();
21 | Thread thread = new Thread(runnable);
22 | thread.start();
23 | }
24 | public void run() {
25 |
26 | Shell Shell = new Shell();
27 | String Cmd[]={"firefox", Link};
28 | String LaunchRes=Shell.sendShellCommand(Cmd);
29 | if (LaunchRes.contains("CritERROR!!!")){
30 | String MCmd[]={"open" , Link};
31 | String MLaunchRes=Shell.sendShellCommand(MCmd);
32 | if (MLaunchRes.contains("CritERROR!!!")){
33 | String WCmd[]={"explorer", Link};
34 | String WLaunchRes=Shell.sendShellCommand(WCmd);
35 | if (WLaunchRes.contains("CritERROR!!!")){
36 | if (Desktop.isDesktopSupported()) {
37 | Desktop desktop;
38 | desktop = Desktop.getDesktop();
39 | URI uri = null;
40 | try {
41 | uri = new URI(Link);
42 | desktop.browse(uri);
43 | } catch (IOException ioe) {
44 | } catch (URISyntaxException use) {
45 | }
46 | }
47 | }
48 | }
49 | }
50 | }
51 | }
52 |
53 |
54 |
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/src/com/AdamOutler/LowLevelUnBrick/Log.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011 Adam Outler
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
4 | * of this software and associated documentation files (the "Software"), to deal
5 | * in the Software without restriction, including without limitation the rights
6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | * copies of the Software, and to permit persons to whom the Software is
8 | * furnished to do so, subject to the following conditions:
9 | *
10 | * The above copyright notice and this permission notice shall be included in
11 | * all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | * SOFTWARE.
20 | */
21 | package com.AdamOutler.LowLevelUnBrick;
22 |
23 | import java.io.FileWriter;
24 | import java.io.IOException;
25 | import java.io.PrintWriter;
26 | import javax.swing.text.BadLocationException;
27 |
28 | /**
29 | *
30 | * @author adam
31 | * Logging levels:
32 | * Logging levels are set in Statics
33 | *
34 | * Level0: silent, keep this for future critical tasks
35 | * Level1: Information for user to see
36 | * Level2: Information for developers to see
37 | * Level3: verbose information, use for conversions and random tasks
38 | *
39 | */
40 |
41 | public class Log{
42 |
43 |
44 |
45 | public Log(){
46 | }
47 |
48 | private void consoleOut(String data) {
49 | System.out.println(data);
50 | if (!"".equals(data)){
51 | if (! "\n".equals(data)){
52 | try{
53 | Statics.ProgressArea.append("\n"+data);
54 | Statics.ProgressArea.setCaretPosition(
55 | Statics.ProgressArea.getDocument()
56 | .getLength());
57 | }catch (NullPointerException e){
58 | Statics.PreStatus=Statics.PreStatus+data;
59 | }
60 |
61 | }
62 | }
63 | }
64 |
65 |
66 | // level 0 is used for errors.. basically silent. Use level 1 for
67 | // for most tasks
68 | public void level0(String data) {
69 | if (Statics.ConsoleLevel >= 0) {
70 | consoleOut(data);
71 |
72 | }
73 | if (Statics.LogLevel >= 0) {
74 | debugOut(data);
75 |
76 | }
77 | }
78 |
79 | // level 1 is for user data
80 | public void level1(String data) {
81 | if (Statics.ConsoleLevel >= 1) {
82 | consoleOut(data);
83 | }
84 | if (Statics.LogLevel >= 1) {
85 | debugOut(data);
86 |
87 | }
88 |
89 | }
90 |
91 | // level 2 is for debugging data
92 | public void level2(String data) {
93 | if (Statics.ConsoleLevel >= 2) {
94 | consoleOut(data);
95 | }
96 | if (Statics.LogLevel >= 2) {
97 | debugOut(data);
98 |
99 | }
100 | }
101 |
102 | // level 3 is conversions and other random test data
103 | public void level3(String data) {
104 | if (Statics.ConsoleLevel >= 3) {
105 | consoleOut(data);
106 | }
107 | if (Statics.LogLevel >= 3) {
108 | debugOut(data);
109 |
110 | }
111 | }
112 |
113 |
114 | public void copyError(String Filename) {
115 | //standard unexpected token failure
116 | this.level0("File Copy Error: " + Filename);
117 | }
118 |
119 | public void genericError(String Message) {
120 | this.level0("Error: " + Message);
121 | }
122 | public void writeToLogFile(String data){
123 | debugOut(data);
124 | }
125 | private void debugOut(String data) {
126 |
127 | FileWriter WriteFile = null;
128 | try {
129 | WriteFile = new FileWriter(Statics.TempFolder+"log.txt", true);
130 | } catch (IOException ex) {
131 | }
132 | PrintWriter out = new PrintWriter(WriteFile);
133 | Statics.OutFile=out;
134 | if (Statics.OutFile != null){Statics.LogCreated=true;}
135 | out.print(data);
136 | out.close();
137 |
138 | }
139 |
140 | public void progress(String data) {
141 | try {
142 | Statics.ProgressArea.append(data);
143 | Statics.ProgressArea.setCaretPosition(Statics.ProgressArea.getDocument().getLength());
144 | } catch (NullPointerException e){
145 | System.out.print(data);
146 | }
147 |
148 | }
149 | public void LiveUpdate(String data){
150 | System.out.println(data);
151 | Statics.ProgressArea.append(data);
152 | Statics.ProgressArea.setCaretPosition(Statics.ProgressArea.getDocument().getLength());
153 |
154 | }
155 | public void beginLine(){
156 | try {
157 | int start=Statics.ProgressArea.getLineStartOffset
158 | (Statics.ProgressArea.getLineCount()-1);
159 | int end = Statics.ProgressArea.getText().length();
160 |
161 | Statics.ProgressArea.replaceRange("", start, end);
162 |
163 | int x=1;
164 | System.out.print(x);
165 | }
166 | catch (BadLocationException ex) {
167 | }
168 | }
169 |
170 | }
171 |
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/src/com/AdamOutler/LowLevelUnBrick/LowLevelUnbrickOneClickApp.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011 Adam Outler
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
4 | * of this software and associated documentation files (the "Software"), to deal
5 | * in the Software without restriction, including without limitation the rights
6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | * copies of the Software, and to permit persons to whom the Software is
8 | * furnished to do so, subject to the following conditions:
9 | *
10 | * The above copyright notice and this permission notice shall be included in
11 | * all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | * SOFTWARE.
20 | */
21 |
22 | package com.AdamOutler.LowLevelUnBrick;
23 |
24 | import java.io.IOException;
25 | import java.util.logging.Level;
26 | import java.util.logging.Logger;
27 | import java.util.zip.ZipException;
28 | import org.jdesktop.application.Application;
29 | import org.jdesktop.application.SingleFrameApplication;
30 |
31 | /**
32 | * The main class of the application.
33 | */
34 | public class LowLevelUnbrickOneClickApp extends SingleFrameApplication {
35 |
36 | /**
37 | * At startup create and show the main frame of the application.
38 | */
39 | @Override protected void startup() {
40 | if ((getClass().getResource(Statics.ROMPackageTGZ))==null){
41 | show(new LowLevelUnbrickOneClickView(this,false));
42 | } else{
43 | show(new LowLevelUnbrickOneClickView(this,true));
44 | }
45 | }
46 |
47 | /**
48 | * This method is to initialize the specified window by injecting resources.
49 | * Windows shown in our application come fully initialized from the GUI
50 | * builder, so this additional configuration is not needed.
51 | */
52 | @Override protected void configureWindow(java.awt.Window root) {
53 | }
54 |
55 | /**
56 | * A convenient static getter for the application instance.
57 | * @return the instance of LowLevelUnBrick
58 | */
59 | public static LowLevelUnbrickOneClickApp getApplication() {
60 | return Application.getInstance(LowLevelUnbrickOneClickApp.class);
61 | }
62 |
63 | /**
64 | * Main method launching the application.
65 | */
66 | public static void main(String[] args) {
67 |
68 | //delete the temp folder before starting.
69 | FileOperations FileOperations=new FileOperations();
70 | Log Log = new Log();
71 | FileOperations.makeFolder(Statics.TempFolder);
72 | Log.level1("\nUncompressing HIBL Payload to " + Statics.TempFolder +"/n");
73 | FileOperations.copyFromResourceToFile("/com/AdamOutler/LowLevelUnBrick/resources/UnBrickPack.zip", Statics.TempFolder+"UnBrickPack.zip");
74 | Unzip Unzip=new Unzip();
75 | try {
76 | Unzip.unzip(Statics.TempFolder+"UnBrickPack.zip");
77 | } catch (ZipException ex) {
78 | Logger.getLogger(LowLevelUnbrickOneClickView.class.getName()).log(Level.SEVERE, null, ex);
79 | Log.level0("ERROR, INVALID ZIP FILE IN PACKAGE");
80 | } catch (IOException ex) {
81 | Logger.getLogger(LowLevelUnbrickOneClickView.class.getName()).log(Level.SEVERE, null, ex);
82 | Log.level0("ERROR, OUT OF SPACE OR NO ACCESS TO TEMP FOLDER");
83 | }
84 | launch(LowLevelUnbrickOneClickApp.class, args);
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/src/com/AdamOutler/LowLevelUnBrick/LowLevelUnbrickOneClickView.form:
--------------------------------------------------------------------------------
1 |
2 |
3 |
248 |
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/src/com/AdamOutler/LowLevelUnBrick/LowLevelUnbrickOneClickView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011 Adam Outler
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
4 | * of this software and associated documentation files (the "Software"), to deal
5 | * in the Software without restriction, including without limitation the rights
6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | * copies of the Software, and to permit persons to whom the Software is
8 | * furnished to do so, subject to the following conditions:
9 | *
10 | * The above copyright notice and this permission notice shall be included in
11 | * all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | * SOFTWARE.
20 | */
21 | package com.AdamOutler.LowLevelUnBrick;
22 |
23 | import java.awt.Dimension;
24 | import java.io.IOException;
25 | import java.util.logging.Level;
26 | import java.util.logging.Logger;
27 | import java.util.ArrayList;
28 |
29 | import java.awt.event.ActionEvent;
30 | import java.awt.event.ActionListener;
31 | import javax.swing.Timer;
32 | import javax.swing.ImageIcon;
33 | import org.jdesktop.application.FrameView;
34 | import org.jdesktop.application.SingleFrameApplication;
35 |
36 | /**
37 | * The application's main frame.
38 | */
39 | public class LowLevelUnbrickOneClickView extends FrameView {
40 |
41 | private static Shell ShellCommand = new Shell();
42 | FileOperations fileOperations = new FileOperations();
43 | /**
44 | * 250ms
45 | */
46 | private final int QUARTER_SECOND = 250; //ms
47 | /**
48 | * 1000ms
49 | */
50 | public final static int ONE_SECOND = 1000;
51 | private static boolean ButtonStatusChangedRequested = true; //used by timer on form oneclickview
52 | private static boolean LabelStatusChangedRequested = true; // used by timer on form oneclickview
53 | Log Log = new Log();
54 | final public static String DebugMode = "resources/images/DebugMode.jpg";
55 | final public static String S5PC110 = "resources/images/S5PC110.jpg";
56 | final public static String Fastboot = "resources/images/fastboot.jpg";
57 | final public static String DeviceNotFound = "resources/images/Unbrickable.png";
58 | final public static String DownloadMode = "resources/images/DownloadMode.jpg";
59 | final public static String MassStorage = "resources/images/MassStorage.jpg";
60 | final public static String MediaPlayer = "resources/images/MediaPlayer.jpeg";
61 | final public static String SamsungKies = "resources/images/SamsungKies.jpg";
62 | final public static String TexasInstruments = "resources/images/TI.jpg";
63 | Timer monitoringTimer = new Timer(QUARTER_SECOND, new ActionListener() {
64 |
65 | public void actionPerformed(ActionEvent evt) {
66 |
67 | String Result = ShellCommand.silentShellCommand(new String[]{"lsusb"});
68 | if (Result.contains("04e8:1234")) {
69 | jLabel2.setText("S5PC110 detected");
70 | jLabel3.setText("Begin Resurrection- Press the Download Mode Button");
71 | jLabel1.setIcon(createImageIcon(S5PC110, "S5PC110 Mode"));
72 | } else {
73 | if (Result.contains("04e8:6601")) {
74 | jLabel1.setIcon(createImageIcon(DownloadMode, "Download Mode."));
75 | jLabel2.setText("Download Mode");
76 | jLabel3.setText("Start Firmware Download with Heimdall or Odin");
77 | } else if (Result.contains("04e8:6877")) {
78 | jLabel1.setIcon(createImageIcon(SamsungKies, "Samsung Kies."));
79 | jLabel2.setText("Samsung Kies");
80 | jLabel3.setText("Kies Mode detected");
81 | } else if (Result.contains("04e8:68a9")) {
82 | jLabel1.setIcon(createImageIcon(MediaPlayer, "Media Player."));
83 | jLabel2.setText("Media Player");
84 | jLabel3.setText("Samsung Media Player");
85 | } else if (Result.contains("04e8:681d")) {
86 | jLabel1.setIcon(createImageIcon(MassStorage, "Mass Storage."));
87 | jLabel3.setText("Mass storage device");
88 | jLabel2.setText("Mass Storage");
89 | } else if (Result.contains("04e8:681c")) {
90 | jLabel1.setIcon(createImageIcon(DebugMode, "Debug Mode."));
91 | jLabel3.setText("Android Debug Bridge");
92 | jLabel2.setText("Debug Mode Detected");
93 | } else if (Result.contains("04e8:685e")) {
94 | jLabel1.setIcon(createImageIcon(DebugMode, "Debug Mode."));
95 | jLabel3.setText("Android Debug Bridge");
96 | jLabel2.setText("Debug Mode Detected");
97 | } else if (Result.contains("04e8:684e")) {
98 | jLabel1.setIcon(createImageIcon(DeviceNotFound, "Samsung GMO Modem"));
99 | jLabel3.setText("Samsung GMO Modem");
100 | jLabel2.setText("Debug Mode");
101 | } else if (Result.contains("18d1:4e20")) {
102 | jLabel1.setIcon(createImageIcon(Fastboot, "Fastboot"));
103 | jLabel3.setText("Fastboot");
104 | jLabel2.setText("Fastboot mode");
105 | } else if (Result.contains("0451:d00e")) {
106 | jLabel1.setIcon(createImageIcon(TexasInstruments, "Texas Instruments"));
107 | jLabel3.setText("TI USB");
108 | jLabel2.setText("Unnown 0451:d010 TI debug mode");
109 | } else if (Result.contains("0451:d010")) {
110 | jLabel1.setIcon(createImageIcon(TexasInstruments, "Texas Instruments"));
111 | jLabel3.setText("TI USB");
112 | jLabel2.setText("Unnown 0451:d00e TI debug mode");
113 | } else if (Result.contains("0955:7820")) {
114 | jLabel1.setIcon(createImageIcon(DeviceNotFound, "The device is connected."));
115 | jLabel3.setText("NVidia");
116 | jLabel2.setText("Unnown 0955:7820 NVFlash Mode");
117 | } else {
118 | jLabel1.setIcon(createImageIcon(DeviceNotFound, "The device is connected."));
119 | jLabel3.setText("No device detected");
120 | jLabel2.setText("Device not found");
121 | }
122 | }
123 |
124 | monitoringTimer.start();
125 | }
126 | });
127 |
128 | public LowLevelUnbrickOneClickView(SingleFrameApplication app, boolean UseTGZFormat) {
129 | super(app);
130 | Statics.UseTGZFormat = UseTGZFormat;
131 | initComponents();
132 | Dimension MinSize = new Dimension(635, 600);
133 | Dimension RecSize = new Dimension(635, 600);
134 | this.getFrame().setMinimumSize(MinSize);
135 | this.getFrame().setSize(RecSize);
136 | this.getFrame().setTitle("UnBrickable Resurrector - Revision41");
137 | Statics Statics = new Statics();
138 | if (Statics.isLinux()) {
139 | monitoringTimer.start();
140 | } else {
141 | TimeOutOptionPane timeOutOptionPane = new TimeOutOptionPane();
142 | int DResult = timeOutOptionPane.showTimeoutDialog(
143 | 10, //timeout
144 | null, //parentComponent
145 | "This app will only work under Linux. This app has not been designed\n"
146 | + "to work with any other OS.",
147 | "Linux Not Detected", //DisplayTitle
148 | TimeOutOptionPane.OK_OPTION, // Options buttons
149 | TimeOutOptionPane.INFORMATION_MESSAGE, //Icon
150 | new String[]{"OK"}, // option buttons
151 | "OK"); //Default{
152 | }
153 | for (int i = 0; i < ResurrectorsDB.length; i++) {
154 | this.jComboBox1.addItem(ResurrectorsDB[i][0]);
155 | }
156 |
157 |
158 | }
159 |
160 | /**
161 | *
162 | */
163 |
164 |
165 | @SuppressWarnings("unchecked")
166 | // //GEN-BEGIN:initComponents
167 | private void initComponents() {
168 |
169 | mainPanel = new javax.swing.JPanel();
170 | Statics.HeimdallOneClickView=this;
171 | jScrollPane2 = new javax.swing.JScrollPane();
172 | jTextArea2 = new javax.swing.JTextArea();
173 | ConnectedLabel = new javax.swing.JLabel();
174 | jLabel1 = new javax.swing.JLabel();
175 | jLabel2 = new javax.swing.JLabel();
176 | jLabel3 = new javax.swing.JLabel();
177 | jPanel1 = new javax.swing.JPanel();
178 | jComboBox1 = new javax.swing.JComboBox();
179 | jButton2 = new javax.swing.JButton();
180 | jButton1 = new javax.swing.JButton();
181 |
182 | mainPanel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
183 | mainPanel.setMinimumSize(new java.awt.Dimension(600, 450));
184 | mainPanel.setName("mainPanel"); // NOI18N
185 | mainPanel.setOpaque(false);
186 | mainPanel.setPreferredSize(new java.awt.Dimension(635, 520));
187 | mainPanel.setRequestFocusEnabled(false);
188 | mainPanel.setVerifyInputWhenFocusTarget(false);
189 | Statics.HeimdallOneClickView=this;
190 |
191 | jScrollPane2.setBorder(null);
192 | org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(com.AdamOutler.LowLevelUnBrick.LowLevelUnbrickOneClickApp.class).getContext().getResourceMap(LowLevelUnbrickOneClickView.class);
193 | jScrollPane2.setViewportBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jScrollPane2.viewportBorder.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, resourceMap.getFont("jScrollPane2.viewportBorder.titleFont"))); // NOI18N
194 | jScrollPane2.setName("jScrollPane2"); // NOI18N
195 |
196 | jTextArea2.setBackground(resourceMap.getColor("jTextArea2.background")); // NOI18N
197 | jTextArea2.setColumns(20);
198 | jTextArea2.setFont(resourceMap.getFont("jTextArea2.font")); // NOI18N
199 | jTextArea2.setRows(5);
200 | jTextArea2.setText(resourceMap.getString("jTextArea2.text")); // NOI18N
201 | jTextArea2.setBorder(null);
202 | jTextArea2.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
203 | jTextArea2.setName("jTextArea2"); // NOI18N
204 | Statics.ProgressArea=this.jTextArea2;
205 | jScrollPane2.setViewportView(jTextArea2);
206 |
207 | ConnectedLabel.setLabelFor(ConnectedLabel);
208 | ConnectedLabel.setName("ConnectedLabel"); // NOI18N
209 |
210 | jLabel1.setIcon(resourceMap.getIcon("jLabel1.icon")); // NOI18N
211 | jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
212 | jLabel1.setName("jLabel1"); // NOI18N
213 |
214 | jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
215 | jLabel2.setName("jLabel2"); // NOI18N
216 |
217 | jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
218 | jLabel3.setName("jLabel3"); // NOI18N
219 |
220 | jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel1.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, resourceMap.getFont("jPanel1.border.titleFont"))); // NOI18N
221 | jPanel1.setFont(resourceMap.getFont("jPanel1.font")); // NOI18N
222 | jPanel1.setName("jPanel1"); // NOI18N
223 |
224 | jComboBox1.setName("jComboBox1"); // NOI18N
225 | jComboBox1.addActionListener(new java.awt.event.ActionListener() {
226 | public void actionPerformed(java.awt.event.ActionEvent evt) {
227 | jComboBox1ActionPerformed(evt);
228 | }
229 | });
230 |
231 | jButton2.setText(resourceMap.getString("Flash.text")); // NOI18N
232 | jButton2.setToolTipText(resourceMap.getString("Flash.toolTipText")); // NOI18N
233 | jButton2.setFocusPainted(false);
234 | jButton2.setName("Flash"); // NOI18N
235 | jButton2.setRequestFocusEnabled(false);
236 | jButton2.addActionListener(new java.awt.event.ActionListener() {
237 | public void actionPerformed(java.awt.event.ActionEvent evt) {
238 | jButton2ActionPerformed(evt);
239 | }
240 | });
241 |
242 | jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
243 | jButton1.setName("jButton1"); // NOI18N
244 | jButton1.addActionListener(new java.awt.event.ActionListener() {
245 | public void actionPerformed(java.awt.event.ActionEvent evt) {
246 | jButton1ActionPerformed(evt);
247 | }
248 | });
249 |
250 | javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
251 | jPanel1.setLayout(jPanel1Layout);
252 | jPanel1Layout.setHorizontalGroup(
253 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
254 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
255 | .addComponent(jComboBox1, 0, 198, Short.MAX_VALUE)
256 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
257 | .addComponent(jButton2)
258 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
259 | .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
260 | .addContainerGap())
261 | );
262 | jPanel1Layout.setVerticalGroup(
263 | jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
264 | .addGroup(jPanel1Layout.createSequentialGroup()
265 | .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
266 | .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
267 | .addComponent(jButton1)
268 | .addComponent(jButton2))
269 | .addContainerGap(2, Short.MAX_VALUE))
270 | );
271 |
272 | javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
273 | mainPanel.setLayout(mainPanelLayout);
274 | mainPanelLayout.setHorizontalGroup(
275 | mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
276 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
277 | .addContainerGap()
278 | .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
279 | .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 579, javax.swing.GroupLayout.PREFERRED_SIZE)
280 | .addGroup(mainPanelLayout.createSequentialGroup()
281 | .addGap(6, 6, 6)
282 | .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
283 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
284 | .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 416, javax.swing.GroupLayout.PREFERRED_SIZE))
285 | .addGroup(mainPanelLayout.createSequentialGroup()
286 | .addComponent(ConnectedLabel)
287 | .addGap(5, 5, 5)
288 | .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
289 | .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 596, Short.MAX_VALUE)
290 | .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
291 | .addGap(17, 17, 17))
292 | );
293 | mainPanelLayout.setVerticalGroup(
294 | mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
295 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
296 | .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 202, javax.swing.GroupLayout.PREFERRED_SIZE)
297 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
298 | .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
299 | .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
300 | .addComponent(jLabel2))
301 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
302 | .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
303 | .addGroup(mainPanelLayout.createSequentialGroup()
304 | .addComponent(ConnectedLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
305 | .addGap(56, 56, 56))
306 | .addGroup(mainPanelLayout.createSequentialGroup()
307 | .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE)
308 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
309 | .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
310 | .addContainerGap())))
311 | );
312 |
313 | setComponent(mainPanel);
314 | }// //GEN-END:initComponents
315 |
316 | private void writeScript() {
317 | FileOperations FileOperations = new FileOperations();
318 |
319 |
320 | if (Statics.isLinux()) {
321 | if (Interface.equals("SMDK")){
322 | Shell Shell = new Shell();
323 | String[] arch = {"arch"};
324 | String ArchReturn = Shell.sendShellCommand(arch);
325 | String SMDK = "";
326 | if (ArchReturn.contains("64")) {
327 | Log.level3("64Bit detected");
328 | SMDK = Statics.TempFolder + "UnBrickPack" + Statics.Slash + "smdk-usbdl64";
329 | } else {
330 | Log.level3("32Bit detected");
331 | SMDK = Statics.TempFolder + "UnBrickPack" + Statics.Slash + "smdk-usbdl";
332 | }
333 |
334 | if (FileOperations.verifyFileExists(SMDK)) {
335 | Log.level3("Verified Binary:" + SMDK);
336 | } else {
337 | if (FileOperations.verifyFileExists(SMDK)) {
338 | Log.level3("Error: Could not find " + SMDK);
339 | }
340 | }
341 | if (FileOperations.setExecutableBit(SMDK)) {
342 | Log.level3("Set Executable Bit " + SMDK);
343 | } else {
344 | Log.level3("Error: Could not Set Executable Bit " + SMDK);
345 | }
346 |
347 | if (FileOperations.verifyFileExists(Statics.TempFolder + "Script.sh")) {
348 | Log.level1("Clearing Previous Instance");
349 | FileOperations.deleteFile(Statics.TempFolder + "Script.sh");
350 | }
351 |
352 | Log.level1("Building command list");
353 | String Command = SMDK + " -f " + Statics.TempFolder + "UnBrickPack"
354 | + Statics.Slash + InitialBootloader+" -a "+InitialMemoryLocation+";\n test $? && echo \\\\n Interceptor Injection Complete. Injecting modified SBL\\\\n\\\\n||echo Interceptor Injection Failure!!!\\\\n\\\\n;\n sleep 3;\n"
355 | + SMDK + " -f " + Statics.TempFolder + "UnBrickPack"
356 | + Statics.Slash + SecondaryBootloader+" -a " +SecondaryMemoryLocation+";\n"
357 | + "test $? = 0 && echo \"Modified SBL Injection Completed Download Mode Activated\"|| echo \"SBL Injection Failure\"";
358 |
359 | try {
360 | FileOperations.writeToFile(Command, Statics.TempFolder + "Script.sh");
361 | } catch (IOException ex) {
362 | Logger.getLogger(LowLevelUnbrickOneClickView.class.getName()).log(Level.SEVERE, null, ex);
363 | Log.level0("ERROR WRITING TO TEMP FOLDER");
364 | }
365 |
366 | Statics.LiveSendCommand = new ArrayList();
367 | Statics.LiveSendCommand.add("gksudo");
368 | Statics.LiveSendCommand.add("-D");
369 | Statics.LiveSendCommand.add("UnBrickable Resurrector");
370 | Statics.LiveSendCommand.add(Statics.TempFolder + "Script.sh");
371 | FileOperations.setExecutableBit(Statics.TempFolder + "Script.sh");
372 | }
373 | } else {
374 | TimeOutOptionPane timeOutOptionPane = new TimeOutOptionPane();
375 | timeOutOptionPane.showTimeoutDialog(
376 | 5, //timeout
377 | null, //parentComponent
378 | "This app will only work under Linux. This app has not been designed\n"
379 | + "to work with any other OS.",
380 | "Linux Not Detected", //DisplayTitle
381 | TimeOutOptionPane.OK_OPTION, // Options buttons
382 | TimeOutOptionPane.INFORMATION_MESSAGE, //Icon
383 | new String[]{"OK"}, // option buttons
384 | "OK"); //Default{
385 | }
386 | }
387 |
388 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
389 | Shell Shell = new Shell();
390 | Log.level1("\n\n Begin Resurrection Sequence\n");
391 | Log.level1("Requesting Permission to access device");
392 | Log.level0("\n Please wait.... Uploading..");
393 | Log.level0("-------------------------------------------------------------\n Hummingbird Interceptor Boot Loader (HIBL) v2.1\n Copyright (C) Rebellos 2011\n-------------------------------------------------------------\n");
394 |
395 | Shell.liveShellCommand();
396 |
397 |
398 |
399 | // 402244000
400 |
401 | //Log.level1(Command.toString());
402 |
403 |
404 |
405 | }//GEN-LAST:event_jButton2ActionPerformed
406 |
407 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
408 | LinkLauncher LinkLauncher = new LinkLauncher();
409 | LinkLauncher.launchLink("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YYAWENUMGYWU2");
410 | }//GEN-LAST:event_jButton1ActionPerformed
411 |
412 | private String GalaxyInstructions = "1. Apply UnBrickable Mod\n"
413 | + "2. Remove then insert Device battery\n"
414 | + "3. Connect to computer via USB.\n"
415 | + "4. Click the Download Mode button\n"
416 | + "5. Download new software with Heimdall.\n ";
417 | private String NexusSInstructions = "1. Apply UnBrickable Mod\n"
418 | + "2. Remove then insert Device battery\n"
419 | + "3. Connect to computer via USB.\n"
420 | + "4. Click the Download Mode button\n"
421 | + "5. Download new software with fastboot for Linux.\n ";
422 | private String[][] ResurrectorsDB = {
423 | //Name Friendly Tool initial init mem secondary secondary mem
424 | {"S5PC110 (Galaxy S)", "SMDK", "HIBL.bin", "D0020000", "Sbl.bin", "40244000", GalaxyInstructions},
425 | {"S5PC110 (Nexus S)", "SMDK", "HIBL.bin", "D0020000", "nexus_sbl.bin", "33040000", NexusSInstructions},
426 | {"S5PC111 (Galaxy Player)", "SMDK", "HIBL.bin", "D0020000", "GPSbl.bin", "40244000", GalaxyInstructions}
427 |
428 | };
429 | private String DeviceName="";
430 | private String Interface="";
431 | private String InitialBootloader="";
432 | private String InitialMemoryLocation="";
433 | private String SecondaryBootloader="";
434 | private String SecondaryMemoryLocation="";
435 | private String Instructions="";
436 |
437 | private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
438 | DeviceName=ResurrectorsDB[jComboBox1.getSelectedIndex()][0];
439 | Interface=ResurrectorsDB[jComboBox1.getSelectedIndex()][1];
440 | InitialBootloader=ResurrectorsDB[jComboBox1.getSelectedIndex()][2];
441 | InitialMemoryLocation=ResurrectorsDB[jComboBox1.getSelectedIndex()][3];
442 | SecondaryBootloader=ResurrectorsDB[jComboBox1.getSelectedIndex()][4];
443 | SecondaryMemoryLocation=ResurrectorsDB[jComboBox1.getSelectedIndex()][5];
444 | Instructions=ResurrectorsDB[jComboBox1.getSelectedIndex()][6];
445 | this.writeScript();
446 | Log.level1("#"+DeviceName+"\n#RESURRECTOR SELECTED:"+InitialBootloader+ " LOCATION:0x"+ InitialMemoryLocation+"\n#SBL: "+SecondaryBootloader+ " LOCATION:0x"+ SecondaryMemoryLocation+" tool:"+Interface +"\n"+Instructions);
447 |
448 | }//GEN-LAST:event_jComboBox1ActionPerformed
449 |
450 | public void enableButtons(boolean State) {
451 | }
452 |
453 | private static void launchLink(String Link) {
454 | LinkLauncher LinkLauncher = new LinkLauncher();
455 | LinkLauncher.launchLink(Link);
456 | }
457 |
458 | /**
459 | *
460 | * @param path
461 | * @param description
462 | * @return
463 | */
464 | protected ImageIcon createImageIcon(String path, String description) {
465 | java.net.URL imgURL = getClass().getResource(path);
466 | if (imgURL != null) {
467 | return new ImageIcon(imgURL, description);
468 | } else {
469 | System.err.println("Couldn't find file: " + path);
470 | return null;
471 | }
472 | }
473 | // Variables declaration - do not modify//GEN-BEGIN:variables
474 | private javax.swing.JLabel ConnectedLabel;
475 | private javax.swing.JButton jButton1;
476 | private javax.swing.JButton jButton2;
477 | private javax.swing.JComboBox jComboBox1;
478 | private javax.swing.JLabel jLabel1;
479 | private javax.swing.JLabel jLabel2;
480 | private javax.swing.JLabel jLabel3;
481 | private javax.swing.JPanel jPanel1;
482 | private javax.swing.JScrollPane jScrollPane2;
483 | public static javax.swing.JTextArea jTextArea2;
484 | private javax.swing.JPanel mainPanel;
485 | // End of variables declaration//GEN-END:variables
486 | }
487 |
--------------------------------------------------------------------------------
/GalaxySFrontend/LowLevelUnbrick/src/com/AdamOutler/LowLevelUnBrick/Shell.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011 Adam Outler
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
4 | * of this software and associated documentation files (the "Software"), to deal
5 | * in the Software without restriction, including without limitation the rights
6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | * copies of the Software, and to permit persons to whom the Software is
8 | * furnished to do so, subject to the following conditions:
9 | *
10 | * The above copyright notice and this permission notice shall be included in
11 | * all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | * SOFTWARE.
20 | */
21 | package com.AdamOutler.LowLevelUnBrick;
22 | import java.io.BufferedReader;
23 | import java.io.IOException;
24 | import java.io.InputStreamReader;
25 | import java.util.logging.Level;
26 | import java.util.logging.Logger;
27 |
28 |
29 | /**
30 | *
31 | * @author adam
32 | */
33 | //define