
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
boot-printer
Advanced tools
npx create-expo-module boot-printer
초기 생성 코드에서 필요 없는 코드 삭제
boot-printer/
├── src/ # TypeScript 브릿지 코드
│ ├── index.ts # 메인 export 파일
│ ├── BootPrinterModule.ts
│ └── bixolonConstants/ # 타입 정의
├── android/ # Android 네이티브 코드 (Kotlin)
│ └── src/
│ ├── main/java/ # Kotlin 모듈 코드
│ ├── libs/ # JAR 라이브러리
│ └── jniLibs/ # SO 네이티브 라이브러리
├── ios/ # iOS 네이티브 코드 (Swift)
│ ├── BootPrinterModule.swift
│ └── libs/ # iOS 프레임워크
├── example/ # 테스트용 예제 앱
│ ├── App.tsx
│ ├── android/ # 빌드 시 생성
│ └── ios/ # 빌드 시 생성
└── build/ # 컴파일된 JS 코드 (npm run build 후 생성)
src 디렉토리의 TypeScript 를 Javascript 로 컴파일하기
# 루트에서 실행
# expo-module build 가 실행 되어, src 의 TypeScript 코드를 JavaScript로 컴파일하여 build/ 디렉토리 .js 파일로 생성된다.
# 컴파일된 파일들은 모듈이 다른 프로젝트에서 사용될 수 았도록 준비 된다.
npm run build
새로운 터미널을 열어서 실행한다.
cd example
# 안드로이드 ( expo run:android )
npm run android
# ios ( expo run:ios )
npm run ios
네이티브 코드를 example 안에서 빌드하는 이유
example/package.json
{
"expo": {
"autolinking": {
"nativeModulesDir": ".."
}
}
}
example(앱) 의 npm run android 프로세스
| 구분 | TypeScript 빌드 | 네이티브 빌드 |
|---|---|---|
| 명령어 | npm run build | npm run android/ios |
| 위치 | 루트 디렉토리 | example 디렉토리 |
| 대상 | src/*.ts | android/, ios/ |
| 결과물 | build/*.js | APK/IPA 앱 |
| 빌드 시간 | 수초 | 수분 |
| 필요 환경 | Node.js | Android Studio/Xcode |
Android Studio, xcode 에서 코딩하기라이브러리 코드 보기, 자동완성 등을 사용할 수 있다.
# 터미널에서 안드로이드 스튜디오를 연다. 이렇게 하면 현재 PC 환경이 그대로 적용된다.
npm run open:android
# 터미널에서 xcode 를 연다.
npm run open:ios
# adb 서버 재시작
adb kill-server
adb start-server
# 현재 연결되어 있는 기기 보기
adb devices
# 모든 에뮬레이터 종료
adb devices | awk '/emulator/ {print $1}' | xargs -I {} adb -s {} emu kill
# 기존 설치 앱 데이터 삭제
adb shell pm clear host.exp.exponent
# 물리기기 무선 페어링
# 기기의 설정 > 개발자 모드 > 무선디버깅 > 코드로 페어링
adb pair 192.168.0.4:41573
# 페어링만 해도 연결됨. 만약 안된다면 컨넥팅!
adb connect 192.168.0.4:43713 # 코드 페어링 포트와는 다른 포트다.
# 이후 example > npm run android 를 하면 물리기기에서 앱이 실행된다.
1. 네이티브 코드 작성
(1) Android Studio 열기
루트에서 npm run open:android 로 Android Studio 열기
(2) 네이티브 코드에서 참조하는 특정 라이브러리 복사
(3)모듈 정의 후 코딩
...
override fun definition() = ModuleDefinition {
Name("BootLabelPrinterProxy")
...
2. 브릿시 코드 작성
// BootLabelPrinterProxy.ts 하단에 export 시
// 모듈 이름을 안드로이드 코드에서 정의한 Name("BootLabelPrinterProxy")와 동일하게 한다.
export default requireNativeModule<BootLabelPrinterProxy>('BootLabelPrinterProxy');
index.ts 에서 앱(example)에서 사용할 수 있게 통합하여 export
루트의 expo-moudle.config.json 에 사용하는 모듈을 정의
3. 앱(example) 코드 작성
example>App.tsx 에서 해당 모듈 임포트 하여 사용하기
import BootPrinter, { BootPrinterLookup, InterfaceType, Label_MediaType } from 'boot-printer';
...
boot-printer 라는 이름은 module 루트의 package.json 의 name 항목에 정의 되어 있음FAQs
EventBoot Printer SDK Module
We found that boot-printer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.