Resigning app means we are signing apk file by same signature as we have in our system.
Why Resign
Sometime for automation of android application, resigning of apk file is required as while working with few automation tools we should have same signature in apk file as well as on the system from which cases need to be triggered
What is resigning?
All apk file holds complete information about developer of that application
For some automation tools, we should have same signature in apk as well as on the system from which cases need to be triggered.
For this first we need to generate debug key on our system and then we need to sign apk file using debug key.
Process to resign an android application
Step 1: Start Debug Mode in phone and connect with system through USB
Step 2: Check device unique code
Open Command prompt and write adb devices

Step 3: Now place my application apk file in any of the place in your system

Step 4: Open apk file using winrar
Step 5: Delete META-INF folder( This META-INF folder holds sign information)

Step 6: Check .android folder in you Documents and Setting Folder

if debug.keystore file does not exist then generate this file by using following command(Follow Step 7)
Note: this is 1 time effort, once you create this file for 1 system, we need not to create it again
Step 7: Open command prompt, move to any location where you want to create debug.keystore file and write following command
keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -keyalg RSA -keysize 2048 -validity 20000

Step 8: Enter details & use android as password
Debug.keystore file will be created
Step 9: pick debug.keystore file and place it to .android folder under documents and settings

Step 10: Now we need to resign apk file, to resign apk file, from command prompt move to location where we placed apk file(step3)
Step 11: Write following command
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore “C:\Documents and Settings\tttyagi\.android\debug.keystore” “D:\MobileAutomation\UDD11.7.1.1.apk” androiddebugkey
NOTE
- Change debug.keystore and apk path as per your location
- Use android as password
APK is successfully resigned

Comments
Post a Comment