Remove All Ads from XDA
Honor 9 Lite

Re-signing the system

2,241 posts
Thanks Meter: 1,034
By Renate NST, Inactive Recognized Developer / Recognized Contributor on 28th June 2012, 04:39 PM
Post Reply Email Thread
11th February 2015, 11:01 AM |#31  
Thanks Meter: 94
Lightbulb [Q] Resigning revisited, re-simplified
Thank you for this very interesting thread and discussion. I've simplified the problem for myself a little. Namely:
  1. I'm patching the APKs before they're even installed. At that time there's no /data/system/packages.xml (in fact there's no /data anything), so the whole endeavour to fix the metadata there is moot. I just let Android create it with whatever values it is happy with.
  2. I sign all the APKs with the same key. I guess it's probably not a great idea security-wise but then so is running Android 2.1 in 2015 in the first place, so if it's just this, I find the associated "risks" acceptable.
  3. I use the Android debug testkey.{pk8,x509.pem} so that I don't need to bother creating my own keys.
So far it appears to work and the logcat seems clean but I didn't debug it extensively. I'd appreciate some feedback on the above. Are there any caveats I have failed to notice so far?

Plus two minor questions:
  • What is this JDK7 "bug" thing? Is it about JDK7 using SHA256withRSA by default, or is there something else?
  • Perhaps not too important in terms of advancing the topic but why does everyone here seem to use Jarsigner and not SignApk?
Comments are appreciated.
14th February 2015, 02:30 AM |#32  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Thanks Meter: 1,034
Originally Posted by Aqq123

What is this JDK7 "bug" thing? Is it about JDK7 using SHA256withRSA by default, or is there something else?

I believe that the real problem was in the dx.bat conversion of JVM 7 code to Dalvik code.
It appears that the current build tools can now do that without a problem.
Newer Android can accept signing with SHA256.
Older versions still can only use SHA1.
I don't know where the dividing line between old and new is.
The Following User Says Thank You to Renate NST For This Useful Post: [ View ] Gift Renate NST Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes